Académique Documents
Professionnel Documents
Culture Documents
An Introduction to Using
C VS
Versions System
Concurrent
* history: when? why?
* collaboration * examine old revisions
* bugfix releases
checkout
Repository
commit
Workspace – p. 2/1
CVS Tutorial
checkout
commit commit
edit edit
– p. 3/1
CVS Tutorial
cvs −d repository−name checkout module−name
checkout
> cd hello
> ls
CVS Makefile hello.c world.c world.h
> ls CVS
Entries Repository Root
– p. 5/1
CVS Tutorial
CVS: −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
CVS: Enter Log. Lines beginning with ‘CVS:’ are removed automatically
CVS:
CVS: Committing in .
$CVSEDITOR
$EDITOR
Checking in hello.c;
/software/examples/hello/hello.c,v <−− hello.c
commit new revision: 1.2; previous revision: 1.1
done
– p. 6/1
CVS Tutorial
> cvs add README
cvs add: scheduling file ‘README’ for addition
cvs add: use ’cvs commit’ to add this file permanently
> cvs commit
cvs commit: Examining .
RCS file: /software/examples/hello/README,v
done
Checking in README;
/software/examples/hello/README,v <−− README
initial revision: 1.1
done
add commit
1.1.3
release−2_0
1.4
1.3
1.2
1.3
1.2
1.1.2
1.1
1.0.1
1.2.2.1
release−1_1
1.3
1.0
1.1
file C
1.2
1.2
1.1
1.1
release−1_0
1.0
1.0
1.0
1.0
1.4
1.2 1.3
1.1
README Makefile
1.1
1.0
1.0
1.1
tag
1.0
hello.c
1.0
1.4
README hello.c
Makefile
1.4
T Makefile
1.2 1.3
T README
T hello.c
1.1
1.1
1.0
1.0
1.0
README hello.c
checkout checkout
update commit
You Developer X.
> cvs update
cvs update: Updating .
U ChangeLog
– p. 11/1
U README
CVS Tutorial
> cvs commit
cvs commit: Examining .
cvs commit: Up−to−date check failed for ‘README’
cvs commit: Up−to−date check failed for ‘hello.c’
cvs [commit aborted]: correct above errors first!
1.4
1.1
commit
1.3
checkout
1.2
1.1
1.1
1.0
1.0
1.0
README hello.c
Makefile
You Developer X.
Moral: update before commit. – p. 12/1
CVS Tutorial
Update (revisited)
> 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
1.3
M hello.c
1.6
? hello
1.5
1.1
1.2
1.4
1.3
1.1
1.2
1.1
1.0
1.1
1.0
1.0
1.0
README ChangeLog
hello.c – p. 13/1
Makefile
CVS Tutorial
> 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
int main( int ac, char* av[] )
{
int show_doom = 0;
int main( int ac, char* av[] )
{ if ( ac > 1 && strcmp( av[1], "−d" ) == 0 )
if ( ac != 1 ) show_doom = 1;
{
fprintf( stderr, "usage ..." ); printf( "Hello, world.\n" );
return 1;
} if ( show_doom )
printf( "Hello, world.\n" ); printf( "You have %f days until the "
" millenium.\n", doom_days() );
} }
commit
1.10
int main( int ac, char* av[] ) int main( int ac, char* av[] )
1.9
{ {
printf( "Hello, world.\n" ); printf( "Hello, world.\n" );
} }
hello.c
int main( int ac, char* av[] ) int main( int ac, char* av[] )
{ {
if ( ac != 1 ) { int show_doom = 0;
fprintf( stderr, "usage ..." );
return 1; if ( ac > 1 && strcmp( av[1], "−d" ) == 0 )
} show_doom = 1;
printf( "Hello, world.\n" );
} printf( "Hello, world.\n" );
if ( show_doom )
hello.c before update printf( "You have %f days until the "
" millenium.\n", doom_days() );
}
revision 1.10
int main( int ac, char* av[] )
{
<<<<<<< hello.c
if ( ac != 1 ) {
fprintf( stderr, "usage: hello\n" );
return 1;
}
=======
int show_doom = 0;
>>>>>>> 1.10
printf( "Hello, world.\n" );
if ( show_doom )
printf( "You have %f days until the "
" millenium.\n", doom_days() );
}
– p. 15/1
hello.c after update
CVS Tutorial
Why Branch?
1.1
1.6
1.5
1.1
1.0
ChangeLog
1.4
release−1_0
1.3
1.1
1.0
1.2
1.1
1.0
1.0
– p. 16/1
README Makefile hello.c
CVS Tutorial
release−3_5
2.2.
1.1
3.7
1.1
1.0
2.4
2.5. 3.6.
1.2 1.1
foo.c
2.5.
1.1
2.3
rele
ase−
4_1
3_4
−fix
es
−3_
release−3_4
ase
rele
2.5
3.6
2.1.2
T README
T Makefile README Makefile hello.c
– p. 17/1
T hello.c
CVS Tutorial
checkout (revisited)
cvs −d repository−name checkout module−name
= latest revisions on HEAD branch (main trunk)
cvs log
= list log messages, tags, etc
cvs status
= up−to−date, locally−modified, etc