RCS

C.L.U.E PRESENTATION

Dennis A. Dallas

October 11, 2005

REVISION CONTROL

Track changes

Restore prior versions

Merge changes

Maintain branches

Keep logs

STRUCTURE

WORKING DIRECTORY

RCS archive/repository

file1

file2

WORK FILES

file1,v

file2,v

CONCEPTS

Working directory – holds program(s) being edited

Repository – holds 'official' copies, changes, logs, etc. In libraries

Check in – puts program into library in repository

Check out – puts program into working directory from repository

CONCEPTS

Log – description of changes

Version – combination of release and revision number (and branch and revision numbers if any)

release.revision – 1.1

release.revision.branch.revision – 1.2.1.4

Branch – version that is an off shoot from main line

CONCEPTS

lock – only one person can edit [unlocked - can not be edited]

COMMANDS

rcs - administration commands

-i initialize library

-kb set up for binary files

-b sets default branch

-l lock or -u unlock

-on.n delete revision

ci check in

-rn.n specify revsion

-rn.n.n.n specify branch

COMMANDS

-l leaves an editable copy in working directory

-u leaves an uneditable copy in working directory

COMMANDS

co – check out

-rn.n specify revision

-l with lock

-jn.n:n.n join (i.e. merge changes)

-p print to screen

rlog – lists log

rcsdiff – lists differences

rcsmerge – combins changes

COMMANDS - MISC.

ci -sstring set status

ci -nstring set release.version name

co -sstring retrieve by status

co -rstring retreive by name

CREATE

$ rcs -i hw.pl OR

hw.pl

print “hello world \n”;

$ ci hw.pl

create library file RCS/hw.pl,y

perl program

program code

create &/or update library file

version 1.1

Created file and archive

FIRST REVISION

$ co -l hw.pl

#! /usr/bin/perl

print “hello ...

$ ci -l hw.pl

check out hw.pl with lock

new code

code

check in hw.pl; update library file RCS/hw.pl,y

version 1.2

log

CREATE BRANCH

#! /usr/bin/perl print “hello print “who are ... $name = <>; print “hi $name

$ ci -r1.2.1.1

updated code

create branch & update library file

version 1.2.1.1

remove lock

Revise Main program

$ co -l hw.pl

#! /usr/bin/perl print “hello ...	print “ I am bob

$ ci -l hw.pl

check out rev 1.2

revised main program

update library file(check in)

keep lock &hw.pl

Version 1.3

show differences

$ rcsdiff -r1.3 -r1.2.1.1 hw.pl

2,3c2,5

< print "hello world \n";

< print "I am bob \n";

---

> print "Who are you? \n";

> $name=<>;

> print "hello $name \n";

Merge Differences

$ co -l -r1.3 hw.pl

$ rcsmerge -r1.2 -r1.2.1.1 hw.pl

OR

$ co -l -r1.3 -j1.2:1.2.1.1 hw.pl

OR

$ co -l -j1.2:1.2.1.1 hw.pl

Merged File

#! /usr/bin/perl

print "hello world \n";

<<<<<<< hw.pl

print "my name is Bob\n";

=======

print "who are you? ";

$name = <>;

print "hello $name \n";

>>>>>>> 1.2.1.1

After Merge

edit out conflicts

$ ci -r2.1 hw.pl

remove conflicts

check in revised program as version 2.1

log

RCS file: RCS/hw.pl,v

Working file: hw.pl

head: 2.1

branch:

locks: strict

... deleted text ...

total revisions: 5;	selected revisions: 5

description:

start of hello world project

----------------------------

revision 2.1

date: 2005/09/15 22:07:36; author: kad; state: Exp; lines: +4 -0

production version

----------------------------

revision 1.3

date: 2005/09/14 19:02:49; author: kad; state: Exp; lines: +1 -0

added my name

----------------------------

revision 1.2

date: 2005/09/14 18:14:06; author: kad; state: Exp; lines: +1 -0

branches: 1.2.1;

added shebang

----------------------------

revision 1.1

date: 2005/09/14 18:08:41; author: kad; state: Exp;

Initial revision

----------------------------

revision 1.2.1.1

date: 2005/09/14 18:53:49; author: kad; state: Exp; lines: +3 -0

started branch to get user input

=============================================================================

revision 1.3

date: 2005/09/14 19:02:49; author: kad; state: Exp; lines: +1 -0

added my name

----------------------------

revision 1.2

date: 2005/09/14 18:14:06; author: kad; state: Exp; lines: +1 -0

branches: 1.2.1;

added shebang

----------------------------

revision 1.1

date: 2005/09/14 18:08:41; author: kad; state: Exp;

Initial revision

----------------------------

revision 1.2.1.1

date: 2005/09/14 18:53:49; author: kad; state: Exp; lines: +3 -0

started branch to get user input

===============================

RESOURCES

www.gnu.org/software/rcs/rcs.html

www.cs.purdue.edu/homes/trinkle/RCS

www.uvm.edu/~ashawley/rcs/rcs_handbook.html

http://freshmeat.net/projects/rcs/

THE END

geri dallas

2005-05-14T17:53:21

geri dallas