hg convert - partial conversions?

Jesse Glick jesse.glick at sun.com
Wed Feb 13 04:50:02 CST 2008


Brian Wallis wrote:
> The one thing I cannot seem to do is just bring across the last 12 
> months of changes. The repository dates back 6 years but I really 
> don't need the whole history in the new repository.

Are you sure you want to discard old history? I found that at least for 
text files, Hg's compression is quite good, and that importing our nine 
years of history added only about 20% to the repo size. I would suggest 
measuring before you make a decision.

For my own CVS -> Hg conversion of a big repo, I decided to convert the 
trunk history of text files, leaving branches (and branch tags and tags 
on branches, but not trunk tags) in the old CVS repo for archival 
purposes, and import binary files only in the head version. The key 
script for this purpose in case you find it useful:

http://deadlock.netbeans.org/fisheye/browse/netbeans/apisupportx/hgimport/lib/prepcvs.rb?r=MAIN

It has some extra stuff in it to collect author names (for convert's -A 
option), as well as to do path translation (you could use a mapfile 
instead if your needs are simpler than mine were). After running hg 
convert with the resulting "postprocessed" CVS repo, just cvs export 
-rHEAD && hg ci -A to get the binary files.



More information about the Mercurial mailing list