2 # Copyright (c) 2007 David Soria Parra <dsp at php dot net>
4 # Licensed under the terms of the MIT License
5 # See /usr/share/doc/gcutils/copyright
6 # or http://www.opensource.org/licenses/mit-license.php
12 echo "Usage:" `basename $0` "[OPTIONS] <cvsroot> <module>"
16 echo " -d <dir> directory for checkout"
17 echo " -gu convert underscores during gitimport"
18 echo " -gn pass --no-cvs-direct to cvsps"
19 echo " -u do not write an ignore file"
20 echo " -V show version information"
21 echo " -r <remote> used refs/remotes/<remote>/ to import CVS branches into"
22 echo " default is 'cvs'"
58 opts
="-p '--no-cvs-direct'"
68 echo >&2 "Parameter $1 is not known."
83 echo "Repository: $CVSROOT"
84 echo "Module: $MODULE"
87 test ${#dir} -eq 0 && dir
="$MODULE"
89 if test -d "$dir/.cvs"
91 echo >&2 "It seems that you are trying to use gc-import on an allready tracked repository."
92 die
"Please use gc-update instead"
95 test -d "$dir" && die
"directory $dir exists"
99 git-cvsimport
$opts -r "$remote" -a -k $verbose $cvrtudsr -m -d$CVSROOT -C "$dir" $MODULE && cd "$dir" && git-config gc-utils.remote
"$remote" && echo "Initialize CVS repository in $PWD/.cvs" && cvs
-d$CVSROOT $quiet -z 9 co
-d ".cvs" $MODULE
101 test $?
!= 0 && die
"Failed."
103 if test -n "$ignorefile"
105 if test ! -f ".gitignore"
107 echo ".cvs" > ".gitignore" && echo "Create ignore file in $PWD/.gitignore"
109 echo ".cvs" >> ".gitignore" && echo "Add ignore entry to $PWD/.gitignore"