Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implements the /svn-history/ path like Google Code Hosting does?

Tags:

http

svn

When you publish a Subversion repository trough Apache Httpd you got an bonus feature: you can browse the HEAD revision of you sources with any HTTP client.

For example, we have this repository:

http://trash-cli.googlecode.com/svn/trunk/

With any HTTP client (e.g. Firefox) you can browse the files at the HEAD revision. The svnbook explain very well how do that.

But Google Code Hosting offer an extra feature: you can browse also the past revisions. For example you can browse the r10 revision:

http://trash-cli.googlecode.com/svn-history/r10/trunk/

Do you know how Google do that? I want this feature in my company repository too! :)

Thanks

Update 1

The following behavior may help us to solve the problem. If I visit a path that doesn't exist in repository, for example

http://trash-cli.googlecode.com/svn-history/r10/non-existent

I got the following 404 error:

Not Found

The requested URL /svn/!svn/bc/10/non-existent was not found on this server.

I suspect that there is a URL rewrite rule under the scene.

Update 2

Please note that this is not the same of this question. I want to expose the this service on my company repository in a way that is comfortable to the user in a way that Google Code do, I'm not interested how to get old revision in a external repository that doesn't has this feature. I'm using the perspective of the service provider, not the perspective of the user. I want make life easier to my colleagues.

like image 932
Andrea Francia Avatar asked Mar 26 '09 18:03

Andrea Francia


1 Answers

From the subversion 1.6 release notes:

New public 'historical' HTTP URI syntax for mod_dav_svn (server)

mod_dav_svn now supports a new public URI syntax for examining older versions of files or directories. The intent here is to allow users to examine history without the use of an svn client, and to make it easier for 3rd-party tools (e.g. code-review services) to work directly against repositories without using svn libraries.

http://host/repos/path?[p=PEG][&r=REV]

like image 89
Wim Coenen Avatar answered Oct 11 '22 12:10

Wim Coenen