Multi-repo support in log viewer, version 2.0

24 views
Skip to first unread message

solsson

unread,
Mar 29, 2008, 3:18:50 PM3/29/08
to ReposStyle
Hello,

Now there is a 2.0 beta1 release for download at
http://groups.google.com/group/reposstyle

The simple log viewer is not as simple anymore. It started as a quick
hack I made for internal use. Now the configuration is better
documented and there is the much asked for multi-repo SVNParentPath
support, which has been discussed at length in this mailing list.

My solution is based on HTTP referer header. This is quite reliable,
but with a major drawback: just like with cookies it is no longer
stateless http, hence not bookmarkable (or emailable etc.). I solved
that by sending a redirect with a 'reponame' parameter when the
repository has been identified.

Theo's javascript solution does not have this drawback, and could be
added as a complement to avoid the redirect and make the solution less
reliant on referer header. So far I have'nt added any client side
logic.

I'd be happy if you could test this beta release and let me know how
it works.

Anyone who's good at web design? Repos Style could really use some
gradients and color matching for this major release.

/Staffan

Scott

unread,
Mar 29, 2008, 9:52:42 PM3/29/08
to ReposStyle
On Mar 29, 12:18 pm, solsson <sols...@gmail.com> wrote:
> Hello,
>
> Now there is a 2.0 beta1 release for download athttp://groups.google.com/group/reposstyle
Works perfectly -- ran it through its paces. See it in action at
https://svn.savannah.borgnet.us/svn/

Stefan

unread,
Mar 31, 2008, 9:58:55 AM3/31/08
to ReposStyle
I'm having difficulties getting this to work.

I have the following settings:
httpd.conf

<Location /svn >
DAV svn
SVNParentPath D:/VCS/svn
SVNListParentPath on
SVNIndexXSLT "/repos-web/view/repos.xsl"
AuthType Digest
AuthName "Subversion"
AuthDigestDomain /svn/
AuthUserFile D:/VCS/svn/svn-auth-file.ht
AuthGroupFile D:/VCS/svn/svn-group-file.ht
Require valid-user
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require group Admin
</LimitExcept>
</Location>

index.php
$repo = 'D:/VCS/svn';
$repoparent = '@@RepoParent@@';

I have also added the following before passthru:
chdir('c:\Program Files\Subversion\bin');
passthru($cmd);

When i'm at the following URL, i get the error message displayed below
when i click "folder history":
http://svn.mydomain.no:8080/svn/ESMobile/trunk/

svn: 'D:\VCS\svn' is not a working copy
svn: Can't open file 'D:\VCS\svn\.svn\entries': The system cannot find
the path specified.

Url displayed is: http://svn.mydomain.no:8080/repos-web/open/log/?target=/trunk

Any ideas?

- Stefan

On 29 Mar, 21:18, solsson <sols...@gmail.com> wrote:
> Hello,
>
> Now there is a 2.0 beta1 release for download athttp://groups.google.com/group/reposstyle

Staffan Olsson

unread,
Mar 31, 2008, 2:55:16 PM3/31/08
to repos...@googlegroups.com

Try to set
$repoparent = 'D:/VCS/svn';
instead in index.php

I'll try to document the configuration better.

/Staffan

Staffan Olsson

unread,
Mar 31, 2008, 2:59:38 PM3/31/08
to repos...@googlegroups.com
Correction...

Must be a subversion url, so that the svn command understands that it
is a remote operation.
$repoparent = 'file:///D:/VCS/svn';

/Staffan

Stefan

unread,
Apr 1, 2008, 2:52:58 AM4/1/08
to ReposStyle
Unable to resolve repository name for this request, reponame must be
set

$repo = '@@';
$repoparent = 'file:///D:/VCS/svn';

- Stefan

On 31 Mar, 20:59, "Staffan Olsson" <sols...@gmail.com> wrote:
> Correction...
>
>
>
>
>
> On Mon, Mar 31, 2008 at 8:55 PM, Staffan Olsson <sols...@gmail.com> wrote:
> /Staffan- Skjul sitert tekst -
>
> - Vis sitert tekst -

