diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2014-02-06 14:12:54 +0200 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2014-02-24 09:09:48 +0200 |
commit | c457eafdfb4ed34faa7f29cd7090350e4e650a34 (patch) | |
tree | 4feef3d210f86b42296177a045c0ef3b60819f1d /tests | |
parent | 27579ee44f0492e9d3d63d238640a3ba2fe77c96 (diff) | |
download | git-buildpackage-c457eafdfb4ed34faa7f29cd7090350e4e650a34.tar.gz git-buildpackage-c457eafdfb4ed34faa7f29cd7090350e4e650a34.tar.bz2 git-buildpackage-c457eafdfb4ed34faa7f29cd7090350e4e650a34.zip |
pq-rpm: implement '--import-files' command line option
For defining the packaging file(s) that will be imported into the
development/patch-queue branch.
By default, the local gbp conf files are imported.
NOTE: This option does not affect the patch files that are imported. The
files defined with this option will appear as one monolithic commit in
the development/patch-queue branch.
Change-Id: Ia1967d77d2be5a8afc41e8d32c84b3386bc45924
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/component/rpm/test_pq_rpm.py | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tests/component/rpm/test_pq_rpm.py b/tests/component/rpm/test_pq_rpm.py index 63d773fa..8356cdd4 100644 --- a/tests/component/rpm/test_pq_rpm.py +++ b/tests/component/rpm/test_pq_rpm.py @@ -492,8 +492,8 @@ class TestPqRpm(ComponentTestBase): branches = ['master', 'upstream', 'development/master'] self._check_repo_state(repo, 'master', branches, files) - def test_gbp_conf_import(self): - """Test importing of gbp.conf files into pq branch""" + def test_option_import_files(self): + """Test the --import-files cmdline option""" repo = self.init_test_repo('gbp-test') # Add new conf file os.mkdir('debian') @@ -502,12 +502,29 @@ class TestPqRpm(ComponentTestBase): repo.add_files(['debian/gbp.conf'], force=True) repo.commit_files(['debian/gbp.conf'], msg="Add conf file") - # Import + # Import with default settings (should import gbp conf files) branches = repo.get_local_branches() + ['my-pq-branch'] eq_(mock_pq(['import']), 0) self._check_repo_state(repo, 'my-pq-branch', branches) - ok_('debian/gbp.conf' in repo.list_files()) + ok_('.gbp.conf' in repo.list_files()) + + # Re-import with user-defined files + eq_(mock_pq(['import', '--force', '--packaging-branch', 'master', + '--import-files', 'foo.txt,my.patch']), 0) + self._check_repo_state(repo, 'my-pq-branch', branches) + ok_('foo.txt' in repo.list_files()) + ok_('my.patch' in repo.list_files()) + + # Drop and re-import with no files + eq_(mock_pq(['switch', '--packaging-branch', 'master', '--pq-branch', + 'my-pq-branch']), 0) + eq_(mock_pq(['drop']), 0) + eq_(mock_pq(['import', '--packaging-branch', 'master', + '--pq-branch', 'my-pq-branch', '--import-files=']), 0) + self._check_repo_state(repo, 'my-pq-branch', branches) + ok_('debian/gbp.conf' not in repo.list_files()) + ok_('.gbp.conf' not in repo.list_files()) def test_import_unapplicable_patch(self): """Test import when a patch does not apply""" |