160 likes | 297 Views
Versioning Systems. Has one of your projects ever looked like this ?. Working alone : Probably manageable Working in a group : Good luck!. Versioning Systems: Ways of avoiding a repository “mess”. Versioning Systems allow: To store one master copy of the source code
E N D
Versioning Systems Has one of your projects ever looked like this ? Working alone : Probably manageable Working in a group : Good luck!
Versioning Systems: Ways of avoiding a repository “mess” • Versioning Systems allow: • To store one master copy of the source code • multiple users to modify the same code • automated updates between versions • Access to any previous state of the source code
Facilitates bug detection when software is modified Economy in disk space while saving versions Prevents code over-writing in a team project Not a build system Not a substitute for communication between developers or for management No change control available CVS do’s and dont’s ……
DISCOVER example session : Variables • Setting up variables: • CVS_RSH : What remote shell to use • CVSROOT : Tells where the repository is • Example: • sh/ksh “export CVS_RSH=ssh” • csh “setenv CVS_RSH ssh” • sh/ksh “export CVSROOT=/caip/u2/DevGroup/cvsroot/” • csh “setenv CVSROOT /caip/u2/DevGroup/cvsroot”
DISCOVER example session : Getting the source code • Get to a working directory on local computer (cd ~/work/) • cvs checkout DISCOVER/Client/java or • cvs co DISCOVER/Client/java • Will download all source files into the current directory. • Similarly using Module name Client: • cvs co Client
DISCOVER example session : Committing a change • Checking file in repository • cvs commit <file1>,<file2>,… • If no filename is given all files are scanned by CVS and all modified files are committed.
DISCOVER example session : Adding a file • To add a file or directory to be checked by CVS • cvs add <file1>,<file2>,… • cvs commit • To add an entire directory of source files • cvs import <repository> <vtag> <rtag> • repository is the directory name in the repository • vtag is a vendor tag –for entire branch 1.1.1 • rtag is a release tag
DISCOVER example session : removing a file • Local file needs to be deleted and then removed from the repository • rm <file1>,<file2>,… • cvs remove <file1>,<file2>,… • cvs commit
Branches • Tag – symbolic name for revision of file • ‘-v’ flag in status : see tags and rev. nos. • Tag all files at strategic points – release • ‘-r’ flag in checkout : checkout a rev. no. • Need for branches : good for bug-fixing • Put modified code in branch and later merge with main trunk
DISCOVER example session : branching out • Create your independent branch (harmless to the main trunck) • cvs –b –r release1-0 release1-0-patch SRC • Merging a branch back to the main trunck • cvs –j <branchname>
Modules • modules are alias names to projects kept in the repository. • More convenient to call a module name rather than a long pathname Example: If repository is in /home/cvsroot/Project_AX/Client/Synchronous/withLimit A module could declare this simply as “Client”
Defining the module • Get working copy of ‘modules’ file • Edit file to define new module • Commit changes to ‘modules’ file • Release the working copy • Eg - $ cvs checkout CVSROOT/modules new line : newdir newcode/newdir $ cvs commit –m “Added module” modules $ cvs release –d modules
cvs Status • Status : gives the state of the file • Up-to-date : latest revision • Locally modified : not committed changes • Locally added : added but not committed • Locally removed : removed, not committed • Needs checkout, Needs merge • Unresolved Conflict – update conflict • Unknown
Tracking mechanisms • cvs watchinfo to inform other about commits • cvs watch on/off – places watch on files : working copies created as read-only • cvs watch add/remove – CVS notification • cvs edit/unedit : edit/abandon watched files • cvs watchers/editors : list of users watching changes or working on files
Links GNU’s site on CVS: http://www.gnu.org/manual/cvs/html_chapter/cvs_20.html CVS Man page: http://hoth.stsci.edu/man/man1/cvs.html