From c7a4eefa7e775b64916a66b52ca6c5f31e2cf5c8 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Thu, 5 Mar 2009 10:32:38 -0800 Subject: Add repo manifest -o to save a manifest 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 --- project.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'project.py') 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): class _CopyFile: - def __init__(self, src, dest): + def __init__(self, src, dest, abssrc, absdest): self.src = src self.dest = dest + self.abs_src = abssrc + self.abs_dest = absdest def _Copy(self): - src = self.src - dest = self.dest + src = self.abs_src + dest = self.abs_dest # copy file if it does not exist or is out of date if not os.path.exists(dest) or not filecmp.cmp(src, dest): try: @@ -691,11 +693,11 @@ class Project(object): self._CopyFiles() return True - def AddCopyFile(self, src, dest): + def AddCopyFile(self, src, dest, absdest): # dest should already be an absolute path, but src is project relative # make src an absolute path - src = os.path.join(self.worktree, src) - self.copyfiles.append(_CopyFile(src, dest)) + abssrc = os.path.join(self.worktree, src) + self.copyfiles.append(_CopyFile(src, dest, abssrc, absdest)) def DownloadPatchSet(self, change_id, patch_id): """Download a single patch set of a single change to FETCH_HEAD. -- cgit v1.2.3-54-g00ecf