info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fetching multiple tags


From: CHARLES HART, BLOOMBERG/ 499 PARK
Subject: fetching multiple tags
Date: Wed, 5 Feb 2003 10:14:51 -0500 (EST)

I found this question interesting, since I'm about to address it in a 
CVS wrapper I'm writing...

Marc Tessier wrote:
> I am wandering if there is any options to extract the most recent
> version of a list of TAG? I have tag A, B, C  and the I want to get 
the
> most recent files of all three in one cvs checkout or cvs export so 
I
> don't have to check the files version one by one.
Larry replied:
> No.  You're expected to tag all the files in a module,
> not just some of them.

Perhaps I'm answering a different question.  Here's my first solution:
$ cvs checkout -r C f1 f2 f3 ...
$ cvs checkout -r B f1 f2 f3 ...
$ cvs checkout -r A f1 f2 f3 ...
Where the first checkout gets the files with tag C.
The second checkout replaces any file that has a B tag (and leaves 
behind any file that should be deleted as-of B I think).  The third 
command overlays all the files tagged with A.

While this approach is "wasteful" in that it can fetch 3 different 
versions of the same file, it meets your criteria for not having to 
think very hard to make it work right.  

A scripted approach, which would be more efficient is to collect the 
list of files and revisions first, and then get only the "good" ones.

$ cvs -n checkout -r C    <<-- returns the list that has tag C.
$ cvs -n checkout -r B    <<-- returns the list that has tag B.
$ cvs -n checkout -r A    <<-- returns the list that has tag A.

Armed with the 3 lists, you can only fetch each file once.  Though I 
don't have an example database handy with deleted files, so I can't 
say what to do about discarding them from the list.

-CTH





reply via email to

[Prev in Thread] Current Thread [Next in Thread]