Mercurial,TortoiseHg,密钥环,并使用两个带有两个用户名和密码的远程存储库 [英] Mercurial, TortoiseHg, keyring and using two remote repos with two usernames and passwords being forgotten

查看:119
本文介绍了Mercurial,TortoiseHg,密钥环,并使用两个带有两个用户名和密码的远程存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用TortoiseHg Workbench 64位2.1.4,尽管它可能是Mercurial的问题.操作系统是Windows 7(64位).

I am using TortoiseHg Workbench 64bit 2.1.4, though it may be an issue with Mercurial. The OS is Windows 7 (64bit).

我有两个项目,我将其推送到两个不同的位置(一个是bitbucket,另一个是私有的).他们使用不同的用户名和密码,我通过HTTPS推送.

I have two projects that I push to two different locations (one is bitbucket, the other is an private one). They use different usernames and passwords, and I push over HTTPS.

我已经在我的mercurial.ini中设置了密钥环:

I have setup the keyring in my mercurial.ini:

[extensions]
mercurial_keyring=

,并且在两个.hg/hgrc文件中,我具有各自的值的设置路径:

and in the two .hg/hgrc files, I have setup paths with their respective values:

[paths]
default = https://userX@domainX/XXX

如果我只处理一个仓库,那么每次连接时都会记住密码.但是,当我在项目之间切换时,必须重新输入密码.好像它只会记住一个密码.

If I only work on one repo, the password is remembered each time I connect. However, when I switch between projects, I have to re-enter the password. It's as if it will only remember one password.

下面是带有teh --debug选项的示例日志(密码在提示"user:userX(在.hg/hgrc中固定)的行之后"提示:

Below is an example log with teh --debug option (the password is prompted after the line saying 'user: userX (fixed in .hg/hgrc)':

% hg --repository xxx push --debug https://userX@domainX/XXX
pushing to https://userX@domainX/XXX
using https://userX@domainX/XXX
http auth: user userX, password not set
sending capabilities command
domainX certificate successfully verified
Keyring URL: https://userX@domainX/XXX
Keyring password found. Url: https://userX@domainX/XXX, user: userX, passwd: ********
domainX certificate successfully verified
Keyring URL: https://userX@domainX/XXX
http authorization required
realm: DEV
user: userX (fixed in .hg/hgrc)
Saving password for userX to keyring
Manually entered password. Url: https://userX@domainX/XXX, user: userX, passwd: ********
domainX certificate successfully verified
sending heads command
Keyring URL: https://userX@domainX/XXX
Cached auth data found. Url: https://userX@domainX/XXX, user: userX, passwd: ********
domainX certificate successfully verified
searching for changes
no changes found
checking for updated bookmarks
sending listkeys command
Keyring URL: https://userX@domainX/XXX
Cached auth data found. Url: https://userX@domainX/XXX, user: userX, passwd: ********
domainX certificate successfully verified

推荐答案

我在Windows计算机上尝试过,可以复制但没有修复.看起来,密钥环扩展名确实只存储一个密码,而在存储另一个密码时,它将被替换.如果您使用Windows的凭据管理器,则可以看到这种情况.

I tried on my Windows-machine, and I can reproduce but have no fix. Looks like the keyring extension indeed only stores one password and it gets replaced when you store another. If you go to Windows’s Credential Manager you can see this happening.

Mercurial密钥环扩展使用的Python密钥环库中有一个现有的错误报告:

There is an existing bug report in the Python keyring library that the Mercurial keyring extension uses:

https://bitbucket. org/kang/python-keyring-lib/issue/47/winvaultkeyring-only-ever-returns-last

看起来像是其中一位开发人员昨天才回答的,所以也许他正在研究修补程序.

Looks like one of the developers replied to it just yesterday, so maybe he is working on a fix.

编辑:根据错误报告,此问题现已修复,据Lee Atkinson称,它现在也可以在TortoiseHg中使用.

Edit: According to the bug report this is now fixed, and according to Lee Atkinson it is now also working in TortoiseHg.

这篇关于Mercurial,TortoiseHg,密钥环,并使用两个带有两个用户名和密码的远程存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