diff options
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 14 |
1 files changed, 14 insertions, 0 deletions
| @@ -733,6 +733,20 @@ class Project(object): | |||
| 733 | else: | 733 | else: |
| 734 | raise GitError('%s checkout %s ' % (self.name, rev)) | 734 | raise GitError('%s checkout %s ' % (self.name, rev)) |
| 735 | 735 | ||
| 736 | def CheckoutBranch(self, name): | ||
| 737 | """Checkout a local topic branch. | ||
| 738 | """ | ||
| 739 | |||
| 740 | # Be sure the branch exists | ||
| 741 | try: | ||
| 742 | tip_rev = self.bare_git.rev_parse(R_HEADS + name) | ||
| 743 | except GitError: | ||
| 744 | return False; | ||
| 745 | |||
| 746 | # Do the checkout | ||
| 747 | cmd = ['checkout', name, '--'] | ||
| 748 | return GitCommand(self, cmd, capture_stdout=True).Wait() == 0 | ||
| 749 | |||
| 736 | def AbandonBranch(self, name): | 750 | def AbandonBranch(self, name): |
| 737 | """Destroy a local topic branch. | 751 | """Destroy a local topic branch. |
| 738 | """ | 752 | """ |
