diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2019-05-20 23:38:24 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2019-06-28 12:45:38 +0100 |
commit | 53cff81bf89593f3ba347e2d8003197a6cd4bb01 (patch) | |
tree | 1d8164b7b9e28e8719b1318194b1d7c3582489b8 /dgit | |
parent | 1a2569eb0561793ae8b5d8c5dab9f90f2fd3fcfa (diff) |
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 <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 62 |
1 files changed, 33 insertions, 29 deletions
@@ -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()) { |