Tuesday, October 26, 2010

Subversion

Check-out (get) from command line:
c:\tmp> svn co svn://srv-svn/server/trunk/Documents --username mike
password?
Will have a SVN repository created in the current folder (c:\tmp)

From:
http://hgbook.red-bean.com/read/how-did-we-get-here.html

Has ability to let a user lock a file.

Prior to version 1.5, Subversion had no useful support for merges. At the time of writing, its merge tracking capability is new, and known to be complicated and buggy.

Because many Subversion commands must talk to the server and Subversion does not have useful replication facilities, server capacity and network bandwidth become bottlenecks for modestly large projects

Subversion doesn't store revision history on the client,
it is well suited to managing projects that deal with lots of large binary files. If you check in fifty revisions to an incompressible 10MB file, Subversion's client-side space usage stays constant The space used by any distributed SCM will grow rapidly in proportion to the number of revisions, because the differences between each revision are large.

Mercurial can import revision history from a Subversion repository. It can also export revision history to a Subversion repository. This makes it easy to “test the waters” and use Mercurial and Subversion in parallel before deciding to switch.


Setting up SVN Server
--------------------------
I used VisualSVNServer for Windows (runs as VisualSVN Server service)
which ?? is a wrapper around Apache http web server + Win GUI console:

httpd.conf:
-----------------
ServerRoot "C:/SVN"
ServerName "myserver.com:80"
PidFile "C:/SVN/Repositories/server.pid"
Listen "80

Provides nice Browser view and Basic Windows GUI.
Start / Stop VisualSVNServer will start / stop Apache Http server
-------------------------------------------
SVN comes with the server for svn protocol:
$ svnserve -d -r C:\SVN\Repositories
-d --deamon
-r --root (directory to serve)
(default port is 3690)

if dir structure is:
C:\SVN\Repositories
|
| - R2

you can do:
$ svn list svn://localhost/R2
$ svn list svn://localhost:3690/R2
branches/
tags/
trunk/
(if have the recommended folder structure)

And that's what you would put in as URL in GUI (e.g. Subclipse plug in)

============================================
Tools:
3-way comparison:
1. http://www.perforce.com/perforce/downloads/windowslist.html#ntx86
2. kdiff3

Client: Eclipse:
downloaded Subclipse plugin site package from C:\downloads\SVN-site-1.0.6 and installed from local site.
============================================
To play with the SVN config on Windows:

C:\Documents and Settings\\Application Data\Subversion
|
-- config


SVN_HOME=....
path \bin


# Create a repository:
$ svnadmin create c:\repo


Prepare a initial project for importing.
Create a folder structure for project (Suggested repository structure):

My_Project
|
|-branches
|-tags
|-trunk

Import the above skeleton to repository:
$ svn import My_Project file:///C:/SVN/Repositories/R2 -m "Init import"
or
$ svn import My_Project http://servername/svn/R2 -m "Init Import"

To start using (checkout / co):
$ svn checkout file:///C:/SVN/Repositories/R2/trunk my_project
Or
$ svn co http://localhost/svn/R2/trunk my_project

to create my_project folder with any subfolders in the current dir (where you execute svn command)

List the folders in a repository:
$ svn -v list file:///C:/SVN/Repositories/R1 (e.g /trunk)

You can lock and steal this lock. Nice.

No comments:

Post a Comment