X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=555e1c00905f30f0da4c18f54ac40c39b8d59ae8;hp=9a8d22147a9b0a80e93f54c20b64a5113c7e962a;hb=30285c0d7edaeb05605ff620f8d8d6d09d91f5c2;hpb=1f7b9876c5641666901f40888eb8a975449569c1 diff --git a/dgit b/dgit index 9a8d2214..555e1c00 100755 --- a/dgit +++ b/dgit @@ -96,6 +96,7 @@ our $orig_f_tail_re = "$orig_f_comp_re\\.tar(?:\\.\\w+)?(?:$orig_f_sig_re)?"; our $git_authline_re = '^([^<>]+) \<(\S+)\> (\d+ [-+]\d+)$'; our $splitbraincache = 'dgit-intern/quilt-cache'; +our $rewritemap = 'dgit-rewrite/map'; our (@git) = qw(git); our (@dget) = qw(dget); @@ -2367,6 +2368,8 @@ END my $path = $ENV{PATH} or die; foreach my $use_absurd (qw(0 1)) { + runcmd @git, qw(checkout -q unpa); + runcmd @git, qw(update-ref -d refs/heads/patch-queue/unpa); local $ENV{PATH} = $path; if ($use_absurd) { chomp $@; @@ -2511,6 +2514,7 @@ sub git_fetch_us () { \&debiantag_new, \&debiantag_maintview) : debiantags('*',access_nomdistro)); push @specs, server_branch($csuite); + push @specs, $rewritemap; push @specs, qw(heads/*) if deliberately_not_fast_forward; # This is rather miserable: @@ -2722,6 +2726,18 @@ sub fetch_from_archive () { progress "no version available from the archive"; } + my $rewritemapdata = git_cat_file lrfetchrefs."/".$rewritemap.':map'; + if (defined $rewritemapdata + && $rewritemapdata =~ m/^$dsc_hash(?:[ \t](\w+))/m) { + progress "server's git history rewrite map contains a relevant entry!"; + $dsc_hash = $1; + if (defined $dsc_hash) { + progress "using rewritten git hash in place of .dsc value"; + } else { + progress "server data says .dsc hash is to be disregarded"; + } + } + # If the archive's .dsc has a Dgit field, there are three # relevant git commitids we need to choose between and/or merge # together: @@ -3536,7 +3552,7 @@ tree $tree parent $dgitview parent $archive_hash author $authline -commiter $authline +committer $authline $msg_msg @@ -4509,7 +4525,7 @@ sub quiltify_trees_differ ($$;$$$) { }; if ($@) { local $/="\n"; chomp $@; - push @$unrepres, [ $f, $@ ]; + push @$unrepres, [ $f, "$@ ($oldmode->$newmode)" ]; } } @@ -5942,10 +5958,14 @@ END progress "Import, merging."; my $tree = cmdoutput @git, qw(rev-parse), "$newhash:"; my $version = getfield $dsc, 'Version'; + my $clogp = commit_getclogp $newhash; + my $authline = clogp_authline $clogp; $newhash = make_commit_text <