Scott

unread,
Apr 1, 2008, 2:56:12 AM4/1/08
to ReposStyle
do not use $repo if you use $repoparent

Example:
//$repo = 'file:///D:/VCS/svn/repo-name';
$repoparent = 'file:///D:/VCS/svn';


Stefan

unread,
Apr 1, 2008, 8:05:27 AM4/1/08
to ReposStyle
I give up :(

Points of interests:
<xsl:param name="startpage">/svn/</xsl:param>
// svn executable, command name in PATH or absolute path
$svn = 'c:\"Program Files"\Subversion\bin\svn"';
// 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 = '@@';
// OR set a parent url instead, corresponding to SVNParentPath, no
trailing slash
$repoparent = 'file:///D:/VCS/svn';

- Stefan

> > > - Vis sitert tekst -- Skjul sitert tekst -

Scott

unread,
Apr 1, 2008, 8:14:13 AM4/1/08
to ReposStyle
This is mine and it works.

// === Print svn log --xml to response ===

// Set the URL to the stylesheet, must be same host or absolute path
from root
$xslt = '/repos-web/view/log.xsl';

// 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@@';
// OR set a parent url instead, corresponding to SVNParentPath, no
trailing slash
$repoparent = 'https://svn.savannah.borgnet.us/svn';

Scott

unread,
Apr 1, 2008, 8:47:43 AM4/1/08
to ReposStyle
Hmmmmm after looking at mine I didn't set my absolute url to style
application and after I did Stefan is correct.

This isn't working.

-------------------------
svn: '/website' is not a working copy
svn: Can't open file '/website/.svn/entries': No such file or
directory
-------------------------

And that is from https://svn.savannah.borgnet.us/repos-web2/open/log/?target=/website/base.css

Which is suppose to looking at the repo clearurlbutton/website/

Now the error make no sense because I can get a log output from svn
just fine using a svn url, e.g. ; svn log --xml --verbose --
incremental --limit 20 --non-interactive http://svn.borgnet.us/svn/clearurlbutton/website/base.css

Scott

unread,
Apr 1, 2008, 8:56:40 AM4/1/08
to ReposStyle
Adding in some debug I found out that $reponame is not being passed
and $url isn't getting joined correctly



On Apr 1, 5:14 am, Scott <sgray...@gmail.com> wrote:

Scott

unread,
Apr 1, 2008, 9:06:11 AM4/1/08
to ReposStyle
My debug was the following.....

header('Content-Type: text/xml');
echo('<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="'.$xslt.'"?>
debug info --> RepoParent '.$repoparent.' | RepoName'.$reponame.' ||
URL '.$url.'

<log limit="'.$limit.'">
');
passthru($cmd);
echo('</log>
');

Then the source ouput showed

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/repos-web2/view/log.xsl"?>
debug info --> RepoParent http://svn.borgnet.us/svn | RepoName || URL /
trunk/install.rdf

<log limit="20">
svn: '/trunk' is not a working copy
svn: Can't open file '/trunk/.svn/entries': No such file or directory
</log>

Soooooo $repoparent is definitely not being set at all.


On Apr 1, 5:14 am, Scott <sgray...@gmail.com> wrote:

Scott

unread,
Apr 1, 2008, 9:22:14 AM4/1/08
to ReposStyle
The correct URL that should be used to see the logs is...

https://svn.savannah.borgnet.us/repos-web2/open/log/?target=clearurlbutton/trunk/install.rdf

You see what isn't getting passed?

What your script is doing is....

https://svn.savannah.borgnet.us/repos-web2/open/log/?target=trunk/install.rdf

The offending line is in --> repos-web/view/repos.xsl where the target
path is set. About line 145

<xsl:if test="$logUrl">
<a id="history:{$id}" class="action"
href="{$logUrl}target={../@path}/{@href}">view history</a>
</xsl:if>



On Apr 1, 6:06 am, Scott <sgray...@gmail.com> wrote:
> My debug was the following.....
>
> header('Content-Type: text/xml');
> echo('<?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="'.$xslt.'"?>
> debug info --> RepoParent '.$repoparent.' | RepoName'.$reponame.' ||
> URL '.$url.'
>
> <log limit="'.$limit.'">
> ');
> passthru($cmd);
> echo('</log>
> ');
>
> Then the source ouput showed
>
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="/repos-web2/view/log.xsl"?>
> debug info --> RepoParenthttp://svn.borgnet.us/svn| RepoName || URL /

Staffan Olsson

unread,
Apr 1, 2008, 9:28:03 AM4/1/08
to repos...@googlegroups.com
On Tue, Apr 1, 2008 at 3:22 PM, Scott <sgra...@gmail.com> wrote:
>
> The correct URL that should be used to see the logs is...
>
> https://svn.savannah.borgnet.us/repos-web2/open/log/?target=clearurlbutton/trunk/install.rdf
>
> You see what isn't getting passed?
>
> What your script is doing is....
>
> https://svn.savannah.borgnet.us/repos-web2/open/log/?target=trunk/install.rdf
>
> The offending line is in --> repos-web/view/repos.xsl where the target
> path is set. About line 145
>
> <xsl:if test="$logUrl">
> <a id="history:{$id}" class="action"
> href="{$logUrl}target={../@path}/{@href}">view history</a>
> </xsl:if>
>

Nope, the url is correct. repos.xsl has no way of knowing the
repository name, unless you hard code it or use Theo's solution. Only
the php is modified for the multi-repo solution.

As you correctly noted, only one of $repo and $repoparent can be set.

I can't follow the debug results. The "is not a working copy" error
must have something to do with the url not starting with http://,
svn:// or file://. I'm not on my test machine now so i'll have to get
back to you.

/Staffan

Scott

unread,
Apr 1, 2008, 9:39:15 AM4/1/08
to ReposStyle
On Apr 1, 6:28 am, "Staffan Olsson" <sols...@gmail.com> wrote:
> On Tue, Apr 1, 2008 at 3:22 PM, Scott <sgray...@gmail.com> wrote:
>
> > The correct URL that should be used to see the logs is...
>
> > https://svn.savannah.borgnet.us/repos-web2/open/log/?target=clearurlb...
>
> > You see what isn't getting passed?
>
> > What your script is doing is....
>
> > https://svn.savannah.borgnet.us/repos-web2/open/log/?target=trunk/ins...
>
> > The offending line is in --> repos-web/view/repos.xsl where the target
> > path is set. About line 145
>
> > <xsl:if test="$logUrl">
> > <a id="history:{$id}" class="action"
> > href="{$logUrl}target={../@path}/{@href}">view history</a>
> > </xsl:if>
>
> Nope, the url is correct. repos.xsl has no way of knowing the
> repository name, unless you hard code it or use Theo's solution. Only
> the php is modified for the multi-repo solution.
>
> As you correctly noted, only one of $repo and $repoparent can be set.
>
> I can't follow the debug results. The "is not a working copy" error
> must have something to do with the url not starting with http://,
> svn:// or file://. I'm not on my test machine now so i'll have to get
> back to you.
>
> /Staffan

Then your version won't work the way it is.

The repo name isn't being passed and that is what is causing this to
not work.

Staffan Olsson

unread,
Apr 1, 2008, 12:10:09 PM4/1/08
to repos...@googlegroups.com

It does work on the two subversion configurations I've tried. The php
file tries to figure out the repository name from the referrer, if you
have set $repoparent and _not_ $repo. If it fails, for example because
the referer header is not set, you will get an error message saying
that the repository name could not be resolved. I could probably come
up with a more clever way to configure this, but I was interested to
see if the referrer concept works first.

/Staffan

Scott

unread,
Apr 1, 2008, 12:24:52 PM4/1/08
to ReposStyle
It certainly doesn't work in firefox 2.0.13 on linux. I even made sure
my referrers were being sent and they are.


On Apr 1, 9:10 am, "Staffan Olsson" <sols...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages