mercurial/ui.py
changeset 5337 8c5ef3b87cb1
parent 5154 67afecb8d6cc
child 5613 2e76e5a23c2b
child 5671 b5605d88dc27
--- a/mercurial/ui.py	Mon Sep 24 19:14:18 2007 -0300
+++ b/mercurial/ui.py	Tue Sep 25 19:05:34 2007 +0200
@@ -211,9 +211,11 @@
             if name is None or name in ('quiet', 'verbose', 'debug'):
                 self.verbosity_constraints()
             if name is None or name == 'interactive':
-                self.interactive = self.configbool("ui", "interactive", None)
-                if self.interactive is None:
+                interactive = self.configbool("ui", "interactive", None)
+                if interactive is None and self.interactive:
                     self.interactive = self.isatty()
+                else:
+                    self.interactive = interactive
             if name is None or name == 'report_untrusted':
                 self.report_untrusted = (
                     self.configbool("ui", "report_untrusted", True))
@@ -391,7 +393,7 @@
         try: sys.stderr.flush()
         except: pass
 
-    def readline(self, prompt=''):
+    def _readline(self, prompt=''):
         if self.isatty():
             try:
                 # magically add command line editing support, where
@@ -406,7 +408,7 @@
     def prompt(self, msg, pat=None, default="y", matchflags=0):
         if not self.interactive: return default
         try:
-            r = self.readline(msg + ' ')
+            r = self._readline(msg + ' ')
             if not pat or re.match(pat, r, matchflags):
                 return r
             else: