aboutsummaryrefslogtreecommitdiff
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
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.
-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