如何让 hgweb 实际显示我想要的存储库?

发布于 2024-10-08 16:33:29 字数 1152 浏览 12 评论 0原文

我对 IIS7、Python 2.6、Mercurial 1.7.2 和 hgweb.cgi 的体验令人恼火。

经过一个下午的努力让 hgweb.cgi 工作,我终于使用 hgweb.cgi 和 IIS7 在浏览器中呈现它。我现在可以看到 Web 服务器的空白渲染,即没有列出存储库的标头。

现在,根据我在搜索 Google 结果后阅读的多个网站,我知道我必须更新我的 hgweb.config 文件以指向某些存储库。

然而,在我的一生中,我无法让它使用 [paths] 或 [collections] 条目列出我的存储库。

我有以下目录结构(简化但说明性...):

c:\code c:\代码\htmlwriter c:\code\CommandLineProjects\Clean

后两个目录中有 Mercurial 存储库。

我正在尝试在 c:\code\htmlwriter 中发布存储库

现在,如果我在 hgweb.config 中输入此条目,

[paths]
htmlwriter = c:\code\htmlwriter

我的输出中将不会列出任何内容。

如果我输入,

[paths]
htmlwriter = c:\code\*

我会得到一些东西,但不是我想要的,即:

htmlwriter/CommandLineProjects/Clean

(请注意,about 比我想要的更深一层目录级别)。

我似乎找不到路径、星号或任何其他可以在 c:\code\htmlwriter 中提供存储库的任何组合。它似乎总是想比我想要的更深入一层,或者什么都不显示。

我知道我的 hgweb.config 文件正在被读取,因为我可以更改其中的样式标签,并且它会更改渲染的内容。

我已经多次阅读并重新阅读了网络上的许多资源,但他们都说我正在尝试的内容应该有效。例如,我严格按照此说明进行操作,但没有取得好的结果:

http://www .jeremyskinner.co.uk/mercurial-on-iis7/

有人有什么建议吗?

I am having an infuriating experience with IIS7, Python 2.6, Mercurial 1.7.2, and hgweb.cgi.

After battling for an afternoon getting hgweb.cgi to work, I finally got it to render in the browser using hgweb.cgi and IIS7. I can now see a blank rendering of the web server, that is, a header with no repositories listed.

Now, according to the multipe sites I've read after scouring through Google results, I know that I have to update my hgweb.config file to point to some repositories.

However, for the life of me, I can't get it to list my repository using either the [paths] or [collections] entries.

I have the following directory structure, (simplified but illustrative...):

c:\code
c:\code\htmlwriter
c:\code\CommandLineProjects\Clean

The latter two directories have mercurial repositories in them.

I am trying to publish the repository in c:\code\htmlwriter

Now, if I make this entry in hgweb.config

[paths]
htmlwriter = c:\code\htmlwriter

I get nothing listed in my output.

If I put

[paths]
htmlwriter = c:\code\*

I get something, but not what I want, i.e. this:

htmlwriter/CommandLineProjects/Clean

(Note that the about drills down one directory level farther than I want it to).

I can't seem to find any combination of paths, asterisks, or anything else that will serve up the repository in c:\code\htmlwriter. It appears to always want to go one level deeper than I want it to, or to show nothing.

I know that my hgweb.config file is being read because I can change the style tag in it and it changes what is rendered.

I have read and re-read multiple time a number of resources on the web, but they all say what I'm trying should be working. For instance, I followed this instructions to the letter with no good results:

http://www.jeremyskinner.co.uk/mercurial-on-iis7/

Anyone have any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

千仐 2024-10-15 16:33:29

我在 hgweb.cgi 上也有同样的运气,最后却选择了 wsgi 和“纯 python”mercurial 安装的不同路线。
我在这里写了一个非常全面的答案。一个>

I had about the same luck with hgweb.cgi, and ended up going a different route with wsgi and a "pure python" mercurial install.
I wrote a pretty comprehensive answer here.

与他有关 2024-10-15 16:33:29

我将回答我自己的问题:

解决方案是 [paths] 部分中列出的路径相对于 hgweb.config 文件所在的目录。

因此,如果您的存储库位于:

c:\code\myrepo

并且您的 hgweb.config 文件位于:

C:\inetpub\hgcgi

那么您的 hgweb.config 文件中的条目需要是:

/myrepo = ../../code/myrepo

这就是技巧 - 放置正确的相对路径。

我始终无法让 hgweb.cgi 与不同驱动器上的存储库一起使用。

I'll answer my own question:

The solution is that the path listed in the [paths] section is relative to the directory where the hgweb.config file is residing.

So, if you have your repository in:

c:\code\myrepo

and your hgweb.config file is in:

C:\inetpub\hgcgi

then the entry in your hgweb.config file needs to be:

/myrepo = ../../code/myrepo

That was the trick -- to put the correct relative path.

I was never able to get hgweb.cgi to work with a repo on a different drive.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文