37 version control
TRANSCRIPT
-
8/2/2019 37 Version Control
1/16
30-Apr-12
Version Control
-
8/2/2019 37 Version Control
2/16
2
Why version control?
Scenario 1: Your program is working
You change just one thing
Your program breaks
You change it back
Your program is still broken--why?
Has this ever happened to you?
-
8/2/2019 37 Version Control
3/16
3
Why version control? (part 2)
Your program worked well enough yesterday
You made a lot of improvements last night...
...but you haven't gotten them to work yet
You need to turn in your program now
Has this ever happened to you?
-
8/2/2019 37 Version Control
4/16
4
Version control for teams
Scenario: You change one part of a program--it works
Your co-worker changes another part--it works
You put them together--it doesnt work
Some change in one part must have broken something in the
other part
What were all the changes?
-
8/2/2019 37 Version Control
5/16
5
Teams (part 2)
Scenario: You make a number of improvements to a class
Your co-worker makes a number ofdifferentimprovements
to the same class
How can you merge these changes?
-
8/2/2019 37 Version Control
6/16
6
difftools
There are a number of tools that help you spot changes(differences) between two files
Tools include diff, rcsdiff, jDiff, etc.
Of course, they won't help unless you kept a copy of theolder version
Differencing tools are useful for finding a small number
of differences in afew files
-
8/2/2019 37 Version Control
7/16
7
jDiff
jDiffis a plugin for the jEdit editor Advantages:
Everything is color coded
Uses synchronized scrolling It's inside an editor--you can make changes directly
Disadvantages:
Not stand-alone, but must be used within jDiff
Just a diff tool, not a complete solution
-
8/2/2019 37 Version Control
8/16
8
jDiff
-
8/2/2019 37 Version Control
9/16
9
Version control systems
A version control system (often called a source codecontrol system) does these things:
Keeps multiple (older and newer) versions of everything (not
just source code)
Requests comments regarding every change
Allows check in and check out of files so you know
which files someone else is working on
Displays differences between versions
-
8/2/2019 37 Version Control
10/16
10
sccs
sccs is Source Code Control System (UNIX) sccs keeps multiple versions of a complete directory
Storage requirements are small, because sccs:
keeps the original documents keeps the changes needed to go from one version to the next
generates any version when you ask for it
-
8/2/2019 37 Version Control
11/16
11
rcs
rcs is Revision Control System (also UNIX) rcs is like sccs, and does the same things, but
sccs keeps the originals, and applies changes to get to newer
versions
rcs keeps the current versions, and applies changes to get back
to older versions
(Opinion) You usually want to work with the newer
versions, so rcs is usually the better choice
-
8/2/2019 37 Version Control
12/16
12
rcs commands
Create a directory for your rcs files co -l file-- check out a file and lockit
Locking means you can check the file back in
ci file -- check in a revision (put file under rcs control) rcs -l file-- lock a file you already checked out
(Needed when you checked it out and forgot the-l)
rcsdifffiles-- report differences between files
merge files -- merges two files into original file
Not magic--you have to check the results
-
8/2/2019 37 Version Control
13/16
13
Who cares about UNIX?
CVS (Concurrent Versions System) is the most popularversion control system on Windows
CVS is built on top ofrcs
CVS is built into JBuilder and Eclipse There are two ways to run CVS on Windows 95/NT.
The first is as a client, talking to a CVS server on a
Unix box. This is the recommended setup and is
commonly used.-- http://www.cvshome.org/dev/codewindow.html
-
8/2/2019 37 Version Control
14/16
14
CVS commands
cvs checkout file cvs commit file
cvs difffile
These are CVS commands under UNIXPopular GUIson Windows:
tkCVS
jCVS
WinCVS
-
8/2/2019 37 Version Control
15/16
15
CVS home page
http://www.cvshome.org
-
8/2/2019 37 Version Control
16/16
16
The End