From: Ian Jackson Date: Sat, 28 Nov 2015 17:43:33 +0000 (+0000) Subject: Split brain: some work on integration into the rest of dgit X-Git-Tag: archive/debian/2.0~295 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=57b7ccba1b4e833e9ffc91efe0afe550138f530d Split brain: some work on integration into the rest of dgit * Move the fast forward die to where we will need to make the synthetic commit, so that the tree equality check is done on the thing we will actually push. * Crash if we are trying to do split brain without split build. (This should never happen.) * Set split build if we need split brain. --- diff --git a/dgit b/dgit index 4b4380b4..4d31cd60 100755 --- a/dgit +++ b/dgit @@ -1988,10 +1988,14 @@ END my $format = getfield $dsc, 'Format'; printdebug "format $format\n"; + if (madformat($format)) { # user might have not used dgit build, so maybe do this now: 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; + check_not_dirty(); changedir $ud; progress "checking that $dscfn corresponds to HEAD"; @@ -2628,7 +2632,6 @@ END runcmd @git, qw(update-ref -m), $cachekey, "refs/$splitbraincache", $dgitview; - die 'xxx fast forward (should not depend on quilt mode, but will always be needed if we did $split_brain)'; changedir '.git/dgit/unpack/work'; } @@ -2865,6 +2868,8 @@ sub build_maybe_quilt_fixup () { quilt_fixup_multipatch($clogp, $headref, $upstreamversion); } + die 'bug' if $split_brain && !$need_split_build_invocation; + changedir '../../../..'; runcmd_ordryrun_local @git, qw(pull --ff-only -q .git/dgit/unpack/work master); @@ -3773,6 +3778,8 @@ if (!defined $quilt_mode) { $quilt_mode = $1; } +$need_split_build_invocation ||= quiltmode_splitbrain(); + if (!defined $cleanmode) { local $access_forpush; $cleanmode = access_cfg('clean-mode', 'RETURN-UNDEF');