diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-05-19 12:06:39 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-05-19 12:13:50 +0200 |
commit | 54e454209a7573b4c321fc19a39f6991a6bd1ac0 (patch) | |
tree | 184a6e5eae1678c1120d9de1dba8fd22a2d36537 /gbp | |
parent | de77df731cd752a9d26c8bef7cf9933f30bfb50a (diff) |
pq: Try harder to cleanup after a failed patch
If we fail to apply the patch the tree is left in a dirty state
so reset to the last head. This avoids irritating errors like:
gbp:error: Failed to apply 'debian/patches/poison+remember_trash': Failed to commit tree: fatal: invalid date format: 1998/03/21
following files would be overwritten by checkout:
doc/hosts.nntp.5
innd/art.c
innd/innd.h
innd/rc.c
Please, commit your changes or stash them before you can switch branches.
Aborting
Thanks: Marco d'Itri for the repo to debug this
Diffstat (limited to 'gbp')
-rwxr-xr-x | gbp/scripts/pq.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py index 05e5660c..ea33c26c 100755 --- a/gbp/scripts/pq.py +++ b/gbp/scripts/pq.py @@ -176,6 +176,7 @@ def import_quilt_patches(repo, branch, series, tries, force): apply_and_commit_patch(repo, patch, maintainer, patch.topic) except (GbpError, GitRepositoryError) as e: gbp.log.err("Failed to apply '%s': %s" % (patch.path, e)) + repo.force_head('HEAD', hard=True) repo.set_branch(branch) repo.delete_branch(pq_branch) break |