Transcript Document

IS2739: Subversion
Team
B
Outline
1. Version Control
2. Subversion vs. CVS
3. Demo
What is version control?
• Version control is the management of changes to
documents, programs, and other information stored as
computer files.
• Put it another way, track every change to every
document and identify the change with number, letter,
and time.
• Versions can be compared, restored, and with some
types of files, merged.
Why version control is needed
• Manage files and directories, and its changes over
time
• Collaboration and keep track of who made which
change.
What you cannot do without version control?
1. No need to notify other members before change the
project file.
2. No need to manually duplicate the original version before
change the project file.
3. No need to tell other members or remember what
changes you have made.
The Problem of File Sharing
All version control systems have to solve the same
fundamental problem : How will the system allow users
to share information, but prevent them from
accidentally stepping on each other's feet?
Lock-Modify-Unlock solution
• Repository allows only one person to change a file at a
time.
• Managed using Locks.
Problems:
• One by One
• No concurrency
• False sense of Security
• Administrative problems: lock a file and forget to unlock it
after finish.
When lock-modify-unlock is necessary?
Files with binary format like picture, sound and video
Lock-Modify-Unlock solution
Copy – Modify – Merge Solution
• Each client gets a working copy. Users work
simultaneously and independently on private copies.
Finally, copies are merged into a final version.
• Overlaps are flag as being in state of conflict
Problems
• Manually fix it.
• Communication
When copy-modify-merge is necessary?
Line-based text files can be contextually mergeable
Copy – Modify – Merge Solution
Track the change
1.Graphic demonstration
2.Color,number-highlight demonstration
3.Comparison demonstration
4.User-defined demonstration
Subversion Categories
1. You always see tags,trunk,branches in Subversion.These
are three different 'categories' for versions of the project.
2. Trunk is traditionally the cutting-edge version that is being
actively developed, a lot like CVS HEAD.
3. Branches are for alternative copies of your project. Allow
you to create as many bugs as you want. After you finish,
merge it into the trunk.
4. Tags are used for milestone releases.
Branch Cont.
1. Create branches by copying your data
2. Maintain parallel branches of your file and directory
3. Duplicate changes from one branch to another branch
4. Reflect differences among branches
Why Subversion over CVS
•
•
•
•
Can move or rename files or directories cleanly
Atomic commits
Good remote options http/https/svn vs pserver
File formats
Basic operations in subversion
svn
svn
svn
svn
svn
svn
svn
svn
svn
svn
svn
svn
--help
add filename/directory
delete filename/directory
checkout http://nodename/repos/svn/trunk/parentPath/path
commit --message "Message goes here." filename
diff filename
mkdir directory
import local-directory http://node/repos/svn/trunk/directory
log filename
merge file1@revJ file2@revK
status
update filename
Planning Your Repository
• Where and How? Local Server or Online Server,
backups.
o VisualSVN
o SVN Server
o Kenai
o Assembla
• File and Directory Organization :
o 1 Repository per Project or all Projects in one
Repository?
o Trunk , branches, tags
• Choosing Data Storage (Reliability, Accesibility,
Scalability, Performance)
o Berkely DB – database environment
o FSFS – flat files, custom format
Project Kenai
What is Project Kenai?
Project Kenai is Sun's connected developer destination,
where developers can host OPEN SOURCE projects, as
well as connect, communicate, and collaborate with
developers of like mind.
Cool features:
• Forums
• Wiki
• IM Chat
• Code Repository
• Netbeans integration
Demo for SVN Server&Client
1. Download CollabNet Subversion Server Package and Install
it
2. Create the repository folder(like D:/svnrepository) and select
it as the repository during install Subversion Server
(For binary file package. create subversion server manually
Command:
sc create svnserve binpath= "
\"C:\Program Files\Subversion\bin\svnserve.exe\"
--service --root c:\repos" displayname= "Subversion"
depend= tcpip start= auto)
3. Restart computer and server will start automaticlly
4. svnadmin create d:\svnrepository
Demo cont.
5. edit conf,passwd file in svnrepository :
o delete comment symbol and following space in
o anon-access, auth-access,passw-db in conf
o [users] in passwd
6. svn mkdir svn://localhost/myproject (server setup finish)
7. Install TortoiseSVN client
8. Create a project folder somewhere on your hard drive. Right
click in that folder and select "SVN Checkout..."
9. type svn://localhost/myproject/ for the repository URL and
click OK.
10.Create a new file in that directory. Right click the file and
select "TortoiseSVN, Add"
Demo cont.
11. The file hasn't actually been checked in yet. Subversion
batches any changes and commits them as one atomic
operation. To send all your changes to the server, right click
and select "SVN Commit"
12.You now have a networked Subversion server and client set
up on your machine.
References:
1. Setting up a Subversion Server under Windows
2.Practical guide to subversion on Windows with TortoiseSVN