From 7acba9707881ff5f08373ff129aebad32d9a9c4d Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 23 Feb 2011 00:26:52 -0800 Subject: [PATCH 01/44] [commit-patch] Specify GPL version--just plain GPL isn't specific enough. --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index a4d8fc9..e98f55a 100755 --- a/commit-patch +++ b/commit-patch @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # Copyright (c) 2003-2010 David Caldwell # and Jim Radford , All Rights Reserved. -# This code can be distributed under the terms of the GNU Public License +# This code can be distributed under the terms of the GNU Public License (Version 2 or greater). my $VERSION = '2.4'; -- 2.54.0 From 17417b761769f41628f10a430c4f87436d24aa38 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 23 Feb 2011 00:27:03 -0800 Subject: [PATCH 02/44] [commit-patch] It's 2011. --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index e98f55a..f49c599 100755 --- a/commit-patch +++ b/commit-patch @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright (c) 2003-2010 David Caldwell +# Copyright (c) 2003-2011 David Caldwell # and Jim Radford , All Rights Reserved. # This code can be distributed under the terms of the GNU Public License (Version 2 or greater). -- 2.54.0 From 38afacc228d6c1d918a70d4bac66eeeaa2269de3 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 23 Feb 2011 00:33:57 -0800 Subject: [PATCH 03/44] [commit-patch-buffer.el] Specify GPL version--just plain GPL isn't specific enough. --- commit-patch-buffer.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch-buffer.el b/commit-patch-buffer.el index 8b48e29..9204450 100644 --- a/commit-patch-buffer.el +++ b/commit-patch-buffer.el @@ -1,6 +1,6 @@ ;; Copyright 2003-2010 Jim Radford ;; and David Caldwell , All Rights Reserved. -;; This code can be distributed under the terms of the GNU Public License +;; This code can be distributed under the terms of the GNU Public License (Version 2 or greater). ;; Version: 2.1 (require 'vc) -- 2.54.0 From a52c158b19963d3484f32555692d08f99a0a1915 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 23 Feb 2011 00:34:17 -0800 Subject: [PATCH 04/44] [commit-patch-buffer.el] It's 2011. --- commit-patch-buffer.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch-buffer.el b/commit-patch-buffer.el index 9204450..38f8e63 100644 --- a/commit-patch-buffer.el +++ b/commit-patch-buffer.el @@ -1,4 +1,4 @@ -;; Copyright 2003-2010 Jim Radford +;; Copyright 2003-2011 Jim Radford ;; and David Caldwell , All Rights Reserved. ;; This code can be distributed under the terms of the GNU Public License (Version 2 or greater). ;; Version: 2.1 -- 2.54.0 From d9bd4698ad3641b63180e4674a4bd1abfdee4efc Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Sun, 17 Apr 2011 23:32:27 -0700 Subject: [PATCH 05/44] [commit-patch] Use scalars instead of temp files. It's cleaner and makes it easy to look for empty files (next patch) but it doesn't scale as well since both working and non-committed patches have to fit in memory (which probably doesn't matter since most patches aren't massive). --- commit-patch | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/commit-patch b/commit-patch index f49c599..31e9f76 100755 --- a/commit-patch +++ b/commit-patch @@ -219,18 +219,17 @@ for my $f (@files) { } $SIG{PIPE} = $SIG{INT} = $SIG{QUIT} = sub { print "Cleanly aborting..\n"; }; -$clean{"working.patch.$$"} = $clean{"non_committed.patch.$$"} = undef; - -my ($out,$non_committed_patch); +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"; -run(["interdiff", $vc{patcharg}, $patch, "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"; +run([split(/ /,$vc{diff}), @files], '>', \$working_patch, '2>', \$err);# CVS diff dies. Sigh. or die "$err\n"; +run(["interdiff", $vc{patcharg}, $patch, '-'], '<', \$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"; run(["patch", $vc{patcharg}], '<', $patch, '>', \$out, '2>', \$err) or die "$out\n$err\n"; # 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"; +run(["patch", $vc{patcharg}], '<', \$non_committed_patch, '>', \$out, '2>', \$err) or die "$out\n$err\n"; END { return if $dry_run; -- 2.54.0 From e49795ec4c345cb26183c6c4507b0650aa1ef9c6 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Sun, 17 Apr 2011 23:41:01 -0700 Subject: [PATCH 06/44] [commit-patch] Don't try to reverse the working patch when there are no diffs. Patch fails when the input has just a single \n in it which is what happens when we do "darcs diff a" and "a" doesn't exist yet. --- commit-patch | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/commit-patch b/commit-patch index 31e9f76..8b3f222 100755 --- a/commit-patch +++ b/commit-patch @@ -223,9 +223,11 @@ 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"; -run(["interdiff", $vc{patcharg}, $patch, '-'], '<', \$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"; +unless ($working_patch =~ /^\s*$/s) { + run(["interdiff", $vc{patcharg}, $patch, '-'], '<', \$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"; +} run(["patch", $vc{patcharg}], '<', $patch, '>', \$out, '2>', \$err) or die "$out\n$err\n"; # 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"; -- 2.54.0 From 1b603b3501de34d8ec8559c394ab4b8bb8bc0926 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Mon, 18 Apr 2011 00:03:58 -0700 Subject: [PATCH 07/44] [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.54.0 From 725135db120a3c371e1f58016db9b792eebcbed5 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Mon, 18 Apr 2011 02:56:13 -0700 Subject: [PATCH 08/44] [commit-patch] Use lsdiffs -s option to keep track of added, removed, and changed files in the patch so we can use them appropriately. --- commit-patch | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/commit-patch b/commit-patch index bf68f7a..25ed6f7 100755 --- a/commit-patch +++ b/commit-patch @@ -206,31 +206,34 @@ if ($vc{name} eq 'git') { } my ($lsdiff_out, $err); -run ["lsdiff", @{$vc{lsdiffarg}}, $patch], '|', ["sort"], '|', ["uniq"], \$lsdiff_out, \$err or die "lsdiff|sort|unique : $! ($err)"; -my @files = split(/\n/, $lsdiff_out); -die "No files in patch" unless scalar @files; +run ["lsdiff", '-s', @{$vc{lsdiffarg}}, $patch], '>', \$lsdiff_out, '2>', \$err or die "lsdiff|sort|unique : $! ($err)"; +my %lsdiff = map { /^([-+!])\s+(.*)$/ or die "bad lsdiff line: $_\nOut:\n$lsdiff_out"; ( $2 => $1 ) } split(/\n/, $lsdiff_out); +my @added = grep { $lsdiff{$_} eq '+' } keys %lsdiff; +my @removed = grep { $lsdiff{$_} eq '-' } keys %lsdiff; +my @changed = grep { $lsdiff{$_} eq '!' } keys %lsdiff; +die "No files in patch" unless scalar %lsdiff; #print "Found $vc{name} in $repo\n"; #printf("files: %s\n", join(",", @files)); -for my $f (@files) { +for my $f (@changed, @removed) { run ["cp", "-f", $f, "$f.orig.$$"] or die "couldn't make backup of $f: $!" if -f $f; $clean{"$f.orig.$$"} = $f; } $SIG{PIPE} = $SIG{INT} = $SIG{QUIT} = sub { print "Cleanly aborting..\n"; }; my ($out, $working_patch, $non_committed_patch); -run([split(/ /,$vc{diff}), @files], '>', \$working_patch, '2>', \$err);# CVS diff dies. Sigh. or die "$err\n"; +run([split(/ /,$vc{diff}), @changed, @removed], '>', \$working_patch, '2>', \$err);# CVS diff dies. Sigh. or die "$err\n"; unless ($working_patch =~ /^\s*$/s) { run(["interdiff", $vc{patcharg}, $patch, '-'], '<', \$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"; } 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. +run([split(/ /,$vc{add}), @added], '>', \$out, '2>', \$err);# Expect these 2 to fail when +run([split(/ /,$vc{remove}), @removed], '>', \$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([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"; END { -- 2.54.0 From 351c723507e174a4c260fc536e7717219eb9105d Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 19 Apr 2011 06:00:17 +0200 Subject: [PATCH 09/44] [commit-patch] Add support for monotone --- commit-patch | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/commit-patch b/commit-patch index 25ed6f7..79bd581 100755 --- a/commit-patch +++ b/commit-patch @@ -110,6 +110,16 @@ while (!$vc{name}) { $vc{message_file} = sub { ('-F', $_[0]) }; $vc{previous_message} = sub { my $prev; run([qw(git log -1 --pretty=format:%s%n%b)], '>', \$prev); $prev }; # Git is special cased below. + } elsif (-d "$repo/_MTN") { + $vc{name} = 'mtn'; + $vc{diff} = 'mtn diff'; + $vc{commit} = 'mtn commit'; + $vc{message} = sub { ('-m', $_[0]) }; + $vc{message_file} = sub { ('--message-file', $_[0]) }; + $vc{add} = 'mtn add'; + $vc{remove} = 'mtn drop'; + $vc{patcharg} = '-p0'; + $vc{lsdiffarg} = []; } else { $repo.="/.."; printf("Trying back a dir: $repo, abs:%s\n", abs_path($repo)); -- 2.54.0 From 02fa79ac37ed5d4c19f5fc86dab3a075900af33a Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 19 Apr 2011 09:31:12 +0200 Subject: [PATCH 10/44] [commit-patch] Avoid running 'interdiff' and 'patch -R' also when the working patch is just a series of comment lines. 'mtn diff' will output three comment lines when there are no changes. patch ignores them, so should we. --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index 79bd581..ac490bf 100755 --- a/commit-patch +++ b/commit-patch @@ -234,7 +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 =~ /^\s*$/s) { +unless ($working_patch =~ /^(#[^\n]*|\s)*$/s) { run(["interdiff", $vc{patcharg}, $patch, '-'], '<', \$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.54.0 From 30ebf82165177a91347ab43ed8a0734a051e3249 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Thu, 19 May 2011 08:33:11 -0700 Subject: [PATCH 11/44] [commit-patch] interdiff doesn't actually support '-'... yet! --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index 25ed6f7..4f1138f 100755 --- a/commit-patch +++ b/commit-patch @@ -225,7 +225,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 =~ /^\s*$/s) { - run(["interdiff", $vc{patcharg}, $patch, '-'], '<', \$working_patch, + 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.54.0 From db8a22b6f3f7a584bb5407c2199027432ff7e2b6 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Thu, 19 May 2011 08:34:26 -0700 Subject: [PATCH 12/44] [commit-patch] Fix error for lsdiff so it reflects the current usage. --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index 4f1138f..4ec9d12 100755 --- a/commit-patch +++ b/commit-patch @@ -206,7 +206,7 @@ if ($vc{name} eq 'git') { } my ($lsdiff_out, $err); -run ["lsdiff", '-s', @{$vc{lsdiffarg}}, $patch], '>', \$lsdiff_out, '2>', \$err or die "lsdiff|sort|unique : $! ($err)"; +run ["lsdiff", '-s', @{$vc{lsdiffarg}}, $patch], '>', \$lsdiff_out, '2>', \$err or die "lsdiff -s: $! ($err)"; my %lsdiff = map { /^([-+!])\s+(.*)$/ or die "bad lsdiff line: $_\nOut:\n$lsdiff_out"; ( $2 => $1 ) } split(/\n/, $lsdiff_out); my @added = grep { $lsdiff{$_} eq '+' } keys %lsdiff; my @removed = grep { $lsdiff{$_} eq '-' } keys %lsdiff; -- 2.54.0 From c222feabc524196f006aa1f7c16bb6b1a8ce5a26 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Thu, 19 May 2011 08:36:43 -0700 Subject: [PATCH 13/44] [commit-patch] Comment stuff added for darcs bug. --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index 4ec9d12..89bb4f2 100755 --- a/commit-patch +++ b/commit-patch @@ -224,7 +224,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 =~ /^\s*$/s) { +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.54.0 From 831825d5a1dbb7d49a549124f5066d27bc9d671e Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Thu, 19 May 2011 09:10:49 -0700 Subject: [PATCH 14/44] [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.54.0 From f682bc70b84a4213c8a330a231fcb883199d1894 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Thu, 19 May 2011 09:21:57 -0700 Subject: [PATCH 15/44] [commit-patch] Update docs to include Monotone. --- commit-patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commit-patch b/commit-patch index eed1d02..20f9f78 100755 --- a/commit-patch +++ b/commit-patch @@ -257,7 +257,7 @@ END { =head1 NAME -commit-patch - commit patches to I, I, I, I, I, or I repositories +commit-patch - commit patches to I, I, I, I, I, I, or I repositories =head1 SYNOPSIS @@ -283,7 +283,7 @@ B. Any files you specify will be passed to your version control's diff command. B currently supports the following version control systems: -B>, B>, B>, B>, B>, and B>. +B>, B>, B>, B>, B>, B>, and B>. =head1 OPTIONS -- 2.54.0 From 13767a6faf15cb65641340f27758c95dd49aec89 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Thu, 19 May 2011 09:33:45 -0700 Subject: [PATCH 16/44] [README] Update to include Monotone. --- README | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README b/README index ee022cd..9c5b015 100644 --- a/README +++ b/README @@ -1,5 +1,6 @@ -commit-patch - commit patches to Darcs, Git, Mercurial, Bazaar, Subversion, CVS -------------------------------------------------------------------------------- +commit-patch - commit patches to Darcs, Git, Mercurial, + Bazaar, Monotone, Subversion, or CVS +------------------------------------------------------- PREREQUISITES commit-patch relies on several programs to get the job done: @@ -14,6 +15,7 @@ PREREQUISITES git - mercurial - bazaar - + monotone - subversion - cvs - -- 2.54.0 From 4039a66d44676f946ce396cefbb89534f1329e39 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Thu, 19 May 2011 09:34:51 -0700 Subject: [PATCH 17/44] [README] Point to patchutils main page, not its download directories. --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 9c5b015..4f9ba63 100644 --- a/README +++ b/README @@ -8,7 +8,7 @@ PREREQUISITES perl - IPC::Run - patch - - interdiff - + interdiff - cp - Ideally installed on your system already. :-) and, of course, one of: darcs - -- 2.54.0 From d8887bf7679c31ff0fd1d3533326767eaf6fedd8 Mon Sep 17 00:00:00 2001 From: Ivan Andrus Date: Mon, 11 Mar 2013 20:31:10 -0600 Subject: [PATCH 18/44] Prevent mercurial from adding/removing every file Fixes #2 --- commit-patch | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/commit-patch b/commit-patch index 20f9f78..850c560 100755 --- a/commit-patch +++ b/commit-patch @@ -240,8 +240,8 @@ unless ($working_patch =~ /^\s*$/s) { # Work around an apparent bug in darcs (', \$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);# Expect these 2 to fail when -run([split(/ /,$vc{remove}), @removed], '>', \$out, '2>', \$err);# there are no new files. +run([split(/ /,$vc{add}), @added], '>', \$out, '2>', \$err) if ($#added >= 0 ); +run([split(/ /,$vc{remove}), @removed], '>', \$out, '2>', \$err) if ($#removed >= 0 ); # 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"; @@ -397,4 +397,3 @@ were causing problems with a repository that had a space in one of the directory names. =cut - -- 2.54.0 From ab05733420a0d2238e4350301f0dae621a74e2b6 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Fri, 18 Nov 2011 16:01:05 -0800 Subject: [PATCH 19/44] [commit-patch] Make VCS initialization more perl-like, less shell-like. --- commit-patch | 146 +++++++++++++++++++++++++-------------------------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/commit-patch b/commit-patch index 850c560..ce6c4cd 100755 --- a/commit-patch +++ b/commit-patch @@ -39,87 +39,87 @@ my $amend; my %vc; while (!$vc{name}) { if (-d "$repo/CVS" && $repo eq '.') { - $vc{name} = 'cvs'; - $vc{diff} = 'cvs diff -u'; - $vc{commit} = 'cvs commit'; - $vc{message} = sub { ('-m', $_[0]) }; - $vc{message_file} = sub { ('-F', $_[0]) }; - $vc{add} = 'cvs add'; - $vc{remove} = 'cvs rm'; - $vc{patcharg} = '-p0'; - $vc{lsdiffarg} = []; + %vc = (name => 'cvs', + diff => 'cvs diff -u', + commit => 'cvs commit', + message => sub { ('-m', $_[0]) }, + message_file => sub { ('-F', $_[0]) }, + add => 'cvs add', + remove => 'cvs rm', + patcharg => '-p0', + lsdiffarg => []); } elsif (-d "$repo/.svn" && $repo eq '.') { - $vc{name} = 'svn'; - $vc{diff} = 'svn diff -x -u'; - $vc{commit} = 'svn commit'; - $vc{message} = sub { ('-m', $_[0]) }; - $vc{message_file} = sub { ('-F', $_[0]) }; - $vc{add} = 'svn add'; - $vc{remove} = 'svn delete'; - $vc{patcharg} = '-p0'; - $vc{lsdiffarg} = []; + %vc = (name => 'svn', + diff => 'svn diff -x -u', + commit => 'svn commit', + message => sub { ('-m', $_[0]) }, + message_file => sub { ('-F', $_[0]) }, + add => 'svn add', + remove => 'svn delete', + patcharg => '-p0', + lsdiffarg => []); } elsif (-d "$repo/_darcs") { - $vc{name} = 'darcs'; - $vc{diff} = 'darcs diff -u'; - $vc{add} = 'darcs add'; - $vc{remove} = 'true'; - $vc{commit} = 'darcs record --all'; - $vc{amend} = 'darcs amend-record --all'; - $vc{patcharg} = '-p1'; - $vc{lsdiffarg} = [qw(--strip 1)]; - $vc{message} = sub { - return () if $amend; # Darcs amend doesn't have --logfile, so don't support comments on amend. - # Darcs doesn't like multiline -m comments so we have to put the log message into a file and use --logfile. Yuck. - #return ('-m', $_[0]); - my $message = $_[0]; - $message .= "\n" unless $message =~ /\n$/s; # Darcs does screwey stuff when logfile has no trailing \n. - my ($message_file, $message_filename) = tempfile("commit-patch-message-XXXXXXXX", UNLINK=>0); - print $message_file $message; - close $message_file; - $clean{$message_filename} = undef; # make sure we delete this file on exit. - ("--logfile=$message_filename"); - }; - $vc{message_file} = sub { die "Darcs doesn't support --message-file and --amend" if $amend; ("--logfile=$_[0]" ) }; + %vc = (name => 'darcs', + diff => 'darcs diff -u', + add => 'darcs add', + remove => 'true', + commit => 'darcs record --all', + amend => 'darcs amend-record --all', + patcharg => '-p1', + lsdiffarg => [qw(--strip 1)], + message => sub { + return () if $amend; # Darcs amend doesn't have --logfile, so don't support comments on amend. + # Darcs doesn't like multiline -m comments so we have to put the log message into a file and use --logfile. Yuck. + #return ('-m', $_[0]); + my $message = $_[0]; + $message .= "\n" unless $message =~ /\n$/s; # Darcs does screwey stuff when logfile has no trailing \n. + my ($message_file, $message_filename) = tempfile("commit-patch-message-XXXXXXXX", UNLINK=>0); + print $message_file $message; + close $message_file; + $clean{$message_filename} = undef; # make sure we delete this file on exit. + ("--logfile=$message_filename"); + }, + message_file => sub { die "Darcs doesn't support --message-file and --amend" if $amend; ("--logfile=$_[0]" ) }); } elsif (-d "$repo/.hg") { - $vc{name} = 'hg'; - $vc{diff} = 'hg diff'; - $vc{commit} = 'hg commit'; - $vc{message} = sub { ('-m', $_[0]) }; - $vc{message_file} = sub { ('--logfile', $_[0]) }; - $vc{add} = 'hg addremove'; - $vc{remove} = 'true'; - $vc{patcharg} = '-p1'; - $vc{lsdiffarg} = [qw(--strip 1)]; + %vc = (name => 'hg', + diff => 'hg diff', + commit => 'hg commit', + message => sub { ('-m', $_[0]) }, + message_file => sub { ('--logfile', $_[0]) }, + add => 'hg addremove', + remove => 'true', + patcharg => '-p1', + lsdiffarg => [qw(--strip 1)]); } elsif (-d "$repo/.bzr") { - $vc{name} = 'bzr'; - $vc{diff} = 'bzr diff'; - $vc{commit} = 'bzr commit'; - $vc{message} = sub { ('-m', $_[0]) }; - $vc{message_file} = sub { ('--file', $_[0]) }; - $vc{add} = 'bzr add'; - $vc{remove} = 'true'; - $vc{patcharg} = '-p0'; - $vc{lsdiffarg} = []; + %vc = (name => 'bzr', + diff => 'bzr diff', + commit => 'bzr commit', + message => sub { ('-m', $_[0]) }, + message_file => sub { ('--file', $_[0]) }, + add => 'bzr add', + remove => 'true', + patcharg => '-p0', + lsdiffarg => []); chdir $repo; # otherwise commit-partial from within a project subdir fails. } elsif (-d "$repo/.git") { - $vc{name} = 'git'; - $vc{diff} = 'git diff'; - $vc{commit} = 'git commit'; - $vc{amend} = 'git commit --amend'; - $vc{message} = sub { ('-m', $_[0]) }; - $vc{message_file} = sub { ('-F', $_[0]) }; - $vc{previous_message} = sub { my $prev; run([qw(git log -1 --pretty=format:%s%n%b)], '>', \$prev); $prev }; + %vc = (name => 'git', + diff => 'git diff', + commit => 'git commit', + amend => 'git commit --amend', + message => sub { ('-m', $_[0]) }, + message_file => sub { ('-F', $_[0]) }, + previous_message => sub { my $prev; run([qw(git log -1 --pretty=format:%s%n%b)], '>', \$prev); $prev }); # Git is special cased below. } elsif (-d "$repo/_MTN") { - $vc{name} = 'mtn'; - $vc{diff} = 'mtn diff --without-header'; - $vc{commit} = 'mtn commit'; - $vc{message} = sub { ('-m', $_[0]) }; - $vc{message_file} = sub { ('--message-file', $_[0]) }; - $vc{add} = 'mtn add'; - $vc{remove} = 'mtn drop'; - $vc{patcharg} = '-p0'; - $vc{lsdiffarg} = []; + %vc = (name => 'mtn', + diff => 'mtn diff --without-header', + commit => 'mtn commit', + message => sub { ('-m', $_[0]) }, + message_file => sub { ('--message-file', $_[0]) }, + add => 'mtn add', + remove => 'mtn drop', + patcharg => '-p0', + lsdiffarg => []); } else { $repo.="/.."; printf("Trying back a dir: $repo, abs:%s\n", abs_path($repo)); -- 2.54.0 From 10d58a70b7f08ff7b2468fd3c1e4be7e8f881323 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Thu, 19 Apr 2012 09:56:24 -0700 Subject: [PATCH 20/44] [commit-patch] Support svn 1.7 which apparently doesn't scatter .svn droppings in every subdirectory. (Thanks sneakypete81) --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index ce6c4cd..fb6688d 100755 --- a/commit-patch +++ b/commit-patch @@ -48,7 +48,7 @@ while (!$vc{name}) { remove => 'cvs rm', patcharg => '-p0', lsdiffarg => []); - } elsif (-d "$repo/.svn" && $repo eq '.') { + } elsif (-d "$repo/.svn") { %vc = (name => 'svn', diff => 'svn diff -x -u', commit => 'svn commit', -- 2.54.0 From 80d8df0f5e830c4179dfa442528041b53a52b2f9 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Thu, 19 Apr 2012 10:26:19 -0700 Subject: [PATCH 21/44] [commit-patch] Only run the vc-add or remove commands when there are files to add or remove. --- commit-patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commit-patch b/commit-patch index fb6688d..5d55c2d 100755 --- a/commit-patch +++ b/commit-patch @@ -240,8 +240,8 @@ unless ($working_patch =~ /^\s*$/s) { # Work around an apparent bug in darcs (', \$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 >= 0 ); -run([split(/ /,$vc{remove}), @removed], '>', \$out, '2>', \$err) if ($#removed >= 0 ); +run([split(/ /,$vc{add}), @added], '>', \$out, '2>', \$err) if @added; +run([split(/ /,$vc{remove}), @removed], '>', \$out, '2>', \$err) 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"; -- 2.54.0 From 2f10907a5dc2c881826f78009200c7f0b2c69cc4 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Thu, 19 Apr 2012 10:27:14 -0700 Subject: [PATCH 22/44] [commit-patch] Save backups of removed files, too (I can't remember why, but it was important) --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index 5d55c2d..cdd36f9 100755 --- a/commit-patch +++ b/commit-patch @@ -226,7 +226,7 @@ die "No files in patch" unless scalar %lsdiff; #print "Found $vc{name} in $repo\n"; #printf("files: %s\n", join(",", @files)); -for my $f (@changed, @removed) { +for my $f (@changed, @added, @removed) { run ["cp", "-f", $f, "$f.orig.$$"] or die "couldn't make backup of $f: $!" if -f $f; $clean{"$f.orig.$$"} = $f; } -- 2.54.0 From ae6af58304a372151b3e982cc40bffb0def17057 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 2 May 2012 12:14:38 -0700 Subject: [PATCH 23/44] [commit-patch] Use --relative with "git diff" so that commit-partial doesn't silently fail when you in a subdirectory. "git apply" seems to filter the diff so that only files within the current directory (and its descendants) get applied. It (crazily) does this silently and there doesn't seem to be an option to override this. The other option would be to cd to the project root just before calling "git apply" but I think it's more intuitive to diff from your current directory--just cd to the root yourself if you want to see the whole project's changes. --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index cdd36f9..3928e3e 100755 --- a/commit-patch +++ b/commit-patch @@ -103,7 +103,7 @@ while (!$vc{name}) { chdir $repo; # otherwise commit-partial from within a project subdir fails. } elsif (-d "$repo/.git") { %vc = (name => 'git', - diff => 'git diff', + diff => 'git diff --relative', # Use --relative here because "git diff | git apply --cached" fails to apply hunks from files not in your current dir tree commit => 'git commit', amend => 'git commit --amend', message => sub { ('-m', $_[0]) }, -- 2.54.0 From a01729ea9f660516f88a9e0a35986ba59511e3cc Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 10:48:36 -0700 Subject: [PATCH 24/44] [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.54.0 From ea4d37468a5a2e9bdddfcffe65a8216fc85d8b8a Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 10:49:04 -0700 Subject: [PATCH 25/44] [commit-patch] Quote things better in --verbose mode. --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index b2a6ab5..fa5a37a 100755 --- a/commit-patch +++ b/commit-patch @@ -16,7 +16,7 @@ my ($dry_run, $verbose); sub run { if ($verbose || $dry_run) { for (@_) { - print join ' ', @$_ if ref $_ eq 'ARRAY'; + print join ' ', map { $_ =~ / / ? "\"$_\"" : $_ } @$_ if ref $_ eq 'ARRAY'; print " $_ " if ref $_ eq ''; print '[',ref $_,'] ' if ref $_ ne 'ARRAY' && ref $_ ne ''; } -- 2.54.0 From 855db1849a116822096229f369c00f929db2336a Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 10:50:29 -0700 Subject: [PATCH 26/44] [commit-patch] Whitespace --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index fa5a37a..1df3a11 100755 --- a/commit-patch +++ b/commit-patch @@ -236,7 +236,7 @@ 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 =~ /^\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"; + '>', \$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 "patch: $out\n$err\n"; -- 2.54.0 From b208d5006ad6133f3df3a89fbe7795b28c904e32 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 10:53:16 -0700 Subject: [PATCH 27/44] [commit-patch] Use --force when patching back to the clean version so if something goes wrong it doesn't ask interactive questions. --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index 1df3a11..654a372 100755 --- a/commit-patch +++ b/commit-patch @@ -237,7 +237,7 @@ run([split(/ /,$vc{diff}), @changed, @removed], '>', \$working_patch, 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"; + run([qw"patch -R --force", $vc{patcharg}], '<', \$working_patch, '>', \$out, '2>', \$err) or die "$out\n$err\n"; } 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; -- 2.54.0 From ef50066d3af12f325ff54d76a96de965ce2394eb Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 11:08:55 -0700 Subject: [PATCH 28/44] It's 2013. --- README | 2 +- commit-patch | 4 ++-- commit-patch-buffer.el | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README b/README index 4f9ba63..5458bf3 100644 --- a/README +++ b/README @@ -53,7 +53,7 @@ AUTHORS o Jim Radford COPYRIGHT AND LICENSE - Copyright 2003-2010 by David Caldwell and Jim Radford. + Copyright 2003-2013 by David Caldwell and Jim Radford. commit-patch is distributed under the GNU General Public License. See the COPYING file in the distribution for more diff --git a/commit-patch b/commit-patch index 654a372..c2cd421 100755 --- a/commit-patch +++ b/commit-patch @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright (c) 2003-2011 David Caldwell +# Copyright (c) 2003-2013 David Caldwell # and Jim Radford , All Rights Reserved. # This code can be distributed under the terms of the GNU Public License (Version 2 or greater). @@ -380,7 +380,7 @@ Jim Radford =head1 COPYRIGHT AND LICENSE -Copyright 2003-2010 by David Caldwell and Jim Radford. +Copyright 2003-2013 by David Caldwell and Jim Radford. B is distributed under the GNU General Public License. See the COPYING file in the distribution for more details. diff --git a/commit-patch-buffer.el b/commit-patch-buffer.el index 38f8e63..87f4293 100644 --- a/commit-patch-buffer.el +++ b/commit-patch-buffer.el @@ -1,4 +1,4 @@ -;; Copyright 2003-2011 Jim Radford +;; Copyright 2003-2013 Jim Radford ;; and David Caldwell , All Rights Reserved. ;; This code can be distributed under the terms of the GNU Public License (Version 2 or greater). ;; Version: 2.1 -- 2.54.0 From fdef1bbde0b3c91805426ac6601003b0cd2b31bb Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 11:09:16 -0700 Subject: [PATCH 29/44] [README] Add Mac OS X/Homebrew instructions. --- README | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README b/README index 5458bf3..43ef43e 100644 --- a/README +++ b/README @@ -25,6 +25,10 @@ PREREQUISITES On Fedora: yum install perl-IPC-Run patch patchutils + On Mac OS X w/ Homebrew + brew install patchutils + cpan -i IPC::Run + commit-patch is known to run on Linux and Mac OS X. It is perl, so ideally it will run anywhere, but we have never tested in other environments, most notably Windows. Use at your own risk. -- 2.54.0 From 96f4a41ccb9dab64bfc9a671a09af31545dcc663 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 11:44:37 -0700 Subject: [PATCH 30/44] [commit-patch-buffer] Add conventional headers for emacs libraries. IE. Section D.8 of the elisp manual. Thanks to Jonas Bernoulli for the push. --- commit-patch-buffer.el | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/commit-patch-buffer.el b/commit-patch-buffer.el index 87f4293..908de65 100644 --- a/commit-patch-buffer.el +++ b/commit-patch-buffer.el @@ -1,7 +1,31 @@ +;;; commit-patch-buffer.el --- commit patches to Darcs, Git, Mercurial, Bazaar, Monotone, Subversion, or CVS repositories + ;; Copyright 2003-2013 Jim Radford ;; and David Caldwell , All Rights Reserved. ;; This code can be distributed under the terms of the GNU Public License (Version 2 or greater). +;; ;; Version: 2.1 +;; +;; Author: Jim Radford +;; David Caldwell + +;;; Commentary: + +;; commit-patch-buffer provides an Emacs front end to the commit-patch(1) +;; program. Typically the patch to commit would be obtained with vc-diff +;; ("C-c v ="), though any Emacs diff-mode buffer can be committed. +;; +;; Typing "C-c C-c" in a diff-mode buffer kicks off the process and brings +;; up a buffer for the commit comment. After entering a suitable comment, +;; type "C-c C-c" again to finish the commit. If commit-patch-buffer cannot +;; automatically detect the repository directory, it will ask for it +;; interactively. +;; +;; commit-patch-buffer-in-directory is also available: this function skips +;; the automagical repository detection logic if the user wants to directly +;; specify the buffer to commit and directory. + +;;; Code: (require 'vc) (require 'log-edit) @@ -96,3 +120,5 @@ following algorithm: (define-key diff-mode-map "\C-xvv" 'commit-patch-buffer))) (provide 'commit-patch-buffer) + +;;; commit-patch-buffer.el ends here -- 2.54.0 From 320f692a066d944fd39bc6abaf8e3faf7de945a3 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 11:47:01 -0700 Subject: [PATCH 31/44] [commit-patch-buffer] Version is really 2.4 --- commit-patch-buffer.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch-buffer.el b/commit-patch-buffer.el index 908de65..80f3bdb 100644 --- a/commit-patch-buffer.el +++ b/commit-patch-buffer.el @@ -4,7 +4,7 @@ ;; and David Caldwell , All Rights Reserved. ;; This code can be distributed under the terms of the GNU Public License (Version 2 or greater). ;; -;; Version: 2.1 +;; Version: 2.4 ;; ;; Author: Jim Radford ;; David Caldwell -- 2.54.0 From 92bbcb9c8b7a50f867013bf1f81d0754778a2192 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 15:03:34 -0700 Subject: [PATCH 32/44] [commit-patch] cvs diff is missing the "-N" option. --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index c2cd421..37636de 100755 --- a/commit-patch +++ b/commit-patch @@ -40,7 +40,7 @@ my %vc; while (!$vc{name}) { if (-d "$repo/CVS" && $repo eq '.') { %vc = (name => 'cvs', - diff => 'cvs diff -u', + diff => 'cvs diff -Nu', commit => 'cvs commit', message => sub { ('-m', $_[0]) }, message_file => sub { ('-F', $_[0]) }, -- 2.54.0 From 581d96f30b655434dfa8cda9e63327c8b5fdc3a6 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 15:29:48 -0700 Subject: [PATCH 33/44] [commit-patch] Need to delete "added" files so that the reverse patch can create them. --- commit-patch | 1 + 1 file changed, 1 insertion(+) diff --git a/commit-patch b/commit-patch index 37636de..1faf94b 100755 --- a/commit-patch +++ b/commit-patch @@ -229,6 +229,7 @@ die "No files in patch" unless scalar %lsdiff; for my $f (@changed, @added, @removed) { run ["cp", "-f", $f, "$f.orig.$$"] or die "couldn't make backup of $f: $!" if -f $f; $clean{"$f.orig.$$"} = $f; + unlink $f if grep { $_ eq $f } @added; # Needs to be gone so patch can create it } $SIG{PIPE} = $SIG{INT} = $SIG{QUIT} = sub { print "Cleanly aborting..\n"; }; -- 2.54.0 From 0414745f7d331997faac2c98a7fe614473342646 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 15:33:40 -0700 Subject: [PATCH 34/44] Add testing infrastructure and a simple test --- test/main.test | 23 ++++++++++++++++++++++ test/run-tests | 50 +++++++++++++++++++++++++++++++++++++++++++++++ test/vcs/cvs.sh | 19 ++++++++++++++++++ test/vcs/darcs.sh | 13 ++++++++++++ test/vcs/git.sh | 13 ++++++++++++ test/vcs/hg.sh | 13 ++++++++++++ 6 files changed, 131 insertions(+) create mode 100644 test/main.test create mode 100755 test/run-tests create mode 100644 test/vcs/cvs.sh create mode 100644 test/vcs/darcs.sh create mode 100644 test/vcs/git.sh create mode 100644 test/vcs/hg.sh diff --git a/test/main.test b/test/main.test new file mode 100644 index 0000000..322931e --- /dev/null +++ b/test/main.test @@ -0,0 +1,23 @@ +# -*- sh -*- + +echo "initial" > a + +diff -uN --label /dev/null --label ${DIFF_PREFIX}a /dev/null a > initial.patch || true + +$COMMIT_PATCH -m "initial" initial.patch + +echo "1234" >> a + +$VC_DIFF > changed.patch || true + +$COMMIT_PATCH -m "changed" changed.patch + +rm a + +# Some VCSes won't show diffs for removed files unless you tell it they are removed: +[ $VC == 'cvs' ] && cvs rm a +[ $VC == 'hg' ] && hg rm a + +$VC_DIFF > removed.patch || true + +$COMMIT_PATCH -m "removed" removed.patch diff --git a/test/run-tests b/test/run-tests new file mode 100755 index 0000000..4839ed5 --- /dev/null +++ b/test/run-tests @@ -0,0 +1,50 @@ +#!/bin/bash + +set -x +TESTDIR=$(dirname $0) +TESTDIR_ABS=$(cd $TESTDIR && pwd) +export COMMIT_PATCH="$TESTDIR_ABS/../commit-patch --verbose" + +VCSes=$((cd "$TESTDIR/vcs" && ls -1 *.sh) | sed -e 's/\(.*\)\.sh/\1/') +Tests=$(cd "$TESTDIR" && ls -1 *.test) + +usage () { + set +x + echo "Usage:" + echo " $0 " + echo "" + echo " Where is one of: $(echo $VCSes)" + exit 1; +} + +VCs=${1:-$VCSes} + +[ "$VCs" == "--help" -o "$VCs" == "-h" ] && usage + +for vc in "$TESTDIR/vcs/"*.sh; do + source "$vc" +done + +run_test () { + export VC=$1 + TEST=$2 + + [ -d "$TESTDIR/tmp" ] || mkdir "$TESTDIR/tmp" + WD=$(mktemp -d "$TESTDIR_ABS/tmp/wd.XXXXXXX") + REPO=$(mktemp -d "$TESTDIR_ABS/tmp/repo.XXXXXXX") + + ${VC}_init "$WD" "$REPO" + + if ! (cd "$WD" && sh -x -e "$TESTDIR_ABS/$TEST"); then + echo "$VC / $TEST: Test failed." + exit 1; + fi + +# ${VC}_cleanup "$WD" "$REPO" +} + +for vc in $VCs; do + for t in $Tests; do + run_test $vc $t + done +done diff --git a/test/vcs/cvs.sh b/test/vcs/cvs.sh new file mode 100644 index 0000000..92d2e3d --- /dev/null +++ b/test/vcs/cvs.sh @@ -0,0 +1,19 @@ +cvs_init () { + WD=$1 + REPO=$2 + + export CVSROOT="$REPO" + cvs init + mkdir "$REPO/test" + cvs checkout -d "$WD" test + + export VC_DIFF="cvs diff -N" + export DIFF_PREFIX="" +} + +cvs_cleanup () { + WD=$1 + REPO=$2 + rm -rf "$WD" + rm -rf "$REPO" +} diff --git a/test/vcs/darcs.sh b/test/vcs/darcs.sh new file mode 100644 index 0000000..d0fdf3b --- /dev/null +++ b/test/vcs/darcs.sh @@ -0,0 +1,13 @@ +darcs_init () { + WD=$1 + mkdir -p "$WD" + (cd "$WD" && darcs init) + + export VC_DIFF="darcs diff" + export DIFF_PREFIX="a/" +} + +darcs_cleanup () { + WD=$1 + rm -rf "$WD" +} diff --git a/test/vcs/git.sh b/test/vcs/git.sh new file mode 100644 index 0000000..e0923f6 --- /dev/null +++ b/test/vcs/git.sh @@ -0,0 +1,13 @@ +git_init () { + WD=$1 + mkdir -p "$WD" + (cd "$WD" && git init) + + export VC_DIFF="git diff" + export DIFF_PREFIX="b/" +} + +git_cleanup () { + WD=$1 + rm -rf "$WD" +} diff --git a/test/vcs/hg.sh b/test/vcs/hg.sh new file mode 100644 index 0000000..29e1d71 --- /dev/null +++ b/test/vcs/hg.sh @@ -0,0 +1,13 @@ +hg_init () { + WD=$1 + mkdir -p "$WD" + (cd "$WD" && hg init) + + export VC_DIFF="hg diff" + export DIFF_PREFIX="a/" +} + +hg_cleanup () { + WD=$1 + rm -rf "$WD" +} -- 2.54.0 From 141c4ff98adf64d4b0edb0c34d30c06e5b18c77b Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 15:37:21 -0700 Subject: [PATCH 35/44] Also test bzr --- test/vcs/bzr.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/vcs/bzr.sh diff --git a/test/vcs/bzr.sh b/test/vcs/bzr.sh new file mode 100644 index 0000000..2b0c277 --- /dev/null +++ b/test/vcs/bzr.sh @@ -0,0 +1,13 @@ +bzr_init () { + WD=$1 + mkdir -p "$WD" + (cd "$WD" && bzr init) + + export VC_DIFF="bzr diff" + export DIFF_PREFIX="" +} + +bzr_cleanup () { + WD=$1 + rm -rf "$WD" +} -- 2.54.0 From 4841d2f6cc038a68c03f9f8d382b0a5aa3297b01 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 18:06:31 -0700 Subject: [PATCH 36/44] Also test Monotone --- test/main.test | 1 + test/vcs/mtn.sh | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 test/vcs/mtn.sh diff --git a/test/main.test b/test/main.test index 322931e..33783fc 100644 --- a/test/main.test +++ b/test/main.test @@ -17,6 +17,7 @@ rm a # Some VCSes won't show diffs for removed files unless you tell it they are removed: [ $VC == 'cvs' ] && cvs rm a [ $VC == 'hg' ] && hg rm a +[ $VC == 'mtn' ] && mtn drop a $VC_DIFF > removed.patch || true diff --git a/test/vcs/mtn.sh b/test/vcs/mtn.sh new file mode 100644 index 0000000..2bd1664 --- /dev/null +++ b/test/vcs/mtn.sh @@ -0,0 +1,24 @@ +mtn_init () { + WD=$1 + REPO=$2 + + export MTN_KEYDIR=$(mktemp -d "$TESTDIR_ABS/tmp/keydir.XXXXXXX") + + # Monotone doesns't like the db dir to exist when you init it. + [ -d "$REPO" ] && rmdir "$REPO" + + mtn --keydir "$MTN_KEYDIR" db init --db="$REPO" + mtn --keydir "$MTN_KEYDIR" --db="$REPO" --branch=test setup "$WD" + (cd "$WD" && mtn automate generate_key commit-patch-automated-tester@example.com '') + + export VC_DIFF="mtn diff --without-header" + export DIFF_PREFIX="" +} + +mtn_cleanup () { + WD=$1 + REPO=$2 + rm -rf "$REPO" + rm -rf "$WD" + rm -rf "$MTN_KEYDIR" +} -- 2.54.0 From ecf74dd1bcacb65bdff58ca31ce78f0b3087f3f5 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 18:49:24 -0700 Subject: [PATCH 37/44] Also test Subversion --- test/main.test | 1 + test/vcs/svn.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/vcs/svn.sh diff --git a/test/main.test b/test/main.test index 33783fc..622ff3a 100644 --- a/test/main.test +++ b/test/main.test @@ -18,6 +18,7 @@ rm a [ $VC == 'cvs' ] && cvs rm a [ $VC == 'hg' ] && hg rm a [ $VC == 'mtn' ] && mtn drop a +[ $VC == 'svn' ] && svn rm a $VC_DIFF > removed.patch || true diff --git a/test/vcs/svn.sh b/test/vcs/svn.sh new file mode 100644 index 0000000..79cec7e --- /dev/null +++ b/test/vcs/svn.sh @@ -0,0 +1,19 @@ +svn_init () { + WD=$1 + REPO=$2 + set -e + + (cd "$REPO" && svnadmin create test) + svn import "$WD" file://"$REPO"/test/trunk -m "Setting up trunk" + svn checkout file://"$REPO"/test/trunk "$WD" + + export VC_DIFF="svn diff" + export DIFF_PREFIX="" +} + +svn_cleanup () { + WD=$1 + REPO=$2 + rm -rf "$WD" + rm -rf "$REPO" +} -- 2.54.0 From ce85bf4b73a16b24bed1624e4448facc14a6d06f Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 18:50:00 -0700 Subject: [PATCH 38/44] [run-tests] Make sure the test framework fails on errors. --- test/run-tests | 1 + 1 file changed, 1 insertion(+) diff --git a/test/run-tests b/test/run-tests index 4839ed5..8e8017f 100755 --- a/test/run-tests +++ b/test/run-tests @@ -1,5 +1,6 @@ #!/bin/bash +set -e set -x TESTDIR=$(dirname $0) TESTDIR_ABS=$(cd $TESTDIR && pwd) -- 2.54.0 From 149c2c32ce6e8180c0605478e569225ab88be09f Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 18:55:05 -0700 Subject: [PATCH 39/44] [run-tests] Make things non-verbose by default. Still lots of noise from VCSes. --- test/run-tests | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/test/run-tests b/test/run-tests index 8e8017f..f388b17 100755 --- a/test/run-tests +++ b/test/run-tests @@ -1,10 +1,17 @@ #!/bin/bash set -e -set -x + +if [ "$1" == "-v" -o "$1" == "--verbose" ]; then + shift + set -x + export V=--verbose + export V_SH=-x +fi + TESTDIR=$(dirname $0) TESTDIR_ABS=$(cd $TESTDIR && pwd) -export COMMIT_PATCH="$TESTDIR_ABS/../commit-patch --verbose" +export COMMIT_PATCH="$TESTDIR_ABS/../commit-patch $V" VCSes=$((cd "$TESTDIR/vcs" && ls -1 *.sh) | sed -e 's/\(.*\)\.sh/\1/') Tests=$(cd "$TESTDIR" && ls -1 *.test) @@ -12,7 +19,7 @@ Tests=$(cd "$TESTDIR" && ls -1 *.test) usage () { set +x echo "Usage:" - echo " $0 " + echo " $0 [-v|--verbose] " echo "" echo " Where is one of: $(echo $VCSes)" exit 1; @@ -36,7 +43,7 @@ run_test () { ${VC}_init "$WD" "$REPO" - if ! (cd "$WD" && sh -x -e "$TESTDIR_ABS/$TEST"); then + if ! (cd "$WD" && sh $V_SH -e "$TESTDIR_ABS/$TEST"); then echo "$VC / $TEST: Test failed." exit 1; fi @@ -49,3 +56,5 @@ for vc in $VCs; do run_test $vc $t done done + +echo "All tests appear to pass." -- 2.54.0 From e310676b26108a011602b4bd9e8eb51e92e7b9aa Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 19:00:15 -0700 Subject: [PATCH 40/44] [test] Move VC rm out into individual vc.sh files, since it's no longer such a special case. --- test/main.test | 5 +---- test/vcs/bzr.sh | 1 + test/vcs/cvs.sh | 1 + test/vcs/darcs.sh | 1 + test/vcs/git.sh | 1 + test/vcs/hg.sh | 1 + test/vcs/mtn.sh | 1 + test/vcs/svn.sh | 1 + 8 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/main.test b/test/main.test index 622ff3a..d3a7764 100644 --- a/test/main.test +++ b/test/main.test @@ -15,10 +15,7 @@ $COMMIT_PATCH -m "changed" changed.patch rm a # Some VCSes won't show diffs for removed files unless you tell it they are removed: -[ $VC == 'cvs' ] && cvs rm a -[ $VC == 'hg' ] && hg rm a -[ $VC == 'mtn' ] && mtn drop a -[ $VC == 'svn' ] && svn rm a +$VC_RM a $VC_DIFF > removed.patch || true diff --git a/test/vcs/bzr.sh b/test/vcs/bzr.sh index 2b0c277..a176083 100644 --- a/test/vcs/bzr.sh +++ b/test/vcs/bzr.sh @@ -4,6 +4,7 @@ bzr_init () { (cd "$WD" && bzr init) export VC_DIFF="bzr diff" + export VC_RM="true" export DIFF_PREFIX="" } diff --git a/test/vcs/cvs.sh b/test/vcs/cvs.sh index 92d2e3d..8f5985c 100644 --- a/test/vcs/cvs.sh +++ b/test/vcs/cvs.sh @@ -8,6 +8,7 @@ cvs_init () { cvs checkout -d "$WD" test export VC_DIFF="cvs diff -N" + export VC_RM="cvs rm" export DIFF_PREFIX="" } diff --git a/test/vcs/darcs.sh b/test/vcs/darcs.sh index d0fdf3b..4d2b79c 100644 --- a/test/vcs/darcs.sh +++ b/test/vcs/darcs.sh @@ -4,6 +4,7 @@ darcs_init () { (cd "$WD" && darcs init) export VC_DIFF="darcs diff" + export VC_RM="true" export DIFF_PREFIX="a/" } diff --git a/test/vcs/git.sh b/test/vcs/git.sh index e0923f6..64fdda6 100644 --- a/test/vcs/git.sh +++ b/test/vcs/git.sh @@ -4,6 +4,7 @@ git_init () { (cd "$WD" && git init) export VC_DIFF="git diff" + export VC_RM="true" export DIFF_PREFIX="b/" } diff --git a/test/vcs/hg.sh b/test/vcs/hg.sh index 29e1d71..df23b4a 100644 --- a/test/vcs/hg.sh +++ b/test/vcs/hg.sh @@ -4,6 +4,7 @@ hg_init () { (cd "$WD" && hg init) export VC_DIFF="hg diff" + export VC_RM="hg rm" export DIFF_PREFIX="a/" } diff --git a/test/vcs/mtn.sh b/test/vcs/mtn.sh index 2bd1664..857a3cc 100644 --- a/test/vcs/mtn.sh +++ b/test/vcs/mtn.sh @@ -12,6 +12,7 @@ mtn_init () { (cd "$WD" && mtn automate generate_key commit-patch-automated-tester@example.com '') export VC_DIFF="mtn diff --without-header" + export VC_RM="mtn drop" export DIFF_PREFIX="" } diff --git a/test/vcs/svn.sh b/test/vcs/svn.sh index 79cec7e..e748e25 100644 --- a/test/vcs/svn.sh +++ b/test/vcs/svn.sh @@ -8,6 +8,7 @@ svn_init () { svn checkout file://"$REPO"/test/trunk "$WD" export VC_DIFF="svn diff" + export VC_RM="svn rm" export DIFF_PREFIX="" } -- 2.54.0 From 3584f4096a1eb735f8350ed67b148cb6ea6f5a05 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 19:26:21 -0700 Subject: [PATCH 41/44] [Makefile] Add "make test". --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index aab79dd..d8c8cee 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,10 @@ commit-patch-$(VERSION).tar.gz: $(ALL) Makefile tar czf commit-patch-$(VERSION).tar.gz commit-patch-$(VERSION) rm -rf commit-patch-$(VERSION) +test: + ./test/run-tests +.PHONY: test + PREFIX=/usr/local install: $(ALL) mkdir -p "$(PREFIX)/bin" -- 2.54.0 From 3d412b0ecc17321be81640d476e1a66fad432b9f Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 19:30:45 -0700 Subject: [PATCH 42/44] [commit-patch] Use Monotone's "automate context_diff" since it's made for scripts. --- commit-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index 1faf94b..21b06b5 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', - diff => 'mtn diff --without-header', + diff => 'mtn automate content_diff', commit => 'mtn commit', message => sub { ('-m', $_[0]) }, message_file => sub { ('--message-file', $_[0]) }, -- 2.54.0 From 3ec1a6e6b1da94abc1ae9050bade6cb1e39c5d7e Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 19:48:09 -0700 Subject: [PATCH 43/44] [test] Make the cleanup generic--only need special case cleanups for monotone --- test/run-tests | 4 +++- test/vcs/bzr.sh | 3 +-- test/vcs/cvs.sh | 5 +---- test/vcs/darcs.sh | 3 +-- test/vcs/git.sh | 3 +-- test/vcs/hg.sh | 3 +-- test/vcs/mtn.sh | 4 ---- test/vcs/svn.sh | 5 +---- 8 files changed, 9 insertions(+), 21 deletions(-) diff --git a/test/run-tests b/test/run-tests index f388b17..4d89b91 100755 --- a/test/run-tests +++ b/test/run-tests @@ -48,7 +48,9 @@ run_test () { exit 1; fi -# ${VC}_cleanup "$WD" "$REPO" + ${VC}_cleanup "$WD" "$REPO" + rm -rf "$WD" + rm -rf "$REPO" } for vc in $VCs; do diff --git a/test/vcs/bzr.sh b/test/vcs/bzr.sh index a176083..34e0ba0 100644 --- a/test/vcs/bzr.sh +++ b/test/vcs/bzr.sh @@ -9,6 +9,5 @@ bzr_init () { } bzr_cleanup () { - WD=$1 - rm -rf "$WD" + true } diff --git a/test/vcs/cvs.sh b/test/vcs/cvs.sh index 8f5985c..1faa009 100644 --- a/test/vcs/cvs.sh +++ b/test/vcs/cvs.sh @@ -13,8 +13,5 @@ cvs_init () { } cvs_cleanup () { - WD=$1 - REPO=$2 - rm -rf "$WD" - rm -rf "$REPO" + true } diff --git a/test/vcs/darcs.sh b/test/vcs/darcs.sh index 4d2b79c..d4f8498 100644 --- a/test/vcs/darcs.sh +++ b/test/vcs/darcs.sh @@ -9,6 +9,5 @@ darcs_init () { } darcs_cleanup () { - WD=$1 - rm -rf "$WD" + true } diff --git a/test/vcs/git.sh b/test/vcs/git.sh index 64fdda6..0ed09f1 100644 --- a/test/vcs/git.sh +++ b/test/vcs/git.sh @@ -9,6 +9,5 @@ git_init () { } git_cleanup () { - WD=$1 - rm -rf "$WD" + true } diff --git a/test/vcs/hg.sh b/test/vcs/hg.sh index df23b4a..017087f 100644 --- a/test/vcs/hg.sh +++ b/test/vcs/hg.sh @@ -9,6 +9,5 @@ hg_init () { } hg_cleanup () { - WD=$1 - rm -rf "$WD" + true } diff --git a/test/vcs/mtn.sh b/test/vcs/mtn.sh index 857a3cc..f5be166 100644 --- a/test/vcs/mtn.sh +++ b/test/vcs/mtn.sh @@ -17,9 +17,5 @@ mtn_init () { } mtn_cleanup () { - WD=$1 - REPO=$2 - rm -rf "$REPO" - rm -rf "$WD" rm -rf "$MTN_KEYDIR" } diff --git a/test/vcs/svn.sh b/test/vcs/svn.sh index e748e25..b768843 100644 --- a/test/vcs/svn.sh +++ b/test/vcs/svn.sh @@ -13,8 +13,5 @@ svn_init () { } svn_cleanup () { - WD=$1 - REPO=$2 - rm -rf "$WD" - rm -rf "$REPO" + true } -- 2.54.0 From fb3a8c56935ea28175d1595987d7d7cc0b70e16b Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 15 May 2013 19:58:12 -0700 Subject: [PATCH 44/44] Version 2.5 --- Changes | 15 +++++++++++++++ commit-patch | 2 +- commit-patch-buffer.el | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 4bc6fd9..d6e58ba 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,18 @@ +commit-patch (2.5) + + * Added Monotone support. + + * Support Subversion version 1.7. + + * Fixed an issue with git where committing inside a repository's + subdirectory would fail. + + * Fixed some cases where adding and removing files would fail. + + * Added a small, poor testing infrastructure. + + -- David Caldwell Wed, 15 May 2013 19:34:42 -0700 + commit-patch (2.4) * Added --retry option to commit-partial for retrying failed patches. diff --git a/commit-patch b/commit-patch index 21b06b5..f9dca19 100755 --- a/commit-patch +++ b/commit-patch @@ -3,7 +3,7 @@ # and Jim Radford , All Rights Reserved. # This code can be distributed under the terms of the GNU Public License (Version 2 or greater). -my $VERSION = '2.4'; +my $VERSION = '2.5'; use strict; use Cwd qw(abs_path); diff --git a/commit-patch-buffer.el b/commit-patch-buffer.el index 80f3bdb..ac99e38 100644 --- a/commit-patch-buffer.el +++ b/commit-patch-buffer.el @@ -4,7 +4,7 @@ ;; and David Caldwell , All Rights Reserved. ;; This code can be distributed under the terms of the GNU Public License (Version 2 or greater). ;; -;; Version: 2.4 +;; Version: 2.5 ;; ;; Author: Jim Radford ;; David Caldwell -- 2.54.0