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
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.
– p. 1/19
– p. 2/19
– p. 3/19
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
✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✓ ✓ ✓ ✓ ✓ ✓ ✔ ✔ ✔✕ ✕ ✖ ✖✍✗ ✗– p. 4/19
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
– p. 5/19
> 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
CVS: CVS: Committing in . CVS: −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− CVS: Enter Log. Lines beginning with ‘CVS:’ are removed automatically
– p. 6/19
> 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
file create
ChangeLog ChangeLog – p. 7/19
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
file A file B file C
– p. 8/19
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
– p. 9/19
– p. 10/19
> cvs update cvs update: Updating . U ChangeLog U README
– p. 11/19
> 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!
README hello.c Makefile 1.0 1.0 1.1 1.0 1.1 1.2 1.4 1.1
1.3
– p. 12/19
> 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
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
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
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
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
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
cvs −d repository−name checkout −r release−tag module−name examples: −D "13:45 1 December 1997" −D "5 days ago"
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
cvs −d repository = create a new repository init cvs tag −c [−b] tag cvs diff −r rev1 −r rev2 file
= 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