Differences between revisions 1 and 22 (spanning 21 versions)
Revision 1 as of 2005-08-26 00:58:25
Size: 2201
Editor: waste
Comment:
Revision 22 as of 2006-12-04 06:47:32
Size: 4680
Editor: rrcs-67-53-116-122
Comment: "cd /path/to/hg" changed to "cd /path/to/hg/repo"
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
This is tested with Mercurial 0.7 and Tailor 0.9.18
Line 8: Line 10:
 * ''-D'' turns on debugging mode, printing each executed command. Good way to understand what Tailor is doing
 * ''-v'' verbose, echo the changelogs as well as the commmands being run (convenient for understanding progress)
 * {{{-D}}} turns on debugging mode, printing each executed command. Good way to understand what Tailor is doing
 * {{{-v}}} verbose, echo the changelogs as well as the commmands being run (convenient for understanding progress)
Line 12: Line 14:
 mkdir /path/to/hg/repo  mkdir -p /path/to/hg/repo
Line 14: Line 16:
 tailor.py -D -v --source-kind cvs --target-kind hg --bootstrap --repository $REP --module MODULENAME -r INITIAL
tailor.py -D -v
 tailor -v --source-kind cvs --target-kind hg --repository $REP --module MODULENAME -r INITIAL > MODULENAME.tailor
 vi MODULENAME
.tailor
Line 17: Line 19:

When this is done, you should have a working Mercurial repository that matches the trunk of the CVS archive you have been using. The ''--repository'' option gets passed to CVS via the ''-d'' option, so anything that works for ''$CVSROOT'' will for for ''--repository''.
Now you will at least need to change {{{subdir}}} from {{{.}}} to {{{MODULENAME}}}, and remove {{{/MODULENAME}}} from {{{root-directory}}}. You will probably also want to set {{{patch-name-format =}}}; otherwise the summaries will have only redundant information in them.
{{{
 tailor --configfile MODULENAME.tailor
}}}
When this is done, you should have a working Mercurial repository that matches the trunk of the CVS archive you have been using. The {{{--repository}}} option gets passed to CVS via the {{{-d}}} option, so anything that works for {{{$CVSROOT}}} will for for {{{--repository}}}.
Line 22: Line 27:
==== Tailor 1.0

Hopefully latest tailor is much more easy to understand. See http://nautilus.homeip.net/~lele/projects/tailor/README.html#config-file-format where the second example shows a configuration sample involving CVS and Mercurial respectively as source and target backends. See also http://www.darcs.net/DarcsWiki/Tailor/VersionOne for a trace back of the changes.
See http://nautilus.homeip.net/~lele/projects/tailor/README.html#config-file-format and look at the second example, which shows a configuration sample converting from a CVS source to a Mercurial target. See also http://www.darcs.net/DarcsWiki/Tailor/VersionOne for a trace back of the changes.
Line 33: Line 36:
attachment:arch-to-hg.py -- I also hacked it to support baz 1.1.1 and tla 1.3-1 (and should also work for other versions, as it only uses some very simple commands). I tuned it to run much faster by just updating the same tree one patch after another. It uses UTC currently. Please try to keep it compatible and do not require latest versions if it can be avoided. -- ThomasWaldmann [[DateTime(2005-11-13T19:31:57Z)]]

