mercurial/ui.py
branchstable
changeset 21195 9336bc7dca8e
parent 21132 350dc24a553d
child 21955 6dfb78f18bdb
--- a/mercurial/ui.py	Tue Apr 29 12:37:36 2014 +0900
+++ b/mercurial/ui.py	Sat Apr 26 18:13:06 2014 +0900
@@ -689,7 +689,12 @@
             return default
         try:
             self.write_err(self.label(prompt or _('password: '), 'ui.prompt'))
-            return getpass.getpass('')
+            # disable getpass() only if explicitly specified. it's still valid
+            # to interact with tty even if fin is not a tty.
+            if self.configbool('ui', 'nontty'):
+                return self.fin.readline().rstrip('\n')
+            else:
+                return getpass.getpass('')
         except EOFError:
             raise util.Abort(_('response expected'))
     def status(self, *msg, **opts):