From 3e768c9dc7f77cb2960f990f6e2d15890e96abdb Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Fri, 10 Apr 2009 16:59:36 -0700 Subject: Add 'repo sync -d' to detach projects from their current topic The -d flag moves the project back to a detached HEAD state, matching what is listed in the manifest. This can be useful to set a client to something stable (or at least well-known), such as before a sequence of 'repo download' commands are used to get some changes for testing. Signed-off-by: Shawn O. Pearce --- project.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'project.py') diff --git a/project.py b/project.py index 06240b7e..d2ec34fe 100644 --- a/project.py +++ b/project.py @@ -573,7 +573,7 @@ class Project(object): for file in self.copyfiles: file._Copy() - def Sync_LocalHalf(self): + def Sync_LocalHalf(self, detach_head=False): """Perform only the local IO portion of the sync process. Network access is not required. @@ -594,7 +594,7 @@ class Project(object): branch = self.CurrentBranch - if branch is None: + if branch is None or detach_head: # Currently on a detached HEAD. The user is assumed to # not have any local modifications worth worrying about. # -- cgit v1.2.3-54-g00ecf