From 1b603b3501de34d8ec8559c394ab4b8bb8bc0926 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Mon, 18 Apr 2011 00:03:58 -0700 Subject: [PATCH] [commit-patch] VCS Add and Remove needs to happen after the patch has been applied to the directory. Thanks to Richard Levitte for pointing this out. --- commit-patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commit-patch b/commit-patch index 8b3f222..bf68f7a 100755 --- a/commit-patch +++ b/commit-patch @@ -220,8 +220,6 @@ for my $f (@files) { $SIG{PIPE} = $SIG{INT} = $SIG{QUIT} = sub { print "Cleanly aborting..\n"; }; my ($out, $working_patch, $non_committed_patch); -run([split(/ /,$vc{add}), @files], '>', \$out, '2>', \$err);# Expect these 2 to fail when -run([split(/ /,$vc{remove}), @files], '>', \$out, '2>', \$err);# there are no new files. run([split(/ /,$vc{diff}), @files], '>', \$working_patch, '2>', \$err);# CVS diff dies. Sigh. or die "$err\n"; unless ($working_patch =~ /^\s*$/s) { run(["interdiff", $vc{patcharg}, $patch, '-'], '<', \$working_patch, @@ -229,6 +227,8 @@ unless ($working_patch =~ /^\s*$/s) { 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}), @files], '>', \$out, '2>', \$err);# Expect these 2 to fail when +run([split(/ /,$vc{remove}), @files], '>', \$out, '2>', \$err);# there are no new files. # Don't capture stdout or stderr because it can be interactive (cough cough darcs) run([split(/ /,$vc_commit), @message_opt, @files],debug => 0) or die "commit failed.\n"; run(["patch", $vc{patcharg}], '<', \$non_committed_patch, '>', \$out, '2>', \$err) or die "$out\n$err\n"; -- 2.51.2