| Message |
I have been using cvs for MUSHclient. It might not be the most modern but it works well enough for me. You can use it on both Windows and Linux.
Cvs is pretty simple to use, once you do the initial setup. Assuming you have installed cvs but never used it, you would do something like this (after setting up CVSROOT, see below):
cvs init
Once only! This creates the repository where copies of your source are stored.
You need a CVSROOT variable set up, undex Linux or Windows. For Windows use the System Properties to do this. On my Windows box, it looks like this:
CVSROOT=:pserver:nick@servername:/cvs
This is telling it to store its files on the /cvs directory, username "nick" on server "servername".
For a local directory, you would simply specify the directory, eg.
CVSROOT=/cvs
After that, I would CD to my smaug source directory, and clean up anything you don't want in cvs (eg. *.o, *.bak and so on).
Then for the first time for this directory you create the entry for it, by importing your existing files, something like this:
cd ~/SmaugFUSS/src
cvs import SmaugFUSS/src yourname INITIAL_RELEASE
This creates "SmaugFUSS/src" entry in the repository.
Now, and this is the important step, exit the directory and remove it (I am assuming you have backups in case something goes wrong).
cd ../.. # back out of the SmaugFUSS/src directory
rm -rf SmaugFUSS/src # remove the source
Now get it back out of cvs - this is important, so that cvs creates a couple of files and directories to track what you are doing. In particular, after doing this you should have a CVS subdirectory in the source directory. You don't use this yourself, it is for CVS to track what it is doing.
cvs get SmaugFUSS/src
These above steps are a once-off.
From now on you simply edit files in the src directory. When you want to "commit" the changes, do this:
cvs commit
This updates the repository to match the source in your directory.
At any time you can see what changes you made since the last commit:
cvs diff
(or)
cvs diff filename
If you add a new file to the project you can then do this:
cvs add filename
cvs commit
The other thing I do is "tag" releases, like this:
cvs rtag RELEASE_1_2 SmaugFUSS/src
In the case of MUSHclient (say) this sets a "checkpoint" of the state of every source file as at a particular release.
In my case, I can see exactly what changes I made between version 3.70 and 3.71 of MUSHclient, in one line, like this:
cvs diff -r RELEASE_3_70 -r RELEASE_3_71
Concurrent updates
Assuming you have more than one developer, this is where CVS comes into its own. All developers need access to the one server that holds the committed copy of the source.
Assuming that Dralnu makes some changes to some source files, and has committed them, then Nick can type:
cvs update
This synchronizes Nick's source directory to match the repository. Similarly Dralnu can do the same thing to get Nick's changes.
There is a lot more to cvs than that (for instance, you can delete files), however that should get you started. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|