Project Version Management with 
CVS 
Concurrent Versions System 
K.Bala Vignesh 
kbalavignesh@gmail.com 
Indian Linux Users Group ­Chennai 
Concurrent Versioning System Indian Linux Users Group­Chennai
Versioning Software – Why Bother? 
● Projects get messy 
● Unnecessary Duplication 
● Working with other developers is hard! 
● Difficult for comparison 
● No Revert Back 
Concurrent Versioning System Indian Linux Users Group­Chennai
The Goals of Version Management 
● Record Keeping 
– Any previous version available at any moment 
● Collaboration 
– Ease synchronization between developers 
Concurrent Versioning System Indian Linux Users Group­Chennai
History Of CVS 
"I created CVS to be able to cooperate with my 
students Erik Baalbergen and Maarten Waage on 
the ACK (Amsterdam Compiler Kit) C compiler. 
The three of us had vastly different schedules 
(one student was a steady 9­5 
worker, the other 
was irregular, and I could work on the project 
only in the evenings). Their project ran from July 
1984 to August 1985. CVS was initially called 
cmt, for the obvious reason that it allowed us to 
commit versions independently." 
— Dick Grune, Dick Grune's website 
Concurrent Versioning System Indian Linux Users Group­Chennai
Terminology 
Repository 
Commit 
Sand Box 
Update 
Sand Box 
First Time 
Sand Box 
Check Out 
Concurrent Versioning System Indian Linux Users Group­Chennai
The “Repository” 
Devi Local Version 
1.1 
Checkout 
Muthu Local Version 
1.1 
a.php Version 1.1 
<?php 
echo “Hello World”; 
?> 
Asha Local Version 
1.1 
Concurrent Versioning System Indian Linux Users Group­Chennai
Make Change and Commit 
The “Repository” 
I 
changed 
logic 
Devi Local Version 
1.2 
Commit 
Muthu Local Version 
1.1 
a.php Version 1.1 
<?php 
echo “Hello World”; 
echo “hi”; 
?> 
Asha Local Version 
1.1 
Concurrent Versioning System Indian Linux Users Group­Chennai
The “Repository” 
Devi Local Version 
1.2 
Update 
Muthu Local Version 
1.1 
I need 
Up to 
Update Date 
Asha Local Version 
1.2 
Concurrent Versioning System Indian Linux Users Group­Chennai
Commit and Conflict 
The “Repository” 
a.php Version 1.1 
<?php 
echo “Hello World”; 
echo “hi”; 
?> 
Devi Local Version 
1.2 
Muthu Local Version 
1.1 
I Changed 
Code. 
<?php 
print “Hello World”; 
?> 
Asha Local Version 
1.2 
Concurrent Versioning System Indian Linux Users Group­Chennai
Update and then Commit 
The “Repository” 
Devi Local Version 
1.2 
Commit 
Error 
Muthu Local Version 
1.1 
Old Version. 
So,Update First 
Asha Local Version 
1.2 
Concurrent Versioning System Indian Linux Users Group­Chennai
The “Repository” 
Devi Local Version 
1.2 
Conflicts 
Update 
Muthu Local Version 
1.1 
Asha Local Version 
1.2 
Concurrent Versioning System Indian Linux Users Group­Chennai
Conflicts 
a.php Version 1.1 a.php Version 1.2 
<?php 
echo “Hello World”; 
?> 
<?php 
echo “Hello World”; 
echo “hi”; 
?> 
<?php 
print “Hello World”; 
?> 
a.php Version 1.1 
<?php 
echo “Hello World”; 
?> 
Update 
Conflicts 
<?php 
<<<<<a.php 
print “Hello World”; 
======= 
Echo “Hello World”; 
echo “hi”; 
>>>>>>1.2 
?> 
a.php Version 1.3 
<?php 
print “Hello World”; 
echo “hi”; 
?> 
Concurrent Versioning System Indian Linux Users Group­Chennai
Conflicts Corrected 
The “Repository” 
Devi Local Version 
1.2 
Commit 
Muthu Local Version 
1.3 
a.php Version 1.3 
<?php 
print “Hello World”; 
echo “hi”; 
?> 
Asha Local Version 
1.2 
Concurrent Versioning System Indian Linux Users Group­Chennai
Other Features 
• Creating snapshot using Tags. 
• Creating branches of the project. 
• Pserver for remote Client­Server. 
• Finding out who did what (Log messages) 
• Revert back to any position. 
• Watching the files. 
Concurrent Versioning System Indian Linux Users Group­Chennai
CVS and OS Support 
● Relatively simple 
● Available on a wide number of platforms 
● Clients 
– Most Linux distributions come with CLI client 
– Available for Mac & Win32, CLI & GUI 
● Server 
– Linux CLI program is the server 
– Win32 server available 
Concurrent Versioning System Indian Linux Users Group­Chennai
● Linux 
CVS Server 
– Generally comes with your distribution 
● Windows 
– CVSNT ­http:// 
cvsnt.org 
● Mac OS X 
– Comes with the free developer tools 
Concurrent Versioning System Indian Linux Users Group­Chennai
GUI CVS Client 
● Free 
pcl­cvs 
­An 
Emacs Interface To CVS 
Cervisia – With KDE Desktop 
WinCVS ­http:// 
www.wincvs.org/ 
MacCVS ­http:// 
www.wincvs.org/downloads.html 
TortoiseCVS ­http:// 
www.tortoisecvs.org/ 
Eclipse ­http:// 
eclipse.org 
● Commerical 
SmartCVS ­http:// 
smartcvs.com 
Concurrent Versioning System Indian Linux Users Group­Chennai
CVS and Open Source 
• CVS and SSH clients are used by most 
developers on SourceForge.net 
and freshmeat. 
• Most of the projects in opensource are 
maintained by CVS. 
Concurrent Versioning System Indian Linux Users Group­Chennai
CVS Resources 
● CVS Home ­http:// 
ximbiot.com/cvs/cvshome/ 
● Web Site Projects with CVS ­http:// 
www.durak.org/cvswebsites/howto­cvs/ 
● Open Source Development with CVS ­http:// 
cvsbook.red­bean. 
com/ 
Concurrent Versioning System Indian Linux Users Group­Chennai
Advantages over CVS 
SubVersion 
• Atomic commits. Interrupted commit operations do not cause repository 
inconsistency or corruption. 
• Renamed/copied/removed files retain full revision history. 
• Native support for binary files, with space­efficient 
binary­diff 
storage. 
• Directories are versioned. Entire directory trees can be moved around 
and/or copied very quickly, and retain full revision history. 
• Constant time branching and tagging. 
• Optimized repository accesses. This reduces unnecessary network traffic to 
the repository host. 
Concurrent Versioning System Indian Linux Users Group­Chennai

Version Management with CVS

  • 1.
    Project Version Managementwith CVS Concurrent Versions System K.Bala Vignesh kbalavignesh@gmail.com Indian Linux Users Group ­Chennai Concurrent Versioning System Indian Linux Users Group­Chennai
  • 2.
    Versioning Software –Why Bother? ● Projects get messy ● Unnecessary Duplication ● Working with other developers is hard! ● Difficult for comparison ● No Revert Back Concurrent Versioning System Indian Linux Users Group­Chennai
  • 3.
    The Goals ofVersion Management ● Record Keeping – Any previous version available at any moment ● Collaboration – Ease synchronization between developers Concurrent Versioning System Indian Linux Users Group­Chennai
  • 4.
    History Of CVS "I created CVS to be able to cooperate with my students Erik Baalbergen and Maarten Waage on the ACK (Amsterdam Compiler Kit) C compiler. The three of us had vastly different schedules (one student was a steady 9­5 worker, the other was irregular, and I could work on the project only in the evenings). Their project ran from July 1984 to August 1985. CVS was initially called cmt, for the obvious reason that it allowed us to commit versions independently." — Dick Grune, Dick Grune's website Concurrent Versioning System Indian Linux Users Group­Chennai
  • 5.
    Terminology Repository Commit Sand Box Update Sand Box First Time Sand Box Check Out Concurrent Versioning System Indian Linux Users Group­Chennai
  • 6.
    The “Repository” DeviLocal Version 1.1 Checkout Muthu Local Version 1.1 a.php Version 1.1 <?php echo “Hello World”; ?> Asha Local Version 1.1 Concurrent Versioning System Indian Linux Users Group­Chennai
  • 7.
    Make Change andCommit The “Repository” I changed logic Devi Local Version 1.2 Commit Muthu Local Version 1.1 a.php Version 1.1 <?php echo “Hello World”; echo “hi”; ?> Asha Local Version 1.1 Concurrent Versioning System Indian Linux Users Group­Chennai
  • 8.
    The “Repository” DeviLocal Version 1.2 Update Muthu Local Version 1.1 I need Up to Update Date Asha Local Version 1.2 Concurrent Versioning System Indian Linux Users Group­Chennai
  • 9.
    Commit and Conflict The “Repository” a.php Version 1.1 <?php echo “Hello World”; echo “hi”; ?> Devi Local Version 1.2 Muthu Local Version 1.1 I Changed Code. <?php print “Hello World”; ?> Asha Local Version 1.2 Concurrent Versioning System Indian Linux Users Group­Chennai
  • 10.
    Update and thenCommit The “Repository” Devi Local Version 1.2 Commit Error Muthu Local Version 1.1 Old Version. So,Update First Asha Local Version 1.2 Concurrent Versioning System Indian Linux Users Group­Chennai
  • 11.
    The “Repository” DeviLocal Version 1.2 Conflicts Update Muthu Local Version 1.1 Asha Local Version 1.2 Concurrent Versioning System Indian Linux Users Group­Chennai
  • 12.
    Conflicts a.php Version1.1 a.php Version 1.2 <?php echo “Hello World”; ?> <?php echo “Hello World”; echo “hi”; ?> <?php print “Hello World”; ?> a.php Version 1.1 <?php echo “Hello World”; ?> Update Conflicts <?php <<<<<a.php print “Hello World”; ======= Echo “Hello World”; echo “hi”; >>>>>>1.2 ?> a.php Version 1.3 <?php print “Hello World”; echo “hi”; ?> Concurrent Versioning System Indian Linux Users Group­Chennai
  • 13.
    Conflicts Corrected The“Repository” Devi Local Version 1.2 Commit Muthu Local Version 1.3 a.php Version 1.3 <?php print “Hello World”; echo “hi”; ?> Asha Local Version 1.2 Concurrent Versioning System Indian Linux Users Group­Chennai
  • 14.
    Other Features •Creating snapshot using Tags. • Creating branches of the project. • Pserver for remote Client­Server. • Finding out who did what (Log messages) • Revert back to any position. • Watching the files. Concurrent Versioning System Indian Linux Users Group­Chennai
  • 15.
    CVS and OSSupport ● Relatively simple ● Available on a wide number of platforms ● Clients – Most Linux distributions come with CLI client – Available for Mac & Win32, CLI & GUI ● Server – Linux CLI program is the server – Win32 server available Concurrent Versioning System Indian Linux Users Group­Chennai
  • 16.
    ● Linux CVSServer – Generally comes with your distribution ● Windows – CVSNT ­http:// cvsnt.org ● Mac OS X – Comes with the free developer tools Concurrent Versioning System Indian Linux Users Group­Chennai
  • 17.
    GUI CVS Client ● Free pcl­cvs ­An Emacs Interface To CVS Cervisia – With KDE Desktop WinCVS ­http:// www.wincvs.org/ MacCVS ­http:// www.wincvs.org/downloads.html TortoiseCVS ­http:// www.tortoisecvs.org/ Eclipse ­http:// eclipse.org ● Commerical SmartCVS ­http:// smartcvs.com Concurrent Versioning System Indian Linux Users Group­Chennai
  • 18.
    CVS and OpenSource • CVS and SSH clients are used by most developers on SourceForge.net and freshmeat. • Most of the projects in opensource are maintained by CVS. Concurrent Versioning System Indian Linux Users Group­Chennai
  • 19.
    CVS Resources ●CVS Home ­http:// ximbiot.com/cvs/cvshome/ ● Web Site Projects with CVS ­http:// www.durak.org/cvswebsites/howto­cvs/ ● Open Source Development with CVS ­http:// cvsbook.red­bean. com/ Concurrent Versioning System Indian Linux Users Group­Chennai
  • 20.
    Advantages over CVS SubVersion • Atomic commits. Interrupted commit operations do not cause repository inconsistency or corruption. • Renamed/copied/removed files retain full revision history. • Native support for binary files, with space­efficient binary­diff storage. • Directories are versioned. Entire directory trees can be moved around and/or copied very quickly, and retain full revision history. • Constant time branching and tagging. • Optimized repository accesses. This reduces unnecessary network traffic to the repository host. Concurrent Versioning System Indian Linux Users Group­Chennai