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.

checkout = git clone ssh://

checkout = git clone git://
# I only check this out on kodama, otherwise skip it.
skip = test $(hostname) != kodama

# A merge of the upstream dpkg git repo and my own personal branch.
checkout = git clone git:// && \
        cd dpkg && \
        git remote add kite ssh:// && \
        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://$(hostname) joey
# run svnfix after each update
update = svn update && svnfix

PS, what should "mr clean" do?