import-srpm: support --upstream-vcs-tag cmdline option
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 30 May 2013 14:35:57 +0000 (17:35 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 7 Jan 2014 14:21:30 +0000 (16:21 +0200)
Similar to what the option does in git-import-orig-[rpm].

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp/scripts/import_srpm.py

index 491a7aa61efae77071325b650bd1ef88816c6e2e..49209b7872a58f245522dbc38b7d46072ccb9033 100755 (executable)
@@ -199,6 +199,9 @@ def parse_args(argv):
                       dest="packaging_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 on top of which to import "
+                                 "the orig sources")
     branch_group.add_boolean_config_file_option(
                       option_name="create-missing-branches",
                       dest="create_missing_branches")
@@ -401,9 +404,14 @@ def main(argv):
                         raise GbpError
 
                 msg = "%s version %s" % (tag_format[1], spec.upstreamversion)
+                if options.vcs_tag:
+                    parents = [repo.rev_parse("%s^{}" % options.vcs_tag)]
+                else:
+                    parents = None
                 upstream_commit = repo.commit_dir(upstream.unpacked,
                                                   "Imported %s" % msg,
                                                   branch,
+                                                  other_parents=parents,
                                                   author=author,
                                                   committer=committer,
                                                   create_missing_branch=options.create_missing_branches)