如何实现像Google Code Hosting这样的/ svn-history / path呢? [英] How to implements the /svn-history/ path like Google Code Hosting does?

查看:98
本文介绍了如何实现像Google Code Hosting这样的/ svn-history / path呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您通过Apache Httpd发布Subversion存储库时,您将获得一个额外的功能:您可以使用任何HTTP客户端浏览源代码的HEAD修订版。

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/

使用任何HTTP客户端(例如Firefox),您可以浏览HEAD修订版中的文件。
svnbook非常清楚地说明了这一点。

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

但Google Code Hosting提供了额外的功能:您还可以浏览过去的修订版。例如,您可以浏览r10版本:

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! :)

谢谢

更新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

我收到以下404错误:

I got the following 404 error:


未找到

Not Found

请求的URL
/ svn /!svn / bc / 10 /不存在在这台服务器上找不到

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

我怀疑在URL下有一个URL重写规则场景。

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

更新2

请注意,这不是同一个这个问题。我希望以一种Google Code所做的方式向用户提供这种服务的方式公开我的公司存储库中的这项服务,我对如何在没有此功能的外部存储库中获取旧版本感兴趣。我使用的是服务提供者的视角,而不是用户的视角。我希望让同事们的生活更轻松。

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.

推荐答案

来自 subversion 1.6发行说明


mod_dav_svn的新公共'历史'HTTP URI语法(服务器)

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

mod_dav_svn 现在支持新的公共
URI语法,用于检查较旧的
版本的文件或目录。这里的
意图是允许用户在不使用
svn客户端的情况下检查历史记录,并使
第三方工具更容易(例如代码审查$) b $ b服务)直接针对
存储库而不使用svn
库。

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]

这篇关于如何实现像Google Code Hosting这样的/ svn-history / path呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