Sometimes I am getting this weird error when try to updating the CVS sandbox:
…move away the file mydir/myfile, it is in the way.
The file was checked in fine and the problem goes away if I try to run update in the directory where the file is located.
Usually deleting the whole “mydir” and do a fresh update will fix the problem, but what causes this?
One possible reason is that the directory name was not properly updated in CVS. This can be verified by going to the parent dire of “mydir”, and open the entries file in the CVS folder. It should include this line:
D/mydir////
If it’s not there, adding line to the file can probably fix the issue above.
But what caused the missing directory name then? Beats me. My best guess in my case is that the failed style checking when checking in CVS files has caused some inconsistency in the sandbox, thus the error.
To merge a branch into a HEAD, simply go to the local sandbox for the mainline code, and run:
%cvs upd -jBUGGY_BRANCH
A HEAD can be merged into a branch too using the same method.
To search for the conflict, from the command line, run:
%grep -r “>>>>>” *
The result should be a list of files which have the “>>>>>” content. Most likely, indicating the CVS conflict.
To get started with a repository:
%export CVSROOT=/home/user/cvs
%cvs init
or, if multiple ROOTs are kept,
%cvs -d /home/user/cvs/project1cvs init
create a source directory just like any normal unix directory, then we can do
%cvs add hello.php
After satisfied with hello.php,
%cvs commit
will check in the file for real.
If you use CVS for your code you probably notice that a CVS folder is created under each directory in your code base. I was playing with the code the other day but struggling to get a clean code base because all these CVS folders are in place. After a little bit of researching this Unix command did the job for me:
find . -name CVS -exec rm -rf {} \;
Basically a “find” command can be concatenated with other commands so the same operation can be applied recursively to all the found results.
Since this is a Unix command Cygwin is required to run it on Windows.