chiark / gitweb /
Split brain: When pushing, find the dgit view in the cache
[dgit.git] / dgit
diff --git a/dgit b/dgit
index f46e55a4e10969f0604f6b22a01aeebe836285e3..d40a178a9cf78c42829265d746dd02d3d4ef19c7 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1999,7 +1999,22 @@ END
 
     if (madformat($format)) {
        # user might have not used dgit build, so maybe do this now:
 
     if (madformat($format)) {
        # user might have not used dgit build, so maybe do this now:
-       commit_quilty_patch();
+       if (quiltmode_splitbrain()) {
+           my $upstreamversion = $clogp->{Version};
+           $upstreamversion =~ s/-[^-]*$//;
+           changedir $ud;
+           quilt_make_fake_dsc($upstreamversion);
+           my ($dgitview, $cachekey) =
+               quilt_check_splitbrain_cache($head, $upstreamversion);
+           $dgitview or fail
+ "--quilt=$quilt_mode but no cached dgit view:
+ perhaps tree changed since dgit build[-source] ?";
+           $split_brain = 1;
+           changedir '../../../..';
+           prep_ud(); # so _only_subdir() works, below
+       } else {
+           commit_quilty_patch();
+       }
     }
 
     die 'xxx fast forward (should not depend on quilt mode, but will always be needed if we did $split_brain)' if $split_brain;
     }
 
     die 'xxx fast forward (should not depend on quilt mode, but will always be needed if we did $split_brain)' if $split_brain;