diff -Nru commit-patch-2.4/Changes commit-patch-2.5/Changes --- commit-patch-2.4/Changes 2010-10-24 22:39:54.000000000 +0000 +++ commit-patch-2.5/Changes 2013-05-16 02:58:12.000000000 +0000 @@ -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 -Nru commit-patch-2.4/Makefile commit-patch-2.5/Makefile --- commit-patch-2.4/Makefile 2010-10-24 22:39:54.000000000 +0000 +++ commit-patch-2.5/Makefile 2013-05-16 02:58:12.000000000 +0000 @@ -28,6 +28,10 @@ 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" diff -Nru commit-patch-2.4/README commit-patch-2.5/README --- commit-patch-2.4/README 2010-10-24 22:39:54.000000000 +0000 +++ commit-patch-2.5/README 2013-05-16 02:58:12.000000000 +0000 @@ -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: @@ -7,13 +8,14 @@ perl - IPC::Run - patch - - interdiff - + interdiff - cp - Ideally installed on your system already. :-) and, of course, one of: darcs - git - mercurial - bazaar - + monotone - subversion - cvs - @@ -23,6 +25,10 @@ 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. @@ -51,7 +57,7 @@ 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 -Nru commit-patch-2.4/commit-patch commit-patch-2.5/commit-patch --- commit-patch-2.4/commit-patch 2010-10-24 22:39:54.000000000 +0000 +++ commit-patch-2.5/commit-patch 2013-05-16 02:58:12.000000000 +0000 @@ -1,9 +1,9 @@ #!/usr/bin/perl -w -# Copyright (c) 2003-2010 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 +# 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); @@ -16,7 +16,7 @@ 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 ''; } @@ -39,77 +39,87 @@ 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} = []; - } 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 => 'cvs', + diff => 'cvs diff -Nu', + 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") { + %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 --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]) }, + 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', + diff => 'mtn automate content_diff', + 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)); @@ -206,31 +216,36 @@ } 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 -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; +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, @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"; }; -$clean{"working.patch.$$"} = $clean{"non_committed.patch.$$"} = undef; - -my ($out,$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(["patch", $vc{patcharg}], '<', $patch, '>', \$out, '2>', \$err) or die "$out\n$err\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) { # 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([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; +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, @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([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 "patch: $out\n$err\n"; END { return if $dry_run; @@ -243,7 +258,7 @@ =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 @@ -269,7 +284,7 @@ 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 @@ -366,7 +381,7 @@ =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. @@ -383,4 +398,3 @@ directory names. =cut - diff -Nru commit-patch-2.4/commit-patch-buffer.el commit-patch-2.5/commit-patch-buffer.el --- commit-patch-2.4/commit-patch-buffer.el 2010-10-24 22:39:54.000000000 +0000 +++ commit-patch-2.5/commit-patch-buffer.el 2013-05-16 02:58:12.000000000 +0000 @@ -1,7 +1,31 @@ -;; Copyright 2003-2010 Jim Radford +;;; 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.1 +;; This code can be distributed under the terms of the GNU Public License (Version 2 or greater). +;; +;; Version: 2.5 +;; +;; 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 @@ (define-key diff-mode-map "\C-xvv" 'commit-patch-buffer))) (provide 'commit-patch-buffer) + +;;; commit-patch-buffer.el ends here diff -Nru commit-patch-2.4/debian/changelog commit-patch-2.5/debian/changelog --- commit-patch-2.4/debian/changelog 2011-02-23 09:22:18.000000000 +0000 +++ commit-patch-2.5/debian/changelog 2013-05-16 20:38:49.000000000 +0000 @@ -1,3 +1,22 @@ +commit-patch (2.5-1) unstable; urgency=low + + * New upstream release: + + * 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. + + * Upgraded to standards version 3.9.4. + + * Updated emacsen-install debhelper script (Closes: #703583) + + -- David Caldwell Wed, 15 May 2013 20:44:57 -0700 + commit-patch (2.4-1) unstable; urgency=low * New upstream version. diff -Nru commit-patch-2.4/debian/commit-patch.doc-base commit-patch-2.5/debian/commit-patch.doc-base --- commit-patch-2.4/debian/commit-patch.doc-base 1970-01-01 00:00:00.000000000 +0000 +++ commit-patch-2.5/debian/commit-patch.doc-base 2013-05-16 20:31:32.000000000 +0000 @@ -0,0 +1,12 @@ +Document: commit-patch +Title: Debian commit-patch Manual +Author: David Caldwell +Abstract: This manual describes what commit-patch is + and how it can be used to commit patches to Darcs, Git, + Mercurial, Bazaar, Monotone, Subversion, or CVS repositories. +Section: Programming + +Format: HTML +Index: /usr/share/doc/commit-patch/commit-patch.html +Files: /usr/share/doc/commit-patch/commit-patch.html + diff -Nru commit-patch-2.4/debian/control commit-patch-2.5/debian/control --- commit-patch-2.4/debian/control 2011-02-23 10:56:56.000000000 +0000 +++ commit-patch-2.5/debian/control 2013-05-16 21:14:26.000000000 +0000 @@ -3,21 +3,22 @@ Priority: optional Maintainer: David Caldwell Build-Depends: debhelper (>= 8.0.0~), perl -Standards-Version: 3.9.1 +Standards-Version: 3.9.4 Homepage: http://porkrind.org/commit-patch/ +Vcs-Git: git://github.com/caldwell/commit-patch.git -b debian Package: commit-patch Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, libipc-run-perl, patch, patchutils -Suggests: darcs | git | mercurial | bzr | subversion | cvs +Suggests: darcs | git | mercurial | bzr | monotone | subversion | cvs Description: utility to commit fine grained patches to source code control repositories Normally version control systems don't allow fine grained commits. commit-patch allows the user to control exactly what gets committed by letting the user supply a patch to be committed rather than using the files in the current working directory. . - commit-patch supports Darcs, Git, Mercurial, Bazaar, Subversion, or CVS - repositories. + commit-patch supports Darcs, Git, Mercurial, Bazaar, Monotone, Subversion, + or CVS repositories. . Also included is an Emacs interface to commit-patch. It allows you to just hit C-c C-c in any patch buffer to apply and commit only the changes diff -Nru commit-patch-2.4/debian/copyright commit-patch-2.5/debian/copyright --- commit-patch-2.4/debian/copyright 2011-02-23 08:21:39.000000000 +0000 +++ commit-patch-2.5/debian/copyright 2013-05-16 04:18:54.000000000 +0000 @@ -1,43 +1,35 @@ -This work was packaged for Debian by: - - David Caldwell on Sat, 20 Mar 2010 15:42:43 -0700 - -It was downloaded from: - - - -Upstream Authors: - - o David Caldwell - o Jim Radford - -Copyright: - - Copyright 2003-2010 by David Caldwell and Jim Radford. - -License: - - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see - -On Debian systems, the complete text of the GNU General -Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". - -The Debian packaging is: - - Copyright (C) 2010,2011 David Caldwell - -you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: commit-patch +Upstream-Contact: David Caldwell + Jim Radford +Source: http://porkrind.org/commit-patch/ + +Files: * +Copyright: 2003-2013 by David Caldwell and Jim Radford. +License: GPL-2+ + +Files: debian/* +Copyright: 2010,2011,2013 David Caldwell +License: GPL-2+ + +License: GPL-2+ + This program is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later + version. + . + This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more + details. + . + You should have received a copy of the GNU General Public + License along with this package; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301 USA + . + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file + `/usr/share/common-licenses/GPL-2'. diff -Nru commit-patch-2.4/debian/emacsen-install commit-patch-2.5/debian/emacsen-install --- commit-patch-2.4/debian/emacsen-install 2010-03-20 22:42:54.000000000 +0000 +++ commit-patch-2.5/debian/emacsen-install 2013-05-16 04:57:51.000000000 +0000 @@ -22,6 +22,7 @@ ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} +ELRELDIR=../../../emacs/site-lisp/${PACKAGE} # Install-info-altdir does not actually exist. # Maybe somebody will write it. @@ -33,13 +34,14 @@ install -m 755 -d ${ELCDIR} cd ${ELDIR} FILES=`echo *.el` -cp ${FILES} ${ELCDIR} cd ${ELCDIR} +ln -sf ${ELRELDIR}/*.el . cat << EOF > path.el -(setq load-path (cons "." load-path) byte-compile-warnings nil) +(debian-pkg-add-load-path-item ".") +(setq byte-compile-warnings nil) EOF ${FLAVOR} ${FLAGS} ${FILES} -rm -f *.el path.el +rm -f path.el exit 0 diff -Nru commit-patch-2.4/debian/patches/makefile-install_el_files_to_correct_dir.patch commit-patch-2.5/debian/patches/makefile-install_el_files_to_correct_dir.patch --- commit-patch-2.4/debian/patches/makefile-install_el_files_to_correct_dir.patch 2011-02-23 09:14:49.000000000 +0000 +++ commit-patch-2.5/debian/patches/makefile-install_el_files_to_correct_dir.patch 2013-05-16 03:43:29.000000000 +0000 @@ -1,9 +1,11 @@ Description: Fix elisp install location Author: David Caldwell ---- commit-patch-2.3.orig/Makefile -+++ commit-patch-2.3/Makefile -@@ -32,9 +32,9 @@ PREFIX=/usr/local +Index: commit-patch/Makefile +=================================================================== +--- commit-patch.orig/Makefile 2013-05-15 20:43:23.000000000 -0700 ++++ commit-patch/Makefile 2013-05-15 20:43:23.000000000 -0700 +@@ -36,9 +36,9 @@ install: $(ALL) mkdir -p "$(PREFIX)/bin" mkdir -p "$(PREFIX)/share/man/man1" diff -Nru commit-patch-2.4/debian/patches/series commit-patch-2.5/debian/patches/series --- commit-patch-2.4/debian/patches/series 2011-02-23 10:21:11.000000000 +0000 +++ commit-patch-2.5/debian/patches/series 2013-05-16 03:42:30.000000000 +0000 @@ -1,2 +1 @@ -specify-gpl-version-2.patch makefile-install_el_files_to_correct_dir.patch diff -Nru commit-patch-2.4/debian/patches/specify-gpl-version-2.patch commit-patch-2.5/debian/patches/specify-gpl-version-2.patch --- commit-patch-2.4/debian/patches/specify-gpl-version-2.patch 2011-02-23 09:44:33.000000000 +0000 +++ commit-patch-2.5/debian/patches/specify-gpl-version-2.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -Description: Specify which version of the GPL we are licenced under. -Author: David Caldwell - -Index: commit-patch/commit-patch -=================================================================== ---- commit-patch.orig/commit-patch 2011-02-23 01:42:34.000000000 -0800 -+++ commit-patch/commit-patch 2011-02-23 01:43:28.000000000 -0800 -@@ -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'; - -Index: commit-patch/commit-patch-buffer.el -=================================================================== ---- commit-patch.orig/commit-patch-buffer.el 2011-02-23 01:43:19.000000000 -0800 -+++ commit-patch/commit-patch-buffer.el 2011-02-23 01:43:28.000000000 -0800 -@@ -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) diff -Nru commit-patch-2.4/debian/rules commit-patch-2.5/debian/rules --- commit-patch-2.4/debian/rules 2011-02-23 12:04:18.000000000 +0000 +++ commit-patch-2.5/debian/rules 2013-05-16 04:50:43.000000000 +0000 @@ -11,5 +11,9 @@ # Installed by dh_installchangelogs: rm debian/commit-patch/usr/share/doc/commit-patch/Changes +# Skip tests. They aren't mature enough to offer any benefit during packaging. +override_dh_auto_test: + true + %: dh $@ diff -Nru commit-patch-2.4/test/main.test commit-patch-2.5/test/main.test --- commit-patch-2.4/test/main.test 1970-01-01 00:00:00.000000000 +0000 +++ commit-patch-2.5/test/main.test 2013-05-16 02:58:12.000000000 +0000 @@ -0,0 +1,22 @@ +# -*- 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_RM a + +$VC_DIFF > removed.patch || true + +$COMMIT_PATCH -m "removed" removed.patch diff -Nru commit-patch-2.4/test/run-tests commit-patch-2.5/test/run-tests --- commit-patch-2.4/test/run-tests 1970-01-01 00:00:00.000000000 +0000 +++ commit-patch-2.5/test/run-tests 2013-05-16 02:58:12.000000000 +0000 @@ -0,0 +1,62 @@ +#!/bin/bash + +set -e + +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 $V" + +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 [-v|--verbose] " + 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 $V_SH -e "$TESTDIR_ABS/$TEST"); then + echo "$VC / $TEST: Test failed." + exit 1; + fi + + ${VC}_cleanup "$WD" "$REPO" + rm -rf "$WD" + rm -rf "$REPO" +} + +for vc in $VCs; do + for t in $Tests; do + run_test $vc $t + done +done + +echo "All tests appear to pass." diff -Nru commit-patch-2.4/test/vcs/bzr.sh commit-patch-2.5/test/vcs/bzr.sh --- commit-patch-2.4/test/vcs/bzr.sh 1970-01-01 00:00:00.000000000 +0000 +++ commit-patch-2.5/test/vcs/bzr.sh 2013-05-16 02:58:12.000000000 +0000 @@ -0,0 +1,13 @@ +bzr_init () { + WD=$1 + mkdir -p "$WD" + (cd "$WD" && bzr init) + + export VC_DIFF="bzr diff" + export VC_RM="true" + export DIFF_PREFIX="" +} + +bzr_cleanup () { + true +} diff -Nru commit-patch-2.4/test/vcs/cvs.sh commit-patch-2.5/test/vcs/cvs.sh --- commit-patch-2.4/test/vcs/cvs.sh 1970-01-01 00:00:00.000000000 +0000 +++ commit-patch-2.5/test/vcs/cvs.sh 2013-05-16 02:58:12.000000000 +0000 @@ -0,0 +1,17 @@ +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 VC_RM="cvs rm" + export DIFF_PREFIX="" +} + +cvs_cleanup () { + true +} diff -Nru commit-patch-2.4/test/vcs/darcs.sh commit-patch-2.5/test/vcs/darcs.sh --- commit-patch-2.4/test/vcs/darcs.sh 1970-01-01 00:00:00.000000000 +0000 +++ commit-patch-2.5/test/vcs/darcs.sh 2013-05-16 02:58:12.000000000 +0000 @@ -0,0 +1,13 @@ +darcs_init () { + WD=$1 + mkdir -p "$WD" + (cd "$WD" && darcs init) + + export VC_DIFF="darcs diff" + export VC_RM="true" + export DIFF_PREFIX="a/" +} + +darcs_cleanup () { + true +} diff -Nru commit-patch-2.4/test/vcs/git.sh commit-patch-2.5/test/vcs/git.sh --- commit-patch-2.4/test/vcs/git.sh 1970-01-01 00:00:00.000000000 +0000 +++ commit-patch-2.5/test/vcs/git.sh 2013-05-16 02:58:12.000000000 +0000 @@ -0,0 +1,13 @@ +git_init () { + WD=$1 + mkdir -p "$WD" + (cd "$WD" && git init) + + export VC_DIFF="git diff" + export VC_RM="true" + export DIFF_PREFIX="b/" +} + +git_cleanup () { + true +} diff -Nru commit-patch-2.4/test/vcs/hg.sh commit-patch-2.5/test/vcs/hg.sh --- commit-patch-2.4/test/vcs/hg.sh 1970-01-01 00:00:00.000000000 +0000 +++ commit-patch-2.5/test/vcs/hg.sh 2013-05-16 02:58:12.000000000 +0000 @@ -0,0 +1,13 @@ +hg_init () { + WD=$1 + mkdir -p "$WD" + (cd "$WD" && hg init) + + export VC_DIFF="hg diff" + export VC_RM="hg rm" + export DIFF_PREFIX="a/" +} + +hg_cleanup () { + true +} diff -Nru commit-patch-2.4/test/vcs/mtn.sh commit-patch-2.5/test/vcs/mtn.sh --- commit-patch-2.4/test/vcs/mtn.sh 1970-01-01 00:00:00.000000000 +0000 +++ commit-patch-2.5/test/vcs/mtn.sh 2013-05-16 02:58:12.000000000 +0000 @@ -0,0 +1,21 @@ +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 VC_RM="mtn drop" + export DIFF_PREFIX="" +} + +mtn_cleanup () { + rm -rf "$MTN_KEYDIR" +} diff -Nru commit-patch-2.4/test/vcs/svn.sh commit-patch-2.5/test/vcs/svn.sh --- commit-patch-2.4/test/vcs/svn.sh 1970-01-01 00:00:00.000000000 +0000 +++ commit-patch-2.5/test/vcs/svn.sh 2013-05-16 02:58:12.000000000 +0000 @@ -0,0 +1,17 @@ +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 VC_RM="svn rm" + export DIFF_PREFIX="" +} + +svn_cleanup () { + true +}