Mercurial > hg
view tests/test-convert-bzr-114.t @ 44758:45f3f35cefe7
copies: fix the changeset based algorithm regarding merge
In 99ebde4fec99, we changed the list of files stored into the `files` field.
This lead to the changeset centric copy algorithm to break in various merge
situation involving merge. Older information could reach the merge through
`p1`, and while information from `p2` was strictly fresher, it would get
overwritten anyway.
We update the situation with more details about which revision introduces rename
information. This help use making the right decision in case of merge.
We are now running a more comprehensive suite of test with include this kind of
situation. The behavior differ slightly from the filelog based in a couple of
instance. There is mostly two distinct cases:
1) there are conflicting rename information in a merge (different rename history
on each side). In this case the filelog based implementation arbitrarily pick a
side based on the file-revision-number. So it depends on a local factor. The
changeset centric algorithm will use a deterministic approach, by picking the
information coming from the first parent of the merge. This is stable across
different clone.
2) rename information related to file that exist in both source and destination.
The filelog based implementation do not even try to detect these, however the
changeset centric one get them for "free" (it is simpler to detect them than
not).
The new implementation focus on correctness. Performance improvement will come
later.
Differential Revision: https://phab.mercurial-scm.org/D8244
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 05 Mar 2020 17:55:05 +0100 |
parents | 89872688893f |
children | 26127236b229 |
line wrap: on
line source
#require bzr bzr114 $ . "$TESTDIR/bzr-definitions" The file/directory replacement can only be reproduced on bzr >= 1.4. Merge it back in test-convert-bzr-directories once this version becomes mainstream. replace file with dir $ mkdir test-replace-file-with-dir $ cd test-replace-file-with-dir $ bzr init -q source $ cd source $ echo d > d $ bzr add -q d $ bzr commit -q -m 'add d file' $ rm d $ mkdir d $ bzr add -q d $ bzr commit -q -m 'replace with d dir' $ echo a > d/a $ bzr add -q d/a $ bzr commit -q -m 'add d/a' $ cd .. $ hg convert source source-hg initializing destination source-hg repository scanning source... sorting... converting... 2 add d file 1 replace with d dir 0 add d/a $ manifest source-hg tip % manifest of tip 644 d/a $ cd source-hg $ hg update 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../..