aboutsummaryrefslogtreecommitdiff
path: root/gbp/scripts
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2012-03-23 20:55:57 +0100
committerGuido Günther <agx@sigxcpu.org>2012-03-23 23:38:55 +0100
commitd6e0e8d593db8b15f227090e7ba7c97df9c47890 (patch)
tree48f573c98cff11b9f72c69e99a92a3c840f84be9 /gbp/scripts
parentb9d03aff15778f0e32487bec3a76da2e5024929e (diff)
git-import-orig: Allow to pass in an upstream vcs tag
This allows to link the import-orig commit with the corresponding upstream vcs tag. See #664771 for a discussion.
Diffstat (limited to 'gbp/scripts')
-rw-r--r--gbp/scripts/import_orig.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py
index 6693acde..7e112989 100644
--- a/gbp/scripts/import_orig.py
+++ b/gbp/scripts/import_orig.py
@@ -292,6 +292,8 @@ def parse_args(argv):
dest="debian_branch")
branch_group.add_config_file_option(option_name="upstream-branch",
dest="upstream_branch")
+ branch_group.add_option("--upstream-vcs-tag", dest="vcs_tag",
+ help="Upstream VCS tag add to the merge commit")
branch_group.add_boolean_config_file_option(option_name="merge", dest="merge")
tag_group.add_boolean_config_file_option(option_name="sign-tags",
@@ -395,7 +397,17 @@ def main(argv):
import_branch = [ options.upstream_branch, None ][is_empty]
msg = upstream_import_commit_msg(options, version)
- commit = repo.commit_dir(source.unpacked, msg=msg, branch=import_branch)
+
+ if options.vcs_tag:
+ parents = [repo.rev_parse("%s^{}" % options.vcs_tag)]
+ else:
+ parents = None
+
+ commit = repo.commit_dir(source.unpacked,
+ msg=msg,
+ branch=import_branch,
+ other_parents=parents,
+ )
if not commit:
raise GbpError, "Import of upstream version %s failed." % version