tags:

views:

72

answers:

1

I have a file in CVS under x/y/f.txt. In my local copy, I have x/, but no x/y/ and I want to fetch f.txt from the repo. Is there any combination of CVS command-line switches which can make it pull only x/y/f.txt with all of its ancestors (in this case x/y/) but without any collateral files (such as x/y/g.txt or x/z)?


The only way I've found so far is:

cvs up -d -l x/y
# ... but be careful not to pass -P (``prune'') implicitly via your ~/.cvsrc
# ``-l'' means act locally, i.e. no recursion
# Do the above for every missing ancestor directory, in left-to-right order
# And ultimately:
cvs up x/y/f.txt

However, it would be rather inelegant for a shell script to split a path and iterate through the ancestors, so I'm still looking for a good solution.

A: 

Do you already have a working copy checked out or is this for a fresh checkout?

If you already have a working copy cvs up -d x/y/f.txt should do the job.

The -d should only be necessary if the x and y folders do not already exist. If they do exist, you can also just cd into the x/y folder and do cvs up f.txt.

If this should be a fresh checkout then cvs co -N x/y/f.txt is probably what you need.

Oliver Giesen
I have a partial working copy---x but not x/y."cvs up -d x/y/f.txt" complains that x/y is missing."cvs co -N x/y/f.txt" says "cannot expand modules".
ngn