diff options
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -710,6 +710,22 @@ class Project(object): | |||
710 | else: | 710 | else: |
711 | raise GitError('%s checkout %s ' % (self.name, rev)) | 711 | raise GitError('%s checkout %s ' % (self.name, rev)) |
712 | 712 | ||
713 | def AbandonBranch(self, name): | ||
714 | """Destroy a local topic branch. | ||
715 | """ | ||
716 | try: | ||
717 | tip_rev = self.bare_git.rev_parse(R_HEADS + name) | ||
718 | except GitError: | ||
719 | return | ||
720 | |||
721 | if self.CurrentBranch == name: | ||
722 | self._Checkout( | ||
723 | self.GetRemote(self.remote.name).ToLocal(self.revision), | ||
724 | quiet=True) | ||
725 | |||
726 | cmd = ['branch', '-D', name] | ||
727 | GitCommand(self, cmd, capture_stdout=True).Wait() | ||
728 | |||
713 | def PruneHeads(self): | 729 | def PruneHeads(self): |
714 | """Prune any topic branches already merged into upstream. | 730 | """Prune any topic branches already merged into upstream. |
715 | """ | 731 | """ |