Show More
@@ -0,0 +1,11 b'' | |||||
|
1 | #!/usr/bin/env python | |||
|
2 | ||||
|
3 | from hgext import color | |||
|
4 | ||||
|
5 | # ensure errors aren't buffered | |||
|
6 | testui = color.colorui() | |||
|
7 | testui.pushbuffer() | |||
|
8 | testui.write('buffered\n') | |||
|
9 | testui.warn('warning\n') | |||
|
10 | testui.write_err('error\n') | |||
|
11 | print repr(testui.popbuffer()) |
@@ -154,7 +154,7 b' class colorui(uimod.ui):' | |||||
154 | self._buffers[-1].extend([(str(a), label) for a in args]) |
|
154 | self._buffers[-1].extend([(str(a), label) for a in args]) | |
155 | elif self._colormode == 'win32': |
|
155 | elif self._colormode == 'win32': | |
156 | for a in args: |
|
156 | for a in args: | |
157 |
win32print(a, |
|
157 | win32print(a, super(colorui, self).write, **opts) | |
158 | else: |
|
158 | else: | |
159 | return super(colorui, self).write( |
|
159 | return super(colorui, self).write( | |
160 | *[self.label(str(a), label) for a in args], **opts) |
|
160 | *[self.label(str(a), label) for a in args], **opts) | |
@@ -163,9 +163,9 b' class colorui(uimod.ui):' | |||||
163 | label = opts.get('label', '') |
|
163 | label = opts.get('label', '') | |
164 | if self._colormode == 'win32': |
|
164 | if self._colormode == 'win32': | |
165 | for a in args: |
|
165 | for a in args: | |
166 |
win32print(a, |
|
166 | win32print(a, super(colorui, self).write_err, **opts) | |
167 | else: |
|
167 | else: | |
168 | return super(colorui, self).write( |
|
168 | return super(colorui, self).write_err( | |
169 | *[self.label(str(a), label) for a in args], **opts) |
|
169 | *[self.label(str(a), label) for a in args], **opts) | |
170 |
|
170 | |||
171 | def label(self, msg, label): |
|
171 | def label(self, msg, label): |
@@ -81,7 +81,7 b' class progresssource(object):' | |||||
81 |
|
81 | |||
82 | def getfile(self, file, rev): |
|
82 | def getfile(self, file, rev): | |
83 | self.retrieved += 1 |
|
83 | self.retrieved += 1 | |
84 |
self.ui.progress(_(' |
|
84 | self.ui.progress(_('getting files'), self.retrieved, | |
85 | item=file, total=self.filecount) |
|
85 | item=file, total=self.filecount) | |
86 | return self.source.getfile(file, rev) |
|
86 | return self.source.getfile(file, rev) | |
87 |
|
87 | |||
@@ -89,7 +89,7 b' class progresssource(object):' | |||||
89 | return self.source.lookuprev(rev) |
|
89 | return self.source.lookuprev(rev) | |
90 |
|
90 | |||
91 | def close(self): |
|
91 | def close(self): | |
92 |
self.ui.progress(_(' |
|
92 | self.ui.progress(_('getting files'), None) | |
93 |
|
93 | |||
94 | class converter(object): |
|
94 | class converter(object): | |
95 | def __init__(self, ui, source, dest, revmapfile, opts): |
|
95 | def __init__(self, ui, source, dest, revmapfile, opts): |
@@ -88,30 +88,30 b' scanning [ <=> ' | |||||
88 | scanning [ <=> ] 4 |
|
88 | scanning [ <=> ] 4 | |
89 |
|
89 | |||
90 | converting [ ] 0/4 |
|
90 | converting [ ] 0/4 | |
91 |
|
|
91 | getting files [==========> ] 1/5 | |
92 |
|
|
92 | getting files [======================> ] 2/5 | |
93 |
|
|
93 | getting files [==================================> ] 3/5 | |
94 |
|
|
94 | getting files [==============================================> ] 4/5 | |
95 |
|
|
95 | getting files [==========================================================>] 5/5 | |
96 |
|
96 | |||
97 | converting [==============> ] 1/4 |
|
97 | converting [==============> ] 1/4 | |
98 | scanning paths [ ] 0/1 |
|
98 | scanning paths [ ] 0/1 | |
99 |
|
99 | |||
100 |
|
|
100 | getting files [==========================================================>] 1/1 | |
101 |
|
101 | |||
102 | converting [==============================> ] 2/4 |
|
102 | converting [==============================> ] 2/4 | |
103 | scanning paths [ ] 0/2 |
|
103 | scanning paths [ ] 0/2 | |
104 | scanning paths [============================> ] 1/2 |
|
104 | scanning paths [============================> ] 1/2 | |
105 |
|
105 | |||
106 |
|
|
106 | getting files [=============> ] 1/4 | |
107 |
|
|
107 | getting files [============================> ] 2/4 | |
108 |
|
|
108 | getting files [===========================================> ] 3/4 | |
109 |
|
|
109 | getting files [==========================================================>] 4/4 | |
110 |
|
110 | |||
111 | converting [=============================================> ] 3/4 |
|
111 | converting [=============================================> ] 3/4 | |
112 | scanning paths [ ] 0/1 |
|
112 | scanning paths [ ] 0/1 | |
113 |
|
113 | |||
114 |
|
|
114 | getting files [==========================================================>] 1/1 | |
115 |
|
115 | |||
116 | initializing destination hg-progress repository |
|
116 | initializing destination hg-progress repository | |
117 | scanning source... |
|
117 | scanning source... |
General Comments 0
You need to be logged in to leave comments.
Login now