Using Mercurial with Subversion, but with a twist

161 views Asked by At

Up front, I am aware of and have looked into:

unfortunately neither discuss the problem at hand.


The question

How can I teach an existing Mercurial repository that was not cloned from an SVN repository directly that it has an SVN repository "parent" to push to?

The existing setup

We have a situation where due to bandwidth issues I have svnsync'd a remote "upstream" SVN repository over to our local branch servers. During this process after each successful synchronization, the respective cron job will hg pull changes from the local svnsync'd SVN repository into a Mercurial clone. All of that works fine and the svnsync'd repository is configured to refuse any commits, but shares the UUID with the "upstream" repository (so that svn switch --relocate ... works).

enter image description here

Now a developer at our branch has three options:

  1. checkout from the remote ("upstream") repository (slow)
  2. checkout from local branch servers (faster, but still SVN speed penalty)
  3. clone Hg repo from local branch servers (fastest)

So in order to get the last version to work, I'd need to be able to tell the local clone about the remote "upstream" SVN repository. How do I do that?

1

There are 1 answers

1
Lazy Badger On

AFAIK, you can't use two Subversion origins at the same time (cloned Mercurial repository will operate only with source-SVN repository later for pull and push): i.e you will not be able hg pull local + hg push remote

But, if local SVN-mirror used only once, for creating clone in Mercurial and later remote SVN is used only (push and pull), you can try replace default path in repository's .hgrc and change local URL to remote (for full mirror with shared UUID it may work)