From 53cff81bf89593f3ba347e2d8003197a6cd4bb01 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 20 May 2019 23:38:24 +0100 Subject: [PATCH] dgit: gdr linear quilt fixup: Do it in a playtree It will work there, since this operation does not need any of the magic gdr refs. And this means that it will DTRT in split brain mode, when we enable that. Signed-off-by: Ian Jackson --- dgit | 62 ++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/dgit b/dgit index ef5fc192..13ed4b6c 100755 --- a/dgit +++ b/dgit @@ -5794,35 +5794,6 @@ sub build_maybe_quilt_fixup () { my $headref = git_rev_parse('HEAD'); my $symref = git_get_symref(); - if ($quilt_mode eq 'linear' - && !$fopts->{'single-debian-patch'} - && branch_is_gdr($headref)) { - # This is much faster. It also makes patches that gdr - # likes better for future updates without laundering. - # - # However, it can fail in some casses where we would - # succeed: if there are existing patches, which correspond - # to a prefix of the branch, but are not in gbp/gdr - # format, gdr will fail (exiting status 7), but we might - # be able to figure out where to start linearising. That - # will be slower so hopefully there's not much to do. - my @cmd = (@git_debrebase, - qw(--noop-ok -funclean-mixed -funclean-ordering - make-patches --quiet-would-amend)); - # We tolerate soe snags that gdr wouldn't, by default. - if (act_local()) { - debugcmd "+",@cmd; - $!=0; $?=-1; - failedcmd @cmd - if system @cmd - and not ($? == 7*256 or - $? == -1 && $!==ENOENT); - } else { - dryrun_report @cmd; - } - $headref = git_rev_parse('HEAD'); - } - prep_ud(); changedir $playground; @@ -6130,6 +6101,39 @@ sub quilt_fixup_multipatch ($$$) { my $splitbrain_cachekey; + if ($quilt_mode eq 'linear' + && branch_is_gdr($headref)) { + # This is much faster. It also makes patches that gdr + # likes better for future updates without laundering. + # + # However, it can fail in some casses where we would + # succeed: if there are existing patches, which correspond + # to a prefix of the branch, but are not in gbp/gdr + # format, gdr will fail (exiting status 7), but we might + # be able to figure out where to start linearising. That + # will be slower so hopefully there's not much to do. + + unpack_playtree_need_cd_work $headref; + + my @cmd = (@git_debrebase, + qw(--noop-ok -funclean-mixed -funclean-ordering + make-patches --quiet-would-amend)); + # We tolerate soe snags that gdr wouldn't, by default. + if (act_local()) { + debugcmd "+",@cmd; + $!=0; $?=-1; + failedcmd @cmd + if system @cmd + and not ($? == 7*256 or + $? == -1 && $!==ENOENT); + } else { + dryrun_report @cmd; + } + $headref = git_rev_parse('HEAD'); + + chdir '..'; + } + quilt_need_fake_dsc($upstreamversion); if (quiltmode_splitbrain()) { -- 2.30.2