Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Open Source

Subversion and Linux: Setup and Use, Part 2


"3690" Reserved

Other than invoking svnserve as a daemon, you can invoke it via inetd. This way, it interacts with the SVN client via custom protocol at the port number, 3690, which is reserved by IANA.

Note: Users trying to access the repository via svn:// should have appropriate permissions, because a separate svnserve process is spawned by inetd for each client request.

Tunnel and Serve

Maintaining multiple user configurations for each active application in the system is a pain for many admins. SVN provides solace and allows re-use of already established SSH authentication and authorization mechanisms to be used with svnserve.

In this case as well, users trying to access the repository via svn:// should have appropriate permissions, because, for each client request by that user, a separate svnserve process is invoked.

Playing with Properties

Properties are a kind of metadata that can be attached to directories and files. The properties attached to revisions ("trees", if you prefer) cannot be versioned, but the properties attached to the items in the working copy can be versioned. This means that, like files and directories, these properties can be modified using SVN subcommands and committed to the repository.

Customized properties, as per the user/project requirements, can be set. However, the restriction from SVN on such properties is that such properties should not begin with the prefix "svn:", which is reserved for its own use. I demonstrate this using a couple of examples on a custom-created property.

For instance, in preparing this article, I had to group and categorize all the command outputs, taking care not to mix them with those meant for the first part of the article. So, I used a self-made property name, partwofigs (no, this is not a typo, this is the name I gave) to all the relevant files.

To set the property value in the file, /home/ram/svnfigtypes, do:

$cat /home/ram/svnfigtypes
SVN figures for part two of the article

Now set the actual property, partwofigs:

$/opt/svn-1.4.3/bin/svn propset partwofigs -F /home/ram/svnfigtypes \
  /home/ram/svnarticle_rndtwo/svnfigs/svnstatus.output
property 'partwofigs' set on '/home/ram/svnarticle_rndtwo/svnfigs/svnstatus.output'

This sets the desired property on a single file.

Setting the same property on multiple files is shown below. Note the warning from SVN; the property cannot be set on files not under revision control.

$/opt/svn-1.4.3/bin/svn propset partwofigs -R -F /home/ram/svnfigtypes /home/ram/svnarticle_rndtwo/svnfigs/*
property 'partwofigs' set (recursively) on '/home/ram/svnarticle_rndtwo/svnfigs/BASE.output'
property 'partwofigs' set (recursively) on '/home/ram/svnarticle_rndtwo/svnfigs/COMMITTED.output'
svn: warning: '/home/ram/svnarticle_rndtwo/svnfigs/propset.output' is not under version control
property 'partwofigs' set (recursively) on '/home/ram/svnarticle_rndtwo/svnfigs/REVDATE.output'
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .

Once you have set the custom property, its time to see how to edit the property:

$pwd
/home/ram/svnarticle_rndtwo/svnfigs

With the first edit, I made no changes; however, in the second edition, I change to the property value.

First edit:

$/opt/svn-1.4.3/bin/svn propedit partwofigs --editor-cmd vi

There are no changes to property partwofigs on .

Second edit:

$/opt/svn-1.4.3/bin/svn propedit partwofigs --editor-cmd vi 

Set new value for property partwofigs on ..

Now list the property value on the directory /home/ram/svnarticle_rndtwo/svnfigs to verify the status.

Here is a complete listing of all the files with their current property values; it is illustrated on purpose to bring out the differences between the changed and unchanged property values:

$/opt/svn-1.4.3/bin/svn proplist -v -R .
Properties on '.':
  partwofigs : SVN figures compiled for part two of the article

Properties on 'svnserve-one-repo.conf':
  partwofigs : SVN figures for part two of the article

Properties on 'svnco-fromtag.output':
  partwofigs : SVN figures for part two of the article

File Type and Content Management ("Built-In Properties")

In heterogeneous operating environments, it is natural that the objects in revision control undergo changes in mixed platform using various different IDEs and editors. In such circumstances, the major troublemaker is the mixture of end-of-line character sequences. To overcome such issues, Subversion provides built-in and pre-defined property attributes that can be set on files and directories. Using this provision, it becomes possible to identify file types based on their contents, mark end-of-line character in the files, and enable serialized access to objects in the repository.

For a complete list of all built-in properties and their usage, see Version Control with Subversion by Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael Pilato.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.