[pkg-perl-tools] 01/01: Capture and show error if pull-request fails
Alex Muntada
alexm at debian.org
Tue Nov 21 19:54:33 UTC 2017
This is an automated email from the git hooks/post-receive script.
alexm pushed a commit to branch master
in repository pkg-perl-tools.
commit 217d671233d35705daee9ca22eb3aed201f93a6d
Author: Alex Muntada <alexm at alexm.org>
Date: Tue Nov 21 20:54:14 2017 +0100
Capture and show error if pull-request fails
---
lib/Debian/PkgPerl/GitHub.pm | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/lib/Debian/PkgPerl/GitHub.pm b/lib/Debian/PkgPerl/GitHub.pm
index 946697e..5c2d4ee 100644
--- a/lib/Debian/PkgPerl/GitHub.pm
+++ b/lib/Debian/PkgPerl/GitHub.pm
@@ -233,7 +233,7 @@ sub clone_branch_patch_push {
$r->run( checkout => '-b', $branch );
# Patch
- $r->run( apply => '-p1', realpath($patch), { quiet => 0 } );
+ $r->run( apply => '-p1', realpath($patch), { quiet => 0, fatal => "!0" } );
# Push
$r->run( add => '.' );
@@ -369,11 +369,17 @@ Forward an issue as a pull request or bug.
sub forward {
my $self = shift;
- my $issue_url = $self->{message}->get_patch()
- ? eval { $self->forward_patch_as_pull_request() }
- || $self->forward_patch_as_ticket()
- : $self->forward_bug_as_issue()
- ;
+ my $issue_url;
+ $issue_url = $self->forward_bug_as_issue()
+ unless $self->{message}->get_patch();
+
+ $issue_url = eval { $self->forward_patch_as_pull_request() }
+ unless defined $issue_url;
+
+ warn "WARNING! Pull request failed...\n$@" if $@;
+
+ $issue_url = $self->forward_patch_as_ticket()
+ unless defined $issue_url;
return $issue_url;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/pkg-perl-tools.git
More information about the Pkg-perl-cvs-commits
mailing list