Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer

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

share|improve this answer
    
There are other files added to the checkout as well. –  Christian Jonassen Jun 25 '10 at 10:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.