SVN -> Hg, but need to add dummy files to empty dirs

Tom Widmer tom.widmer at gmail.com
Fri Jul 22 09:19:00 UTC 2011


On 21/07/2011 06:50, Nick Sabalausky wrote:
> From: "Augie Fackler" <durin42 at gmail.com>
>> On Jul 20, 2011, at 5:02 PM, Nick Sabalausky wrote:
>>>
>>> How do I convert a SVN repo to Hg, while making sure empty dirs are
>>> preserved (obviously with a dummy files added)?
>>>
>>> I tried "hg convert {SVN repo}", and that converted the repo, but all
>>> the empty dirs were killed off because dummy files weren't added.
>>
>> OOC, why do you need empty directories preserved?
>>
>
> It's been a SVN repo for years and so for all the histroy of the repo,
> the buildscripts didn't have any reason to assume the dirs in the repo
> might not be there, therefore the buildscripts break without them.

If you don't manage to fix the underlying conversion, it possibly 
doesn't matter. You probably don't need to worry about rebuilding old 
revisions except in rare circumstances, and hg makes it very easy to 
branch from an old revision and fix the scripts in a new branch, ideally 
using a simple merge. What I would do is:

a) do the conversion
b) make a new branch (not a named one), called build_fix or something, 
from an old revision, before any currently active branches you are 
using, and before any historic revisions you are ever likely to need to 
rebuild
c) fix the scripts on that branch and commit (rev x)
d) merge build_fix into all currently active branches, one by one, so 
that they all build going forwards

If you need to build a historic revision, you just branch from that 
revision and merge the fix in.

Tom




More information about the Mercurial mailing list