Skip to content

Commit 4d4d5c1

Browse files
committed
git-cvs-synchronizer: use cvsclone on non-Sourceforge repositories
cvsclone is an rsync-like tool working on CVS repositories only. Using cvsclone and cvs2git is more precise -- and faster -- than cvsimport. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 4c6885b commit 4d4d5c1

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

git-cvs-synchronizer.sh

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ shift
2727
RSYNC_URL="$(echo "$CVSROOT" |
2828
sed -n 's/^:pserver:anonymous@\([^:]*\.cvs\.\(sourceforge\|sf\)\.net\):\/\(cvsroot\/.*\)/\1::\3/p')"
2929

30+
cvsclone () {
31+
mkdir -p cvs-mirror/
32+
(cd cvs-mirror &&
33+
test -d "$CVSCLONE" || {
34+
CVSCLONE=../../../cvsclone
35+
test -d "$CVSCLONE" ||
36+
git clone git://repo.or.cz/cvsclone.git "$CVSCLONE"
37+
}
38+
test -x "$CVSCLONE"/cvsclone ||
39+
(cd "$CVSCLONE" && make)
40+
"$CVSCLONE"/cvsclone "$@")
41+
}
42+
3043
cvs2git () {
3144
test -d "$CVS2SVN" || {
3245
CVS2SVN=../../cvs2svn
@@ -49,8 +62,20 @@ then
4962
rsync -va "$RSYNC_URL/$CVSMODULE" cvs-mirror
5063
rsync -va "$RSYNC_URL/CVSROOT" cvs-mirror
5164
cvs2git
65+
elif cvsclone -d "$CVSROOT" "$CVSMODULE"
66+
then
67+
test -d cvs-mirror/CVSROOT || {
68+
mkdir -p cvs-mirror/CVSROOT
69+
cvs -d "$(pwd)"/cvs-mirror/CVSROOT init
70+
}
71+
test -d .git || {
72+
git init
73+
mkdir -p .git/info
74+
echo /cvs-mirror/ >> .git/info/exclude
75+
}
76+
cvs2git
5277
else
53-
# TODO: try cvsclone (git://repo.or.cz/cvsclone.git)
78+
# fall back to cvsimport
5479
cvs -d "$CVSROOT" co "$CVSMODULE"
5580
cd "$CVSMODULE"
5681
case "$CVSROOT" in

0 commit comments

Comments
 (0)