CVS Tutorial An Introduction to Using C VS Versions System - - PowerPoint PPT Presentation

cvs tutorial
SMART_READER_LITE
LIVE PREVIEW

CVS Tutorial An Introduction to Using C VS Versions System - - PowerPoint PPT Presentation

CVS Tutorial An Introduction to Using C VS Versions System Concurrent * history: when? why? * collaboration * examine old revisions * bugfix releases Steve Robbins p. 1/19 CVS Tutorial checkout Repository commit Workspace p.


slide-1
SLIDE 1

CVS Tutorial

C VS

Versions System * history: when? why? * examine old revisions * bugfix releases * collaboration

An Introduction to Using

Concurrent

Steve Robbins

– p. 1/19

slide-2
SLIDE 2

CVS Tutorial

Workspace Repository commit checkout

– p. 2/19

slide-3
SLIDE 3

CVS Tutorial

edit edit checkout commit commit

– p. 3/19

slide-4
SLIDE 4

CVS Tutorial

  • ✁✂
✂✄☎ ☎✆ ✝✞✟ ✟✠✡ ✡☛ ☞ ☞ ☞ ☞✍✌ ✌ ✌ ✌ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎✑✏ ✏ ✏ ✏ ✏ ✏

cvs checkout: Updating hello U hello/Makefile U hello/hello.c U hello/world.c U hello/world.h > cvs −d /software/examples checkout hello

✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✓ ✓ ✓ ✓ ✓ ✓ ✔ ✔ ✔✕ ✕ ✖ ✖✍✗ ✗

cvs checkout module−name −d repository−name

– p. 4/19

slide-5
SLIDE 5

CVS Tutorial

Entries Repository Root > ls CVS > cd hello > ls CVS Makefile hello.c world.c world.h > cd ~/src U hello/Makefile U hello/hello.c U hello/world.c U hello/world.h > cvs −d /software/examples checkout hello cvs checkout: Updating hello

checkout

– p. 5/19

slide-6
SLIDE 6

CVS Tutorial

> cvs commit cvs commit: Examining . /software/examples/hello/hello.c,v <−− hello.c Checking in hello.c; new revision: 1.2; previous revision: 1.1 done

$EDITOR $CVSEDITOR

commit

CVS: CVS: Committing in . CVS: −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− CVS: Enter Log. Lines beginning with ‘CVS:’ are removed automatically

– p. 6/19

slide-7
SLIDE 7

CVS Tutorial

> cvs commit cvs commit: Examining . RCS file: /software/examples/hello/README,v done initial revision: 1.1 done Checking in README; /software/examples/hello/README,v <−− README cvs add: use ’cvs commit’ to add this file permanently > cvs add README cvs add: scheduling file ‘README’ for addition Remove files: rm filename; cvs remove filename Rename files: remove then add

add commit

file create

ChangeLog ChangeLog – p. 7/19

slide-8
SLIDE 8

CVS Tutorial

1.1 1.2 1.2.2.1 1.1 1.1.2 1.3 1.1 1.2 1.3 1.1 1.2 1.3 1.4 1.1.3

file D file E

1.0 1.0 1.2 1.0.1 1.0 1.0 1.0

release−1_0 release−1_1 release−2_0

The Source Tree

file A file B file C

– p. 8/19

slide-9
SLIDE 9

CVS Tutorial

README hello.c Makefile 1.0 1.0 1.1 1.0 1.1 1.2 1.3 1.4

> cvs tag release−1_0 T Makefile cvs tag: Tagging . T README T hello.c

README 1.0

README hello.c Makefile 1.0 1.0 1.1 1.0 1.1 1.2 1.3 1.4

release−1_0

hello.c 1.4 Makefile 1.1

tag Moral: use cvs tag −c ...

– p. 9/19

slide-10
SLIDE 10

CVS Tutorial

checkout checkout You Developer X. Collaborative Development

– p. 10/19

slide-11
SLIDE 11

CVS Tutorial

commit update You Developer X.

> cvs update cvs update: Updating . U ChangeLog U README

– p. 11/19

slide-12
SLIDE 12

CVS Tutorial

> cvs commit cvs commit: Up−to−date check failed for ‘README’ cvs commit: Up−to−date check failed for ‘hello.c’ cvs commit: Examining . cvs [commit aborted]: correct above errors first!

Developer X. Moral: update before commit.

README hello.c Makefile 1.0 1.0 1.1 1.0 1.1 1.2 1.4 1.1

