diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-02-09 22:50:59 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-02-09 22:53:10 +0100 |
commit | b92b88f95aacdbc1afcb0f2ad91a835fd3ad2612 (patch) | |
tree | 42676cd9f5b4d47e4ec9ead7c959b12328279776 /gbp/git.py | |
parent | d21506e3aa06dfd7f4acf953b2e58807b71677e0 (diff) |
git-import-dsc: auto create upstream branch
if it's missing. This allows to mass import old history of packages that
were native and switched to non-native later.
Closes: #610379
Diffstat (limited to 'gbp/git.py')
-rw-r--r-- | gbp/git.py | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -1,12 +1,13 @@ # vim: set fileencoding=utf-8 : # -# (C) 2006,2007,2008 Guido Guenther <agx@sigxcpu.org> +# (C) 2006,2007,2008,2011 Guido Guenther <agx@sigxcpu.org> """provides git repository related helpers""" import re import subprocess import os.path -from command_wrappers import (GitAdd, GitRm, GitCheckoutBranch, GitInit, GitCommand, copy_from) +from command_wrappers import (GitAdd, GitBranch, GitRm, GitCheckoutBranch, + GitInit, GitCommand, copy_from) from errors import GbpError import log import dateutil.parser @@ -198,6 +199,15 @@ class GitRepository(object): if self.get_branch() != branch: GitCheckoutBranch(branch)() + def create_branch(self, branch, rev=None): + """create a new branch + @param rev: where to start the branch from + + if param is None the branch starts form the current HEAD + """ + self.__check_path() + GitBranch()(branch, rev) + def delete_branch(self, branch): self.__check_path() if self.get_branch() != branch: |