CVS checkout based only on tags
Asked Answered
cvs
I

2

7

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.

Inward answered 28/12, 2010 at 17:19 Comment(3)
As written, this doesn't make a lot of sense. When you check out using -r TAG, you'll only get the files that have that tag. What are you seeing instead?Coherence
Running cvs co -r baz_1_0_0_0 I get an error that I must specify at least one module or directory. Since what I am checking out is not a module I would need to specify a directory, but I don't know the directory ahead of time and I haven't been able to come up with a way to parse out the needed directories from some other command.Inward
Well, yes, you have to specify the name of a project. How do you checkout without a tag?Coherence
I
1

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
Ingles answered 22/6, 2012 at 17:19 Comment(0)
A
1

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 .
Anomalous answered 12/9, 2017 at 4:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.