V
V
Vladimir Chernyshev2011-11-07 22:46:31
subversion
Vladimir Chernyshev, 2011-11-07 22:46:31

Mirror Subversion (svn) -> Mercurial (hg)?

There is a constantly (two or three times a day) updated third-party svn repository (on Google Code), I want to have for myself (and the people) its hg mirror (on BitBucket). Not necessarily automatically, but with the ability to initiate mirroring from any machine, even under Windows :) (meaning without installing a bunch of software like hg, svn, python, bindings, etc. and constant conversion).
All day I was tormented with XP and Google, but I did not find a sensible solution. The only thing spinning in my head is creating a script that runs on VDS via ssh (via putty under Windows) or cron, which does something like:

hg convert <a href="http://code.google.com/&lt;repo">code.google.com/&lt;repo</a>&gt; /tmp/&lt;repo&gt;-hg<br/>
cd /tmp/&lt;repo&gt;-hg<br/>
hg push ssh://[email protected]/VolCh/&lt;repo&gt;<br/>
cd /<br/>
rm -r /tmp/&lt;repo&gt;<br/>

Maybe there are better options? At least almost the same, but without a complete conversion of the entire SVN repository, but purely new revisions.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
susl, 2011-11-08
@VolCh

Well, in order not to pull everything every time, you can use hgsubversion. But a better option doesn't come to mind :)

B
Beholder, 2011-11-29
@Beholder

As far as I remember, hg convertit can work incrementally - when it is restarted with the same repositories, it takes only new revisions from the source.

P
png, 2011-11-09
@png

I once made a stupid script:
the main idea
at the beginning is to do
svn co code.google.com/ /home/user/google_code_repo
and then push the script into crontab:
cd /home/user/google_code_repo
svn up
hg addremove ./*
hg commit -m "auto commit from svn"
hg push ssh://[email protected]/VolCh/ if you don't need an exact match of revisions and their comments, then this option is quite convenient

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question