Question

I have what seems to be a unique situation. I need to have a central Mercurial repository that can pull from a Subversion server and whose clones will also be able to pull updates from the same Subversion server. The updates would be committed to the Mercurial repository along with changes committed via Mercurial.

Now, hgsubversion seems to work well at first, cloning the Subversion repository, allowing me to commit changes via Mercurial, and correctly pulling updates from the Subversion repository. However, when I clone the hgsubversion repository, the clone attempts to pull the entire Subversion repository all over again, despite it already being in the repository.

Is there a way to fix this problem? Is there a better way to set this up?

For reference, my current setup is a Subversion repository stored within a Mercurial repository. Mercurial commits also commit the .svn folder, so anyone cloning the repository can simply run SVN Cleanup on the folder and then SVN Update to get the latest files from the Subversion server. They then run hg Commit followed by pushing the files to the central Mercurial repository. This works moderately well, but I'd prefer to find a better solution.

Note: I don't need to push changes back to the Subversion server. I only need to pull changes.

Was it helpful?

Solution 2

Apparently this is answered in "hg help subversion":

When interacting with Subversion, hgsubversion relies on information
about the previously converted changesets. This information will not be
updated if pushing or pulling converted changesets to or from any other
source. To regenerate the stored metadata, run "hg svn rebuildmeta
[URI]". This must also be done if any converted changesets are ever
removed from the repository.

Using "hg svn rebuildmeta [URI]" worked perfectly to solve the problem of clones not properly pulling new revisions.

OTHER TIPS

Central server (even in Mercurial) is CENTRAL SERVER. If it cloned Subversion repo and have pull cycle why clients repeat this operation? It's wasted time... But it can't break anything, because

my current setup is a Subversion repository stored within a Mercurial repository.

Is just wrong. Not "not elegant", "ineffective", "error-prone", but - WRONG!!!

Mercurial clone of Subversion repo (with hgsubversion) is Mercurial classic repo, which have Subversion in externals (in [paths] as one of targets) and some link-specific metadata.

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