define standard name for base url to use when printing hgweb urls.

useful for bugzilla integration, email notifications, other stuffs.
This commit is contained in:
Vadim Gelfer 2006-05-04 11:32:00 -07:00
parent 42a1166b20
commit 901f2c1543
2 changed files with 7 additions and 2 deletions

View File

@ -300,6 +300,10 @@ web::
allowzip;;
Whether to allow .zip downloading of repo revisions. Default is false.
This feature creates temporary files.
baseurl;;
Base URL to use when publishing URLs in other locations, so
third-party tools like email notification hooks can construct URLs.
Example: "http://hgserver/repos/"
description;;
Textual description of the repository's purpose or contents.
Default is "unknown".

View File

@ -30,7 +30,6 @@
# OPTIONAL:
# bzuser = ... # bugzilla user id to record comments with
# db = bugs # database to connect to
# hgweb = http:// # root of hg web site for browsing commits
# notify = ... # command to run to get bugzilla to send mail
# regexp = ... # regexp to match bug ids (must contain one "()" group)
# strip = 0 # number of slashes to strip for url paths
@ -38,6 +37,8 @@
# template = ... # template to use when formatting comments
# timeout = 5 # database connection timeout (seconds)
# user = bugs # user to connect to database as
# [web]
# baseurl = http://hgserver/... # root of hg web site for browsing commits
from mercurial.demandload import *
from mercurial.i18n import gettext as _
@ -266,7 +267,7 @@ class bugzilla(object):
t.use_template(tmpl)
t.show(changenode=node, changes=changes,
bug=str(bugid),
hgweb=self.ui.config('bugzilla', 'hgweb'),
hgweb=self.ui.config('web', 'baseurl'),
root=self.repo.root,
webroot=webroot(self.repo.root))
self.add_comment(bugid, sio.getvalue(), templater.email(changes[1]))