diff options
author | Shawn O. Pearce <sop@google.com> | 2009-03-05 10:32:38 -0800 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2009-03-05 10:32:38 -0800 |
commit | c7a4eefa7e775b64916a66b52ca6c5f31e2cf5c8 (patch) | |
tree | 49451ef2767128c809e48f980766c1a02d6504aa /project.py | |
parent | 43c3d9ea17f1436a6b3b2e7e7827da6f48a21da9 (diff) | |
download | git-repo-c7a4eefa7e775b64916a66b52ca6c5f31e2cf5c8.tar.gz |
Add repo manifest -o to save a manifestv1.6.2
This can be useful to create a new manifest from an existing client,
especially if the client wants to use the "-r" option to set each
project's revision to the current commit SHA-1, making a sort of a
tag file that can be used to recreate this exact state elsewhere.
Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -178,13 +178,15 @@ class DiffColoring(Coloring): | |||
178 | 178 | ||
179 | 179 | ||
180 | class _CopyFile: | 180 | class _CopyFile: |
181 | def __init__(self, src, dest): | 181 | def __init__(self, src, dest, abssrc, absdest): |
182 | self.src = src | 182 | self.src = src |
183 | self.dest = dest | 183 | self.dest = dest |
184 | self.abs_src = abssrc | ||
185 | self.abs_dest = absdest | ||
184 | 186 | ||
185 | def _Copy(self): | 187 | def _Copy(self): |
186 | src = self.src | 188 | src = self.abs_src |
187 | dest = self.dest | 189 | dest = self.abs_dest |
188 | # copy file if it does not exist or is out of date | 190 | # copy file if it does not exist or is out of date |
189 | if not os.path.exists(dest) or not filecmp.cmp(src, dest): | 191 | if not os.path.exists(dest) or not filecmp.cmp(src, dest): |
190 | try: | 192 | try: |
@@ -691,11 +693,11 @@ class Project(object): | |||
691 | self._CopyFiles() | 693 | self._CopyFiles() |
692 | return True | 694 | return True |
693 | 695 | ||
694 | def AddCopyFile(self, src, dest): | 696 | def AddCopyFile(self, src, dest, absdest): |
695 | # dest should already be an absolute path, but src is project relative | 697 | # dest should already be an absolute path, but src is project relative |
696 | # make src an absolute path | 698 | # make src an absolute path |
697 | src = os.path.join(self.worktree, src) | 699 | abssrc = os.path.join(self.worktree, src) |
698 | self.copyfiles.append(_CopyFile(src, dest)) | 700 | self.copyfiles.append(_CopyFile(src, dest, abssrc, absdest)) |
699 | 701 | ||
700 | def DownloadPatchSet(self, change_id, patch_id): | 702 | def DownloadPatchSet(self, change_id, patch_id): |
701 | """Download a single patch set of a single change to FETCH_HEAD. | 703 | """Download a single patch set of a single change to FETCH_HEAD. |