我有一個本地 HG 儲存庫用於我的客戶工作。我之前在早期版本的 OS X 上配置過 HG 伺服器,沒有任何問題,但在 Yosemite 上我遇到了問題。我使用了 MacPorts 的 Mercurial 包,使用自簽名 SSL 憑證配置了 apache,而且大部分都很好...... hgweb 工作正常,我可以拉取並執行其他命令。
但是我不能推動:
$ hg push --debug --traceback -v
pushing to https://localhost/hg/website.com
using https://localhost/hg/website.com
sending capabilities command
using auth.default.* for authentication
localhost certificate matched fingerprint ************
using auth.default.* for authentication
http auth: user mike, password ************
using auth.default.* for authentication
localhost certificate matched fingerprint ************
query 1; heads
sending batch command
using auth.default.* for authentication
searching for changes
all remote heads known locally
sending branchmap command
using auth.default.* for authentication
sending branchmap command
using auth.default.* for authentication
preparing listkeys for "bookmarks"
sending listkeys command
using auth.default.* for authentication
1 changesets found
list of changesets:
c05e7b9045cf27f7508dcaaace632ba8a9940c4e
bundling: 1/1 changesets (100.00%)
bundling: 1/1 manifests (100.00%)
bundling: file1.txt 1/2 files (50.00%)
bundling: file2.txt 2/2 files (100.00%)
sending unbundle command
sending 12141 bytes
using auth.default.* for authentication
sending: 11/22 kb (50.00%)
sending: 11/22 kb (50.00%)
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 138, in _runcatch
return _dispatch(req)
…
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 172, in _call
fp = self._callstream(cmd, **args)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 122, in _callstream
raise util.Abort(_('authorization failed'))
Abort: authorization failed
abort: authorization failed
使用者名稱和密碼是正確的...它們在 hgweb 介面上工作,甚至在前面的步驟(第 8 行)中在上面的輸出中工作。我還多次檢查了存儲庫的權限... _www 用戶具有完全訪問權限:
$ ls -al /var/repos/website.com
total 0
drwxrwxr-x 3 _www staff 102 Oct 19 23:34 .
drwxrwxr-x 11 _www staff 374 Oct 27 02:09 ..
drwxrwxr-x 10 _www staff 340 Oct 19 23:34 .hg
HG 版本:3.1.2,OSX 版本:10.10,Apache 版本:2.4.9
任何幫助或建議將不勝感激 - 提前致謝!
答案1
我找到了答案。我不知道為什麼會修復它,但我所要做的就是在相關存儲庫的 .hg 目錄(而不是本地克隆目錄)中創建一個 hgrc 文件,並添加:
[web]
allow_push = *
如果有人在嘗試調試設定的不同部分時找到了這個答案,這裡是 Yosemite 上 Mercurial 的整個設定的教學。
http://www.curvingspace.com/2014/11/05/mercurial-on-yosemite/