[Top][All Lists]

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

Re: Why only files are checked out and not the directories?

From: Mark D. Baushke
Subject: Re: Why only files are checked out and not the directories?
Date: Mon, 21 Aug 2006 02:04:49 -0700

Hash: SHA1

Zsolt Koppany <address@hidden> writes:

> I have a directory structure like below (an example):
> src/dir/sd1/1.c
> src/dir/sd1/2.c
> src/dir/sd2/a.c
> src/dir/sd2/b.c
> src/dir/readme
> checkout -d $CVSROOT (points to src) -l dir
> and I get ONLY readme. I would like also get sd1 and sd2 (but not their 
> content).
> What my goal is: I would like to get the list of files and directories
> under src/dir. I need a solution for cvs-1.11 thus I cannot use cvs
> ls.
> Can somebody help?

cvs rlog -R dir | xargs -n 1 dirname | sort -u

        -- Mark

Here is the example output:

Here was the setup...

% export CVSROOT=:ext:remote-host/tmp/mdb.repos
% cvs init
% cvs co -d top .
% mkdir dir && cvs add dir && cd dir
% mkdir sd1 sd2 && cvs add sd1 sd2
% touch readme sd1/{1,2}.c sd2/{a,b}.c
% cvs add readme sd1/{1,2}.c sd2/{a,b}.c

Here is how to get a listing... (assuming a bourne shell of some kind,
tcsh or csh is possible, but slightly different).

% prefix=`cvs -n rlog -R CVSROOT/modules | sed s:CVSROOT/modules,v::`
% echo $prefix

The prefix is using a known file in the repsitory to understand what is
in the beginning of each RCS filename.

% cvs -Qn rlog -R dir
% cvs -Qn rlog -R dir | xargs -n 1 dirname
% cvs -Qn rlog -R dir | xargs -n 1 dirname | sort -u
% cvs -Qn rlog -R dir | xargs -n 1 dirname | sort -u | sed "s,^$prefix,,"

Just so you can see what is in the entire repository...

% cvs -Qn rlog -R .
% cvs -v

Concurrent Versions System (CVS) 1.11.18 (client/server)

Copyright (c) 1989-2004 Brian Berliner, david d `zoo' zuhn, 
                        Jeff Polk, and other authors

CVS may be copied only under the terms of the GNU General Public License,
a copy of which can be found with the CVS distribution kit.

Specify the --help option for further information about CVS
Version: GnuPG v1.4.4 (FreeBSD)


reply via email to

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