changeset 45758:14ac6a74e7e7 stable

ui: fix echo back of ui.prompt() to not concatenate None as bytes Spotted while writing tests for the issue6425. The default value may be None.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 23 Oct 2020 20:10:17 +0900
parents 067707e026b4
children ff48eea4a926
files mercurial/ui.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Thu Oct 29 07:51:13 2020 +0100
+++ b/mercurial/ui.py	Fri Oct 23 20:10:17 2020 +0900
@@ -1659,7 +1659,9 @@
             if not r:
                 r = default
             if self.configbool(b'ui', b'promptecho'):
-                self._writemsg(self._fmsgout, r, b"\n", type=b'promptecho')
+                self._writemsg(
+                    self._fmsgout, r or b'', b"\n", type=b'promptecho'
+                )
             return r
         except EOFError:
             raise error.ResponseExpected()