From e68d566248dbd8d58a15bf72af0272e1886452cb Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Thu, 30 May 2013 17:35:57 +0300 Subject: [PATCH] import-srpm: support --upstream-vcs-tag cmdline option Similar to the corresponding option in gbp import-orig. Signed-off-by: Markus Lehtonen --- gbp/scripts/import_srpm.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gbp/scripts/import_srpm.py b/gbp/scripts/import_srpm.py index 958f5ff..472b801 100755 --- a/gbp/scripts/import_srpm.py +++ b/gbp/scripts/import_srpm.py @@ -151,6 +151,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") @@ -350,9 +353,14 @@ def main(argv): raise GbpError src_vendor = "Native" if options.native else "Upstream" msg = "%s version %s" % (src_vendor, spec.upstreamversion) + if options.vcs_tag: + parents = [repo.rev_parse("%s^{}" % options.vcs_tag)] + else: + parents = None src_commit = repo.commit_dir(sources.unpacked, "Imported %s" % msg, branch, + other_parents=parents, author=author, committer=committer, create_missing_branch=options.create_missing_branches) -- 2.7.4