our $supplementary_message = '';
our $split_brain = 0;
+our $do_split_brain = 0;
END {
local ($@, $?);
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;
"--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) {
local $ENV{GIT_AUTHOR_DATE} = $authline[2];
die if $split_brain;
+ die unless $do_split_brain;
runcmd @git, qw(checkout -q -b dgit-view);
$split_brain = 1;
check_for_vendor_patches();
- if (quiltmode_splitbrain) {
- fail <<END unless access_cfg_tagformats_can_splitbrain;
-quilt mode $quilt_mode requires split view so server needs to support
- both "new" and "maint" tag formats, but config says it doesn't.
-END
- }
+ $do_split_brain = 1 if quiltmode_splitbrain();
my $clogp = parsechangelog();
my $headref = git_rev_parse('HEAD');
@git, qw(pull --ff-only -q), "$playground/work", qw(master);
}
+sub build_check_quilt_splitbrain () {
+ build_maybe_quilt_fixup();
+
+ if ($do_split_brain) {
+ fail <<END unless access_cfg_tagformats_can_splitbrain;
+quilt mode $quilt_mode requires split view so server needs to support
+ both "new" and "maint" tag formats, but config says it doesn't.
+END
+ }
+}
+
sub unpack_playtree_mkwork ($) {
my ($headref) = @_;
# said -wc we should still do the check.
clean_tree_check();
}
- build_maybe_quilt_fixup();
+ build_check_quilt_splitbrain();
if ($rmchanges) {
my $pat = changespat $version;
foreach my $f (glob "$buildproductsdir/$pat") {
"dgit push-source: --include-dirty/--ignore-dirty does not make".
"sense with push-source!"
if $includedirty;
- build_maybe_quilt_fixup();
+ build_check_quilt_splitbrain();
if ($changesfile) {
my $changes = parsecontrol("$buildproductsdir/$changesfile",
__ "source changes file");