summaryrefslogtreecommitdiff
path: root/git-debrebase
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-08-11 13:25:41 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-08-11 15:36:23 +0100
commit5f0580a8bbf6460363d208acfab53714f190a7a6 (patch)
treebdf078261c499889fdc9fe24cebe1e2d219fa9d0 /git-debrebase
parentcfbec7a706fd1f631ebbed0c545980590eb26656 (diff)
git-debrebase: merge: Get debian/ parts of new patch queue right
We want the newly generated delta queue commits to have the $newbase's debian/. Previously we let read_tree_upstream save and restore debian/, but the contents of debian/ in the index are not right: they're the result of the git merge, which is whatever is left over from earlier. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'git-debrebase')
-rwxr-xr-xgit-debrebase33
1 files changed, 23 insertions, 10 deletions
diff --git a/git-debrebase b/git-debrebase
index 4f9a9bb..60ea976 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -522,7 +522,7 @@ sub merge_series ($$;@) {
foreach my $c (grep /./, split /\n/, cmdoutput @lcmd) {
my $commit = git_cat_file $c, 'commit';
printdebug "merge_series series ok, building $c\n";
- read_tree_upstream $c;
+ read_tree_upstream $c, 0, $newbase;
my $tree = cmdoutput @git, qw(write-tree);
$commit =~ s{^parent (\S+)$}{parent $build}m or confess;
$commit =~ s{^tree (\S+)$}{tree $tree}m or confess;
@@ -1332,16 +1332,29 @@ sub walk ($;$$$) {
$cl->{MergeInterchangeBaseInfo},
@{ $cl->{Parents} };
$last_anchor = $cl->{MergeBestAnchor};
- my $check_differs = get_differs $build, $cl->{CommitId};
+
+ # Check for mismerges:
+ my $check = sub {
+ my ($against, $allow, $what) = @_;
+ my $differs = get_differs $build, $against;
+ $nomerge->(sprintf
+ "merge misresolved: %s are not the same (%s %s d.%#x)",
+ $what, $against, $build, $differs)
+ if $differs & ~($allow | D_PAT_ADD);
+ };
+
# Breakwater changes which were in each side of the
- # merge should be in MergeCreateMergedBreakwaters
- # output. Upstream changes are exactly the result
- # of merge_series. So the only difference should
- # be potential laundry results.
- $nomerge->(sprintf
- "merge misresolved: tree is not the same (%s %s d.%#x)",
- $cl->{CommitId}, $build, $check_differs)
- if $check_differs & ~D_PAT_ADD;
+ # merge will have been incorporated into the
+ # MergeCreateMergedBreakwaters output. Because the
+ # upstream series was rebased onto the new breakwater,
+ # so should all of the packaging changes which were in
+ # the input.
+ $check->($input, D_UPS, 'debian files');
+
+ # Upstream files are merge_series, which ought to
+ # have been identical to the original merge.
+ $check->($cl->{CommitId}, DS_DEB, 'upstream files');
+
print "Merge resolution successful.\n";
next;
} else {