Categories
CVS

How to fix CVS import that was done to wrong directory?

Imported the third party source files to wrong directory.

  1. Checkout the directory that contains the wronlgly imported files e.g.cvs -d /home/cvs co -r FreeBSD-6_0-RELEASE myproj/freebsd5/lib/libc
  2. Tag those files with some other tag name e.g. cvs tag -r FreeBSD-6_0-RELEASE WRONG_FREEBSD_SUBDIR
  3. Remove the third party tag import tag e.g. cvs tag -d FreeBSD-6_0-RELEASE
  4. Find the files that have a new version due import e.g. cvs diff -u -r FreeBSD5-LATEST-MERGE -r WRONG_FREEBSD_SUBDIR Note: that you have to also outdate the files that are new not just the chnged ones
  5. Outdate the imported changed version with cvs admin e.g. cvs admin -o WRONG_FREEBSD_SUBDIR Makefile
  6. Remove the symbolic name from the repositry using cvs admin -nName e.g. cvs admin -nWRONG_FREEBSD_SUBDIR

After all this you might see complains from CVS that nothing know about file xxx. You can ignore these messages but if you want to get rid of them you have to manually remove the files from your cvs server (this is dangerous and be aware if you remove a wrong file there is no way to get it back!)