From d6e0e8d593db8b15f227090e7ba7c97df9c47890 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 23 Mar 2012 20:55:57 +0100 Subject: 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. --- docs/manpages/git-import-orig.sgml | 12 ++++++++++++ gbp/scripts/import_orig.py | 14 +++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/manpages/git-import-orig.sgml b/docs/manpages/git-import-orig.sgml index b8095e02..fb9f7a94 100644 --- a/docs/manpages/git-import-orig.sgml +++ b/docs/manpages/git-import-orig.sgml @@ -26,6 +26,7 @@ branch_name branch_name + tag_name gpg-keyid tag-format @@ -90,6 +91,17 @@ will try to merge the new version onto this branch. + + =tag_name + + + + Add tag_name as additional parent to the commit + of the upstream tarball. Useful when upstream uses git and you want to + link to it's revision history. + + + 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 -- cgit v1.2.3