From cd829c9437d42f3223fbf51e22b795d2fcc33d00 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Tue, 3 Jul 2012 11:48:21 +0300 Subject: GitRepository: raise GitRepositoryError on git errors Raise GitRepositoryError in cases where CommandExecFailed (from GitCommand) was previously silently passed forward. Heavily based on a patch by Markus Lehtonen --- gbp/scripts/pq.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gbp/scripts/pq.py') diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py index 44b8819..ed95e0f 100755 --- a/gbp/scripts/pq.py +++ b/gbp/scripts/pq.py @@ -136,7 +136,7 @@ def import_quilt_patches(repo, branch, series, tries, force): try: gbp.log.info("Trying to apply patches at '%s'" % commit) repo.create_branch(pq_branch, commit) - except CommandExecFailed: + except GitRepositoryError: raise GbpError("Cannot create patch-queue branch '%s'." % pq_branch) repo.set_branch(pq_branch) @@ -144,7 +144,7 @@ def import_quilt_patches(repo, branch, series, tries, force): gbp.log.debug("Applying %s" % patch.path) try: apply_and_commit_patch(repo, patch, patch.topic) - except (GbpError, GitRepositoryError, CommandExecFailed): + except (GbpError, GitRepositoryError): repo.set_branch(branch) repo.delete_branch(pq_branch) break @@ -251,7 +251,7 @@ def main(argv): switch_pq(repo, current) except CommandExecFailed: retval = 1 - except GbpError as err: + except (GbpError, GitRepositoryError) as err: if len(err.__str__()): gbp.log.err(err) retval = 1 -- cgit v1.2.3