chiark / gitweb /
push actually takes an optional suite, like it says in the synopsis.
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 5cdf21e14a5a75fe01fb94c57817b2dc6b8225cb..b4c931687e43f40474792227d7c9cac94130993b 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -906,6 +906,8 @@ sub push_parse_changelog ($) {
     my $clogp = Dpkg::Control::Hash->new();
     $clogp->load($clogpfn);
 
+    responder_send_file('parsed-changelog', $clogpfn);
+
     $package = getfield $clogp, 'Source';
     my $cversion = getfield $clogp, 'Version';
     my $tag = debiantag($cversion);
@@ -1140,15 +1142,24 @@ sub cmd_push {
     check_not_dirty();
     my $clogp = parsechangelog();
     $package = getfield $clogp, 'Source';
+    my $specsuite;
     if (@ARGV==0) {
-       $isuite = getfield $clogp, 'Distribution';
-       if ($new_package) {
-           local ($package) = $existing_package; # this is a hack
-           canonicalise_suite();
-       }
+    } elsif (@ARGV==1) {
+       ($specsuite) = (@ARGV);
     } else {
        badusage "incorrect arguments to dgit push";
     }
+    $isuite = getfield $clogp, 'Distribution';
+    if ($new_package) {
+       local ($package) = $existing_package; # this is a hack
+       canonicalise_suite();
+    }
+    if (defined $specsuite && $specsuite ne $isuite) {
+       canonicalise_suite();
+       $csuite eq $specsuite or
+           fail "dgit push: changelog specifies $isuite ($csuite)".
+               " but command line specifies $specsuite";
+    }
     if (check_for_git()) {
        git_fetch_us();
     }