pq: Print proper error message if we fail to apply the tree
authorGuido Günther <agx@sigxcpu.org>
Mon, 19 May 2014 10:06:08 +0000 (12:06 +0200)
committerGuido Günther <agx@sigxcpu.org>
Mon, 19 May 2014 10:12:22 +0000 (12:12 +0200)
e.g. instead of

gbp:error: Failed to apply 'debian/patches/poison+remember_trash'

we now have

gbp:error: Failed to apply 'debian/patches/poison+remember_trash': Failed to commit tree: fatal: invalid date format: 1998/03/21

gbp/scripts/pq.py

index fc205bf2920d4d7cac3f98de2ebc776121550d01..05e5660c7f0b9d174916f4c3077cd59e1f2cfe89 100755 (executable)
@@ -174,8 +174,8 @@ def import_quilt_patches(repo, branch, series, tries, force):
             gbp.log.debug("Applying %s" % patch.path)
             try:
                 apply_and_commit_patch(repo, patch, maintainer, patch.topic)
-            except (GbpError, GitRepositoryError):
-                gbp.log.err("Failed to apply '%s'" % patch.path)
+            except (GbpError, GitRepositoryError) as e:
+                gbp.log.err("Failed to apply '%s': %s" % (patch.path, e))
                 repo.set_branch(branch)
                 repo.delete_branch(pq_branch)
                 break