From dcffa99a7274ed045c2616d1793dd73f81595a8a Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Wed, 7 Nov 2012 17:38:06 +0200 Subject: [PATCH] cmd_import: enable importing patches Signed-off-by: Markus Lehtonen --- gitbuildsys/cmd_import.py | 9 +++++++-- tests/test_import.py | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gitbuildsys/cmd_import.py b/gitbuildsys/cmd_import.py index 64e3007..4ce7367 100644 --- a/gitbuildsys/cmd_import.py +++ b/gitbuildsys/cmd_import.py @@ -43,8 +43,13 @@ def main(args): params.append("--pristine-tar") if path.endswith('.src.rpm') or path.endswith('.spec'): - params.append("--no-patch-import") - if gbp_import_srpm(params): + ret = gbp_import_srpm(params) + if ret == 2: + msger.warning("Importing of patches into packaging branch failed! " + "Please import manually (apply and commit to git, " + "remove files from packaging dir and spec) in order " + "to enable automatic patch generation.") + elif ret: msger.error("Failed to import %s" % path) else: if args.no_merge: diff --git a/tests/test_import.py b/tests/test_import.py index 87b2d4d..db0b797 100644 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -92,7 +92,9 @@ class TestImport(unittest.TestCase): os.path.join(srcdir, 'bluez.spec')]), None) repo = GitRepository("./bluez") eq_(repo.get_local_branches(), ['master', 'pristine-tar', 'upstream']) - eq_(repo.get_tags(), ['upstream/4.87', 'vendor/4.87-1']) + # No packging tag as patch-import fails + eq_(repo.get_tags(), ['upstream/4.87']) + eq_(len(repo.get_commits(until='master')), 2) #raise Exception(os.listdir('./bluez')) -- 2.7.4