+#DATA{{{
+__DATA__
+[ALIAS]
+co = checkout
+ci = commit
+ls = list
+
+[DEFAULT]
+order = 10
+lib =
+ error() {
+ echo "mr: $@" >&2
+ exit 1
+ }
+ hours_since() {
+ if [ -z "$1" ] || [ -z "$2" ]; then
+ error "mr: usage: hours_since action num"
+ fi
+ for dir in .git .svn .bzr CVS .hg _darcs; do
+ if [ -e "$MR_REPO/$dir" ]; then
+ flagfile="$MR_REPO/$dir/.mr_last$1"
+ break
+ fi
+ done
+ if [ -z "$flagfile" ]; then
+ error "cannot determine flag filename"
+ fi
+ delta=$(perl -wle 'print -f shift() ? int((-M _) * 24) : 9999' "$flagfile")
+ if [ "$delta" -lt "$2" ]; then
+ exit 0
+ else
+ touch "$flagfile"
+ exit 1
+ fi
+ }
+
+update =
+ if [ -d "$MR_REPO"/.svn ]; then
+ svn update "$@"
+ elif [ -d "$MR_REPO"/.git ]; then
+ if [ -z "$@" ]; then
+ git pull -t origin master
+ else
+ git pull "$@"
+ fi
+ elif [ -d "$MR_REPO"/.bzr ]; then
+ bzr merge "$@"
+ elif [ -d "$MR_REPO"/CVS ]; then
+ cvs update "$@"
+ elif [ -d "$MR_REPO"/.hg ]; then
+ hg pull "$@" && hg update "$@"
+ elif [ -d "$MR_REPO"/_darcs ]; then
+ darcs pull -a "$@"
+ else
+ error "unknown repo type"
+ fi
+status =
+ if [ -d "$MR_REPO"/.svn ]; then
+ svn status "$@"
+ elif [ -d "$MR_REPO"/.git ]; then
+ git status "$@" || true
+ elif [ -d "$MR_REPO"/.bzr ]; then
+ bzr status "$@"
+ elif [ -d "$MR_REPO"/CVS ]; then
+ cvs status "$@"
+ elif [ -d "$MR_REPO"/.hg ]; then
+ hg status "$@"
+ elif [ -d "$MR_REPO"/_darcs ]; then
+ darcs whatsnew -ls "$@"
+ else
+ error "unknown repo type"
+ fi
+commit =
+ if [ -d "$MR_REPO"/.svn ]; then
+ svn commit "$@"
+ elif [ -d "$MR_REPO"/.git ]; then
+ git commit -a "$@" && git push --all
+ elif [ -d "$MR_REPO"/.bzr ]; then
+ bzr commit "$@" && bzr push
+ elif [ -d "$MR_REPO"/CVS ]; then
+ cvs commit "$@"
+ elif [ -d "$MR_REPO"/.hg ]; then
+ hg commit -m "$@" && hg push
+ elif [ -d "$MR_REPO"/_darcs ]; then
+ darcs commit -a -m "$@" && darcs push -a
+ else
+ error "unknown repo type"
+ fi
+diff =
+ if [ -d "$MR_REPO"/.svn ]; then
+ svn diff "$@"
+ elif [ -d "$MR_REPO"/.git ]; then
+ git diff "$@"
+ elif [ -d "$MR_REPO"/.bzr ]; then
+ bzr diff "$@"
+ elif [ -d "$MR_REPO"/CVS ]; then
+ cvs diff "$@"
+ elif [ -d "$MR_REPO"/.hg ]; then
+ hg diff "$@"
+ elif [ -d "$MR_REPO"/_darcs ]; then
+ darcs diff "$@"
+ else
+ error "unknown repo type"
+ fi
+log =
+ if [ -d "$MR_REPO"/.svn ]; then
+ svn log"$@"
+ elif [ -d "$MR_REPO"/.git ]; then
+ git log "$@"
+ elif [ -d "$MR_REPO"/.bzr ]; then
+ bzr log "$@"
+ elif [ -d "$MR_REPO"/CVS ]; then
+ cvs log "$@"
+ elif [ -d "$MR_REPO"/.hg ]; then
+ hg log "$@"
+ elif [ -d "$MR_REPO"/_darcs ]; then
+ darcs changes "$@"
+ else
+ error "unknown repo type"
+ fi
+register =
+ if [ -n "$1" ]; then
+ cd "$1"