[http://www.linux-france.org/~dmentre/misc/tla-to-hg-hist.py tla-to-hg-hist.py] -- I extended above script to import the full history of a revision (using tla's ancestry-graph command). -- DavidMentre [[DateTime(2006-05-10T11:15:00Z)]]

=== From Perforce to Mercurial ===

This utility can actually keep two repositories in sync.

Currently, it's slapped together and built to serve my particular needs, but it could probably be modified into something more general. It currently makes no attempt to do anything with Perforce's ability to track branches or the movement of changesets from branch to branch. -- EricHopper [[DateTime(2005-09-27T06:31:03Z)]]

[http://hg.omnifarious.org/~hopper/p4_to_hg p4_to_hg]

=== Fast (incremental) cvs->hg conversion ===

If you have the cvsroot locally available (i.e. you can more the rcs,v files), you can use
["corecode"]'s fast repo syncer [http://ww2.fs.ei.tum.de/~corecode/hg/cvs20hg cvs20hg].
It's still a little bit rough on the user interface side, but it is being used to sync the
[http://chlamydia.fs.ei.tum.de/hg/dragonfly-src DragonFly repo]. For cvs20hg you'll need the [http://ww2.fs.ei.tum.de/~corecode/hg/rcsparse rcsparse] module as well.

On [http://hg.intevation.org/] you'll find a mirror of corecode's repository and two improved versions,
one with only bugfixes and an highly experimental one with support for CVS branches.

To get it going, do something like this:{{{
cd rcsparse
./setup.py install
cd ../cvs20hg
./setup.py install
hg init /path/to/hgdest
cvs20hg /path/to/cvsroot modulename /path/to/hgdest
}}}

cvs20hg operates incremental, which means that you can run it later again to incoporate new changes from CVS.

-- ["corecode"]
Line 35: Line 73:
Also take a look at ''contrib/convert-repo''. This is an extensible Also take a look at {{{contrib/convert-repo}}}. This is an extensible

Converting from other SCM formats to Mercurial

See http://www.darcs.net/DarcsWiki/Tailor for a tool that handles several popular formats.

Example Tailor conversion from CVS

This is tested with Mercurial 0.7 and Tailor 0.9.18

Things to know:

  • -D turns on debugging mode, printing each executed command. Good way to understand what Tailor is doing

  • -v verbose, echo the changelogs as well as the commmands being run (convenient for understanding progress)

 mkdir -p /path/to/hg/repo
 cd /path/to/hg/repo
 tailor -v --source-kind cvs --target-kind hg --repository $REP --module MODULENAME -r INITIAL > MODULENAME.tailor
 vi MODULENAME.tailor

Now you will at least need to change subdir from . to MODULENAME, and remove /MODULENAME from root-directory. You will probably also want to set patch-name-format =; otherwise the summaries will have only redundant information in them.

 tailor --configfile MODULENAME.tailor

When this is done, you should have a working Mercurial repository that matches the trunk of the CVS archive you have been using. The --repository option gets passed to CVS via the -d option, so anything that works for $CVSROOT will for for --repository.

Be aware that the last stage of this script will take a long time to run. Also, local access to the CVS repository instead of remote access may make it significantly faster.

See http://nautilus.homeip.net/~lele/projects/tailor/README.html#config-file-format and look at the second example, which shows a configuration sample converting from a CVS source to a Mercurial target. See also http://www.darcs.net/DarcsWiki/Tailor/VersionOne for a trace back of the changes.

From Arch 1.x/baz 1.5 to Mercurial

SamTardieu wrote a script to convert from Arch 1.0 archive format and I enhanced it to write full changelog instead of just the summary. You can find it on http://archives.keltia.net/hg/hg-convert. You need baz 1.5 because the option to get the full changelog is different in 1.4 and more important, the format of the changelog is different. -- OllivierRobert

attachment:arch-to-hg.py -- I also hacked it to support baz 1.1.1 and tla 1.3-1 (and should also work for other versions, as it only uses some very simple commands). I tuned it to run much faster by just updating the same tree one patch after another. It uses UTC currently. Please try to keep it compatible and do not require latest versions if it can be avoided. -- ThomasWaldmann DateTime(2005-11-13T19:31:57Z)

[http://www.linux-france.org/~dmentre/misc/tla-to-hg-hist.py tla-to-hg-hist.py] -- I extended above script to import the full history of a revision (using tla's ancestry-graph command). -- DavidMentre DateTime(2006-05-10T11:15:00Z)

From Perforce to Mercurial

This utility can actually keep two repositories in sync.

Currently, it's slapped together and built to serve my particular needs, but it could probably be modified into something more general. It currently makes no attempt to do anything with Perforce's ability to track branches or the movement of changesets from branch to branch. -- EricHopper DateTime(2005-09-27T06:31:03Z)

[http://hg.omnifarious.org/~hopper/p4_to_hg p4_to_hg]

Fast (incremental) cvs->hg conversion

If you have the cvsroot locally available (i.e. you can more the rcs,v files), you can use ["corecode"]'s fast repo syncer [http://ww2.fs.ei.tum.de/~corecode/hg/cvs20hg cvs20hg]. It's still a little bit rough on the user interface side, but it is being used to sync the [http://chlamydia.fs.ei.tum.de/hg/dragonfly-src DragonFly repo]. For cvs20hg you'll need the [http://ww2.fs.ei.tum.de/~corecode/hg/rcsparse rcsparse] module as well.

On [http://hg.intevation.org/] you'll find a mirror of corecode's repository and two improved versions, one with only bugfixes and an highly experimental one with support for CVS branches.

To get it going, do something like this:

cd rcsparse
./setup.py install
cd ../cvs20hg
./setup.py install
hg init /path/to/hgdest
cvs20hg /path/to/cvsroot modulename /path/to/hgdest

cvs20hg operates incremental, which means that you can run it later again to incoporate new changes from CVS.

-- ["corecode"]

Other options

Also take a look at contrib/convert-repo. This is an extensible framework for converting between repository types that is currently used for git to Mercurial conversion.

/hg.py there seems to not use hg addremove/ -- DanConnolly /it seems to now as of 2005.8.17/ -- MichaelKJohnson

ConvertingRepositories (last edited 2009-05-19 19:31:05 by localhost)