changeset 15002:b55c1c6a793e

merge with stable
author Matt Mackall <mpm@selenic.com>
date Mon, 01 Aug 2011 14:52:11 -0500
parents f6a737357195 (current diff) dd74cd1e5d49 (diff)
children a31b8e03af28
files mercurial/hgweb/hgwebdir_mod.py mercurial/ui.py
diffstat 2 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Mon Aug 01 10:54:34 2011 -0500
+++ b/mercurial/hgweb/hgwebdir_mod.py	Mon Aug 01 14:52:11 2011 -0500
@@ -370,4 +370,7 @@
             env['SERVER_NAME'] = u.host
             if u.port:
                 env['SERVER_PORT'] = u.port
-            env['SCRIPT_NAME'] = '/' + u.path
+            path = u.path or ""
+            if not path.startswith('/'):
+                path = '/' + path
+            env['SCRIPT_NAME'] = path
--- a/mercurial/ui.py	Mon Aug 01 10:54:34 2011 -0500
+++ b/mercurial/ui.py	Mon Aug 01 14:52:11 2011 -0500
@@ -539,12 +539,15 @@
             except Exception:
                 pass
 
-        # instead of trying to emulate raw_input, swap our in/out
-        # with sys.stdin/out
-        old = sys.stdout, sys.stdin
-        sys.stdout, sys.stdin = self.fout, self.fin
-        line = raw_input(prompt)
-        sys.stdout, sys.stdin = old
+        # call write() so output goes through subclassed implementation
+        # e.g. color extension on Windows
+        self.write(prompt)
+
+        # instead of trying to emulate raw_input, swap self.fin with sys.stdin
+        old = sys.stdin
+        sys.stdin = self.fin
+        line = raw_input()
+        sys.stdin = old
 
         # When stdin is in binary mode on Windows, it can cause
         # raw_input() to emit an extra trailing carriage return