commit checkout

1.3

You

– p. 12/19

slide-13
SLIDE 13

CVS Tutorial

> cvs update cvs update: Updating . U ChangeLog M Makefile RCS file: /software/examples/hello/hello.c,v retrieving revision 1.5 retrieving revision 1.6 Merging differences between 1.5 and 1.6 into hello.c M hello.c ? hello

Update (revisited)

README Makefile 1.0 1.0 1.1 1.0 1.1 1.0 1.1 1.2 1.3 1.4 1.5 1.6 hello.cChangeLog 1.1 1.3 1.2

– p. 13/19

slide-14
SLIDE 14

CVS Tutorial

int main( int ac, char* av[] ) printf( "Hello, world.\n" ); } { fprintf( stderr, "usage ..." ); return 1; } int main( int ac, char* av[] ) { printf( "Hello, world.\n" ); } if ( ac != 1 ) { 1.10 1.9 hello.c int main( int ac, char* av[] ) printf( "Hello, world.\n" ); } { int main( int ac, char* av[] ) { printf( "Hello, world.\n" ); } int show_doom = 0; if ( ac > 1 && strcmp( av[1], "−d" ) == 0 ) show_doom = 1; if ( show_doom ) printf( "You have %f days until the " " millenium.\n", doom_days() );

> cvs update cvs update: Updating . RCS file: /software/examples/hello/hello.c,v retrieving revision 1.9 retrieving revision 1.10 Merging differences between 1.9 and 1.10 into hello.c rcsmerge: warning: conflicts during merge cvs update: conflicts found in hello.c C hello.c

commit You Developer X.

– p. 14/19

slide-15
SLIDE 15

CVS Tutorial

int main( int ac, char* av[] ) { printf( "Hello, world.\n" ); } int show_doom = 0; if ( ac > 1 && strcmp( av[1], "−d" ) == 0 ) show_doom = 1; if ( show_doom ) printf( "You have %f days until the " " millenium.\n", doom_days() );

revision 1.10

fprintf( stderr, "usage ..." ); return 1; }

Conflict Resolution

int main( int ac, char* av[] ) { if ( ac != 1 ) { fprintf( stderr, "usage: hello\n" ); return 1; } ======= int show_doom = 0; if ( ac > 1 && strcmp( av[1], "−d" ) == 0 ) show_doom = 1; >>>>>>> 1.10 printf( "Hello, world.\n" ); if ( show_doom ) printf( "You have %f days until the " <<<<<<< hello.c " millenium.\n", doom_days() ); }

hello.c after update

int main( int ac, char* av[] ) { if ( ac != 1 ) { printf( "Hello, world.\n" ); }

hello.c before update

– p. 15/19

slide-16
SLIDE 16

CVS Tutorial

Why Branch?

1.0 1.1 1.5 1.6 1.1 1.1 README Makefile hello.c 1.0 1.0 1.1 1.2 1.3 1.4 1.0 ChangeLog

release−1_0

– p. 16/19

slide-17
SLIDE 17

CVS Tutorial

release−3_4_1 release−3_5

2.4 3.6 2.5 2 . 3 2 . 4 3 . 7 2.5.1.1 3.6.1.1 2.5.1.2 1.1 1.0

release−3_4 release−3_4−fixes foo.c README Makefile hello.c

2.2.1.1 2.1.2

> cvs tag −b release−3_4−fixes cvs tag: Tagging . T README T Makefile T hello.c

– p. 17/19

slide-18
SLIDE 18

CVS Tutorial

cvs −d repository−name checkout −r release−tag module−name examples: −D "13:45 1 December 1997" −D "5 days ago"

checkout (revisited)

cvs −d repository−name checkout module−name cvs −d repository−name checkout module−name = latest revisions on HEAD branch (main trunk) = revisions selected by tag name = latest revisions on specified branch also: −D date −r branch−tag

– p. 18/19

slide-19
SLIDE 19

CVS Tutorial

cvs −d repository = create a new repository init cvs tag −c [−b] tag cvs diff −r rev1 −r rev2 file

Command Summary

= create a new module −d repository import release−tag module vendor−tag cvs update cvs −d repository checkout [−r tag] module [−r tag] cvs commit cvs remove cvs add file ... file ... cvs log cvs status cvs = list log messages, tags, etc = up−to−date, locally−modified, etc = difference between specified revisions

– p. 19/19