diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -684,7 +684,9 @@ class ui(object): r = default # sometimes self.interactive disagrees with isatty, # show response provided on stdin when simulating - if not util.isatty(self.fin): + # but commandserver + if (not util.isatty(self.fin) + and not self.configbool('ui', 'nontty')): self.write(r, "\n") return r except EOFError: diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t --- a/tests/test-commandserver.t +++ b/tests/test-commandserver.t @@ -497,6 +497,9 @@ check that local configs for the cached > @command("debuggetpass", norepo=True) > def debuggetpass(ui): > ui.write("%s\\n" % ui.getpass()) + > @command("debugprompt", norepo=True) + > def debugprompt(ui): + > ui.write("%s\\n" % ui.prompt("prompt:")) > EOF $ cat <> .hg/hgrc > [extensions] @@ -511,8 +514,13 @@ check that local configs for the cached ... runcommand(server, ['debuggetpass', '--config', ... 'ui.interactive=True'], ... input=cStringIO.StringIO('1234\n')) + ... runcommand(server, ['debugprompt', '--config', + ... 'ui.interactive=True'], + ... input=cStringIO.StringIO('5678\n')) *** runcommand debuggetpass --config ui.interactive=True password: 1234 + *** runcommand debugprompt --config ui.interactive=True + prompt: 5678 start without repository: