summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-03-05 10:32:38 -0800
committerShawn O. Pearce <sop@google.com>2009-03-05 10:32:38 -0800
commitc7a4eefa7e775b64916a66b52ca6c5f31e2cf5c8 (patch)
tree49451ef2767128c809e48f980766c1a02d6504aa /project.py
parent43c3d9ea17f1436a6b3b2e7e7827da6f48a21da9 (diff)
downloadgit-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.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/project.py b/project.py
index b9792523..8ed61551 100644
--- a/project.py
+++ b/project.py
@@ -178,13 +178,15 @@ class DiffColoring(Coloring):
178 178
179 179
180class _CopyFile: 180class _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.