From 8515181255c532fe25cd1b8b0c59814ea0eb2003 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Mon, 22 Jan 2018 14:28:08 +0200 Subject: import-srpm: support --upstream-vcs-tag cmdline option Similar to what the option does in git-import-orig. Signed-off-by: Markus Lehtonen --- tests/component/rpm/test_import_srpm.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/component/rpm/test_import_srpm.py b/tests/component/rpm/test_import_srpm.py index 15db0cf0..17344b21 100644 --- a/tests/component/rpm/test_import_srpm.py +++ b/tests/component/rpm/test_import_srpm.py @@ -285,6 +285,22 @@ class TestImportPacked(ComponentTestBase): eq_(info['author'].name, info['committer'].name) eq_(info['author'].email, info['committer'].email) + # Create a new commit by committing an empty tree + commit = repo.commit_tree('4b825dc642cb6eb9a060e54bf8d69288fbee4904', + msg="Empty commit", parents=[]) + repo.create_tag('foo/1.0', msg="New tag", commit=commit) + # Just blindly import another package on top of this to test more options + os.chdir('gbp-test2') + srpm = os.path.join(DATA_DIR, 'gbp-test-1.0-1.src.rpm') + eq_(mock_import(['--upstream-vcs-tag=foo/%(version)s', + '--upstream-branch=orig', + '--packaging-branch=pack', + srpm]), 0) + parents = repo.get_commits(until='orig', num=1, options='--format=%P')[0].split() + eq_(len(parents), 2) + ok_(commit in parents) + ok_(repo.rev_parse('orig/2.0^{}') in parents) + class TestImportUnPacked(ComponentTestBase): """Test importing of unpacked source rpms""" -- cgit v1.2.3