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.

8.2 Source C<strong>on</strong>trol: Whys and Hows195which will prompt you for a password. Having logged in <strong>on</strong>ce, you will notneed to log in again, even after reboots of your system, as CVS keeps thepassword (by default; it can be changed) in a file called .cvspass in your homedirectory. This makes using CVS with a remote repository (<strong>on</strong>ce you’ve loggedin as simple as if the repository were local). From here <strong>on</strong>, the commands willall look the same. If your repository is remote, CVS will use the password fromyour .cvspass file, without asking you for it.8.2.2 ImportAre you wanting to use CVS <strong>on</strong> an existing project? Have you already got yourproject at least partly underway? Let’s look at how to enter all those files intoCVS with a single command.Not every file that is in a working directory needs to be kept under sourcec<strong>on</strong>trol. Some, like .class files, are created from the .java source files. Othersmay be just scratch files that you d<strong>on</strong>’t want to keep versi<strong>on</strong>ed.To automatically exclude certain files from ever being included in yourrepository, CVS uses a file called .cvsignore that lists filename patterns. Anyfilename matching a pattern will be ignored by all CVS commands.Here is a .cvsignore file that we recommend for Java developers:*.zip*.classThis will exclude any file whose name ends in .class or .zip. Note thatthe comparis<strong>on</strong> is strictly based <strong>on</strong> a name, not the actual c<strong>on</strong>tents. CVSdoesn’t know what a “class” file is; it is <strong>on</strong>ly excluding a file based <strong>on</strong> its name.Certain files are not really source files and can’t be managed as such, butwe would still like to keep versi<strong>on</strong>s and a history of changes for them. A goodexample would be an image file. For example, you may have a corporate logoin a file called logo.jpg and at some point you may get a new or revised versi<strong>on</strong>of that file. You can use CVS to track such files, but you need to tell CVSthat this is a binary file, so that CVS doesn’t try to do some special substituti<strong>on</strong>sthat it does <strong>on</strong> check-in and check-out. (More about those substituti<strong>on</strong>s later.)For now, let’s just c<strong>on</strong>sider how to tell CVS which files are binary. We cando that <strong>on</strong> the command line when we create a new file, but for importing alot of files at <strong>on</strong>ce, and to avoid the need to remember doing that each time weadd a file, we can put patterns for binary filenames in a CVS file called.cvswrappers.

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

Saved successfully!

Ooh no, something went wrong!