13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

192Chapter 8Know What You Have: CVSOnce a repository has been set up for use by a project, each developerwould check out a copy of the source. Thereafter, the typical sequence for adeveloper would be:1. Edit.2. Test.3. Commit.4. Go to step 1.In some organizati<strong>on</strong>s, developers will commit and then test. Others willwant to <strong>on</strong>ly commit changes that have been tested. Which order you chooseis a policy decisi<strong>on</strong> by your project, not mandated by CVS.TIPWe recommend that you test before committing because <strong>on</strong>ce you have committedyour changes, they become available to all others developers. The morepeople are working together <strong>on</strong> a project, the more important it is to keep thesource base workable, that is, clean compiling at least, so others can keepworking.Sometimes the developer needs to do an update step before a commit.Such a step is used to integrate other developers’ changes into this developer’ssource. Sometimes this goes smoothly; other times it needs someadditi<strong>on</strong>al work.A simple scenario might help explain these steps, too.Two developers, Ti and Kwan, are working <strong>on</strong> project Doh. They alreadyhave a repository set up with all the source for project Doh. Each developer,<strong>on</strong> his/her own system, checks out a copy of the source (cvs checkout doh).Now let’s say that part of the source is a Java class file called Account.javaand it has had several changes made already, so Account.java is now atversi<strong>on</strong> 1.7 in CVS.Let’s say that Ti finds a bug in Account.java and makes a change to fixthat problem. Ti checks in (commits) the changes to Account.java (cvscommit Account.java) so that the repository now c<strong>on</strong>tains Ti’s changes,which CVS keeps as versi<strong>on</strong> 1.8 of Account.java.All this time Kwan has been busy modifying Account.java (e.g., addinga new method). Remember that Kwan is working from the 1.7 versi<strong>on</strong>. When

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!