I know there is hgsubversion extension for mercurial. But before I knew how it works, I maintain two separate repositories, one is SVN repo and one is Hg repo. I made most of my recent changes in the Hg repository and I need to "push" them to the svn repository.
The most straight forward way to do this is to get one revision from svn which is in sync with one revision from hg.
From there, I update to the next revision (from Hg), then commit it (to svn). Repeating these steps for many changesets is rather inconvenient. Are there more convenient ways to do this?
And if possible, solution that works in Windows OS.
Regards,
Afriza
If you're talking about a linear series of changesets (no merges) you could employ a shell for loop
for therev in $(seq $(hg id -n -r .) $(hg id -n -r tip)) ; do
hg update $therev
svn commit -m "$(hg log --template '{desc}' -r .)"
done
That loops from the checkedout revision to the tip and commits each in turn preserving the commit message. You probably need to do something fancy arround added/removes files.
No there are not.
You might have already seen this link. Currently interacting with svn repos is not officially supported yet. I would not write a shell script to automate this. This may yield unexpected results screw up the repos (however take a look at following workflow)
https://www.mercurial-scm.org/wiki/WorkingWithSubversion.
I currently do something similar to what you do.
e.g (i have not tested this)
in $HOME/svnhgrepos/project1/.hg/hgrc
[hooks]
changegroup.hg-update = hg update >&2
changegroup.svn-commit = svn commit -m "hg log --template '{desc}' -r ."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With