CVS

More information about cvs could be obtained from http://ximbiot.com/cvs/cvshome/

 

 

 

1. Starting Fresh

 

You've just installed Fedora, postgresql, and the java.tar. You haven't got the emp6 source tree on your system and so you want to fetch it online. "Online" means you@enterprise.cvs.sourceforge.net, the CVS server at SourceForge's.

You need to have the cvs command already installed along with the installation of Fedora Core. So be sure to tick the Development Tools package so that you have it.

[you@box:~]$ mkdir mycvs bin  -- makes two directories
[you@box:~]$ vi bin/cvs.sf -- makes use of the cvs command. Script it out yourself. Its only one line.
[you@box:~]$ cd mycvs
[you@box:~]$ cvs.sf co emp6 -- you'll be prompted for a password so enter it.

        [Wait for 100MB+ of data to download. Takes around 15 minutes on a good day]
        [Downloading means transfering the contents of the emp6/ from SourceForge's repository to your local subdirectory mycvs/emp6/ ]

When the "cvs.sf co" run is complete, you can immediately type ant to build-deploy the most recent emp6 source.

The usual checkout-code-test-checkin cycle
-------------------------------------------
Your (un)interesting life as a developer is made interesting by the need to coordinate with your fellow developers collaborating over the same repository that hold the source files of emp6. Coordination herein means not screwing things up, not undoing other peoples' hard work, and not incur unnecessary pain for me/you to clean up the bad files piece by piece.

Before checking out to refresh your local source tree, make sure your current directory is ~/mycvs/ and not ~/mycvs/emp6/ before you check out or you risk a fresh checkout under ~/mycvs/emp6/emp6/. From time to time if and when you accidentally execute " cvs.sf co emp6" under the wrong current working directory, hit CTRL-C at once and "rm -rf emp6".

The programmer's typical work cycle is illustrated in the following sequence of commands:

[Boot up PC and log in]

[you@box:~]$ cd mycvs
[you@box:~/mycvs]$ cvs.sf co emp6 -- this checkout run is like washing your face in the morning before starting your brand new day.
[you@box:~/mycvs]$ cd emp6
[you@box:~/mycvs/emp6]$ ant -- This is followed by jboss-stop followed by jboss-start.
You simply need to see if the refreshed source compiles and deploys properly.

[Edit, code, copy-paste, indent, outdent, nest, un-nest, fuk, un-fuk, comment-in, comment-out etc.]
[ant <whatever>, jboss-stop, jboss-start etc.]
[Repeat two steps above until you see the correct results]

[you@box:~/mycvs/emp6]$ rm -rf build -- so that your tarball can be kept lean.
[you@box:~/mycvs/emp6]$ cd ..
[you@box:~/mycvs]$ tar cvzf emp6-<yourname>-<today's date><nn>-<your remarks>.tar.gz emp6
[you@box:~/mycvs]$ cvs.sf co emp6 -- make sure you are under mycvs/ and not under mycvs/emp6/
[See the CVS messages.]
[you@box:~/mycvs]$ cd emp6
[you@box:~/mycvs/emp6]$ cvs.sf add <file1> <file2> <path>/<to>/file3 ... -- repeat for all the "?" entries you decide to add
[you@box:~/mycvs/emp6]$ cvs.sf commit




Understanding CVS messages
--------------------------
?  When files exist in your sandbox, but do not appear in cvs repository.
U  When the files in your repository are updated, or created, as you check out the files
M These files are modified by you, and is different from those in the repository
A  You have added the files to the repository, but have not committed it into the repository

 
 

Five Important Rules
--------------------
1. Never add and never commit before checking-out.
2. Never touch the CVS subdirectories lying everywhere under the emp6 source tree, never meddle with the three files Entries, Repository, Root contained under CVS/.
3. Always checkout before you start coding.
4. Checkout one more time when done with coding and prior to committing.
5. Good to tar-gzip your local copy of emp6 before checking out to protect against merging disasters that can potentially happen to your local source tree containing your recent work due to others' mishandling or messing up of the repository.



Quick way to add new files to the repository
--------------------------------------------

[you@box:~/mycvs/emp6]$ cd <some>/<where>/<onearth>
[you@box:~/mycvs/emp6/<some>/<where>/<onearth>]$ cvs.sf add <file1> ./<file2> <deep>/<underground>/<file>
[you@box:~/mycvs/emp6/<some>/<where>/<onearth>]$ cvs.sf commit --you'll only commit stuff under <onearth> and not stuff above it.

Usually you cd .. repeatedly all the way up to [you@box:~/mycvs/emp6]$ and then you commit everything under the emp6/ tree after adding. Like this:

[you@box:~/mycvs/emp6/<some>/<where>/<onearth>]$ cd ../../..
[you@box:~/mycvs/emp6]$ cvs.sf commit

[ copy the vi prompting screen]

Read and confirm the commit prompting screen. Type ":q" to exit the screen, and the (c) to commit or (a) to abort. Receive your karma so that you go to heaven later on :-p


Removing files from the repository
----------------------------------
[you@box:~/mycvs/emp6/<some>/<where>/<onearth>]$ cvs.sf rm <file1> ./<file2> <deep>/<underground>/<file>
[you@box:~/mycvs/emp6/<some>/<where>/<onearth>]$ cvs.sf commit