summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2019-05-20 23:02:25 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2019-06-28 12:45:38 +0100
commit75581df3d6c82c3727971756a028b7b2a4d97dce (patch)
tree97777fa5f4fd4a5d8a8d8dafa6b990b5fb63a753
parent9dd8836fb53b8d37db646b28d6ae94b052130736 (diff)
dgit: Separate out build_check_quilt_splitbrain
The only effect of this is to move the tag format check from before the main work of build_maybe_quilt_fixup to later, and to not check it at all for `dgit quilt-fixup'. We don't really care about this any more; this tag format stuff is obsolete and we will delete it at some point... Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xdgit24
1 files changed, 16 insertions, 8 deletions
diff --git a/dgit b/dgit
index 97557ce..db56b50 100755
--- a/dgit
+++ b/dgit
@@ -176,6 +176,7 @@ autoflush STDOUT 1;
our $supplementary_message = '';
our $split_brain = 0;
+our $do_split_brain = 0;
END {
local ($@, $?);
@@ -5394,6 +5395,7 @@ sub quiltify_splitbrain ($$$$$$$) {
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;
@@ -5783,12 +5785,7 @@ sub build_maybe_quilt_fixup () {
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');
@@ -5839,6 +5836,17 @@ END
@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) = @_;
@@ -6393,7 +6401,7 @@ sub build_prep ($) {
# 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") {
@@ -6773,7 +6781,7 @@ sub cmd_push_source {
"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");