0

I have a checkout of a CVS repository. The original repository does not exist anymore. Would it be possible to run something similar to "export" on the checkout itself? What I would want to end up with, is the set of all files that came from the checkout, and remove the files that were added afterwards.

Example: I check out superProject, and get

superProject/checkedoutFile1.txt
superProject/checkedoutFile2.txt
superProject/checkedoutFile3.txt
And then I add
superProject/someFile1.txt
superProject/someFile2.txt
superProject/someFile3.txt
and then I would like to remove all the files that were not in the original checkout.

2 Answers 2

3

cvsu does an offline cvs update by comparing the timestamps of files on disk with their timestamps recorded in CVS/Entries. You can thus tell which files have been locally modified and which files are not known to be under CVS control.

sudo aptitude install cvsutils
cvsu --batch="tar cf export.tar " --types=AFGM

Run cvsu --help to see supported command line options. This functionality is provided by Perl, and can vary from one machine to another.

On Windows, Cygwin supports it.

1

Just noted your comment and edited my answer accordingly.

My initial answer was: simply remove all directories named "CVS"

Naturally, if more stuff has been added to the checked out directories, you should go a different route. CVS keeps its metadata in a CVS subdirectory in each checked out directory. The various files are described on p.16 of the Cederqvist manual.

In your case, the interesting information is kept in the Entries file, which has two different line formats:

/filename/...other stuff...
D/directory/...filler...

The first one for plain files, the second one for directories; there's no particular order.

You could write a script that walks down the directory tree, extracting directory and file names from these Entries files. You can feed this list into cpio -pmdv target-dir to create a copy of your directory structure, that holds exactly the files, a cvs export would have created.

I hope this helps

1
  • There are other files added to the checkout as well. Jun 25, 2010 at 10:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .