cmd_import: enable importing patches
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Wed, 7 Nov 2012 15:38:06 +0000 (17:38 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Wed, 21 Nov 2012 12:00:21 +0000 (14:00 +0200)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gitbuildsys/cmd_import.py
tests/test_import.py

index 64e300791647602e3049195c542988cd70941f00..4ce7367b964c91f17d445ba4bb82be88ee7ee797 100644 (file)
@@ -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:
index 87b2d4dd315dbe9b57f2f72b2c993857a0c14a8a..db0b79781451b0fa7dbb2f2396b404302070a6d9 100644 (file)
@@ -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'))