chiark / gitweb /
dgit: dopush pseudomerge, break apart from quilt fixup
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 21 May 2019 12:39:44 +0000 (13:39 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 28 Jun 2019 11:45:38 +0000 (12:45 +0100)
In the future, we are going to have split brain in situations without
any quilt fixup.  We will use $do_split_brain for this.

In that situation, do the splitbrain pseudomerge too.

No actual functional change yet.

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

diff --git a/dgit b/dgit
index db56b503b14c82e0af53c0051f9b7180c5a7badd..cf12faeafe3cc048c940712e3e3f431b256644de 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4493,6 +4493,7 @@ END
     if (madformat_wantfixup($format)) {
        # user might have not used dgit build, so maybe do this now:
        if (quiltmode_splitbrain()) {
+           $do_split_brain = 1;
            changedir $playground;
            quilt_make_fake_dsc($upstreamversion);
            my $cachekey;
@@ -4502,17 +4503,22 @@ END
  "--quilt=%s but no cached dgit view:
  perhaps HEAD changed since dgit build[-source] ?",
                               $quilt_mode;
-           $split_brain = 1;
-           $dgithead = splitbrain_pseudomerge($clogp,
-                                              $actualhead, $dgithead,
-                                              $archive_hash);
-           $maintviewhead = $actualhead;
-           changedir $maindir;
-           prep_ud(); # so _only_subdir() works, below
-       } else {
+       }
+       if (!$do_split_brain) {
+           # In split brain mode, do not attempt to incorporate dirty
+           # stuff from the user's working tree.  That would be mad.
            commit_quilty_patch();
        }
     }
+    if ($do_split_brain) {
+       $split_brain = 1;
+       $dgithead = splitbrain_pseudomerge($clogp,
+                                          $actualhead, $dgithead,
+                                          $archive_hash);
+       $maintviewhead = $actualhead;
+       changedir $maindir;
+       prep_ud(); # so _only_subdir() works, below
+    }
 
     if (defined $overwrite_version && !defined $maintviewhead
        && $archive_hash) {