Difference between revisions of "Short Notes on SVN"

From PaskvilWiki
Jump to: navigation, search
(Created page with "=== Simple Guide to SVN Client === Bullets on how to use SVN client. === Creating a SVN Repository === How to create a new SVN repository to serve using <tt>svnserve<...")
 
 
Line 7: Line 7:
 
=== [[Moving a SVN Repository]] ===
 
=== [[Moving a SVN Repository]] ===
 
Moving complete SVN repository from one host to another.
 
Moving complete SVN repository from one host to another.
 +
 +
=== Change Repository URL (Subversion 1.7+) ===
 +
 +
Few days ago I've migrated among servers, and along the way had to rename the user used via ssh to serve SVN.
 +
 +
The problem - URL of all repositories has changed. It's either endless <tt>diff</tt>, <tt>checkout</tt>, <tt>patch</tt>, or ... dig into the SVN checkout and edit the repo URL!
 +
 +
Pre-1.7 this was pure horror, as the URL was in every ''.svn/entries'' file in every folder. Twice. So, you had to pretty much do your <tt>awk</tt> magic on <tt>find</tt> results.
 +
 +
Subversion 1.7 introduced something magical - centralized metadata in SQLite DB.
 +
 +
Now, to change ''old_url'' to ''new_url'' simply go to the root of your checkout, and
 +
--- open the metadata DB
 +
$ sqlite3 .svn/wc.db
 +
--- check the repository table; with no externals, this contains just one row
 +
sqlite&gt; select * from REPOSITORY ;
 +
--- change the URL
 +
sqlite&gt; update REPOSITORY set root ='' 'new_url' ''where root ='' 'old_url' '';
 +
Of course, if there is just a single row in the ''repository'' table, you can leave out the ''where'' clause.
  
 
=== [[Setup a SVN Server on a Shared Hosting]] ===
 
=== [[Setup a SVN Server on a Shared Hosting]] ===
 
How to setup SVN hosting (via <tt>svn+ssh</tt>) if you're on a shared hosting client - no root access.
 
How to setup SVN hosting (via <tt>svn+ssh</tt>) if you're on a shared hosting client - no root access.

Latest revision as of 12:20, 20 December 2013

Simple Guide to SVN Client

Bullets on how to use SVN client.

Creating a SVN Repository

How to create a new SVN repository to serve using svnserve, via svn+ssh or via Apache.

Moving a SVN Repository

Moving complete SVN repository from one host to another.

Change Repository URL (Subversion 1.7+)

Few days ago I've migrated among servers, and along the way had to rename the user used via ssh to serve SVN.

The problem - URL of all repositories has changed. It's either endless diff, checkout, patch, or ... dig into the SVN checkout and edit the repo URL!

Pre-1.7 this was pure horror, as the URL was in every .svn/entries file in every folder. Twice. So, you had to pretty much do your awk magic on find results.

Subversion 1.7 introduced something magical - centralized metadata in SQLite DB.

Now, to change old_url to new_url simply go to the root of your checkout, and

--- open the metadata DB
$ sqlite3 .svn/wc.db
--- check the repository table; with no externals, this contains just one row
sqlite> select * from REPOSITORY ;
--- change the URL
sqlite> update REPOSITORY set root = 'new_url' where root = 'old_url' ;

Of course, if there is just a single row in the repository table, you can leave out the where clause.

Setup a SVN Server on a Shared Hosting

How to setup SVN hosting (via svn+ssh) if you're on a shared hosting client - no root access.