You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Martin MAURER <ma...@email.de> on 2003/08/23 18:19:31 UTC

PHP script for viewing subversion repositories

Hi all,

I recently wrote a small PHP script which displays subversion
repositories similar (but not as powerful) to viewcvs.
This script calls the svn binary of your system and parses the output.
I wrote it as I had some problems with viewcvs cvs version (first not
getting it installed easily and then not doing some things - diff - for
me correctly).

Although this script is not well tested and even lacking some features
in respect to viewcvs it works well fo me, and so I decided to send it
to this list, so maybe other people could use it too. I most likely wont
do a lot of further changes (as it does what i needed it to do), but if
anyone has problems "installing" it, i could of course try to help out -
just send a mail.
If anyone improves the script I would be happy to get a copy of it.

Please know, that there may be security problems that I don't know of.
(I am not a professional PHP programmer, and this script executes shell
commands - so don't use this script on publically available servers as
long as no one rechecked it for problems regarding security - you have
been warned.)

Things that (should) work:
- browsing the repository
- viewing the logs of a file
- retrieving diffs between a file+revision and the previous revision 
- manually switching to a specific revision

Things that dont't work / are missing:
- error handling
- show some sort of revision log for a directory
  (didn't know how to get the revisions of a directory where its direct
  childs changed using an elegant way.)
- not tested on _big_ archives

To install it, simply put the .php file into some direcotry on your
PHP-enabled webserver (you may rename the php file without breaking
something) and edit the top part of the file.
(you have to specify your repositories and such things)

greetings
Martin

PS: I am not on this list any more - so CC for any feedback/question/...
 

Re: [chora] Re: PHP script for viewing subversion repositories

Posted by Chuck Hagenbuch <ch...@horde.org>.
Quoting "Jay Freeman (saurik)" <sa...@saurik.com>:

> The Chora people were interested in merging this, but the person I was
> talking to got sick or something and we lost touch for a while (although I
> may have misinterpreted what was going on and just overlooked an e-mail or
> something...)... I should try to get in contact with them again... *would
> need to port it to the latest version of Chora if they are still
> interested*. In fact, so I don't forget... *cross-posts this to Chora's
> mailing list*.

We're definitely interested in integrating this into Chora HEAD. I'd suggest
keeping the conversation on the Chora list; that way even if one person is out
of touch for a bit, there are at least 2-3 of us who'll keep this rolling.

-chuck

--
Charles Hagenbuch, <ch...@horde.org>
They're just looking at a wall of meat.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: PHP script for viewing subversion repositories

Posted by "Jay Freeman (saurik)" <sa...@saurik.com>.
Sander:

Oooo... thanks :). *Fixed that now.*

Also, I guess this URL is a better example (as it has the whole colored
output thing going):

http://mail.saurik.com/chora/diff.php/trunk/eisodos.vcproj?r1=223&r2=224&ty=
h

I also refactored a few small things and fixed the whole "diff to the wrong
revision" problem. It now correctly scans to the previous revision of the
file and makes it easy to diff against that.

Sincerely,
Jay Freeman (saurik)
saurik@saurik.com

----- Original Message -----
From: "Sander Striker" <st...@apache.org>
To: "Jay Freeman (saurik)" <sa...@saurik.com>
Cc: <us...@subversion.tigris.org>
Sent: Sunday, August 24, 2003 7:31 AM
Subject: RE: PHP script for viewing subversion repositories


> > From: Jay Freeman (saurik) [mailto:saurik@saurik.com]
> > Sent: Sunday, August 24, 2003 2:26 PM
>
> > Tobias:
> >
> > DOH! Fixed. That's _EVIL_ though... it seems like svn no longer supports
> > passing just about anything through -x to GNU diff... I keep getting
stuff
> > like:
> >
> > subversion/libsvn_client/diff.c:314: (apr_err=200016)
> > svn: The specified diff option is not supported
> > svn: '-c' is not supported
>
> That's because if you don't configure subversion to use GNU diff we don't
> use it.  We use our internal diff library instead.  And that only knows
> about one single option: -u (which is the default aswell).
> Set diff-cmd = /path/to/diff in your config file, or pass --diff-cmd
/path/to/diff
> on the cmdline.
>
>
> Sander


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: PHP script for viewing subversion repositories

Posted by Sander Striker <st...@apache.org>.
> From: Jay Freeman (saurik) [mailto:saurik@saurik.com]
> Sent: Sunday, August 24, 2003 2:26 PM

> Tobias:
> 
> DOH! Fixed. That's _EVIL_ though... it seems like svn no longer supports
> passing just about anything through -x to GNU diff... I keep getting stuff
> like:
> 
> subversion/libsvn_client/diff.c:314: (apr_err=200016)
> svn: The specified diff option is not supported
> svn: '-c' is not supported

That's because if you don't configure subversion to use GNU diff we don't
use it.  We use our internal diff library instead.  And that only knows
about one single option: -u (which is the default aswell).
Set diff-cmd = /path/to/diff in your config file, or pass --diff-cmd /path/to/diff
on the cmdline.


Sander

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: PHP script for viewing subversion repositories

Posted by "Jay Freeman (saurik)" <sa...@saurik.com>.
Tobias:

DOH! Fixed. That's _EVIL_ though... it seems like svn no longer supports
passing just about anything through -x to GNU diff... I keep getting stuff
like:

subversion/libsvn_client/diff.c:314: (apr_err=200016)
svn: The specified diff option is not supported
svn: '-c' is not supported

I removed the code that passes options through so now it only ever will give
unified diffs... *will see what other solutions he can come up with*.

http://mail.saurik.com/chora/diff.php/trunk/eisodos.vcproj?r1=207&r2=208&ty=
u

Note that diff to previous doesn't always work because it gets the "previous
version" by just subtracting one from the revision number (and therefor will
just return an empty diff).

Sincerely,
Jay Freeman (saurik)
saurik@saurik.com

----- Original Message -----
From: "Tobias Ringström" <to...@ringstrom.mine.nu>
To: "Jay Freeman (saurik)" <sa...@saurik.com>
Cc: <us...@subversion.tigris.org>; <ch...@lists.horde.org>;
<re...@redoz.com>
Sent: Sunday, August 24, 2003 7:12 AM
Subject: Re: PHP script for viewing subversion repositories


> Jay Freeman (saurik) wrote:
> > If people would like to take a look at it you can go to:
> > http://mail.saurik.com/chora/cvs.php/trunk/
>
> Looks nice, but the diffs do not seem to work.
>
> /Tobias


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: PHP script for viewing subversion repositories

Posted by Tobias Ringström <to...@ringstrom.mine.nu>.
Jay Freeman (saurik) wrote:
> If people would like to take a look at it you can go to:
> http://mail.saurik.com/chora/cvs.php/trunk/

Looks nice, but the diffs do not seem to work.

/Tobias


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: [chora] Re: PHP script for viewing subversion repositories

Posted by Jan Schneider <ja...@horde.org>.
Please forward to the subversion list if necessary, I'm not subscribed.

Zitat von "Jay Freeman (saurik)" <sa...@saurik.com>:

> On a related note, a _long_ time ago I modified Chora (a really nice CVS
> repository browser) to work almost entirely against Subversion using the
> same method (executing the command line programs and parsing the
> results). I
> took the 20 minutes just now to port it to a more recent version of
> Subversion. Back when I first wrote this it was kind of slow, but it
> seems
> that the command line programs got faster or something... now browsing is
> rather reasonable.
>
> If people would like to take a look at it you can go to:
> http://mail.saurik.com/chora/cvs.php/trunk/

This looks really nice.

> something...)... I should try to get in contact with them again... *would
> need to port it to the latest version of Chora if they are still
> interested*. In fact, so I don't forget... *cross-posts this to Chora's
> mailing list*.

We are definitely interested in subversion support, though you should indeed
 make your patches against the latest version from HEAD.

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: PHP script for viewing subversion repositories

Posted by "Jay Freeman (saurik)" <sa...@saurik.com>.
(*cross posted to Chora's mailing list, for people who are seeing this just
suddenly appear there*)

