Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CVS checkout based only on tags

Tags:

cvs

I have a file containing a number of tags contained in a a CVS repository. 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.

like image 355
Greg Avatar asked Dec 28 '10 17:12

Greg


2 Answers

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
like image 102
koral Avatar answered Sep 20 '22 21:09

koral


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 .
like image 21
Gilles 'SO- stop being evil' Avatar answered Sep 20 '22 21:09

Gilles 'SO- stop being evil'