tag 536037 + patch
thanks

Hi,

Am Dienstag, den 07.07.2009, 01:27 +0200 schrieb Joachim Breitner:
> it would be nice if debcommit had darcs-support. I’m writing a patch and
> will attach it here.

here it goes. Patch is against SVN revision 1921.

Greetings,
Joachim

-- 
Joachim "nomeata" Breitner
Debian Developer
  nome...@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nome...@joachim-breitner.de | http://people.debian.org/~nomeata
Index: debian/changelog
===================================================================
--- debian/changelog	(Revision 1921)
+++ debian/changelog	(Arbeitskopie)
@@ -1,5 +1,6 @@
 devscripts (2.10.53) UNRELEASED; urgency=low
 
+  [ Adam D. Barratt ]
   * checkbashisms: Detect the use of "source" when the sourced filename
     contains a tilde (Closes: #528592) or consists of a single character
     (Closes: #535252).  Thanks, Raphael Geissert and Ryan Niebur.
@@ -7,6 +8,9 @@
     as an option to mutt and not as a recipient address.  Thanks, Filippo
     Giunchedi.  (Closes: #534585)
 
+  [ Joachim Breitner ]
+  * debcommit: Implement darcs-support (Closes: #536037)
+
  -- Adam D. Barratt <a...@adam-barratt.org.uk>  Wed, 01 Jul 2009 18:43:43 +0100
 
 devscripts (2.10.52) unstable; urgency=low
Index: scripts/debcommit.pl
===================================================================
--- scripts/debcommit.pl	(Revision 1921)
+++ scripts/debcommit.pl	(Arbeitskopie)
@@ -14,7 +14,7 @@
 and commits the change to a package's repository. It must be run in a working
 copy for the package. Supported version control systems are:
 B<cvs>, B<git>, B<hg> (mercurial), B<svk>, B<svn> (subversion),
-B<baz>, B<bzr>, B<tla> (arch).
+B<baz>, B<bzr>, B<tla> (arch), B<darcs>.
 
 =head1 OPTIONS
 
@@ -372,6 +372,8 @@
 	    } else {
 		return "tla";
 	    }
+	} elsif (-d "debian/_darcs") {
+	    return "darcs";
 	}
     }
     if (-d ".svn") {
@@ -399,6 +401,9 @@
     if (-d ".hg") {
 	return "hg";
     }
+    if (-d "_darcs") {
+	return "darcs";
+    }
 
     # Test for this file to avoid interactive prompting from svk.
     if (-d "$ENV{HOME}/.svk/local") {
@@ -418,7 +423,7 @@
     	}
     }
 
-    die "debcommit: not in a cvs, subversion, baz, bzr, git, hg, or svk working copy\n";
+    die "debcommit: not in a cvs, subversion, baz, bzr, git, hg, svk or darcs working copy\n";
 }
 
 sub action {
@@ -511,6 +516,13 @@
                     @fixes_arg, @files_to_commit);
         }
     }
+    elsif ($prog eq 'darcs') {
+	if ($diffmode) {
+	    $action_rc = action($prog, "diff", @files_to_commit);
+        } else {
+	    $action_rc = action($prog, "record", "-m", $message, "-a", @files_to_commit);
+        }
+    }
     else {
 	die "debcommit: unknown program $prog";
     }
@@ -601,6 +613,11 @@
 	        die "debcommit: failed tagging with $tag\n";
     	}
     }
+    elsif ($prog eq 'darcs') {
+    	if (! action($prog, "tag", $tag)) {
+	        die "debcommit: failed tagging with $tag\n";
+    	}
+    }
     else {
 	die "debcommit: unknown program $prog";
     }
@@ -609,7 +626,7 @@
 sub getmessage {
     my $ret;
 
-    if ($prog =~ /^(cvs|svn|svk|tla|baz|bzr|git|hg)$/) {
+    if ($prog =~ /^(cvs|svn|svk|tla|baz|bzr|git|hg|darcs)$/) {
 	$ret='';
 	my @diffcmd;
 
@@ -635,6 +652,8 @@
 	} elsif ($prog eq 'svk') {
 	    $ENV{'SVKDIFF'} = '/usr/bin/diff -w -u';
 	    @diffcmd = ($prog, 'diff');
+	} elsif ($prog eq 'darcs') {
+	    @diffcmd = ($prog, 'diff', '--diff-opts=-wu');
 	} else {
 	    @diffcmd = ($prog, 'diff', '-w');
 	}

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Reply via email to