Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 15067:cc16323e748d
merge with stable
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Tue, 30 Aug 2011 15:22:10 +0200 |
parents | 7c03e3b1b858 0fc95f5cea57 |
children | bfe903b1ff4e |
comparison
equal
deleted
inserted
replaced
15061:86380f24e697 | 15067:cc16323e748d |
---|---|
553 | 553 |
554 # call write() so output goes through subclassed implementation | 554 # call write() so output goes through subclassed implementation |
555 # e.g. color extension on Windows | 555 # e.g. color extension on Windows |
556 self.write(prompt) | 556 self.write(prompt) |
557 | 557 |
558 # instead of trying to emulate raw_input, swap self.fin with sys.stdin | 558 # instead of trying to emulate raw_input, swap (self.fin, |
559 old = sys.stdin | 559 # self.fout) with (sys.stdin, sys.stdout) |
560 oldin = sys.stdin | |
561 oldout = sys.stdout | |
560 sys.stdin = self.fin | 562 sys.stdin = self.fin |
563 sys.stdout = self.fout | |
561 line = raw_input(' ') | 564 line = raw_input(' ') |
562 sys.stdin = old | 565 sys.stdin = oldin |
566 sys.stdout = oldout | |
563 | 567 |
564 # When stdin is in binary mode on Windows, it can cause | 568 # When stdin is in binary mode on Windows, it can cause |
565 # raw_input() to emit an extra trailing carriage return | 569 # raw_input() to emit an extra trailing carriage return |
566 if os.linesep == '\r\n' and line and line[-1] == '\r': | 570 if os.linesep == '\r\n' and line and line[-1] == '\r': |
567 line = line[:-1] | 571 line = line[:-1] |