Question

At the moment I am trying to get a clone of a remote subversion repository running. The remote repository is only available over a very slow link, so I went with svnsync to create a local subversion repository. After nearly thirty hours I now have the local copy of the subversion repository.

How can I now clone this to a new mercurial repository? Problem being that neither of the following forms using file:/// appear to work:

$ hg clone svn+file:///home/user/repo repo.hg
abort: repository svn+file:///home/user/repo not found!
$ hg clone file+svn:///home/user/repo repo.hg
abort: repository file+svn:///home/user/repo not found!
$ hg clone file:///home/user/repo repo.hg
abort: repository /home/user/repo not found!

Conversely svn info file:///home/user/repo does give me the info and proves there is a proper subversion repository in that place. svn:// obviously makes no sense as I am not running the server locally.

I also tried:

$ hgimportsvn file:///home/user/repo repo.hg
SVN branch isn't a copy
Finished! You can now pull all SVN history with 'hgpullsvn'.

but the hgpullsvn only succeeds for the first half dozen revisions and then errors out:

Interrupted, please wait for cleanup!

External program failed (return code 1): hg '--encoding' 'utf-8' 'remove' '-A' 'branches/Company/CVSROOT'
branches/Company/CVSROOT: No such file or directory

(The CVSROOT stems from a previous conversion to Subversion from CVS, apparently. This was before my time.)

Does hgsvn not understand the file:/// protocol specifier even if I try to force it with svn+file:///?

NB: I have tried to clone via hg and hgsvn before, but then ended up getting errors when synchronizing via hgsvn after a while. Since cloning the whole history takes so long I went with the local subversion repository copy from which I intended to clone via hgsvn as I did in the past the remote one.

Was it helpful?

Solution

Just opinion: don't use hgsvn, which "is in maintenance mode" from 2010, add hgsubversion extension to Mercurial and clone Subversion repository with it

PS: "svn+" prefix will be useful only for http-served repositories (because you can use http:// for Subversion, Mercurial, Git). Local Subversion repo (in clone with hgsubversion) will be file:///

OTHER TIPS

I've had this problem again. This is one symptom of a misconfigured or not installed hgsubversion extension as well.

Make sure you have the appropriate lines in your .hgrc or Mercurial.ini (global or local) as pointed out on the documentation site for HgSubversion. Example (adjust the path as needed):

[extensions]
hgsubversion = ~/hgsubversion/hgsubversion

Then check with:

hg help hgsubversion
hg help subversion

My guess would be that without the extension Hg simply has no idea what to expect in the folder and so expects a Mercurial repo, which it cannot find.

In my case this was caused again by overwriting a local ~/.hgrc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top