From a01729ea9f660516f88a9e0a35986ba59511e3cc Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 10:48:36 -0700 Subject: [PATCH] [commit-patch] Better error reporting when various things fail. --- commit-patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commit-patch b/commit-patch index 3928e3e..b2a6ab5 100755 --- a/commit-patch +++ b/commit-patch @@ -239,12 +239,12 @@ unless ($working_patch =~ /^\s*$/s) { # Work around an apparent bug in darcs (', \$non_committed_patch, '2>', \$err) or die "$err\n"; run(["patch", $vc{patcharg}, "-R"], '<', \$working_patch, '>', \$out, '2>', \$err) or die "$out\n$err\n"; } -run(["patch", $vc{patcharg}], '<', $patch, '>', \$out, '2>', \$err) or die "$out\n$err\n"; -run([split(/ /,$vc{add}), @added], '>', \$out, '2>', \$err) if @added; -run([split(/ /,$vc{remove}), @removed], '>', \$out, '2>', \$err) if @removed; +run(["patch", $vc{patcharg}], '<', $patch, '>', \$out, '2>', \$err) or die "patch: $out\n$err\n"; +run([split(/ /,$vc{add}), @added], '>', \$out, '2>', \$err) or die "$vc{add}: $out\n$err\n" if @added; +run([split(/ /,$vc{remove}), @removed], '>', \$out, '2>', \$err) or die "$vc{remove}: $out\n$err\n" if @removed; # Don't capture stdout or stderr because it can be interactive (cough cough darcs) run([split(/ /,$vc_commit), @message_opt, @added, @removed, @changed]) or die "commit failed.\n"; -run(["patch", $vc{patcharg}], '<', \$non_committed_patch, '>', \$out, '2>', \$err) or die "$out\n$err\n"; +run(["patch", $vc{patcharg}], '<', \$non_committed_patch, '>', \$out, '2>', \$err) or die "patch: $out\n$err\n"; END { return if $dry_run; -- 2.51.2