Mercurial > hg
view tests/test-convert-bzr-ghosts.t @ 19457:948df0f10ec1
convert: fix bad conversion of copies when hg.startrev is specified
The 'copynode' was looked up in self.keep as if it was a changeset node. It is
however a filelog node, and self.keep would thus fail if it actually looked at
its parameter ... which it only did if a startrev was specified.
Instead we now don't check the copy node - we don't have to. It must have been
copied from one of the parents, and we already check whether one of the parents
have the copy source.
We could perhaps use linkrev to see if the corresponding changeset was
converted ... but that would sometimes be wrong.
The existing test of this was wrong - now it is better, but it seems like it
exposes a 'log' issue.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 19 Jul 2013 01:40:57 +0200 |
parents | f2719b387380 |
children | 89872688893f |
line wrap: on
line source
$ . "$TESTDIR/bzr-definitions" $ cat > ghostcreator.py <<EOF > import sys > from bzrlib import workingtree > wt = workingtree.WorkingTree.open('.') > > message, ghostrev = sys.argv[1:] > wt.set_parent_ids(wt.get_parent_ids() + [ghostrev]) > wt.commit(message) > EOF ghost revisions $ mkdir test-ghost-revisions $ cd test-ghost-revisions $ bzr init -q source $ cd source $ echo content > somefile $ bzr add -q somefile $ bzr commit -q -m 'Initial layout setup' $ echo morecontent >> somefile $ python ../../ghostcreator.py 'Commit with ghost revision' ghostrev $ cd .. $ hg convert source source-hg initializing destination source-hg repository scanning source... sorting... converting... 1 Initial layout setup 0 Commit with ghost revision $ glog -R source-hg o 1@source "Commit with ghost revision" files: somefile | o 0@source "Initial layout setup" files: somefile $ cd ..