On a related note, a _long_ time ago I modified Chora (a really nice CVS
repository browser) to work almost entirely against Subversion using the
same method (executing the command line programs and parsing the results). I
took the 20 minutes just now to port it to a more recent version of
Subversion. Back when I first wrote this it was kind of slow, but it seems
that the command line programs got faster or something... now browsing is
rather reasonable.

If people would like to take a look at it you can go to:
http://mail.saurik.com/chora/cvs.php/trunk/

That repository is the same as that being backed by this URL:
http://svn.saurik.com/repos/menes/trunk/

The source code is in my CVS repository if anyone wants it
(cvs.saurik.com:/cvs/chora, chora, anonymous, no password).

I didn't break Chora's CVS support, this URL should browse the source for
the repository browser:
http://mail.saurik.com/chora/cvs.php?rt=Chora

The Chora people were interested in merging this, but the person I was
talking to got sick or something and we lost touch for a while (although I
may have misinterpreted what was going on and just overlooked an e-mail or
something...)... I should try to get in contact with them again... *would
need to port it to the latest version of Chora if they are still
interested*. In fact, so I don't forget... *cross-posts this to Chora's
mailing list*.

Sincerely,
Jay Freeman (saurik)
saurik@saurik.com

----- Original Message -----
From: "Martin MAURER" <ma...@email.de>
To: <us...@subversion.tigris.org>
Sent: Saturday, August 23, 2003 1:19 PM
Subject: PHP script for viewing subversion repositories


Hi all,

I recently wrote a small PHP script which displays subversion
repositories similar (but not as powerful) to viewcvs.
This script calls the svn binary of your system and parses the output.
I wrote it as I had some problems with viewcvs cvs version (first not
getting it installed easily and then not doing some things - diff - for
me correctly).

Although this script is not well tested and even lacking some features
in respect to viewcvs it works well fo me, and so I decided to send it
to this list, so maybe other people could use it too. I most likely wont
do a lot of further changes (as it does what i needed it to do), but if
anyone has problems "installing" it, i could of course try to help out -
just send a mail.
If anyone improves the script I would be happy to get a copy of it.

Please know, that there may be security problems that I don't know of.
(I am not a professional PHP programmer, and this script executes shell
commands - so don't use this script on publically available servers as
long as no one rechecked it for problems regarding security - you have
been warned.)

Things that (should) work:
- browsing the repository
- viewing the logs of a file
- retrieving diffs between a file+revision and the previous revision
- manually switching to a specific revision

Things that dont't work / are missing:
- error handling
- show some sort of revision log for a directory
  (didn't know how to get the revisions of a directory where its direct
  childs changed using an elegant way.)
- not tested on _big_ archives

To install it, simply put the .php file into some direcotry on your
PHP-enabled webserver (you may rename the php file without breaking
something) and edit the top part of the file.
(you have to specify your repositories and such things)

greetings
Martin

PS: I am not on this list any more - so CC for any feedback/question/...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: PHP script for viewing subversion repositories

Posted by kf...@collab.net.
Martin MAURER <ma...@email.de> writes:
> sounds nice to me. Simply tell me what you need me to do (besides
> creating a README) and I'll do so.

Send me your subversion.tigris.org username and a plaintext or
crypt()ed password, and I'll set you up with commit access for a new
subdirectory under tools (name to be chosen shortly).

-Karl


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: PHP script for viewing subversion repositories

Posted by Martin MAURER <ma...@email.de>.
On Mon, 2003-08-25 at 16:21, kfogel@collab.net wrote:
> Martin, we could put this in the tools/ area of Subversion, if you're
> okay with maintaining it there.  It'd get its own subdirectory, and
> would need a README (although if you want to keep the script's
> documentation inside the script, it's fine for the README just to say
> briefly what the script does and then refer to the script for further
> details).
sounds nice to me. Simply tell me what you need me to do (besides
creating a README) and I'll do so.

greetings
Martin
lonestar on IRC

