Graphic illustration of CVS
Below is an attempt to illustrate the functionality of the CVS system graphically.
The repository was set up with three files, A, B and C. Over time the files were edited (revisions 1, 2, etc.). Also over time, the trunk (main or head) was tagged at various points of time (tags 1.0, 1.1, etc.).
Also over time, branches x, y, etc., were created. Branches x and z were tagged at one point of time. A new file, D, was added to branch x. File A was edited separately for branch z (revisions 2.1 and 2.2).
The time-line for this simple scenario, extended a bit in to the future, will look like this:
Feb Mar Apr May Jun Jul Aug Sep Oct Nov
.|.....|.....|.....|.....|.....|.....|.....|.....|.....|.
|
today
Files & revisions over time:
A 1..............2....................3..........4..........
only for branch z 2.1......2.2..............
B 1.........2....................................3......4...
C 1.........2..............3..........4..........5.........6
D later added to branch x 1.................2.....
Total files in repository: twelve
|
000000000000000000000000000000000000 |
3333333333555556666666666777777788991111111111111111111111
| 1111122222255555667778
|
three
Branching over time:
0.1
tag /--+------------------------> x
1.0 1.1 / 1.2
head +----------+--\------------/-------------+---------------> main
\
\---------------\------------------------> y
\ 0.1
\---+------------------> zIf one were to check-out the repository (download) 'today' (as indicated on the time-line), the files & revisions obtained would be as shown below. Note that tags are like persisting time-stamps. Also, the CVS system does not actually keep different versions of files; in stead, it stores the revision changes.
Branch Tag File A File B File C File D
head - 4 3 5 -
head 1.0 1 1 1 -
head 1.2 3 2 4 -
x - 4 3 5 2
x 0.1 2 2 3 -
z - 2.2 3 5 -
z 0.1 2.1 3 5 -Below are some of the CVS commands used over time.
Jan: Initial deposit of files (from folder my_folder) to the repository (to folder named my_module)
cvs co -l contributions/modules
cp -r my_folder my_module
cd my_folder
cvs add A
cvs add B
cvs add C
cvs commit -m "Initial deposit"
Mar: Edited files B and C
cvs co contributions/modules/my_module
cd my_folder
cvs update
cvs commit -m "a note" B
cvs commit -m "another note" C
Apr: Creating branch y
cvs co contributions/modules/my_module
cd my_folder
cvs update
cvs tag -b y my_module
Aug: Tagging branch z with tag 0.1
cvs co -r z contributions/modules/my_module
cd my_folder
cvs update -dP -r z
cvs tag 0.1