Author: adam-guest
Date: 2008-03-19 20:38:03 +0000 (Wed, 19 Mar 2008)
New Revision: 1173

Modified:
   trunk/conf.default.in
   trunk/debian/NEWS
   trunk/debian/changelog
   trunk/debian/postinst
   trunk/scripts/debcommit.pl
Log:
debcommit: Make the change to --release's behaviour introduced in the
  last upload optional. If -R / --release-use-changelog is used then
  the changelog will be checked for uncommitted changes when determining
  the commit message. The default is not to do so and use the message
  passed with --message (if any) or "releasing version X.Y.Z" as before.
  (Closes: #471723)

Modified: trunk/conf.default.in
===================================================================
--- trunk/conf.default.in       2008-03-18 18:27:07 UTC (rev 1172)
+++ trunk/conf.default.in       2008-03-19 20:38:03 UTC (rev 1173)
@@ -182,6 +182,11 @@
 #
 # Sign created tags using gnupg?
 # DEBCOMMIT_SIGN_TAGS=no
+#
+# Take any uncommitted changes in the changelog in
+# to account when determining the commit message
+# for a release?
+# DEBCOMMIT_RELEASE_USE_CHANGELOG=no
 
 ##### debdiff
 # 

Modified: trunk/debian/NEWS
===================================================================
--- trunk/debian/NEWS   2008-03-18 18:27:07 UTC (rev 1172)
+++ trunk/debian/NEWS   2008-03-19 20:38:03 UTC (rev 1173)
@@ -1,3 +1,17 @@
+devscripts (2.10.20) unstable; urgency=low
+
+    devscripts 2.10.19 modified debcommit's --release option to use the
+    uncommitted changes (if any) in the changelog to derive the commit
+    message.
+
+    This behaviour is now optional and can be enabled using the -R /
+    --release-use-changelog command line option or by setting the
+    DEBCOMMIT_RELEASE_USE_CHANGELOG configuration option to "yes".
+
+    The default is to use the previous (i.e. pre-2.10.19) behaviour.
+
+ -- Adam D. Barratt <[EMAIL PROTECTED]>  Wed, 19 Mar 2008 20:31:20 +0000
+
 devscripts (2.10.19) unstable; urgency=low
 
     In devscripts 2.10.17, dget was modified to unpack source packages by

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-03-18 18:27:07 UTC (rev 1172)
+++ trunk/debian/changelog      2008-03-19 20:38:03 UTC (rev 1173)
@@ -13,6 +13,12 @@
     + Enhance quoted block detection to handle escaped quotes better
     + Enhance "shell script wrapper" detection to catch more ways of
       disguising a non shell script as one
+  * debcommit: Make the change to --release's behaviour introduced in the
+    last upload optional. If -R / --release-use-changelog is used then
+    the changelog will be checked for uncommitted changes when determining
+    the commit message. The default is not to do so and use the message
+    passed with --message (if any) or "releasing version X.Y.Z" as before.
+    (Closes: #471723)
   * debdiff: Escape package names when normalising path names
     (Closes: #471282)
   * uscan: Correctly handle an explicit upstream-version of 0

Modified: trunk/debian/postinst
===================================================================
--- trunk/debian/postinst       2008-03-18 18:27:07 UTC (rev 1172)
+++ trunk/debian/postinst       2008-03-19 20:38:03 UTC (rev 1173)
@@ -436,6 +436,20 @@
 
 EOF
        fi
+
+       if dpkg --compare-versions "$2" lt 2.10.20
+       then
+           # Added in devscripts 2.10.20
+           cat >> /etc/devscripts.conf <<EOF
+##### debcommit option added in version 2.10.20
+#
+# Take any uncommitted changes in the changelog in
+# to account when determining the commit message
+# for a release?
+# DEBCOMMIT_RELEASE_USE_CHANGELOG=no
+
+EOF
+       fi
     fi
 fi
 

Modified: trunk/scripts/debcommit.pl
===================================================================
--- trunk/scripts/debcommit.pl  2008-03-18 18:27:07 UTC (rev 1172)
+++ trunk/scripts/debcommit.pl  2008-03-19 20:38:03 UTC (rev 1173)
@@ -6,7 +6,7 @@
 
 =head1 SYNOPSIS
 
-B<debcommit> [B<--release>] [B<--message=>I<text>] [B<--noact>] [B<--diff>] 
[B<--confirm>] [B<--edit>] [B<--changelog=>I<path>] [B<--all> | I<files to 
commit>]
+B<debcommit> [B<--release>] [B<--release-use-changelog>] 
[B<--message=>I<text>] [B<--noact>] [B<--diff>] [B<--confirm>] [B<--edit>] 
[B<--changelog=>I<path>] [B<--all> | I<files to commit>]
 
 =head1 DESCRIPTION
 
@@ -34,6 +34,12 @@
 L<svnpath(1)> to determine where the tag should be placed in the
 repository.
 
+=item B<-R> B<--release-use-changelog>
+
+When used in conjunction with --release, if there are uncommited
+changes to the changelog then derive the commit message from those
+changes rather than using the default message.
+
 =item B<-m> I<text> B<--message> I<text>
 
 Specify a commit message to use. Useful if the program cannot determine
@@ -110,6 +116,11 @@
 If this is set to I<yes>, then it is the same as the --sign-tags command
 line parameter being used. The default is I<no>.
 
+=item B<DEBCOMMIT_RELEASE_USE_CHANGELOG>
+
+If this is set to I<yes>, then it is the same as the --release-use-changelog
+command line parameter being used. The default is I<no>.
+
 =item B<DEBSIGN_KEYID>
 
 This is the key id used for signing tags. If not set, a default will be
@@ -139,6 +150,10 @@
 Options:
    -c --changelog=path Specify the location of the changelog
    -r --release        Commit a release of the package and create a tag
+   -R --release-use-changelog
+                       Take any uncommitted changes in the changelog in
+                       to account when determining the commit message
+                       for a release
    -m --message=text   Specify a commit message
    -n --noact          Dry run, no actual commits
    -d --diff           Print diff on standard output instead of committing
@@ -174,6 +189,7 @@
 
 my $release=0;
 my $message;
+my $release_use_changelog=0;
 my $noact=0;
 my $diffmode=0;
 my $confirm=0;
@@ -195,6 +211,7 @@
     my %config_vars = (
                       'DEBCOMMIT_STRIP_MESSAGE' => 'no',
                       'DEBCOMMIT_SIGN_TAGS' => 'no',
+                      'DEBCOMMIT_RELEASE_USE_CHANGELOG' => 'no',
                       'DEBSIGN_KEYID' => '',
                      );
     my %config_default = %config_vars;
@@ -216,6 +233,8 @@
        or $config_vars{'DEBCOMMIT_STRIP_MESSAGE'}='no';
     $config_vars{'DEBCOMMIT_SIGN_TAGS'} =~ /^(yes|no)$/
        or $config_vars{'DEBCOMMIT_SIGN_TAGS'}='no';
+    $config_vars{'DEBCOMMIT_RELEASE_USE_CHANGELOG'} =~ /^(yes|no)$/
+       or $config_vars{'DEBCOMMIT_RELEASE_USE_CHANGELOG'}='no';
 
     foreach my $var (sort keys %config_vars) {
         if ($config_vars{$var} ne $config_default{$var}) {
@@ -227,6 +246,7 @@
 
     $stripmessage = $config_vars{'DEBCOMMIT_STRIP_MESSAGE'} eq 'no' ? 0 : 1;
     $signtags = $config_vars{'DEBCOMMIT_SIGN_TAGS'} eq 'no' ? 0 : 1;
+    $release_use_changelog = $config_vars{'DEBCOMMIT_RELEASE_USE_CHANGELOG'} 
eq 'no' ? 0 : 1;
     if (exists $config_vars{'DEBSIGN_KEYID'} &&
        length $config_vars{'DEBSIGN_KEYID'}) {
        $keyid=$config_vars{'DEBSIGN_KEYID'};
@@ -247,10 +267,11 @@
                 "c|changelog=s" => \$changelog,
                 "s|strip-message!" => \$stripmessage,
                 "sign-tags!" => \$signtags,
+                "R|release-use-changelog!" => \$release_use_changelog,
                 "h|help" => sub { usage(); exit 0; },
                 "v|version" => sub { version(); exit 0; },
                 )) {
-    die "Usage: debcommit [--release] [--message=text] [--noact] [--diff] 
[--confirm] [--edit] [--changelog=path] [--all | files to commit]\n";
+    die "Usage: debcommit [--release] [--release-use-changelog] 
[--message=text] [--noact] [--diff] [--confirm] [--edit] [--changelog=path] 
[--all | files to commit]\n";
 }
 
 my @files_to_commit = @ARGV;
@@ -263,7 +284,7 @@
     die "debcommit: cannot find $changelog\n";
 }
 
-$message=getmessage() if ! defined $message;
+$message=getmessage() if ! defined $message and (not $release or 
$release_use_changelog);
 
 if ($release) {
     open (C, "<$changelog" ) || die "debcommit: cannot read $changelog: $!";



-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to