Mr. Who? No..

mr is a Multiple Repository management tool. With lots of people using svn with no real reason to switch, and some people using git because it's the cool thing of the day, I need a way to be able to checkout and update from multiple repositories, in multiple revison control systems. There are probably many scripts already written to do this; mr(1) is my attempt, and since it's very configurable and has a very short name, perhaps it will be useful to others in this situation.

An example is probably worth 1347 words (according to wc -w mr). One thing not shown here is that it can look for .mrconfig files not just in the home directory, but inside the repositories it checks out.

joey@kodama:~/src> mr update
mr update: in /home/joey/src/dpkg
Already up-to-date.
Already up-to-date.

mr update: in /home/joey/src/linux-2.6
Already up-to-date.

mr update: in /home/joey/src/mr
Already up-to-date.

mr update: finished (3 sucessful; 1 skipped)

Here's my current ~/.mrconfig file.

[src/mr]
checkout = git clone ssh://git.joeyh.name/srv/git.joeyh.name/mr

[src/linux-2.6]
checkout = git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
# I only check this out on kodama, otherwise skip it.
skip = test $(hostname) != kodama

[src/dpkg]
# A merge of the upstream dpkg git repo and my own personal branch.
checkout = git clone git://git.debian.org/git/dpkg/dpkg.git && \
        cd dpkg && \
        git remote add kite ssh://kitenet.net/srv/git.joeyh.name/dpkg && \
        git fetch kite && \
        git checkout -b sourcev3 kite/sourcev3
update = git pull origin master && git pull kite sourcev3
commit = git push kite

# My home directory, which I keep in svn.
[]
checkout = svn co svn+ssh://svn.kitenet.net/srv/svn/joey/trunk/home-$(hostname) joey
# run svnfix after each update
update = svn update && svnfix

PS, what should "mr clean" do?