IntentionYou prefer to use Mercurial yourself, but the pristine source code (let's call it upstream) of the project you are working on is kept in Subversion restraints? Then this article is for you! I'm going to explain how to:
All you need to do this, is the command line tools for Subversion (svn, svnadmin, svnsync) and Mercurial (hg). Acquiring an upstream clone (SVN)In a terminal window, create a new SVN repository (we assume /tmp/upstream here, but in a real-world scenario you may want to put it in a more appropriate location): svnadmin create /tmp/upstream The next step is to allow property changes. Create the file /tmp/upstream/hooks/pre-revprop-change with this content: #!/bin/bash exit 0 Make it executable: chmod 755 /tmp/upstream/hooks/pre-revprop-change Now you've got an empty repository, which allows property manipulations (necessary for the sync process). Let's say we want to use http://arbitrary.upstream.org/svn/trunk
svnsync init file:///tmp/upstream http://arbitrary.upstream.org/svn/trunk
And then, finally, you are ready to kick off:
svnsync sync file:///tmp/upstream
This will take a while for repositories with many revisions. Grab a coffee
Preparing MercurialYou need to have a ~/.hgrc file with at least this content: [extensions] hg.convert= As convert is an extension, which is part of Mercurial, we don't need to specify more here. It will know where to find it and how to use it. Importing into MercurialThis is so simple that a whole section is hardly justified: hg convert /tmp/upstream /where/ever/you/want/upstream-copy Then it takes a while (mostly depending on the size of the old repo, of course), and that's it. Keeping theirs and yours in syncThis section has yet to be written. But as the conversion part itself may be useful for some, I published that bit already. Soon you can read more about re-syncing the svn-converted clone, and using Mercurial Patch Queues to manage your changes. Watch this space. |
Shortcuts |