Mercurial > hg
comparison mercurial/ui.py @ 40593:6f0941f4a184
commandserver: make getpass() request distinct from normal prompt
Otherwise, GUI clients would have to parse the prompt text.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 04 Nov 2018 12:38:49 +0900 |
parents | 83e571ea06a9 |
children | 234c2d8c9e48 |
comparison
equal
deleted
inserted
replaced
40592:83e571ea06a9 | 40593:6f0941f4a184 |
---|---|
1462 def getpass(self, prompt=None, default=None): | 1462 def getpass(self, prompt=None, default=None): |
1463 if not self.interactive(): | 1463 if not self.interactive(): |
1464 return default | 1464 return default |
1465 try: | 1465 try: |
1466 self._writemsg(self._fmsgerr, prompt or _('password: '), | 1466 self._writemsg(self._fmsgerr, prompt or _('password: '), |
1467 type='prompt') | 1467 type='prompt', password=True) |
1468 # disable getpass() only if explicitly specified. it's still valid | 1468 # disable getpass() only if explicitly specified. it's still valid |
1469 # to interact with tty even if fin is not a tty. | 1469 # to interact with tty even if fin is not a tty. |
1470 with self.timeblockedsection('stdio'): | 1470 with self.timeblockedsection('stdio'): |
1471 if self.configbool('ui', 'nontty'): | 1471 if self.configbool('ui', 'nontty'): |
1472 l = self._fin.readline() | 1472 l = self._fin.readline() |