We have a PowerShell 3 script that automates the push/pull/merge/commit cycle. It pipes the output of commands so it can inspect them and convert them to objects so we can do PowerShell-y things with them (e.g. improved error handling). Mercurial 2.5.4 would show the password prompt despite piping the command output. In Mercurial 2.7.1+, the password prompt no longer appears, so to the user it looks like our sync script hangs, when in fact, its just waiting for the user's response. We can't put passwords in our personal hgrc files because it is against corporate security policy. Steps to reproduce: 1. In a repository that requires authentication when pushing, make a change, and try to push (commands shown are PowerShell): PS> '' | sc newfile PS> hg add newfile PS> hg ci -m "Adding newfile." PS> hg push | % { Write-Host $_ } Note that under Mercurial 2.7.1/2.7.2, the password prompt never appears. In version 2.5.4, it does.
Probably caused by this in 2.6: http://www.selenic.com/hg/rev/be207d9b7e4b Looks like the prompt is going to stdout instead of stderr. Regression -> urgent Can you test the following patch with: http://mercurial.selenic.com/wiki/HackableMercurial --- a/mercurial/ui.py Mon Oct 07 15:23:52 2013 -0700 +++ b/mercurial/ui.py Tue Oct 08 15:17:37 2013 -0700 @@ -665,7 +665,7 @@ if not self.interactive(): return default try: - self.write(self.label(prompt or _('password: '), 'ui.prompt')) + self.write_err(self.label(prompt or _('password: '), 'ui.prompt')) return getpass.getpass('') except EOFError: raise util.Abort(_('response expected'))
I downloaded, unblocked, and unzipped the 2.6 hackable Mercurial. When I try to run any Mercurial command, I get: > hg push abort: failed to load Python DLL I have Python 2.7 installed, but it isn't in my path.
Hackable comes with its own copy of Python. Make sure you are explicitly running the hg.exe in the hackable bundle.
I'm explicitly using the path. I should have shown that in my original trace: > C:\hg-2.6\hg.exe push abort: failed to load Python DLL Process Monitor is reportin that hg.exe is looking for python26.dll in its directory, instead of the hg-python26 sub-directory. Is there some additional setup besides downloading and unzipping?
Fixed by http://selenic.com/repo/hg/rev/ba2be32d14f2 Matt Mackall <mpm@selenic.com> ui: send password prompts to stderr again (issue4056) (please test the fix)