mirror of
https://gerrit.googlesource.com/git-repo
synced 2026-10-23 05:38:21 +00:00
Add checkout command.
Teach repo how to checkout a branch in all projects or a list of specific projects. Bug: REPO-21
This commit is contained in:
1 parent
8f82a4f828
commit
02d7945eb8
2 files changed
+59
No files matched your search
+14
@@ -733,6 +733,20 @@ class Project(object):
|
||||
else:
|
||||
raise GitError('%s checkout %s ' % (self.name, rev))
|
||||
|
||||
def CheckoutBranch(self, name):
|
||||
"""Checkout a local topic branch.
|
||||
"""
|
||||
|
||||
# Be sure the branch exists
|
||||
try:
|
||||
tip_rev = self.bare_git.rev_parse(R_HEADS + name)
|
||||
except GitError:
|
||||
return False;
|
||||
|
||||
# Do the checkout
|
||||
cmd = ['checkout', name, '--']
|
||||
return GitCommand(self, cmd, capture_stdout=True).Wait() == 0
|
||||
|
||||
def AbandonBranch(self, name):
|
||||
"""Destroy a local topic branch.
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user