X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=dgit;h=6d9a8045412d349dad14a383efeed4012f1a6a9c;hb=cd8e216085a98334b6d167b958127ffa8756062a;hp=73b88ad593616e086fda2736b1e9e96bde0a0fcc;hpb=13aca4fc3c36a5ce46e1a7d9ac3534ef247bee63;p=dgit.git diff --git a/dgit b/dgit index 73b88ad5..6d9a8045 100755 --- a/dgit +++ b/dgit @@ -82,7 +82,7 @@ our $quilt_mode; our $quilt_upstream_commitish; our $quilt_upstream_commitish_used; our $quilt_upstream_commitish_message; -our $quilt_options_re = 'gbp|dpm|baredebian'; +our $quilt_options_re = 'gbp|dpm|baredebian(?:\+tarball|\+git)?'; our $quilt_modes_re = "linear|smash|auto|nofix|nocheck|unapplied|$quilt_options_re"; our $splitview_mode; our $splitview_modes_re = qr{auto|always|never}; @@ -300,6 +300,10 @@ sub deliberately_not_fast_forward () { sub quiltmode_splitting () { $quilt_mode =~ m/gbp|dpm|unapplied|baredebian/; } +sub format_quiltmode_splitting ($) { + my ($format) = @_; + return madformat_wantfixup($format) && quiltmode_splitting(); +} sub do_split_brain () { !!($do_split_brain // confess) } @@ -985,7 +989,7 @@ sub determine_whether_split_brain () { printdebug "format $format, quilt mode $quilt_mode\n"; - if (madformat_wantfixup($format) && quiltmode_splitting()) { + if (format_quiltmode_splitting $format) { $splitview_mode ne 'never' or fail f_ "dgit: quilt mode \`%s' (for format \`%s')". " implies split view, but split-view set to \`%s'", @@ -2443,9 +2447,10 @@ sub import_tarball_commits ($$) { $changes =~ s/^\n//; # Changes: \n my $cversion = getfield $clogp, 'Version'; + my $r1authline; if (@$tartrees) { $r1clogp //= $clogp; # maybe there's only one entry; - my $r1authline = clogp_authline $r1clogp; + $r1authline = clogp_authline $r1clogp; # Strictly, r1authline might now be wrong if it's going to be # unused because !$any_orig. Whatever. @@ -2455,7 +2460,8 @@ sub import_tarball_commits ($$) { foreach my $tt (@$tartrees) { printdebug "import tartree $tt->{F} $tt->{Tree}\n"; - my $mbody = f_ "Import %s", $tt->{F}; + # untranslated so that different people's imports are identical + my $mbody = sprintf "Import %s", $tt->{F}; $tt->{Commit} = hash_commit_text($tt->{Orig} ? <{Tree} author $r1authline @@ -2476,7 +2482,7 @@ END_T } } - return ($authline, $clogp, $changes); + return ($authline, $r1authline, $clogp, $changes); } sub generate_commits_from_dsc () { @@ -2569,7 +2575,7 @@ sub generate_commits_from_dsc () { $dappliedtree = git_add_write_tree(); } - my ($authline, $clogp, $changes) = + my ($authline, $r1authline, $clogp, $changes) = import_tarball_commits(\@tartrees, $upstreamv); my $cversion = getfield $clogp, 'Version'; @@ -2693,7 +2699,10 @@ END if ($vcmp < 0) { @output = ($rawimport_mergeinput, $lastpush_mergeinput, { ReverseParents => 1, - Message => (f_ < (sprintf < 0) { @@ -4352,11 +4361,12 @@ sub push_mktags ($$ $$ $) { my $cversion = getfield $clogp, 'Version'; my $clogsuite = getfield $clogp, 'Distribution'; + my $format = getfield $dsc, 'Format'; # We make the git tag by hand because (a) that makes it easier # to control the "tagger" (b) we can do remote signing my $authline = clogp_authline $clogp; - my $delibs = join(" ", "",@deliberatelies); + my @dtxinfo = @deliberatelies; my $mktag = sub { my ($tw) = @_; @@ -4377,8 +4387,9 @@ END %s release %s for %s (%s) [dgit] ENDT or confess "$!"; + my $dtxinfo = join(" ", "",@dtxinfo); print TO <{Filename} eq $leaf } @$fakedfi; + push @$fakedfi, { + Filename => $leaf, + Path => "$dir/$leaf", + }; + } + + die "$dir; $!" if $!; + closedir OD; +} + sub quilt_fixup_multipatch ($$$) { my ($clogp, $headref, $upstreamversion, $splitbrain_cachekey) = @_; @@ -6219,7 +6254,74 @@ END my $uheadref = $headref; my $uhead_whatshort = 'HEAD'; - if ($quilt_mode =~ m/baredebian/) { + if ($quilt_mode =~ m/baredebian\+tarball/) { + # We need to make a tarball import. Yuk. + # We want to do this here so that we have a $uheadref value + + my @fakedfi; + baredebian_origtarballs_scan \@fakedfi, $upstreamversion, bpd_abs(); + baredebian_origtarballs_scan \@fakedfi, $upstreamversion, + "$maindir/.." unless $buildproductsdir eq '..'; + changedir '..'; + + my @tartrees = import_tarball_tartrees $upstreamversion, \@fakedfi; + + fail __ "baredebian quilt fixup: could not find any origs" + unless @tartrees; + + changedir 'work'; + my ($authline, $r1authline, $clogp,) = + import_tarball_commits \@tartrees, $upstreamversion; + + if (@tartrees == 1) { + $uheadref = $tartrees[0]{Commit}; + # TRANSLATORS: this translation must fit in the ASCII art + # quilt differences display. The untranslated display + # says %9.9s, so with that display it must be at most 9 + # characters. + $uhead_whatshort = __ 'tarball'; + } else { + # on .dsc import we do not make a separate commit, but + # here we need to do so + rm_subdir_cached '.'; + my $parents; + foreach my $ti (@tartrees) { + my $c = $ti->{Commit}; + if ($ti->{OrigPart} eq 'orig') { + runcmd qw(git read-tree), $c; + } elsif ($ti->{OrigPart} =~ m/orig-/) { + read_tree_subdir $', $c; + } else { + confess "$ti->OrigPart} ?" + } + $parents .= "parent $c\n"; + } + my $tree = git_write_tree(); + my $mbody = f_ 'Combine orig tarballs for %s %s', + $package, $upstreamversion; + $uheadref = hash_commit_text <