I felt at the time that to understand CVS better, one should make a personal repository and play with it (or at least make use of the experience of someone who had done so, with whom verbal contact was good). It took me a long time to actually do this. One reason was that I had read that AFS and CVS didn't coexist well (it was described as a conflict of the file locking philosophy). Since the only place I had to build a repository was on AFS disk space, this was a perceived inhibition. By asking the help desk, I learned that on FNALU this isn't a problem. Another holdup was that there is no sense in using CVS until one gets enough code in use, and being modified, that putting it into CVS has some attractiveness. A third holdup was that I never felt too comfortable with the documentation existing on the WWW. A final inhibition was that I thought it worth waiting for someone else to take the lead, and learn from that person.
One recent complication with CVS Info files is that the latest version of CVS does not have them included with the distribution. They are therefore not to be found descending from the environmental variable CVS_DIR that results from "setup cvs". I had to reference back to an older version to access the info files. Fermilab's HelpDesk and the expert who was consulted about this don't plan to correct this situation; for them having HTML files explaining CVS is sufficient. As I state elsewhere in this little part of the Web, I regard the Info files as superior to the HTML files. Either can be produced from the original "texinfo" files that were distributed with the latest version of CVS.
Below I show how I access the CVS info files. The first line is inserted into my ~/.login file, to define the environmental variable CVS_INFO. The second line also goes in the ~/.login file and shows what I use to tell Emacs where to look for these "dir" files, and other info files (I added "~/emacs/info" to the standard list of places to look). The third line shows the entry in my local "dir" file-- that Info merges with the standard Emacs "dir" file.
setenv CVS_INFO `dirname $CVS_DIR`/v1_8_1_1/info setenv INFOPATH $GEN2":~/emacs/info:/usr/local/lib/info/:/usr/local/info/:/usr/local/products/emacs/v19_30/info/" * CVS: ($CVS_INFO/cvs.info). cvs
For the impatient, I should point out that the Info node "(cvs.info)Invoking CVS" is a reference menu for all the important commands--if one doesn't want to read the other stuff in (cvs.info). See remark in my other writeup for a discussion of Info nodes.
cvs -d /usr/local/cvsroot initI didn't save what I used to create my repository, so I can't give it as an example.
"(cvs.info)Repository" suggests several ways to thereafter refer to the repository. I chose to define the `$CVSROOT' environment variable in my ".login" file.
"(cvs.info)Starting a new project" suggests "the first thing you do when you start a new project should be to think through your file organization." This is very true. If you have existing files that you are going to want to put in the repository, they may be accompanied by other files that you don't want to put there. I used the "cvs import" command to do the initial load of the repository. It will start from the directory where it is at, and will import all files that aren't on the "ignore" list (for example, "*.o" files are ignored). This includes a recursive descent down through all the sub-directories. Before I did the initial import, I separated my Fortran files, Makefiles, and certain setup files into a directory structure that was not shared with all the other files I used to keep together with them (output files, for example).
In my case, the "cvs import" command looked like:
cvs import -m "reconstructed phase I" gbeam phase_I phase_Iand was done from the "~wehmann/muon_studies/gbeam" directory. There were several sub-directories that were imported by the same command. An example of importing
cvs checkout gbeamThis was done with the directory set to "~wehmann/muon_studies"; the earlier "gbeam" subdirectory had been renamed to something else (and is no longer needed, if the checkout is successful).
The "cvs checkout" command creates all the necessary directories. It also creates a special set of CVS files that keep track of where the checked out files came from. An Example of Checkout
At the moment my disk area is cluttered with several relic versions of code. When I bump up against quota limits, and am confident of my CVS skills, then I can get rid of these relic versions.
I started a branch at one point, for some code modifications that I didn't want to have on the main development path. I used "cvs -b rtag" to start the branch. Being new at this, I managed to commit these modifications on the main development path as well. I could get back as working code a version of the code without these modifications, but I didn't find any way to commit the unmodified code back on the main development path without being forced to reconcile the unmodified version against the modified version that was at the head of the main development path. CVS forced me to do an update before the commit; the update combined the modified code with the unmodified code. Even with the import command this was true. I could import the unmodified code onto the "vendor" branch, but the local CVS files forced an update against the code at the head of the main development path, when trying to go from that branch back to the main development path.
The lesson I drew from this experience is to be more careful when branching off with a set of modifications. I suspect I should have used "cvs -b tag", rather than "cvs -b rtag". To know for sure, I'll have to wait for the next occasion to try branching.
cvs import -m "reconstructed phase I" muon_new phase_I_muon_new phase_I_muon_new cvs import -m "reconstructed phase I" muon_new phase_I_muon_new phase_I_muon_new N muon_new/muon_new.setup N muon_new/muon.ffr N muon_new/Makefile N muon_new/readmuonntup.F N muon_new/uhinit.F N muon_new/muonntup.inc N muon_new/Make.include N muon_new/uload.F N muon_new/get_mu.F N muon_new/get_mu_init.F N muon_new/look_cont.F L muon_new/chng_no.pl cvs import: Importing /afs/fnal.gov/files/home/room3/wehmann/cvsdir/cvsroot/muon_new/paw N muon_new/paw/rock.F No conflicts created by this import
cvs checkout muon_new cvs checkout muon_new cvs checkout: Updating muon_new U muon_new/Make.include U muon_new/Makefile U muon_new/get_mu.F U muon_new/get_mu_init.F U muon_new/look_cont.F U muon_new/muon.ffr U muon_new/muon_new.setup U muon_new/muonntup.inc U muon_new/readmuonntup.F U muon_new/uhinit.F U muon_new/uload.F cvs checkout: Updating muon_new/paw U muon_new/paw/rock.F >
cvs commit -m 'phase_II 1_20_save, muon_new' cvs commit -m 'phase_II 1_20_save, muon_new' cvs commit: Examining . cvs commit: Examining paw cvs commit: Committing . Checking in muon.ffr; /afs/fnal.gov/files/home/room3/wehmann/cvsdir/cvsroot/muon_new/muon.ffr,v muon.ffr new revision: 1.2; previous revision: 1.1 done Checking in muon_new.setup; /afs/fnal.gov/files/home/room3/wehmann/cvsdir/cvsroot/muon_new/muon_new.setup,v muon_new.setup new revision: 1.2; previous revision: 1.1 done Checking in muonntup.inc; /afs/fnal.gov/files/home/room3/wehmann/cvsdir/cvsroot/muon_new/muonntup.inc,v muonntup.inc new revision: 1.2; previous revision: 1.1 done Checking in readmuonntup.F; /afs/fnal.gov/files/home/room3/wehmann/cvsdir/cvsroot/muon_new/readmuonntup.F,v readmuonntup.F new revision: 1.2; previous revision: 1.1 done Checking in uhinit.F; /afs/fnal.gov/files/home/room3/wehmann/cvsdir/cvsroot/muon_new/uhinit.F,v uhinit.F new revision: 1.2; previous revision: 1.1 done cvs commit: Committing paw Checking in paw/rock.F; /afs/fnal.gov/files/home/room3/wehmann/cvsdir/cvsroot/muon_new/paw/rock.F,v rock.F new revision: 1.2; previous revision: 1.1 done >
This branch was created for a test version of gbeam. After making the branch, I made the changes in my working files for the test version and commited them to the branch. I haven't yet gone back to the main trunk.
The output from "cvs log" shows the various symbolic names for revision numbers. The "1.1.1" indicates a "vendor" branch, used by the "cvs import" command. The "126.96.36.199" is a branch revision number; this can be seen by the ".0.2" tacked on the end.
cvs rtag -b -r 'test_3_20_a' test_3_20 gbeam cvs rtag: Tagging gbeam cvs rtag: Tagging gbeam/adamoinc cvs rtag: Tagging gbeam/adamoinc/from_gminos cvs rtag: Tagging gbeam/inc cvs rtag: Tagging gbeam/init cvs rtag: Tagging gbeam/lib cvs rtag: Tagging gbeam/subr cvs rtag: Tagging gbeam/utilities cvs rtag: Tagging gbeam/wbb
> cvs log gustep.F cvs log gustep.F RCS file: /afs/fnal.gov/files/home/room3/wehmann/cvsdir/cvsroot/gbeam/gustep.F,v Working file: gustep.F head: 1.4 branch: locks: strict access list:
symbolic names: test_3_20: 188.8.131.52 test_3_20_a: 1.4 tag_3_21: 1.3 tag_3_20: 1.3 phase_I: 184.108.40.206 phase_I: 1.1.1 comment leader: "c " keyword substitution: kv total revisions: 5; selected revisions: 5 description: ---------------------------- revision 1.4 date: 1997/03/21 03:45:18; author: wehmann; state: Exp; lines: +9 -4 put in test histogram for importance weighting ---------------------------- revision 1.3 date: 1997/03/16 20:50:33; author: wehmann; state: Exp; lines: +49 -31 phase_IV, as of 3/16/97 ---------------------------- revision 1.2 date: 1997/03/16 19:19:36; author: wehmann; state: Exp; lines: +229 -177 phase_II 2_20_save files ---------------------------- revision 1.1 date: 1997/03/16 00:57:28; author: wehmann; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 220.127.116.11 date: 1997/03/16 00:57:28; author: wehmann; state: Exp; lines: +0 -0 reconstructed phase I =============================================================================