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 /git-import-dsc | |
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 'git-import-dsc')
-rwxr-xr-x | git-import-dsc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/git-import-dsc b/git-import-dsc index 4c774acb..19f5f14c 100755 --- a/git-import-dsc +++ b/git-import-dsc @@ -1,7 +1,7 @@ #!/usr/bin/python -u # vim: set fileencoding=utf-8 : # -# (C) 2006,2007 Guido Guenther <agx@sigxcpu.org> +# (C) 2006,2007,2011 Guido Guenther <agx@sigxcpu.org> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -173,6 +173,8 @@ def parse_args(argv): dest="debian_branch") branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch") + branch_group.add_boolean_config_file_option(option_name="create-missing-branches", + dest="create_missing_branches") tag_group.add_boolean_config_file_option(option_name="sign-tags", dest="sign_tags") @@ -270,6 +272,9 @@ def main(argv): else: branch = [options.upstream_branch, options.debian_branch][src.native] + if not repo.has_branch(branch) and options.create_missing_branches: + gbp.log.info("Creating missing branch '%s'" % branch) + repo.create_branch(branch) commit = repo.commit_dir(unpack_dir, "Imported %s" % msg, branch) |