aboutsummaryrefslogtreecommitdiffhomepage
path: root/git-import-dsc
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-02-09 16:36:46 -0600
committerGuido Günther <agx@sigxcpu.org>2011-02-11 18:18:58 +0100
commit0363f4792e0c81be213f8955b4509caab166f984 (patch)
tree93bf0f43bfc473b15a84d91461f9e65263718956 /git-import-dsc
parent23c534db7d0f5431597c765b7decb06cc153c6ca (diff)
git-import-dsc: better explain missing upstream branch
Thanks: Jonathan Nieder for the suggestion.
Diffstat (limited to 'git-import-dsc')
-rwxr-xr-xgit-import-dsc14
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)