aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/manpages/git-import-orig.sgml12
-rw-r--r--gbp/scripts/import_orig.py14
2 files changed, 25 insertions, 1 deletions
diff --git a/docs/manpages/git-import-orig.sgml b/docs/manpages/git-import-orig.sgml
index b8095e0..fb9f7a9 100644
--- a/docs/manpages/git-import-orig.sgml
+++ b/docs/manpages/git-import-orig.sgml
@@ -26,6 +26,7 @@
<arg><option>--[no-]merge</option></arg>
<arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--upstream-vcs-tag=</option><replaceable>tag_name</replaceable></arg>
<arg><option>--[no-]sign-tags</option></arg>
<arg><option>--keyid=</option><replaceable>gpg-keyid</replaceable></arg>
<arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
@@ -91,6 +92,17 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--upstream-vcs-tag</option>=<replaceable>tag_name</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Add <replaceable>tag_name</replaceable> 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.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--verbose</option></term>
<term><option>-v</option></term>
<listitem>
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py
index 6693acd..7e11298 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