Mercurial 通用通知模板配置

Mercurial 通用通知模板配置,mercurial,hgrc,Mercurial,Hgrc,是否有方法指向windows上每个存储库的hgrc文件中的公共HgNotify配置?对于服务器上的每个回购,我在每个hgrc中都有下面的通知部分,当我想要创建新的回购时,我必须将此部分复制到hgrc中 [notify] sources = serve push pull bundle #For template, see: http://hgbook.red-bean.com/read/customizing-the-output-of-mercurial.html strip=3 templa

是否有方法指向windows上每个存储库的hgrc文件中的公共HgNotify配置?对于服务器上的每个回购,我在每个hgrc中都有下面的通知部分,当我想要创建新的回购时,我必须将此部分复制到hgrc中

[notify]
sources = serve push pull bundle
#For template, see: http://hgbook.red-bean.com/read/customizing-the-output-of-mercurial.html
strip=3
template = 
  files:     
  {files}
  details:   {baseurl}/rev/{node|short}
  branches:  {branches}
  changeset: {rev}:{node|short}
  user:      {author}
  date:      {date|date}
  description:
  {desc}
  =================\n

test=false
maxdiff = 0
config=D:\hg\Repositories\HgNotify\NotificationList.txt
我正在尝试更改模板,希望所有回购协议自动获得新模板


更新:Hg服务器位于windows上,通过IIS提供服务。

您可以使用全局hgrc文件,其中包含所有存储库的设置。请参见
man hgrc

我最终使用了hgrc文件的%include语法,部分原因是服务器是一个Windows框,我不确定将IIS服务器/IIS用户可以访问的全局hgrc文件放在何处

我将以下内容放在hgrc文件的末尾:

%包括D:\Hg\HgNotify\hgrc.notify.txt

%include实际上效果很好,因为它允许我将文件放在它自己的hg repo中,这样我就可以拥有所做更改的历史记录

以下是我的一份回购协议中完整的hgrc文件的外观:

[web]
name=MyRepo
contact=hg@mydomain.com
push_ssl=False
description=MyRepo
allow_archive = zip
allow_push = *
baseurl = http://hg.mydomain.net/MyRepo
logourl = http://hg.mydomain.net/

[extensions]
hgext.notify = 
progress = 
rebase =

[hooks]
changegroup.notify = python:hgext.notify.hook

#Include file for common notification template
%include D:\Hg\HgNotify\hgrc.notify.txt