Mercurial附带了一些捆绑的模板。它们可以存储在/usr/local/lib/python2.7/dist-packages/mercurial/templates/或/usr/share/mercurial/templates中。
此文件夹中包含的文件很少:
map-cmdline.bisect
map-cmdline.changelog
map-cmdline.compact
map-cmdline.default
map-cmdline.xml它们是在命令行中使用的样式,例如hg log -l 10 --style changelog。
此外,还有以下文件夹:
atom
coal
gitweb
monoblue
paper
raw
rss
spartan它们中的每一个都包含如下文件:
bookmarkentry.tmpl
bookmarks.tmpl
changelogentry.tmpl
changelog.tmpl
error.tmpl
filelog.tmpl
header.tmpl
map
tagentry.tmpl
tags.tmpl我猜这些是用于hg serve的模板。在尝试使用-t选项运行hgweb时,我收到以下错误:
$ hg serve -t paper
listening at http://127.0.0.1:8000/ (bound to *:8000)
127.0.0.1 - - [14/May/2012 14:16:38] "GET / HTTP/1.1" 500 -
127.0.0.1 - - [14/May/2012 14:16:38] Exception happened during processing request '/':
Traceback (most recent call last):
[traceback here]
RuntimeError: No hgweb templates found in ['paper']谁知道这些文件夹/文件是什么,以及如何使用不同的模板运行hg serve?
附言:我使用Mercurial 2.1.1
发布于 2012-05-14 21:03:22
您需要使用--style标志来指定模板样式,例如gitweb或纸张。
hg serve --style paper这将在共享模板文件夹中查找,并使用其中的模板集。-t选项需要指向一组模板的路径。
https://stackoverflow.com/questions/10583260
复制相似问题