diff -Nru devscripts-2.10.26ubuntu10/debian/changelog devscripts-2.10.26ubuntu11/debian/changelog --- devscripts-2.10.26ubuntu10/debian/changelog 2008-08-19 21:34:43.000000000 +0100 +++ devscripts-2.10.26ubuntu11/debian/changelog 2008-08-26 13:27:19.000000000 +0100 @@ -1,3 +1,12 @@ +devscripts (2.10.26ubuntu11) intrepid; urgency=low + + * scripts/debcommit.pl: + - Parse out the bug numbers and turn them in to --fixes arguments + for bzr commit. (LP: #261445) + - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=496643 + + -- James Westby Tue, 26 Aug 2008 12:37:27 +0100 + devscripts (2.10.26ubuntu10) intrepid; urgency=low * Revert dget hack (it's only needed to work around a PPA related bug) diff -Nru devscripts-2.10.26ubuntu10/po4a/po/devscripts.pot devscripts-2.10.26ubuntu11/po4a/po/devscripts.pot diff -Nru devscripts-2.10.26ubuntu10/po4a/po/fr.po devscripts-2.10.26ubuntu11/po4a/po/fr.po diff -Nru devscripts-2.10.26ubuntu10/scripts/debcommit.pl devscripts-2.10.26ubuntu11/scripts/debcommit.pl --- devscripts-2.10.26ubuntu10/scripts/debcommit.pl 2008-04-30 09:20:28.000000000 +0100 +++ devscripts-2.10.26ubuntu11/scripts/debcommit.pl 2008-08-26 13:01:22.000000000 +0100 @@ -159,12 +159,18 @@ summary. If multiple changes were detected then an editor will be spawned to allow the message to be fine-tuned. +=item B + +If the changelog entry used for the commit message closes any bugs then --fixes +options to "bzr commit" will be generated to associate the revision and the bugs. + =cut use warnings; use strict; use Getopt::Long; use Cwd; +use Dpkg::Changelog; use File::Basename; use File::Temp; my $progname = basename($0); @@ -413,6 +419,18 @@ return (system($prog, @_) != 0) ? 0 : 1; } +sub bzr_find_fixes { + my $message=shift; + + my $debian_closes = Dpkg::Changelog::find_closes($message); + my $launchpad_closes = Dpkg::Changelog::find_launchpad_closes($message); + + my @fixes_arg = (); + map { push(@fixes_arg, ("--fixes", "deb:".$_)) } @$debian_closes; + map { push(@fixes_arg, ("--fixes", "lp:".$_)) } @$launchpad_closes; + return @fixes_arg; +} + sub commit { my $message=shift; @@ -420,7 +438,7 @@ if (@files_to_commit and $all); my $action_rc; # return code of external command - if ($prog =~ /^(cvs|svn|svk|bzr|hg)$/) { + if ($prog =~ /^(cvs|svn|svk|hg)$/) { $action_rc = $diffmode ? action($prog, "diff", @files_to_commit) : action($prog, "commit", "-m", $message, @files_to_commit); @@ -464,6 +482,15 @@ ) if @files_to_commit; $action_rc = action($prog, $diffmode ? "diff" : "commit", @args); } + elsif ($prog eq 'bzr') { + if ($diffmode) { + $action_rc = action($prog, "diff", @files_to_commit); + } else { + my @fixes_arg = bzr_find_fixes($message); + $action_rc = action($prog, "commit", "-m", $message, + @fixes_arg, @files_to_commit); + } + } else { die "debcommit: unknown program $prog"; }