diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-02-09 16:36:46 -0600 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-02-11 18:18:58 +0100 |
commit | 0363f4792e0c81be213f8955b4509caab166f984 (patch) | |
tree | 93bf0f43bfc473b15a84d91461f9e65263718956 /git-import-dsc | |
parent | 23c534db7d0f5431597c765b7decb06cc153c6ca (diff) |
git-import-dsc: better explain missing upstream branch
Thanks: Jonathan Nieder for the suggestion.
Diffstat (limited to 'git-import-dsc')
-rwxr-xr-x | git-import-dsc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/git-import-dsc b/git-import-dsc index d537ad6e..a04344f1 100755 --- a/git-import-dsc +++ b/git-import-dsc @@ -31,7 +31,7 @@ from gbp.deb import (debian_version_chars, parse_changelog, unpack_orig, parse_dsc, DscFile, tar_toplevel) from gbp.git import (build_tag, create_repo, GitRepository, GitRepositoryError, rfc822_date_to_git) -from gbp.config import GbpOptionParser, GbpOptionGroup +from gbp.config import GbpOptionParser, GbpOptionGroup, no_upstream_branch_msg from gbp.errors import GbpError import gbp.log @@ -272,9 +272,15 @@ 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) + if not repo.has_branch(branch): + if options.create_missing_branches: + gbp.log.info("Creating missing branch '%s'" % branch) + repo.create_branch(branch) + else: + gbp.log.err(no_upstream_branch_msg % branch + + "\nAlso check the --create-missing-branches option.") + raise GbpError + commit = repo.commit_dir(unpack_dir, "Imported %s" % msg, branch) |