> 
> Let us know,
> -Karl
> 
> 
> Martin MAURER <ma...@email.de> writes:
> > I recently wrote a small PHP script which displays subversion
> > repositories similar (but not as powerful) to viewcvs.
> > This script calls the svn binary of your system and parses the output.
> > I wrote it as I had some problems with viewcvs cvs version (first not
> > getting it installed easily and then not doing some things - diff - for
> > me correctly).
> > 
> > Although this script is not well tested and even lacking some features
> > in respect to viewcvs it works well fo me, and so I decided to send it
> > to this list, so maybe other people could use it too. I most likely wont
> > do a lot of further changes (as it does what i needed it to do), but if
> > anyone has problems "installing" it, i could of course try to help out -
> > just send a mail.
> > If anyone improves the script I would be happy to get a copy of it.
> > 
> > Please know, that there may be security problems that I don't know of.
> > (I am not a professional PHP programmer, and this script executes shell
> > commands - so don't use this script on publically available servers as
> > long as no one rechecked it for problems regarding security - you have
> > been warned.)
> > 
> > Things that (should) work:
> > - browsing the repository
> > - viewing the logs of a file
> > - retrieving diffs between a file+revision and the previous revision 
> > - manually switching to a specific revision
> > 
> > Things that dont't work / are missing:
> > - error handling
> > - show some sort of revision log for a directory
> >   (didn't know how to get the revisions of a directory where its direct
> >   childs changed using an elegant way.)
> > - not tested on _big_ archives
> > 
> > To install it, simply put the .php file into some direcotry on your
> > PHP-enabled webserver (you may rename the php file without breaking
> > something) and edit the top part of the file.
> > (you have to specify your repositories and such things)
> > 
> > greetings
> > Martin
> > 
> > PS: I am not on this list any more - so CC for any feedback/question/...
> >  
> > 
> > 
> > diff -b -B --unchanged-group-format='' --new-group-format='::DIFF::NEW: %>' --old-group-format='::DIFF::OLD: %<' --changed-group-format='::DIFF::CHANGED: %< <--> %>' $6 $7

Re: PHP script for viewing subversion repositories

Posted by kf...@collab.net.
Martin, we could put this in the tools/ area of Subversion, if you're
okay with maintaining it there.  It'd get its own subdirectory, and
would need a README (although if you want to keep the script's
documentation inside the script, it's fine for the README just to say
briefly what the script does and then refer to the script for further
details).

Let us know,
-Karl


Martin MAURER <ma...@email.de> writes:
> I recently wrote a small PHP script which displays subversion
> repositories similar (but not as powerful) to viewcvs.
> This script calls the svn binary of your system and parses the output.
> I wrote it as I had some problems with viewcvs cvs version (first not
> getting it installed easily and then not doing some things - diff - for
> me correctly).
> 
> Although this script is not well tested and even lacking some features
> in respect to viewcvs it works well fo me, and so I decided to send it
> to this list, so maybe other people could use it too. I most likely wont
> do a lot of further changes (as it does what i needed it to do), but if
> anyone has problems "installing" it, i could of course try to help out -
> just send a mail.
> If anyone improves the script I would be happy to get a copy of it.
> 
> Please know, that there may be security problems that I don't know of.
> (I am not a professional PHP programmer, and this script executes shell
> commands - so don't use this script on publically available servers as
> long as no one rechecked it for problems regarding security - you have
> been warned.)
> 
> Things that (should) work:
> - browsing the repository
> - viewing the logs of a file
> - retrieving diffs between a file+revision and the previous revision 
> - manually switching to a specific revision
> 
> Things that dont't work / are missing:
> - error handling
> - show some sort of revision log for a directory
>   (didn't know how to get the revisions of a directory where its direct
>   childs changed using an elegant way.)
> - not tested on _big_ archives
> 
> To install it, simply put the .php file into some direcotry on your
> PHP-enabled webserver (you may rename the php file without breaking
> something) and edit the top part of the file.
> (you have to specify your repositories and such things)
> 
> greetings
> Martin
> 
> PS: I am not on this list any more - so CC for any feedback/question/...
>  
> 
> 
> diff -b -B --unchanged-group-format='' --new-group-format='::DIFF::NEW: %>' --old-group-format='::DIFF::OLD: %<' --changed-group-format='::DIFF::CHANGED: %< <--> %>' $6 $7

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: PHP script for viewing subversion repositories

Posted by kf...@collab.net.
<<< No Message Collected >>>