[issue2538] hg-hg conversion fails silently with filemap after cvs2hg conversion

Lars Westerhoff bugs at mercurial.selenic.com
Mon Dec 6 08:16:48 CST 2010


New submission from Lars Westerhoff <lars.westerhoff at newtec.eu>:

After converting a CVS repository to Mercurial with cvs2hg we performed an
"hg convert" from hg to hg for applying a filemap and a branchmap, which
silently failed and produced changesets with wrong content.

The "hg convert" broke the fixup dummy merges from cvs2hg by discarding the
first parent and inserting (previously discarded) changes by the second
parent, which lead to following changesets having different content than
before the conversion.

This happens only when a filemap ist given (which may even be empty).

The following setup reproduces the bug (prepare.sh is attached):

$ hg --version
Mercurial Distributed SCM (version 1.7.2)
...

$ ./prepare.sh
...
$ echo "">filemap
$ hg -R orig glog

o    changeset:   2:7fd0d9904bc0
|\   tag:         tip
| |  parent:      0:1df89211742d
| |  parent:      1:87bbbcfef099
| |  user:        Lars Westerhoff <lars.westerhoff at newtec.eu>
| |  date:        Mon Dec 06 14:35:32 2010 +0100
| |  summary:     b2
| |
| o  changeset:   1:87bbbcfef099
|/   user:        Lars Westerhoff <lars.westerhoff at newtec.eu>
|    date:        Mon Dec 06 14:35:32 2010 +0100
|    summary:     a2
|
o  changeset:   0:1df89211742d
   user:        Lars Westerhoff <lars.westerhoff at newtec.eu>
   date:        Mon Dec 06 14:35:32 2010 +0100
   summary:     initial

$ hg convert --filemap=filemap orig dest

initializing destination dest repository
scanning source...
sorting...
converting...
2 initial
1 a2
0 b2

$ hg -R dest glog

o  changeset:   2:56acf5cfdb78
|  tag:         tip
|  user:        Lars Westerhoff <lars.westerhoff at newtec.eu>
|  date:        Mon Dec 06 14:35:32 2010 +0100
|  summary:     b2
|
o  changeset:   1:87bbbcfef099
|  user:        Lars Westerhoff <lars.westerhoff at newtec.eu>
|  date:        Mon Dec 06 14:35:32 2010 +0100
|  summary:     a2
|
o  changeset:   0:1df89211742d
   user:        Lars Westerhoff <lars.westerhoff at newtec.eu>
   date:        Mon Dec 06 14:35:32 2010 +0100
   summary:     initial

$ hg -R orig up ; hg -R dest up
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2 files updated, 0 files merged, 0 files removed, 0 files unresolved

$ diff -u orig/a dest/a
--- orig/a      2010-12-06 14:35:39.926531227 +0100
+++ dest/a      2010-12-06 14:35:40.126531253 +0100
@@ -1 +1,2 @@
 a
+a2

$ diff -s orig/b dest/b
Files orig/b and dest/b are identical

As you see the repository was changed topologically as well as logically
(last changeset now contains the change to file "a" introduced by
87bbbcfef099, as well as the correct change of file "b" by 7fd0d9904bc0).

Without the (empty) filemap the repository stays the same, both
topologically, as well as in content.

With both changesets changing the same file, the repository only changes
topologically, but the final content of the final revision seems to be okay.

I know that the orig repository is kind of strange (I had to use a splicemap
to produce it with Mercurial), but this kind of repository also appears as a
result of a cvs2hg conversion: cvs2hg synthesizes artificial changesets for
inconsistent or partial tags of CVS and later dummy merges those to avoid
loose heads.

----------
files: prepare.sh
messages: 14591
nosy: lwhoff
priority: bug
status: unread
title: hg-hg conversion fails silently with filemap after cvs2hg conversion
topic: convert

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2538>
____________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prepare.sh
Type: application/x-shellscript
Size: 365 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20101206/f00d01e2/attachment.bin>


More information about the Mercurial-devel mailing list