Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 40573:0c7b2035a604
ui: indent _writenobuf() to prepare moving bits from _write() functions
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 03 Nov 2018 17:43:57 +0900 |
parents | 51091816a355 |
children | 25732c5678bc |
comparison
equal
deleted
inserted
replaced
40572:51091816a355 | 40573:0c7b2035a604 |
---|---|
950 self._writenobuf(self._write, *args, **opts) | 950 self._writenobuf(self._write, *args, **opts) |
951 | 951 |
952 def _writenobuf(self, write, *args, **opts): | 952 def _writenobuf(self, write, *args, **opts): |
953 self._progclear() | 953 self._progclear() |
954 msg = b''.join(args) | 954 msg = b''.join(args) |
955 if self._colormode == 'win32': | 955 try: |
956 # windows color printing is its own can of crab, defer to | 956 if self._colormode == 'win32': |
957 # the color module and that is it. | 957 # windows color printing is its own can of crab, defer to |
958 color.win32print(self, write, msg, **opts) | 958 # the color module and that is it. |
959 else: | 959 color.win32print(self, write, msg, **opts) |
960 if self._colormode is not None: | 960 else: |
961 label = opts.get(r'label', '') | 961 if self._colormode is not None: |
962 msg = self.label(msg, label) | 962 label = opts.get(r'label', '') |
963 write(msg) | 963 msg = self.label(msg, label) |
964 write(msg) | |
965 finally: | |
966 pass | |
964 | 967 |
965 def _write(self, data): | 968 def _write(self, data): |
966 # opencode timeblockedsection because this is a critical path | 969 # opencode timeblockedsection because this is a critical path |
967 starttime = util.timer() | 970 starttime = util.timer() |
968 try: | 971 try: |