0

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 を介して提供されます。

4

2 に答える 2

1

サーバーが Windows ボックスであり、IIS サーバー/IIS ユーザーがアクセスできるグローバル hgrc ファイルをどこに配置すればよいかわからなかったため、hgrc ファイルに %include 構文を使用することになりました。

hgrc ファイルの末尾に次のコードを追加します。

%include D:\Hg\HgNotify\hgrc.notify.txt

%include は、ファイルを独自の hg リポジトリに配置して、変更の履歴を保持できるため、実際にはうまく機能します。

私のリポジトリの 1 つにある完全な 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
于 2013-05-16T22:17:56.263 に答える
1

すべてのリポジトリの設定を含むグローバル hgrc ファイルを使用できます。を参照してくださいman hgrc

于 2013-05-16T10:10:28.033 に答える