1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
# Adds support for git-cvs repositories.
# https://github.com/osamuaoki/git-cvs
#
# To make mr use this file, add a line like this inside the [DEFAULT]
# section of your ~/.mrconfig
#include = cat /usr/share/mr/git-cvs
#
# Note that by default this makes mr update do a git cvs update.
# Some might prefer it to do a git cvs rebase, if you do, you can
# configure that as follows in your ~/.mrconfig:
#git_cvs_update = cd "$MR_REPO/gitdir" && git cvs rebase "$@"
git_cvs_update = cd "$MR_REPO/gitdir" && git cvs update "$@"
git_cvs_fetch = cd "$MR_REPO/gitdir" && git cvs update "$@"
git_cvs_clean =
cd "$MR_REPO/gitdir" && \
if [ "x$1" = x-f ] ; then
shift
git clean -dx --force "$@"
else
git clean -dx --dry-run "$@"
fi
git_cvs_status = cd "$MR_REPO/gitdir" && git status -s "$@" || true; git --no-pager log --branches --not --remotes --simplify-by-decoration --decorate --oneline || true; git --no-pager stash list
git_cvs_commit = cd "$MR_REPO/gitdir" && git cvs dcommit "$@"
git_cvs_record = cd "$MR_REPO/gitdir" && git commit -a "$@"
git_cvs_push = cd "$MR_REPO/gitdir" && git cvs dcommit "$@"
git_cvs_diff = cd "$MR_REPO/gitdir" && git diff "$@"
git_cvs_log = cd "$MR_REPO/gitdir" && git log "$@"
git_cvs_grep = cd "$MR_REPO/gitdir" && git grep "$@" || true
git_cvs_test = perl:
-f "$ENV{MR_REPO}/.gitcvsrc" &&
-d "$ENV{MR_REPO}/rsyncdir/CVSROOT" &&
-d "$ENV{MR_REPO}/cvsdir/CVS" &&
-d "$ENV{MR_REPO}/gitdir/.git" &&
1
git_cvs_register =
CVSROOT="$(sed -n s/^CVSROOT=//p .gitcvsrc)"
MODULE="$(sed -n s/^MODULE=//p .gitcvsrc)"
if [ -z "$CVSROOT" ] || [ -z "$MODULE" ]; then
error "cannot determine git cvs repository or module"
fi
echo "Registering git cvs repository: $CVSROOT module $MODULE in $MR_CONFIG"
mr -c "$MR_CONFIG" config "$(pwd)" checkout="mkdir '$MR_REPO' && cd '$MR_REPO' && git cvs sync '$CVSROOT' '$MODULE'"
# vim:sw=8:sts=0:ts=8:noet
|