ui: label prompt and echo messages
authorYuya Nishihara <yuya@tcha.org>
Sun, 18 Jan 2015 17:42:53 +0900
changeset 40542 d8997c5ce2ff
parent 40541 c2aea007130b
child 40543 7bffbbe03e90
ui: label prompt and echo messages I'm going to add a dedicated command-server channel for status messages, which carries metadata alongside a message text. 'ui.*' label provides a hint how message text should be processed.
mercurial/ui.py
--- a/mercurial/ui.py	Sat Nov 03 18:17:30 2018 +0900
+++ b/mercurial/ui.py	Sun Jan 18 17:42:53 2015 +0900
@@ -1340,7 +1340,8 @@
         If ui is not interactive, the default is returned.
         """
         if not self.interactive():
-            self.write(msg, ' ', default or '', "\n")
+            self.write(msg, ' ', label='ui.prompt')
+            self.write(default or '', "\n", label='ui.promptecho')
             return default
         self._writenobuf(self.fout, msg, label='ui.prompt')
         self.flush()
@@ -1349,7 +1350,7 @@
             if not r:
                 r = default
             if self.configbool('ui', 'promptecho'):
-                self.write(r, "\n")
+                self.write(r, "\n", label='ui.promptecho')
             return r
         except EOFError:
             raise error.ResponseExpected()