Repository history - SVNParentPath et al

42 views
Skip to first unread message

face

unread,
Dec 22, 2008, 11:39:06 AM12/22/08
to ReposStyle
I have a collection of repositories
I got history to work "the way I think it should" with the following
changes

face@mac:repos-web:166 $ svn diff open/log/index.php
Index: open/log/index.php
===================================================================
--- open/log/index.php (revision 471)
+++ open/log/index.php (working copy)
@@ -23,15 +23,15 @@
// Set either repository root url OR the url to SVNParentPath for
multi-repo
// accepts any subversion url that does not require authentication,
including file:///
// no trailing slash
-$repo = '@@Repository@@';
+$repo = '';
// OR set a parent url instead, corresponding to SVNParentPath, no
trailing slash
-$repoparent = '@@RepoParent@@';
+$repoparent = 'file:///opt/svn';

// limit log length for performance reasons (users should run svn
client for more entries)
$limit = 20;

// svn executable, command name in PATH or absolute path
-$svn = 'svn';
+$svn = '/opt/local/bin/svn';

// === configuration done, get parameters ===

@@ -67,7 +67,7 @@
if (strstr($repo,'@@')) die('The log script must be configured with a
root URL');
is_numeric($limit) or die('The log script must be configured with a
numeric limit');

-$url = $repo . $target;
+$url = $repoparent . "/" . $repo . $target;

// command line, injection safe, svn must be in path, assumes utf-8
shell
$cmd = $svn.' log --xml --verbose --incremental --non-interactive';


face@mac:repos-web:168 $ svn diff view/repos.xsl
Index: view/repos.xsl
===================================================================
--- view/repos.xsl (revision 471)
+++ view/repos.xsl (working copy)
@@ -37,7 +37,7 @@
<!-- logUrl: empty -> no log tool, absolute url -> enable 'history'
link. Must allow appended query param -->
<xsl:param name="logUrl"><xsl:value-of select="$static"/>open/log/?</
xsl:param>
<!-- startpage: empty -> standard behaviour, absolute url -> special
handling of 'up' from trunk -->
- <xsl:param name="startpage">/</xsl:param>
+ <xsl:param name="startpage">/s/</xsl:param>
<!-- tools: name of recognized top level folders to get css tool-
class -->
<xsl:param name="tools">/trunk/branches/tags/</xsl:param>
<!-- ===== end of configuration ===== -->
@@ -84,7 +84,7 @@
<!-- </xsl:if> -->
<!-- <xsl:if test="$logUrl"> add @rev>0 to hide log for
SVNParentPath and empty repositories -->
<xsl:if test="$logUrl and @rev>0">
- <a id="history" class="command translate" href="{$logUrl}target={/
svn/index/@path}">folder history</a>
+ <a id="history" class="command translate" href="{$logUrl}target=/{/
svn/index/@base}{/svn/index/@path}">folder history</a>
</xsl:if>
<a id="refresh" class="command translate" href="#"
onclick="window.location.reload( true )">refresh</a>
</div>
@@ -139,7 +139,7 @@
<div class="actions">
<a id="open:{$id}" class="action" href="{@href}">open</a>
<xsl:if test="$logUrl">
- <a id="history:{$id}" class="action" href="{$logUrl}target={../
@path}/{@href}">view history</a>
+ <a id="history:{$id}" class="action" href="{$logUrl}target={../
@base}{../@path}/{@href}">view history</a>
</xsl:if>
</div>
<a id="f:{$id}" class="file-{$filetype} file" href="{@href}">

Stryke

unread,
Feb 2, 2009, 2:16:27 PM2/2/09
to ReposStyle
I can confirm that Face's mods also work on Windows based systems with
very little modification. Our multiple repository environment is
working perfectly. They only deviation from his instructions were to
supply the correct path for $svn and we left out the change to
"startpage" as this is handled this elsewhere in our configuration.

--
~ Stryke ~

Anthony A.

unread,
Feb 25, 2009, 10:32:28 PM2/25/09
to ReposStyle
I can also confirm that it works. My setup is a Linux-based server,
with multiple repositories, with apache + SSL. The only differences
were the $svn path and the "startpage", as with Stryke's post. Thanks
for figuring this out!

my setup:

Linux
apache: 2.2
php: 5.2
openssl: 0.9.8
svn: 1.5.5
reposstyle: 2.0b1

Staffan

unread,
Feb 26, 2009, 3:07:48 PM2/26/09
to repos...@googlegroups.com
Hi all,

Thanks a lot for the feedback. I wasn't aware of the @base attribute,
but I tracked it to commit 25837 in svn source, but the first release
I found it in is 1.5 (see
http://svn.collab.net/repos/svn/tags/1.5.0/tools/xslt/svnindex.xsl).
I'd like to make a release 2.0 now with your fixes, but I don't want
repos style to require svn 1.5. It'll need some xsl:if in the
stylesheet.

/Staffan
Reply all
Reply to author
Forward
0 new messages