http://www.selenic.com/pipermail/mercurial/2008-March/018014.html
在 Windows 上安裝 Mercurial 又安裝了 TortoiseHg 的人請注意,TortoiseHg 在 HKEY_LOCAL_MACHINESOFTWAREMercurial 裡塞了它自己的 hgrc,啟用了 1.0 裡沒了的 hgext.qct 和 hgext.hgconfig。錯誤訊息很擾人,可用:
hgext.qct=! hgext.hgconfig=!
關掉。
#!/usr/bin/env python
from mercurial import demandimport; demandimport.enable()
import cgitb; cgitb.enable()
import os; os.environ["HGENCODING"] = "UTF-8"
from mercurial.hgweb.hgwebdir_mod import hgwebdir
from mercurial.hgweb.request import wsgiapplication
import mercurial.hgweb.wsgicgi as wsgicgi
def make_web_app():
return hgwebdir({
'name1': '/path/to/the/repository',
'name2': '/path/to/the/repository',
})
wsgicgi.launch(wsgiapplication(make_web_app))
... continue... /etc/mercurial/hgrc.d/hgext.rc 這個檔怪里怪氣的,看 /usr/share/doc/mercurial/README.Debian 的日期,說是過時太久了也不一定。
這個奇怪的 hgext.rc 會載入一些在 lenny (current testing of Debian) 的 mercurial 0.9.4 裡沒有包的 extension。像是 hgext/churn。結果會讓 mercurial 在執行的時候跑出來一些煩人的警告訊息。幸好無害。
不過,它的有害影響是讓 hg view (hgk) 無法動作。這就讓人困擾了。為了正確在 Debian 上啟動 hgk,我用 export HGRCPATH="$HOME/.hgrc" 來使 mercurial 不要去讀取系統裡的 mercurial 設定檔 (就是那個奇怪的設定檔)。
當然,不要忘了 apt-get install tk8.4,不然沒有 wish,hgk 也不會啟動喔。







