SVN -> Hg, but need to add dummy files to empty dirs
Haszlakiewicz, Eric
EHASZLA at transunion.com
Mon Jul 25 16:35:32 UTC 2011
> -----Original Message-----
> From: mercurial-bounces at selenic.com [mailto:mercurial-
>
> 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.
>
You can't. Mercurial is limited (or arguably, broken) in that respect. :( It doesn't track directories at all, so if you want a directory to show up you either need to put a dummy file inside of it, or create it through some external process after you pull changes.
If you need to figure out what empty directories you need to create, something like this should work:
find . -type f | sed -e's,/[^/]*$,,' | sort -u > directories_with_files
find . -type d | sort -u > all_directories
comm. -23 directories_with_files all_directories > empty_directories
eric
More information about the Mercurial
mailing list