chiark / gitweb /
dgit: baredebian: Introduce --upstream-commitish
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 29 Jun 2019 11:52:55 +0000 (12:52 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 29 Jun 2019 11:58:21 +0000 (12:58 +0100)
Not documented yet.  Nor, used, since $quilt_mode is not ever
baredebian yet.

So currently just an option you can pass to make dgit bomb out.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index a168384441455ecbd73c246abea5773da7165529..fb64dc2da8fc967051ce948eb6e8bd44d4c8dcf1 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -79,6 +79,7 @@ our $changes_since_version;
 our $rmchanges;
 our $overwrite_version; # undef: not specified; '': check changelog
 our $quilt_mode;
+our $quilt_upstream_commitish;
 our $quilt_modes_re = 'linear|smash|auto|nofix|nocheck|gbp|dpm|unapplied';
 our $splitview_mode;
 our $splitview_modes_re = qr{auto|always|never};
@@ -5984,6 +5985,7 @@ sub quilt_check_splitbrain_cache ($$) {
     push @cachekey, $upstreamversion;
     push @cachekey, $quilt_mode;
     push @cachekey, $headref;
+    push @cachekey, $quilt_upstream_commitish // '-';
 
     push @cachekey, hashfile('fake.dsc');
 
@@ -6391,6 +6393,17 @@ sub build_or_push_prep_modes () {
     fail __ "dgit: --include-dirty is not supported with split view".
             " (including with view-splitting quilt modes)"
        if do_split_brain() && $includedirty;
+
+    if (madformat_wantfixup $format and $quilt_mode =~ m/baredebian$/) {
+       my ($dummy, $umessage);
+       ($quilt_upstream_commitish, $dummy, $umessage) =
+       resolve_upstream_version
+           $quilt_upstream_commitish, upstreamversion $version;
+       progress f_ "dgit: --quilt=%s, %s", $quilt_mode, $umessage;
+    } elsif (defined $quilt_upstream_commitish) {
+       fail __
+ "dgit: --upstream-commitish only makes sense with --quilt=baredebian"
+    }
 }
 
 sub build_prep_early () {
@@ -7352,6 +7365,9 @@ sub parseopts () {
            } elsif (m/^--delayed=(\d+)$/s) {
                push @ropts, $_;
                push @dput, $_;
+           } elsif (m/^--upstream-commitish=(.+)$/s) {
+               push @ropts, $_;
+               $quilt_upstream_commitish = $1;
            } elsif (m/^--save-(dgit-view)=(.+)$/s ||
                     m/^--(dgit-view)-save=(.+)$/s
                     ) {