chiark / gitweb /
Allow fetching when archive has out-of-date git hash in .dsc. Closes: #720490. debian/0.6
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 22 Aug 2013 15:02:24 +0000 (16:02 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 22 Aug 2013 15:02:24 +0000 (16:02 +0100)
debian/changelog
dgit

index 990d99a2f24ed12517b484280257dc75dbd6fbd0..449aa612814f71937c722f4e8e7849a6423f10c6 100644 (file)
@@ -1,3 +1,10 @@
+dgit (0.6) unstable; urgency=low
+
+  * Allow fetching when archive has out-of-date git hash in .dsc.
+    Closes: #720490.
+
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk>  Thu, 22 Aug 2013 16:02:10 +0100
+
 dgit (0.5) unstable; urgency=low
 
   * Upload to unstable, as this version mostly works.  (All the RC
diff --git a/dgit b/dgit
index 8132b8fce7eab84e711e7ee961ad3fbfd3ee773b..4e9afe0fe423ed590962adf4da16bcde574ed08a 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -200,6 +200,10 @@ important dgit options:
   -c<name>=<value>    set git config option (used directly by dgit too)
 END
 
+our $later_warning_msg = <<END;
+Perhaps the upload is stuck in incoming.  Using the version from git.
+END
+
 sub badusage {
     print STDERR "$us: @_\n", $helpmsg or die $!;
     exit 8;
@@ -565,9 +569,10 @@ END
             $outputhash = make_commit qw(../commit2.tmp);
        } elsif ($vcmp > 0) {
            print STDERR <<END or die $!;
+
 Version actually in archive:    $cversion (older)
 Last allegedly pushed/uploaded: $oversion (newer or same)
-Perhaps the upload is stuck in incoming.  Using the version from git.
+$later_warning_msg
 END
             $outputhash = $upload_hash;
        } elsif ($outputhash ne $upload_hash) {
@@ -651,6 +656,16 @@ sub fetch_from_archive () {
            unless $upload_hash;
        $hash = $dsc_hash;
        ensure_we_have_orig();
+       if (is_fast_fwd($dsc_hash,$upload_hash)) {
+           print STDERR <<END or die $!;
+
+Git commit in archive is behind the last version allegedly pushed/uploaded.
+Commit referred to by archive:  $dsc_hash
+Last allegedly pushed/uploaded: $upload_hash
+$later_warning_msg
+END
+           $hash = $upload_hash;
+       }
     } else {
        $hash = generate_commit_from_dsc();
     }