Bits of Learning

Learning sometimes happens in big jumps, but mostly in little tiny steps. I share my baby steps of learning here, mostly on topics around programming, programming languages, software engineering, and computing in general. But occasionally, even on other disciplines of engineering or even science. I mostly learn through examples and doing. And this place is a logbook of my experiences in learning something. You may find several things interesting here: little cute snippets of (hopefully useful) code, a bit of backing theory, and a lot of gyan on how learning can be so much fun.

Sunday, May 28, 2006

CVS Repair

Today when I tried to commit the testing directory to cvs, there was a strange problem coming up. All commands including cvs commit were failing when cvs was trying to go into a directory demo/input/api1. It would report no such directory existed and would abort.

I realised that initially the directory testing/demo/data/input/ was created as testing/demo/input and was cvs added. Later when I realised that I would like to divide my data as input and output and intermediate. So, moved the whole directory into testing/demo/inputdemo/data after creating it. Since the CVS directory named testing/demo/input was already there in the CVS repository, this move of a directory created the problem. I should perhaps have followed the following sequence to create the whole thing:

mkdir testing/demo/data
cp -r testing/demo/input testing/demo/data
rm -f testing/demo/input/*
cvs remove testing/demo/input/*
cvs remove testing/demo/input
rm -rf testing/demo/data/input/api1/CVS
rm -rf testing/demo/data/input/CVS
cd testing/demo/data/input/api1
cvs add *
cd ..
cvs add api1
cd ..
cvs add input

OK! That's quite a long process. I don't think it would scale for a more complicated shift of directories within the working directory. I am sure there's another better way to do it. Nevertheless...

So, once the mistake was done (that is, shifting the directory without following the above sequence), I was persistently getting the above errors. I finally managed to get rid of it by the following process:

Went to the CVSROOT and saw that there's a directory testing/demo/input.
I moved it to testing/demo/data/

Then I came to the working directory, and went to the testing/demo/data/input/CVS
I opened the Repository file. In it, I saw that the path given was testing/demo/input. I changed it to testing/demo/data/input. I went to all the directories contained in testing/demo/data/ and changed this erroneous pointer to the repository.
I also edited the Entries file of the testing/demo/CVS directory to remove the 'input' entry from it. This now fixed the problem of cvs trying to look for this this directory in the testing/demo directory. I had to remove some spurious entries in the Entries files of one or two CVS directories withing this path.

This fixed the problems. My CVS commands are now working fine.

Related Blog:
Working with CVS

No comments: