Tải bản đầy đủ (.pdf) (50 trang)

Version control

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.67 MB, 50 trang )

Version Control
Lecturer: Ngô Huy Biên

Books And Reading
There is no course textbook. Here are some useful books:
• Version Control with Subversion By Ben Collins-Sussman, Brian W.
Fitzpatrick, C. Michael Pilato, 2004
• Subversion Version Control: Using The Subversion Version Control
System in Development Projects By William Nagel, 2005
• Visual SourceSafe 2005 Software Configuration Management in
Practice By Alexandru Serban, 2007
• Essential CVS By Jennifer Vesperman, 2006
Working Together
 "Hey, Jane, could you send me a copy of those changes
you made last Tuesday?"
 "Bob, this function doesn't work anymore. Did you change

– "Sorry, I can't seem to find those old classes. I guess
you'll just have to re-implement them.“
 "Ok, we've all been working hard for the last week. Now
let's integrate everyone's work together."
Where did my code go?
Who overwrote my code?
Why did you overwrite my
code?
and
When was the last time we
backed up the code?
When did file X last
change?
What changed in the file?


Why was the file
changed?
and
Who changed the file?
The Repository
The repository stores information in the form of a filesystem
treea typical hierarchy of files and directories. Any number
of clients connect to the repository, and then read or write to
these files.
Typically server/client architecture.
Working Copy
Users work on a copy, the
Working Copy
The version control
system manages
the synchronization
between repository
and working copies
States
Unchanged, and current
Locally changed, and current
Unchanged, and out-of-date
Locally changed, and out-of-date
Workspaces
An area where users can work separated from the repository and to isolate
each user from the others.
Working folder
Working directory
Sandbox
View

Enlistment
Revision
The repository's
filesystem
Revisions
Revision Numbers
Revision Keywords
HEAD
BASE, COMMITTED, PREV
Revision Dates
{2009-03-19}
-02- 
Mixed Revision
Working Copies
Updates and Commits
are Separate
Global Revision Numbers
calc/Makefile:4
integer.c:4
button.c:4
calc/Makefile:4
integer.c:4
button.c:5
calc/Makefile:6
integer.c:6
button.c:6
Deltas
The difference between the two revisions is called a delta.
Forward Deltas
Reverse Deltas

CheckOut/Update
To get a resource from the repository with the
purpose of making changes to it
A patchfile is a special file that can be used
by the patch utility to update a set of files
from one revision to another.
Modify/Edit
To make changes to the resources in our
workspace
Check In/Commit
To save changes to the repository
Atomic commits ensures that
while one person is committing
changes to the repository, no
one else can.
A hook is a place to hang a
script, such that the script is
run at a specific stage of the
version control
processperhaps before or after
a change is committed, when a
log message is stored, or when
a file is checked out for
exclusive development.
Conflict
Lock  Modify  Unlock
Lock  Modify  Unlock (cont.)
Copy  Modify  Merge
Automatic merge
Manual merge

To combine changes of 2 working copies to one
working copy
Branch
A branch is a line of
development that exists
independently of another line.
Starting repository
layout
Repository with new copy
The branching of one file's history
A codeline represents a project's
development evolution across time, having a
continuous history.
Merging Branches
To integrate changes
performed in one
branch into another
branch.
Tag/Label
A tag (label) is
just a snapshot of
a project in time.
Exclusive Development
The version control system permits only one user at a time to work on any individual
file.
Simultaneous Development
Multiple users can work on the same file and the version control system attempts
to merge the respective changes seamlessly.
Central Repository
Central repository  The historic data about project changes is

stored in a single place.
Central
Repository
User
User
User
User
Data export – An
exported set of data
should not contain
administrative files or
data for the version
control system.
Distributed Repositories
Distributed Repositories  Each developer has a personal repository, and the
repositories update from their peers.
Repository
RepositoryRepository
User
User
User
Proxied Repositories
Proxied repositories  There is a central repository, which holds the changes
data, and proxy repositories, which are used for read requests and which refer
write requests to the central repository.
Central
Repository
Proxy
Repository
Proxy

Repository
Proxy
Repository
Proxy
Repository
User
User User
User
Remote Access To The Repository
Benefits
Any stored revision of a file can be retrieved,
viewed, and changed.
The differences between any two revisions can
be displayed.
Patches can be created automatically.
Multiple developers can work simultaneously on
the same project or file without overwriting one
another's changes.
The project can be branched to allow
simultaneous development along varied tracks.
These branches can be merged back into the main
line of development.
Distributed development is supported across
large or small networks.
Any version control
is better than no
version control.

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×