Using CVS via the Eclipse or WSAD CVS plugin
IMPORTANT! Before adding any WSAD projects to CVS, make sure
that you have named the directories correctly.
See the porting howto at http://admc.com/blaine/howtos.
Pay particular attention that the source directories should be named
source for Java projects, and JavaSource for Web projects.
Setup
BEFORE you check out or commit any project/module, go to
Windows / Preferences / Team and make the following settings.
- I recommend that you click the box
Use Incoming/Outgoing mode when synchronizing.
This is just a suggestion.
IMO, the default separate Incoming and Outgoing modes are confusing.
- Under CVS, set Default keyword substitution to
-kkv. FYI, this set the default substitution mode
for the individual server-side files of new files that you
you add from this workspace.
This does not effect retrievals because the WSAD CVS Plugin always
uses the default substitution mode that the CVS server has for the file.
- Under Ignored Resources repeatedly hit the ADD button to
add the following patterns
- classes
- bin
- *.class
- org
- ibm
These prevent storage of a bunch of unnecessary crap under SCM,
and results in significant speed increase for WSAD synchronizations.
These changes have to be made for every WSAD Workspace that you use.
(This is because these settings are saved in the workspace, and therefore
apply only to the current workspace).
Recommended Practices
The WSAD/Eclipse Team plugins follow the CVS convention that
- commit
- means upload changes TO repository
- update
- means download changes FROM repository.
- committing and updating
- In your J2EE navigator, select a super-set of all of the items that you wish
to commit and/or update.
These could be individual files and/or folders and/or WSAD projects containing
the files that you wish to commit/update.
Right-click and Team/Synchonize (either one).
Your synchronization window will list all suggested commits and updates.
Look it over carefully with particular attention to the icons which clearly
show the type of change.
Arrows to the right mean commits, arrows to the left mean updates.
In most cases, you will want to make all of the suggested changes.
In that case, select all of the top-level items in the syncro view, right-click
and select update, then the same but select commit.
If you add new resources, for some reason WSAD insists that you confirm you
are adding new files (even though you just confirmed the icons in the
synchro window which show file additions).
- Keyword expansion
- It is often very useful to code in keywords that will dynamically expand
to the appropriate value.
To see the CVS revision number right in your source file (like a .java or
a .xml file),
type
$Revision$ in the source file. When you commit
it, and upon all future checkouts and updates, $Revision$ will be replaced
with the appropriate revision number.
In Javadoc comments, keywords can save a lot of work, and
increase accuracy and consistency.
For your class Javadoc header, instead of typing in your name for Author,
the data and revision number, you cut and paste a boilerplate with the
appropriate keywords.
The available keywords are listed at
http://www.linuxselfhelp.com/gnu/cvs/html_chapter/cvs_17.html#SEC78.
Making a new CVS module for a WSAD project
To add a new WSAD project to CVS, you will add a new CVS module.
Be aware that you can not just right-click on the PVCS module and do
Team/Share....
We have restrictions in place so that you can only upload a project if a
CVS Administrator has created and set up the module directory on the CVS
server.
- Tell your CVS Administrator the name(s) of the project(s) to add.
- If you haven't already done so, set up the repository by opening
the CVS Repositories view (in the Repository perspective in WSAD),
right clicking in the left pane, and adding a New Repository Location.
Choose Connection Type of "extssh".
- Now in your main navigator, right click on an existing project and
select Team/Share. Use all defaults. Confirm that you
want to add even though the module appears to exist already.
Confirm that you want to add to the HEAD branch.
Checking out an existing CVS module
- If you already have a WSAD project with the name of the CVS
module, then remove it.
- In the CVS Repositories view, expand the HEAD for the
repository and select all of the desired CVS module(s)
(the top level nodes under HEAD).
- Right click on any of them and choose Check Out As Project.
- After checking out all of the projects that you need, you should go
to the main navigator, select every connected module (i.e.,
every module using CVS), syncronize then
Override and Update everything.
This is often necessary because during the Check Out As Project
process, WSAD often makes undesirable changes to your workspace
(we definitely don't want this, since what we want is to load exactly
what is stored in CVS).
Working with Branches
- Load up your repository like usual (see about New Repository
Location above).
Your goal is to list the desired branch identifier and CVS modules
under the Branches node in the view.
- In the CVS Repositories view, select any module (top-level
folder) under HEAD, which has the desired branch. Right-click and
Configure Branches and Versions.
- In the left top window, select any file containing the branch.
- In the right top window, click on the branch identifier.
- Click Add Checked Tags.
- Now the added branch(es) will have their own branches in the
CVS Repositories view under Branches.
(ALL modules will be added to the new branch. The plug-in is
not smart enough to add just those modules containing the given tag).
- Right click on the desired project in the CVS Repositories view,
but select the project from under the desired branch identifier
under Branches, not under HEAD.
Select Check Out As Project as usual.