With Git and Mercurial around I'm used to do local changes, commit them locally and maybe undo them if I made mistakes. With SVN this is not possible.
Why do they still use SVN?
There is even a discussion on the mailinglist:
The Git mirror mentioned in the Wiki seems outdated.
But there are some unofficial ones on github:
But compiling them gives you messages about missing locale, addons and addons_contrib. Those folders are normally pulled via SVN externals. So if you are using the Git mirror you still need to get those extra folders from somewhere. A way might be Git-Submodules.
Looking around I found hgsubversion: http://mercurial.selenic.com/wiki/HgSubversion
A simple one:
- add hgsubversion to your extensions list
- hg clone svn+repository
The same I did for
In the meantime I pushed the repositories to new created repositories on https://bitbucket.org/
After that I had the following:
Just create a .hgsubs file in your hg root folder and insert the appropriate lines. Just like this:
release/datafiles/locale = [svn]https://svn.blender.org/svnroot/bf-translations/trunk/localeYou can use Mercurial, Git and Subversion repositories here.
release/scripts/addons = https://bitbucket.org/Urfoex/addons
release/scripts/addons_contrib = https://bitbucket.org/Urfoex/addons_contrib
I'm not sure right now if I had to checkout / clone those repositories myself for it to initially work. At least for SVN HG complained about locale "is not a working copy". But right now if I clone my repository and go to the right branch Mercurial pulls all subrepositories in without my help. It works just like with SVN and SVN externals.
Sounds easy so far.
Looking at the commit graph shows that I had some problems.
I simply can't delete branches. I made some to test if I can put some commits in the branch and then put commits from default to it to, like "rebase". Didn't really work as I thought and now I have some branches "just because". This also includes some commits that I made that I can't remove. Not reverting. That works. But real deletion.
Branches could be removed in 3 ways: http://mercurial.selenic.com/wiki/PruningDeadBranches
None worked for me. I finally merged and closed them but they are still there. The clone-method somehow didn't work with hgsubversion. It technically worked but doing a "hg pull" that normally pulled new SVN changes in resulted in an error.
Another commit and another branch was just locally. "hg strip" did fine to remove those. (http://webcache.googleusercontent.com/search?q=cache:jYnn0rwFlkIJ:mercurial.selenic.com/wiki/EditingHistory+&cd=2&hl=de&ct=clnk&gl=de)
Somehow I managed to accidentally put a commit in the default branch. And hgsubversion created a new head for the new SVN incomings. Now I have two heads for the default branch and don't now how to safely change that. Every time I pull the changes from SVN in it create a new head. If I don't mind I can push that and have two heads. Or I merge those two heads together. That creates a commit and looks a bit ugly. But at least the last commit will unsure that the specific subrepo-changes are in.
One thing I would like to know is: What happens when my local hgsubversion repository that I use to pull SVN changes and push them to Mercurial gets deleted? How do I then push SVN changes? Can I simply create a new local hgsubversion repository and my pushes will work on top?
At least it works for now.
Btw.: If you gonna push to a different path then you pull you can tell hg to do so in the .hg/hgrc file. Just like this:
default = svn+https://svn.blender.org/svnroot/bf-blender/trunk/blender
default-push = https://bitbucket.org/Urfoex/blender
I also create a very simple script for updating the repositories:
$ cat update.sh
echo "-------------------- ADDONS --------------------"
echo "---------------- ADDONS_CONTRIB ----------------"
echo "------------------ BLENDER-HG ------------------"
echo "!! Don't forget to merge changes for subrepos !!"
echo "----------------- BL_HG_CLONE ------------------"
echo "-------------------- LOCALE --------------------"
In the end it is possible to move a SVN repository to Mercurial or just use one that way. Moving it over is a nice opportunity.
But using it as a wrapper is a bit painful. It feels much better with just Mercurial or just Git.
Back to changing BGE code…