From 831825d5a1dbb7d49a549124f5066d27bc9d671e Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Thu, 19 May 2011 09:10:49 -0700 Subject: [PATCH] [commit-patch] Use Monotone's --without-header option instead of looking for diffs that are exclusively comments. --- commit-patch | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/commit-patch b/commit-patch index d45c7f3..eed1d02 100755 --- a/commit-patch +++ b/commit-patch @@ -112,7 +112,7 @@ while (!$vc{name}) { # Git is special cased below. } elsif (-d "$repo/_MTN") { $vc{name} = 'mtn'; - $vc{diff} = 'mtn diff'; + $vc{diff} = 'mtn diff --without-header'; $vc{commit} = 'mtn commit'; $vc{message} = sub { ('-m', $_[0]) }; $vc{message_file} = sub { ('--message-file', $_[0]) }; @@ -234,8 +234,7 @@ $SIG{PIPE} = $SIG{INT} = $SIG{QUIT} = sub { print "Cleanly aborting..\n"; }; my ($out, $working_patch, $non_committed_patch); run([split(/ /,$vc{diff}), @changed, @removed], '>', \$working_patch, '2>', \$err);# CVS diff dies. Sigh. or die "$err\n"; -unless ($working_patch =~ /^(#[^\n]*|\s)*$/s) { # Work around an apparent bug in darcs () - # Also ignore monotone's empty diffs which include 3 commented lines. +unless ($working_patch =~ /^\s*$/s) { # Work around an apparent bug in darcs () run(["interdiff", $vc{patcharg}, $patch, '/dev/stdin'], '<', \$working_patch, '>', \$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"; -- 2.51.2