summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-04-10 16:59:36 -0700
committerShawn O. Pearce <sop@google.com>2009-04-10 17:08:02 -0700
commit3e768c9dc7f77cb2960f990f6e2d15890e96abdb (patch)
treeb5d256542c4e6aeeb467cd830584941542c8362f /project.py
parent96fdcef9e3087d71266d5c78e4a9716e3afa6d41 (diff)
downloadgit-repo-3e768c9dc7f77cb2960f990f6e2d15890e96abdb.tar.gz
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 <sop@google.com>
Diffstat (limited to 'project.py')
-rw-r--r--project.py4
1 files changed, 2 insertions, 2 deletions
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):
573 for file in self.copyfiles: 573 for file in self.copyfiles:
574 file._Copy() 574 file._Copy()
575 575
576 def Sync_LocalHalf(self): 576 def Sync_LocalHalf(self, detach_head=False):
577 """Perform only the local IO portion of the sync process. 577 """Perform only the local IO portion of the sync process.
578 Network access is not required. 578 Network access is not required.
579 579
@@ -594,7 +594,7 @@ class Project(object):
594 594
595 branch = self.CurrentBranch 595 branch = self.CurrentBranch
596 596
597 if branch is None: 597 if branch is None or detach_head:
598 # Currently on a detached HEAD. The user is assumed to 598 # Currently on a detached HEAD. The user is assumed to
599 # not have any local modifications worth worrying about. 599 # not have any local modifications worth worrying about.
600 # 600 #