svnmercurialhgsubversion

Sync svn folder to mercurial repo


This is a followup question from Sync svn and mercurial repo

The solution worked nicely, however what we want to do is to break up a tree by cloning a number of specific folders to a mercurial repo so we modified the command to

hg clone https://username@serverAddress/svn/MainRepo/SubFolder/Folder/ --insecure

This gives us a

error: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:661)

Any help?

Thanks for reading


Solution

  • Mercurial's design is incompatible with partial checkouts. I haven't looked at the hgsubversion internals, but I would expect support for partial checkouts to be neither easy nor a priority to implement. Note also that the official hgsubversion wiki states:

    Right now, you can only clone repositories that use a more-or-less standard Subversion layout. That is, the default location where work is done is called trunk, branches are located in a sibling of that directory called branches. Tags are expected to be another sibling of trunk called tags, but that is configurable.

    Again this suggests that cloning a subdirectory will probably violate these assumptions, since the subdirectory has no trunk and branches subfolders.

    As a work-around, consider doing a full checkout and then splitting it up into subrepos (keeping the history), as shown in this question. If you want to continue two-way synchronization with svn, this will require you to do it in two steps, first importing all changes from the subrepos into the hg mirror and then pushing these to svn.