comparison mercurial/ui.py @ 23053:5ba11ab48fcf stable

ui: separate option to show prompt echo, enabled only in tests (issue4417) The problem in commandserver was addressed by 524b786bd54f, but it is tricky to reuse ui.nontty option to disable echo back. Instead, this patch introduces new option to enable echoing of prompt response. Prompt echoing is changed to be off by default, which should avoid possible breakage of output parsing in user scripts. For now, this option is undocumented because it exists for internal use.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 21 Oct 2014 23:16:46 +0900
parents 2be7d5ebd4d0
children e53f6b72a0e4
comparison
equal deleted inserted replaced
23052:c1ae0b2c1719 23053:5ba11ab48fcf
709 return default 709 return default
710 try: 710 try:
711 r = self._readline(self.label(msg, 'ui.prompt')) 711 r = self._readline(self.label(msg, 'ui.prompt'))
712 if not r: 712 if not r:
713 r = default 713 r = default
714 # sometimes self.interactive disagrees with isatty, 714 if self.configbool('ui', 'promptecho'):
715 # show response provided on stdin when simulating
716 # but commandserver
717 if (not util.isatty(self.fin)
718 and not self.configbool('ui', 'nontty')):
719 self.write(r, "\n") 715 self.write(r, "\n")
720 return r 716 return r
721 except EOFError: 717 except EOFError:
722 raise util.Abort(_('response expected')) 718 raise util.Abort(_('response expected'))
723 719