Version Control with Subversion - httpd, the Apache HTTP server - Repository Browsing
Repository Browsing
One of the most useful benefits of an Apache/WebDAV
configuration for your Subversion repository is that the
youngest revisions of your versioned files and directories
are immediately available for viewing via a regular web
browser. Since Subversion uses URLs to identify versioned
resources, those URLs used for HTTP-based repository access
can be typed directly into a Web browser. Your browser will
issue a GET request for that URL, and
based on whether that URL represents a versioned directory
or file, mod_dav_svn will respond with a directory listing
or with file contents.
Since the URLs do not contain any information about
which version of the resource you wish to see, mod_dav_svn
will always answer with the youngest version. This
functionality has the wonderful side-effect that you can
pass around Subversion URLs to your peers as references to
documents, and those URLs will always point at the latest
manifestation of that document. Of course, you can even use
the URLs as hyperlinks from other web sites, too.
You generally will get more use out of URLs to versioned
files—after all, that's where the interesting content
tends to lie. But you might have occasion to browse a
Subversion directory listing, where you'll quickly note that
the generated HTML used to display that listing is very
basic, and certainly not intended to be aesthetically
pleasing (or even interesting). To enable customization of
these directory displays, Subversion provides an XML index
feature. A single SVNIndexXSLT directive
in your repository's Location block of
httpd.conf will instruct mod_dav_svn to
generate XML output when displaying a directory listing, and
to reference the XSLT stylesheet of your choice:
<Location /svn>
DAV svn
SVNParentPath /usr/local/svn
SVNIndexXSLT "/svnindex.xsl"
…
</Location>
Using the SVNIndexXSLT directive and
a creative XSLT stylesheet, you can make your directory
listings match the color schemes and imagery used in other
parts of your website. Or, if you'd prefer, you can use the
sample stylesheets provided in the Subversion source
distribution's tools/xslt/ directory.
Keep in mind that the path provided to the
SVNIndexXSLT directory is actually a URL
path—browsers need to be able to read your stylesheets
in order to make use of them!
[an error occurred while processing this directive]
|