[BUG?] Experimenting problems during an Arch->Mercurial repo conversion

Edouard Gomez ed.gomez at free.fr
Tue Jul 26 19:30:38 CDT 2005


Hello,

As  tailor   doesn't  support  arch  repos,   i  had  to   code  my  own
arch->mercurial export script.  It is  quite simple and does only single
line of  dev export as  i've never played  with rawcommit yet  to export
full merge history accross branches.

During the various attempts to confirm my script was working, i noticed,
that for a same set of original  repos, and the same script, the hg repo
had different number of patchsets !

Here is an example of diff for 'hg log' between 2 runs of the script:
-changeset: 67:5e2697211d9426e7914e3a6658a92b637f30aea9
+changeset: 68:338acabf1c541a989aba60a8dc223fbf644a74a5
 user: ed.gomez at free.fr
 date: Tue Jun 10 11:13:40 2003
 summary: xvid_bench updates and corresponding Makefile changes.

+changeset: 67:664087781152ecacdd4bac7f601be5a2eab51215
+user: ed.gomez at free.fr
+date: Tue Jun 10 11:05:14 2003
+summary: Probably a small copy/paste error
+
 changeset: 66:b715b731c6fa4ca378d30dca4efbc91107fc6387
 user: ed.gomez at free.fr
 date: Mon Jun 9 21:39:47 2003

See the  patchset 67 was missing, and  another 2 also, but  they are not
shown here.

As the script  is purely deterministic, and that i know  i can trust baz
patchset replaying,  i'd conclude that mercurial is  probably not immune
to  something   that  can  be   triggered  by  automatic   importing.  I
particularly think  of the non detection  of changes due  to missed stat
file changes, or too fast changes because of script speed (though baz is
not known to be blazing fast).

To reproduce the bug, just install latest bazaar version.
$ baz --version
baz Bazaar version 1.4.2 (thelove at canonical.com/dists--bazaar--1.4[bazaar--devo.cfg])
from Canonical Ltd. and other members of the arch community

Download my script:
$ wget http://ed.gomez.free.fr/vrac/convert-xvid-baz-repo-to-mercurial.sh

For better import performance, mirror my available archives from my site:
$ baz make-archive --mirror \
  http://ed.gomez.free.fr/arch-repositories/ed.gomez@free.fr--2003-1/ \
  ${HOME}/baz-archives/ed.gomez at free.fr--2003-1
$ baz make-archive --mirror \
  http://ed.gomez.free.fr/arch-repositories/ed.gomez@free.fr--2004-1/ \
  ${HOME}/baz-archives/ed.gomez at free.fr--2004-1
$ baz make-archive --mirror \
  http://ed.gomez.free.fr/arch-repositories/ed.gomez@free.fr--2005-1/ \
  ${HOME}/baz-archives/ed.gomez at free.fr--2005-1
$ baz archive-mirror ${HOME}/baz-archives/ed.gomez at free.fr--2003-1
$ baz archive-mirror ${HOME}/baz-archives/ed.gomez at free.fr--2004-1
$ baz archive-mirror ${HOME}/baz-archives/ed.gomez at free.fr--2005-1

Then make sure baz only knows about your local mirror, remove remote
archives' location:
$ baz register-archive -d \
  http://ed.gomez.free.fr/arch-repositories/ed.gomez@free.fr--2003-1
$ baz register-archive -d \
  http://ed.gomez.free.fr/arch-repositories/ed.gomez@free.fr--2004-1
$ baz register-archive -d \
  http://ed.gomez.free.fr/arch-repositories/ed.gomez@free.fr--2005-1

Run my  script multiple  times:
$ chmod 750 convert-xvid-baz-repo-to-mercurial.sh
 
(Maybe you need to edit the script  not to take into account my very old
-main archive that has never been publicly mirrored)

$ for i in `seq 1 5` ; do
     ./convert-xvid-baz-repo-to-mercurial.sh
     mv xvidcore.hgrepo xvidcore.hgrepo${i}
     cd xvidcore.hgrepo${i}
     hg log > ../log{i}
     cd ..
  done
 
Check  the number of  changesets, it should vary a little, often by 2 or
3 patchsets:
$ diff -u logN logM (N != M ;-))

Two examples of generated Mercurial repos are available:
http://ed.gomez.free.fr/vrac/xvidcore-buggy.tar.bz2

I'd be glad to have some opinions about this.

-- 
Edouard Gomez


More information about the Mercurial mailing list