D3984: merge: do the trivial resolution after updating sparse checkout
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Fri Jul 27 12:39:10 UTC 2018
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
In merge, we do trivial resolution for files which were deleted on one side and
changed on other. When sparse extension in involved that file might not be
present in wdir and trivial resolution can lead to file not found error. This
patch make sure we updates the sparse checkout before doing the trivial
resolution.
This fixes the test failure demonstrated in previous patch.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D3984
AFFECTED FILES
mercurial/merge.py
tests/test-sparse-merges.t
CHANGE DETAILS
diff --git a/tests/test-sparse-merges.t b/tests/test-sparse-merges.t
--- a/tests/test-sparse-merges.t
+++ b/tests/test-sparse-merges.t
@@ -112,5 +112,9 @@
a
$ hg merge
- abort: $ENOENT$: '$TESTTMP/ytest/d'
- [255]
+ temporarily included 1 file(s) in the sparse checkout for merging
+ local [working copy] changed d which other [merge rev] deleted
+ use (c)hanged version, (d)elete, or leave (u)nresolved? u
+ 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+ use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
+ [1]
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1424,14 +1424,14 @@
del actions[f]
repo.ui.note(_('end of auction\n\n'))
- _resolvetrivial(repo, wctx, mctx, ancestors[0], actions)
if wctx.rev() is None:
fractions = _forgetremoved(wctx, mctx, branchmerge)
actions.update(fractions)
prunedactions = sparse.filterupdatesactions(repo, wctx, mctx, branchmerge,
actions)
+ _resolvetrivial(repo, wctx, mctx, ancestors[0], actions)
return prunedactions, diverge, renamedelete
To: pulkit, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list