Thank you Mark, but rlog will be recursive and I work on a large repository, thus this command would read the history of the entire repository (below the path) and would be very slow.
Zsolt "Mark D. Baushke" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Zsolt Koppany <[EMAIL PROTECTED]> 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 Enjoy! -- 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 /tmp/mdb.repos/ % 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 /tmp/mdb.repos/dir/readme,v /tmp/mdb.repos/dir/sd1/1.c,v /tmp/mdb.repos/dir/sd1/2.c,v /tmp/mdb.repos/dir/sd2/a.c,v /tmp/mdb.repos/dir/sd2/b.c,v % cvs -Qn rlog -R dir | xargs -n 1 dirname /tmp/mdb.repos/dir /tmp/mdb.repos/dir/sd1 /tmp/mdb.repos/dir/sd1 /tmp/mdb.repos/dir/sd2 /tmp/mdb.repos/dir/sd2 % cvs -Qn rlog -R dir | xargs -n 1 dirname | sort -u /tmp/mdb.repos/dir /tmp/mdb.repos/dir/sd1 /tmp/mdb.repos/dir/sd2 % cvs -Qn rlog -R dir | xargs -n 1 dirname | sort -u | sed "s,^$prefix,," dir dir/sd1 dir/sd2 % Just so you can see what is in the entire repository... % cvs -Qn rlog -R . /tmp/mdb.repos/CVSROOT/checkoutlist,v /tmp/mdb.repos/CVSROOT/commitinfo,v /tmp/mdb.repos/CVSROOT/config,v /tmp/mdb.repos/CVSROOT/cvswrappers,v /tmp/mdb.repos/CVSROOT/editinfo,v /tmp/mdb.repos/CVSROOT/loginfo,v /tmp/mdb.repos/CVSROOT/modules,v /tmp/mdb.repos/CVSROOT/notify,v /tmp/mdb.repos/CVSROOT/rcsinfo,v /tmp/mdb.repos/CVSROOT/taginfo,v /tmp/mdb.repos/CVSROOT/verifymsg,v /tmp/mdb.repos/dir/readme,v /tmp/mdb.repos/dir/sd1/1.c,v /tmp/mdb.repos/dir/sd1/2.c,v /tmp/mdb.repos/dir/sd2/a.c,v /tmp/mdb.repos/dir/sd2/b.c,v % 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 % -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (FreeBSD) iD8DBQFE6XcxCg7APGsDnFERAndpAJ90gg34s8HAyu6ENKCvolRUYa2OyACggPB9 ny6Rz916MsVPpQwVaXjou6w= =vK2l -----END PGP SIGNATURE----- _______________________________________________ info-cvs mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/info-cvs
