Concurrent Version System CVS Doris Lee http pyre

  • Slides: 16
Download presentation
Concurrent Version System (CVS) Doris Lee http: //pyre. third-bit. com/gforge/presentations/cvs. ppt Email : ywlee@pyre.

Concurrent Version System (CVS) Doris Lee http: //pyre. third-bit. com/gforge/presentations/cvs. ppt Email : ywlee@pyre. third-bit. com 11/1/2020 1

Agenda • • • 11/1/2020 Introduction Useful Commands Tagging and Branching Case Studies Do

Agenda • • • 11/1/2020 Introduction Useful Commands Tagging and Branching Case Studies Do and Don’t 2

What is CVS? Ø Dominant version control system Ø Time machine Why we need

What is CVS? Ø Dominant version control system Ø Time machine Why we need CVS? Ø Create a repository Ø To coordinate code 11/1/2020 3

Introduction • Setup : download software and set the environment variables Ø CVSROOT Ø

Introduction • Setup : download software and set the environment variables Ø CVSROOT Ø CVS_RSH • Files in the repository Ø All program source files Ø All non-code project artifacts Ø Exclude files that can be reconstituted easily 11/1/2020 4

Introduction (Cont’d) • Keyword e. g. $Author$, $Name$, $Date$ – $Author$ $Author : ywlee$

Introduction (Cont’d) • Keyword e. g. $Author$, $Name$, $Date$ – $Author$ $Author : ywlee$ • Created “CVS” Subdirectory 11/1/2020 5

Useful Commands Command Usage: cvs [cvs-options] command [command-options-and-arguments] Øcheckout Øadd Øupdate Øcommit Ødiff Ølog

Useful Commands Command Usage: cvs [cvs-options] command [command-options-and-arguments] Øcheckout Øadd Øupdate Øcommit Ødiff Ølog 11/1/2020 - retrieve file(s) - add file(s) to repository - download changes - upload changes - view differences - display log info 6

Note Ø Binary file “cvs add Text. File” vs “cvs add -kb Binary. File”

Note Ø Binary file “cvs add Text. File” vs “cvs add -kb Binary. File” Ø NO way to delete directories in CVS ! Ø Sticky Bit - when checkout old version of file – impact : can’t overwrite current version at repository 11/1/2020 7

Tagging • Marking a group of file revisions cvs tag Rel_1_beta File 1. java

Tagging • Marking a group of file revisions cvs tag Rel_1_beta File 1. java File 2. java File 3. java Ver 1. 1 Ver 1. 2 : Ver 1. 2 Ver 1. 3 Ver 2. 1 Ver 2. 2 11/1/2020 8

Branching • Branch : a fork of the repository Ø experimental work, release, or

Branching • Branch : a fork of the repository Ø experimental work, release, or bug fixing cvs rtag –b BR_1 project. Name 2. 6. 2. 1 BR_1 Trunk 2. 5 11/1/2020 2. 6 2. 7 2. 8 9

Case Study (1) 2 4 cvs update cvs commit Test. java revision 1. 1

Case Study (1) 2 4 cvs update cvs commit Test. java revision 1. 1 Þif: (amount > 10) { Total+=amount; } - new revision: 1. 2 : done 1 - Merging differences between 1. 1 and 1. 2 into Test. java cvs update cvs commit Test. java revision 1. 1 : Total+=amount; : Þ Total++; 3 - new revision: 1. 3 done 11/1/2020 Alan Mary 10

Case Study (2) 2 cvs update cvs commit Test. java revision 1. 1 :

Case Study (2) 2 cvs update cvs commit Test. java revision 1. 1 : Total+=amount; Total+=tax; - new revision: 1. 2 : done - Merging differences between 1. 1 and 1. 2 into Test. java - rcsmerge: warning: conflicts during merge - cvs update: conflicts found 11/1/2020 1 Alan 4 cvs update Test. java revision 1. 1 : Total+=amount; Total+=subtotal; : 3 Mary 11

Case Study (2) (cont’d) • Resolve conflicts by communications, and • I) if the

Case Study (2) (cont’d) • Resolve conflicts by communications, and • I) if the repository is the correct one, – Remove local copy and do update • II) if different codes are preferred, – Edit the code <<<<<< Test. java Total+=subtotal; ===== Total+=tax; >>>>>> • III) cvs commit 11/1/2020 12

Case Study (3) Test. txt(repository) Blue Yellow Orange Test. txt(sandbox) ! ! ! Blue

Case Study (3) Test. txt(repository) Blue Yellow Orange Test. txt(sandbox) ! ! ! Blue Yellow Orange Ø cvs diff Ø Why? Tab and Spaces are different in CVS! 11/1/2020 13

Do and Don’t • Do Ø Enter meaningful comments Ø Check in only when

Do and Don’t • Do Ø Enter meaningful comments Ø Check in only when files are stable Ø “cvs update” before “cvs commit” • Don’t Ø Change files in the ‘CVS’ subdirectory Ø Change or create files in repository directly Ø Change layout of a shared file 11/1/2020 14

References • Books : – Pragmatic Version Control Using CVS by David Thomas –

References • Books : – Pragmatic Version Control Using CVS by David Thomas – Essential CVS by Jennifer Vesperman • Online : – http: //www. cvshome. org/docs/manual/ – CSC 207, CSC 408 websites – man pages 11/1/2020 15

Question and Answer 11/1/2020 16

Question and Answer 11/1/2020 16