on howto create it otherwise use --upstream-branch to specify it.
"""
+no_debian_branch_msg = """
+Repository does not have branch '%s' for packaging sources. If there is none see
+file:///usr/share/doc/git-buildpackage/manual-html/gbp.import.html#GBP.IMPORT.CONVERT
+on howto create it otherwise use --debian-branch to specify it.
+"""
+
def expand_path(option, opt, value):
value = os.path.expandvars(value)
from gbp.git.modifier import GitModifier
from gbp.git.vfs import GitVfs
from gbp.config import (GbpOptionParserDebian, GbpOptionGroup,
- no_upstream_branch_msg)
+ no_debian_branch_msg, no_upstream_branch_msg)
from gbp.errors import GbpError
from gbp.scripts.common import ExitCodes, debug_exc
from gbp.scripts.common import repo_setup
os.chdir(repo.path)
-def create_missing_branch(repo, branch, options):
+def create_missing_branch(repo, branch, options, err_msg):
if not repo.has_branch(branch):
if options.create_missing_branches:
gbp.log.info("Creating missing branch '%s'" % branch)
repo.create_branch(branch)
else:
- raise GbpError(no_upstream_branch_msg % branch +
- "\nAlso check the --create-missing-branches option.")
+ raise GbpError(err_msg + "\n"
+ "Also check the --create-missing-branches option.")
def import_native(repo, source, dsc, options):
branch = None
else:
branch = options.debian_branch
- create_missing_branch(repo, branch, options)
+ create_missing_branch(repo, branch, options,
+ no_debian_branch_msg % branch)
author = get_author_from_changelog(source.unpacked)
committer = get_committer_from_author(author, options)
branch = None
else:
branch = options.upstream_branch
- create_missing_branch(repo, branch, options)
+ create_missing_branch(repo, branch, options,
+ no_upstream_branch_msg % branch)
author = committer = {}
commit_msg = "Import %s" % msg