diff options
author | Guido Guenther <agx@sigxcpu.org> | 2007-08-20 19:05:42 +0200 |
---|---|---|
committer | Guido Guenther <agx@bogon.sigxcpu.org> | 2007-08-20 19:05:42 +0200 |
commit | 635bd6093a74f42b118e6d980c1491a00aa6c3e4 (patch) | |
tree | 10c79280363f6daea5ba2b923c72f14b596a14fe | |
parent | b2d6ee6a75ed4e1b21405e6c54a96a9494c6f5d6 (diff) | |
parent | b8387c263b216952b972f4e4bc57d1cfe23890dd (diff) | |
download | git-buildpackage-635bd6093a74f42b118e6d980c1491a00aa6c3e4.tar.gz git-buildpackage-635bd6093a74f42b118e6d980c1491a00aa6c3e4.tar.bz2 git-buildpackage-635bd6093a74f42b118e6d980c1491a00aa6c3e4.zip |
Merge ../git-buildpackage.devel
-rwxr-xr-x | git-import-dsc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/git-import-dsc b/git-import-dsc index 432c1556..d02e73d1 100755 --- a/git-import-dsc +++ b/git-import-dsc @@ -155,6 +155,17 @@ def move_tree(src, dirs): return True +def create_debian_branch(debian_branch, dirs): + os.chdir(dirs['git']) + repo = GitRepository('.') + if repo.get_branch() != debian_branch: + if not repo.has_branch(debian_branch): + print "Creating Debian branch '%s'" % debian_branch + gbpc.GitBranch()(debian_branch) + gbpc.GitCheckoutBranch(debian_branch) + os.chdir(dirs['top']) + + def main(argv): dirs = {'top': os.path.abspath(os.curdir)} ret = 0 @@ -164,6 +175,8 @@ def main(argv): parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose command execution") + parser.add_config_file_option(option_name="debian-branch", dest='debian_branch', + help="branch the debian patch is being developed on, default is '%(debian-branch)s'") parser.add_config_file_option(option_name="upstream-branch", dest="upstream_branch", help="upstream branch, default is '%(upstream-branch)s'") parser.add_config_file_option(option_name="sign-tags", dest="sign_tags", @@ -203,6 +216,7 @@ def main(argv): "%s-%s-%s" % (src.pkg, src.upstream_version, src.debian_version)) if not apply_debian_patch(src, dirs, options, gitTag, options.filter): raise GbpError + create_debian_branch(options.debian_branch, dirs) os.chdir(dirs['top']) if not move_tree(src, dirs): raise GbpError @@ -210,11 +224,12 @@ def main(argv): if len(err.__str__()): print >>sys.stderr, err ret = 1 + os.chdir(dirs['top']) if not ret: print 'Everything imported under %s' % src.pkg if __name__ == '__main__': sys.exit(main(sys.argv)) - + # vim:et:ts=4:sw=4: |