ui: allow default when prompting
authorMatt Mackall <mpm@selenic.com>
Thu, 27 Dec 2007 22:49:01 -0600
changeset 5709 9dc26941020b
parent 5708 f6bf89722e29
child 5710 026eb80060d8
ui: allow default when prompting
mercurial/ui.py
--- a/mercurial/ui.py	Thu Dec 27 22:47:44 2007 -0600
+++ b/mercurial/ui.py	Thu Dec 27 22:49:01 2007 -0600
@@ -415,6 +415,8 @@
         while True:
             try:
                 r = self._readline(msg + ' ')
+                if not r:
+                    return default
                 if not pat or re.match(pat, r, matchflags):
                     return r
                 else: