CVS checkout based only on tags
I have a file containing a number of tags contained in a a CVS re开发者_开发问答pository. Is there a way I can checkout all the files and their associated directories using only these tags without checking out the whole repository?
I don't have a list of the directories in the repository so I can't run cvs co -r baz_1_0_0_0 foo/bar/baz
since I don't know where baz
is actually located.
I am running CVS 1.11 so I don't have commands like rls
available.
If you do a:
cvs history -T
it will give you tags and associated modules (assuming you have CVSROOT defined). You can then grep for the TAG you are looking for and checkout only those modules.
e.g.
mods=`cvs history -T | grep $TAG | awk '{print $6}'`
for mod in $mods; do
cvs co -r $TAG $mod
done
Check out .
. That gives you all the files in the repository. With -r
, that checks out all the files with that revision or tag.
Note that checking out .
populates the current directory, so you may want to create a toplevel directory first.
mkdir baz
cd baz
cvs co -r baz_1_0_0_0 .
精彩评论