Differences between revisions 10 and 11
Revision 10 as of 2005-09-27 06:31:03
Size: 2698
Editor: EricHopper
Comment:
Revision 11 as of 2005-11-08 20:21:56
Size: 2952
Comment: Initial attempt to convert from old tailor model to new tailor model
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 12: Line 14:
 mkdir /path/to/hg/repo
 cd /path/to/hg/repo
 tailor.py -D -v --source-kind cvs --target-kind hg --bootstrap --repository $REP --module MODULENAME -r INITIAL
 tailor.py -D -v
 mkdir -p /path/to/hg/repo
 cd /path/to/hg
 tailor -D -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}}}.
{{{
 tailor --configfile MODULENAME.tailor

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
 tailor -D -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.

 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.

==== 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.

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

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]

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)