A CVS HowTo for C3UV /////////////////////////////////////////////// All of this information is outdated: Please check the CVS FAQ on the C3UV Wiki page. -Jack /////////////////////////////////////////////// // A step-by-step to get cvs working. 1. Establish internet connection (a) on the airplanes cd /home/c3uv/ sh wireless.start or phlip and a pretty graphical interface will come up. choose dhcp. Make sure your connection is established by pinging vehicle.me.berkeley.edu 2. Check to see if the CVS_RSH variable is set. The command echo $CVS_RSH should return ssh If it doesn't, issue the command export CVS_RSH=ssh 3. Make sure that the CVSROOT variable is set. This variable tells cvs where to find the cvsroot directory. CVS looks for this variable in 3 places (1) command line in the -d option (2) In a file called CVS/Root in the current directory. (3) In a shell variable called CVSROOT In the directory you're working, check to see if a file called Root exists in the CVS directory. (a) If it does exist, make sure that the login matches your login to the vehicle server. For instance, if in the Root file, you found :ext:SomeGuy@vehicle.me.berkeley.edu/:/home/c3uv/cvsroot you would change it to :ext:myLogin@vehicle.me.berkeley.edu/:/home/c3uv/cvsroot (b) If no Root file exists, set the CVSROOT shell variable export CVSROOT=:ext:myLogin@vehicle.me.berkeley.edu/:/home/c3uv/cvsroot Lastly, if you like to type a lot, you specify the commandline option. cvs -d :ext:SomeGuy@vehicle.me.berkeley.edu/:/home/c3uv/cvsroot command where command is one of the following checkout commit update update -d Now you should be set to use cvs. ////////////////////////////////////////////////////////////////////////// Your first CVS experience ////////////////////////////////////////////////////////////////////////// (1) checkout the code In the directory where you want the qnx directory to be cvs checkout qnx or (if your CVSROOT variable is not set) cvs -d :ext:login@vehicle.me.berkeley.edu/:/home/c3uv/cvsroot checkout This will download the entire codebase (2) Write some code. (3) Commit your changes In the directory in which you are working cvs commit This will go through and compare your code to the repository code and upload any new files. Then it will ask you to write a log file. If you're using the plane computers, it will bring up vi. Type i to insert text. Write some text indicating your changes. Type esc to get to command mode Type :wq to save your changes and quit. (4) You're done. Examine your history now. cvs log anyfileyouchanged to look at the history. /////////////////////////////////////////////////////////////////////////// Troubleshooting ////////////////////////////////////////////////////////////////////////// (1) Can't login? Won't accept your password? Check to see if CVS/Root file exists and contains your login. ///////////////////////////////////////////////////////////////////////// Quick reference ///////////////////////////////////////////////////////////////////////// cvs checkout qnx : get the entire codebase cvs update : update your local version of the code cvs update -d : update, and add new files cvs commit : commit your code changes to the repository cvs add : add a file or directory to the repository vi commands: i insert text. esc escape to command mode :w From command mode, write file :q From command mode, quit ///////////////////////////////////////////////////////////////////////////// The long version //////////////////////////////////////////////////////////////////////////// CVS (Concurrent Versions System) is an application that maintains a database of code so that developers can check copies in and out. It tracks changes, merges files, finds conflicts and allows for easy updates. How: Currently we have a CVS server on vehicle.me.berkeley.edu. It is a complete version of the code as of the Demo. (What this really means is that its a complete version of the code I've written, but its probably missing lots of vision stuff.) The details. There are 4 main functions for a CVS client: checkout - get a complete copy of the module (code). (Download the entire codebase from the CVS server. This is what you start with) update - refresh an old copy of the module or file. (Download everything that has changed since your last checkout) add - add a file or directory to the module. (If you create a new file, and want it to be part of the distribution, you add it) commit - commit your changes to the module. (You've written some code, it works, you want it to be part of the main distribution) How to use these commands in linux/QNX. (CVS is installed on most linux/qnx systems, including the planes and vehicle. I'm sure there is a fancy Windows GUI out there somewhere). 1. set the variable CVS_RSH to ssh. You can do this in your ~/.bashrc or you can issue the command export CVS_RSH=ssh 2. set the variable CVSROOT to the following value. (again, in your ~/.bashrc or manually.) export CVSROOT=:ext:YOUR_USERNAME_HERE@vehicle.me.berkeley.edu:/home/c3uv/cvsroot This tells cvs where to find the cvsroot directory. 3. In the directory where you want to download the code, issue the command cvs checkout qnx qnx is the name of our module (the entire distribution). 4. write some code 5. Commit your code back to the module. Assuming I've changed something in the payload directory, issue the following command IN THE DIRECTORY YOU WANT TO COMMIT. cvs commit CVS will examine your changes, ask you to write a log file and commit your changes. 6. Play with other fun commands including diff, log and history. --- To update a module you checked out months ago. In the directory containing 'qnx' issue the command. cvs update qnx Note: cvs will only update directories and files that exist on your system. To get CVS to add new directories and files to your copy, use cvs update -d qnx or to update just one directory issue this command in that directory. cvs update -d To add a file or directory to the module cvs add file.c Note: at this point in time, it is not possible to add a directory and all the files inside. You must add each individually. The following command is useful cvs add *.c *.h *.sh Makefile The rules. There are just a few rules, following the rules will keep everyone happy, and keep me from beating you with a lead pipe. 1. Do NOT perform 'commit' operations on the whole module. Commit ONLY the directories that you are responsible for (i.e. Shiva - laneTrack, Jack - piccolo, payload, Tim- Tim vision) Yes, CVS makes backups, but its nicer to see that you are the only person that has made changes to your code. 2. Write good log files. Its common sense. 3. Under no circumstances are you to ssh/sftp into the vehicle account and mess with the CVS repository. This will break the repository. -Jack