At home, this works perfectly. I'm on another computer now (using cygwin) and hg push will not prompt for a username / password:
user@localhost /cygdrive/d/repos/upthescala/viewprotect
$ hg push https://viewprotect.googlecode.com/hg/
pushing to https://viewprotect.googlecode.com/hg/
searching for changes
abort: http authorization required
Here are the contents of my ~/.hgrc:
[http_proxy]
host=someproxy:8080
[ui]
username = My Name <myemail>
Thanks in advance for any advice!
Note: this seems to 开发者_如何学编程be a cygwin problem. When I try from the Windows prompt (cmd.exe), it works as expected:
D:\repos\upthescala\viewprotect>hg push https://viewprotect.googlecode.com/hg/
pushing to https://viewprotect.googlecode.com/hg/
searching for changes
http authorization required
realm: Google Code Mercurial Repository
user: myemailaddress
password: *********
remote: Success.
-- LES
This could be caused by using a version of Mercurial that's tied to the Windows console subsystem. The binary distributed with Tortoise falls into this category. If this is the case, mercurial is expecting to use the console subsystem to prompt for credentials, but it does not find it when run from the Cygwin shell. In my case, installing and using the Cygwin version of mercurial fixed the problem, in addition to fixing color output. To check which version you're using, run 'which hg' (but you probably already knew that).
To add to Andrew's comment:
installing and using the Cygwin version of mercurial fixed the problem,
This also fixed the problem for me, but it caused another problem which took me some time to figure out. When using the Cygwin version of hg, all files that had been cloned under TortoiseHG showed up as modified when I ran hg status
, but no differences were shown for any of them when I ran hg diff
.
The problem was that the permissions didn't match. Running chmod 644 .* -R
in each repo resolved this problem.
Since it's HTTP you can always put the username and password right in the URL. That works on any website using http auth and in any browser.
hg push https://myemailaddress:*********@viewprotect.googlecode.com/hg/
Alternately, newer Mercurial versions have an auth section you can use.
BTW, that's a terrible password. You should come up with something better than eight stars.
精彩评论