Administration
  Home arrow Administration arrow Making Changes in the CVS
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ADMINISTRATION

Making Changes in the CVS
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-04-24

    Table of Contents:
  • Making Changes in the CVS
  • Updating Sandboxes
  • Adding Files
  • Removing Files
  • Exporting and Building Projects

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Route your faxes to your email inbox. Private, secure fax numbers available from CallWave. Choose your fax number.

    Making Changes in the CVS
    (Page 1 of 5 )

    In this conclusion to a three-part series on the Concurrent Versions System (CVS), you'll learn how to commit changes and add and remove files. This article is excerpted from chapter two of Essential CVS, Second Edition, written by Jennifer Vesperman (O'Reilly; ISBN: 0596527039). Copyright © 2007 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

    Committing Changes

    Changes to your sandbox files are not synchronized with the repository until you run the cvs commit command. This command is best run from the root directory of your sandbox, and it must be run from within the sandbox. 

    Commit to the repository frequently. Rules of thumb for when to commit include “every time the code compiles cleanly” and “every day before lunch and before you leave.” Speak to your project manager about the preferred working style, or read Chapter 7 for ideas.

    In programming projects with several developers, try to avoid committing code that doesn’t compile, unless your project manager tells you that your project is using a different working style.

    When you commit, CVS examines each directory and subdirectory under the current working directory. It searches for files that it is tracking that have changed, and commits all changes to the repository. See Example 2-12 for an example of committing files. Remember that the repository path is stored in the sandbox, so you don’t need to specify the path explicitly in your cvs commit command.

    Example 2-12. Committing files

    $ cd ~/cvs/example
    $ cvs commit
    cvs commit: Examining .

    If your repository is not on the local machine and your repository server doesn’t have your SSH public key, CVS asks for a password for the remote machine. If the server has the public key, your SSH client can use the private key to authenticate you. It’s much easier to use CVS if the server has the public key.

    Keeping a public key on the server is a security decision: it’s much more convenient to use CVS if you don’t have to keep typing in your password, but it also means that if an intruder has access to your shell, he can gain access to the data stored in the repository. I keep my desktop’s public key on the server, but not my laptop’s. It’s always possible that I’ll lose my laptop, so I don’t want it to have password-free access into our network. The desktop computer is a little bit harder to lose.

    SSH is a system of authentication and encryption that relies on a public key and a private key. Only you (or your sandbox computer) should ever know your private key. Anyone (or any computer) can be told your public key, which they use to encrypt messages specifically for you. Your SSH documentation should include instructions for making and storing your private and public keys.

    If any files have been changed, CVS opens an editor to allow you to record a change message. By default, the editor is vi, just as when importing a project. Chapter 3 gives instructions on changing your editor.

    I strongly recommend meaningful change notes. If you’re trying to do a rollback and all you have are messages that say “fixed a few bugs,” you won’t know which revision to roll back to. See Example 2-13 for an example of a good change note.

    Example 2-13. Enter a commit message

    Corrected bug #35. 'hello' was misspelled as 'helo'.
    CVS:----------------------------------------
    CVS: Enter Log. Lines beginning with 'CVS:' are removed automatically
    CVS:
    CVS: Committing in .
    CVS:
    CVS: Modified Files:
    CVS:  file1
    CVS:----------------------------------------

    After you exit the editor, CVS completes the commit, displaying messages similar to those in Example 2-14.

    Example 2-14. Completing the commit

    Checking in file1;
    /var/lib/cvsroot/example/file1,v <--  file1 new revision: 1.2; previous revision: 1.1 done

    Figure 2-7 shows the same commit in gCVS.

    If a revision in the repository is more recent than the revision the sandbox was based on, cvs commit fails. Use the cvs update command to merge the changed files; resolve the conflict as shown in the next section, “Updating Sandboxes,” then run cvs commit again. Example 2-15 shows the response to a failed commit.


    Figure 2-7.  Committing files in gCVS

    Example 2-15. Failed commit response

    cvs server: Up-to-date check failed for 'file2'
    cvs [server aborted]: correct above errors first!
    cvs commit: saving log message in /tmp/cvst7onmJ

    More Administration Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Essential CVS, Second Edition," published...
     

    Buy this book now. This article is excerpted from chapter two of Essential CVS, Second Edition, written by Jennifer Vesperman (O'Reilly; ISBN: 0596527039). Check it out today at your favorite bookstore. Buy this book now.

       

    ADMINISTRATION ARTICLES

    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems
    - More Hacks for the User Environment in BSD
    - Personalizing the User Environment in BSD
    - Customizing the User Environment in BSD

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway