UsingLibrariesInCVS

Created by: Anonymous, Last modification: 26 Aug 2006 (19:29 UTC) by laetzer

Including 3rd party code in CVS


How merge to HEAD is done: Let's say we want to import the excellent database abstraction layer ADOdb version 4.60 into our CVS repository:

ADOdb:


<?php
  1
: $ wget http://phplens.com/lens/dl/adodb360.tgz
  
2: $ tar xvzf adodb360.tgz
  3
: $ rm adodb360.tgz
  4
: $ cd adodb
  5
: $ cvs import -'Imported ADOdb 4.60' _adodb PHPLENS_COM R4_60
  6
: $ cd ..
  
7: $ rm -fr adodb
?>


Now, we're going to check it out from CVS and fix a bug we found:


<?php
  1
: $ cvs checkout _adodb
  2
: $ cd _adodb
  3
: ...hackchopwhittle...
  
4: $ cvs commit -"Fixed bug #12345: Replace doesn't use native REPLACE command, if available"
  
5: $ cd ..
  
6: $ rm -fr _adodb
?>


Now, we want to upgrade to version 4.62:


<?php
  1
: $ wget http://phplens.com/lens/dl/adodb462.tgz
  
2: $ tar xvzf adodb462.tgz
  3
: $ rm adodb462.tgz
  4
: $ cd adodb
  5
: $ cvs import -'Imported ADOdb 4.62' _adodb PHPLENS_COM R4_62
?>


This command completed successfully, but reported the following:


<?php
  1
1 conflicts created by this import.
  
2: Use the following command to help the merge:
  
3cvs checkout --jR4_62 _adodb
?>


So, let's delete the imported directory ...


<?php
  1
: $ cd ..
  
2: $ rm -fr adodb
?>


... and checkout as instructed above


<?php
  1
: $ cvs checkout -jR4_60 -jR4_62 _adodb
  2
Manually resolve any conflicts that were reported
?>


Now, let's commit our 4.60 changes into 4.62:


<?php
  1
: $ cvs commit -'Merged our 4.60 changes into 4.62'
?>


And finally remove our directory:


<?php
  1
: $ rm -fr _adodb
?>