无法使用mercurial_keyring扩展名,TortoiseHg和Kiln在Windows中执行hg推送

时间:2014-03-05 22:51:52

标签: mercurial mercurial-extension

我在Windows Server 2008R2中使用TortoiseHg(v2.11.1 64位)的mercurial keyring扩展时遇到了一些无法解释的困难。

扩展名似乎已启用(mercurial_keyring条目存在于mercurial.ini以及repo hgrc文件中),我已设置默认的repo URL以传递我的用户帐户(例如“default=http://username@my-host-name/reponame/” )。
我已经完成了从命令提示符手动推送以将我的密码存储在Windows凭证存储中,这似乎有效 - 从命令提示符后续推送不请求身份验证。我还可以在Windows Credential Store中看到“Mercurial”条目。 我已确认我的PATH环境变量仅 指向TortoiseHg安装的hg.exe实例。 最后,我在Jenkins中创建了一个作业,尝试执行提交并推送相同的repo,我执行了测试推送以存储我的凭据。但是,该作业失败并显示以下消息:

16:33:00 c:\_servers\Jenkins>hg push --debug 

16:33:12 pushing to http://<username>@<my-host-name>/kiln/Code/<repo path>
16:33:12 using http://<my-host-name>/kiln/Code/<repo path>
16:33:12 http auth: user <username>, password not set
16:33:12 sending capabilities command
16:33:12 query 1; heads
16:33:12 sending batch command
16:33:12 searching for changes
16:33:12 all remote heads known locally
16:33:12 sending branchmap command
16:33:12 sending branchmap command
16:33:12 preparing listkeys for "bookmarks"
16:33:12 sending listkeys command
16:33:12 2 changesets found
16:33:12 list of changesets:
16:33:12 e7131cb8af1d3e64e678861c687d76025d3c639f
16:33:12 7bc85ba011df5c423244e3222efd7ebf6b5f0dd6
16:33:12 bundling: 1/2 changesets (50.00%)
16:33:12 bundling: 2/2 changesets (100.00%)
16:33:12 bundling: 1/2 manifests (50.00%)
16:33:12 bundling: 2/2 manifests (100.00%)
16:33:12 bundling: .hgignore 1/2 files (50.00%)
16:33:12 bundling: <mutated file list> 2/2 files (100.00%)
16:33:12 sending unbundle command
16:33:12 sending 685 bytes
16:33:12 sending: 0 kb
16:33:12 sending: 0 kb
16:33:12 [HgKeyring] Keyring URL: http://<my-host-name>/kiln/Code/<repo path>
16:33:12 [HgKeyring] Looking for password for user <username> and url `http://<my-host-name>/kiln/Code/<repo path>`
16:33:12 [HgKeyring] **Password not present in the keyring**
16:33:12 abort: mercurial_keyring: http authorization required but program used in non-interactive mode

我不确定我做错了什么,或者这不是一个可行的配置,但我当然会感谢任何建议。谢谢你的考虑。

1 个答案:

答案 0 :(得分:1)

您需要手动推送作为Jenkins在下运行的用户帐户,以将密码存储在该用户的Windows密钥环中。