diff options
| author | Shawn O. Pearce <sop@google.com> | 2009-04-10 16:59:36 -0700 |
|---|---|---|
| committer | Shawn O. Pearce <sop@google.com> | 2009-04-10 17:08:02 -0700 |
| commit | 3e768c9dc7f77cb2960f990f6e2d15890e96abdb (patch) | |
| tree | b5d256542c4e6aeeb467cd830584941542c8362f /project.py | |
| parent | 96fdcef9e3087d71266d5c78e4a9716e3afa6d41 (diff) | |
| download | git-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.py | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -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 | # |
