chiark / gitweb /
dgit: Separate out build_check_quilt_splitbrain
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 20 May 2019 22:02:25 +0000 (23:02 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 28 Jun 2019 11:45:38 +0000 (12:45 +0100)
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>
dgit

diff --git a/dgit b/dgit
index 97557ce1c3e1c3a4042160a8c2ab99359184330b..db56b503b14c82e0af53c0051f9b7180c5a7badd 100755 (executable)
--- 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");