[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

browsing SVNParentPath

From: Martin Furter <mf_at_rola.ch>
Date: 2003-08-15 18:36:26 CEST

Hello!

Because I couldn't browse the SVNParentDir I made a php script and a
change to my http.conf using mod_rewrite.

My httpd.conf contains the following lines for svn:
    <Location /svn>
        DAV svn
        SVNParentPath /home/svn
        ...
    </Location>
    RewriteEngine on
    RewriteRule ^/svn$ /svn_index.phtml [PT]
    RewriteRule ^/svn/$ /svn_index.phtml [PT]
    RewriteRule ^/svn/index.html$ /svn_index.phtml [PT]

And svn_index.phtml located in the document root directory contains these
lines:

<html>
<head>
<title>Subversion Repositories</title>
</head>
<body>

<h2>Subversion Repositories</h2>
<p><?php
    $svnparentpath = "/home/svn";
    $svnparenturl = "/svn";

    $dh = opendir( $svnparentpath );
    if( $dh ) {
        while( $dir = readdir( $dh ) ) {
            $svndir = $svnparentpath . "/" . $dir;
            $svndbdir = $svndir . "/db";
            if( is_dir( $svndir ) && is_dir( $svndbdir ) ) {
                echo "<a href=\"" . $svnparenturl . "/" . $dir . "\">" .
                        $dir . "</a><br />\n";
            }
        }
        closedir( $dh );
    }
?>
</p>

</body>
</html>

If you have different locations of your repositories you have to change
the RewriteRule's in httpd.conf and the 2 variables in the php script.
$svnparentpath must be set to the same value as SVNParentPath,
$svnparenturl must contain the URL of the same path.

I hope you find this useful.
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Aug 15 18:39:06 2003

This is an archived mail posted to the Subversion Users mailing list.