Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

htmlui: use lists to hold output

''.join(list) is much faster than iterative string concatenation

Changeset 1519249de5a9

Parent 139cd2dfa477

by Steve Borho

Changes to one file · Browse files at 1519249de5a9 Showing diff from parent 139cd2dfa477 Diff from another changeset...

 
17
18
19
20
21
 
22
23
24
 
27
28
29
30
 
31
32
33
34
 
35
36
37
 
51
52
53
54
55
 
 
56
57
58
 
17
18
19
 
 
20
21
22
23
 
26
27
28
 
29
30
31
32
 
33
34
35
36
 
50
51
52
 
 
53
54
55
56
57
@@ -17,8 +17,7 @@
  super(htmlui, self).__init__(src)   self.setconfig('ui', 'interactive', 'off')   self.setconfig('progress', 'disable', 'True') - self.output = '' - self.error = '' + self.output, self.error = [], []   os.environ['TERM'] = 'dumb'   qtlib.configstyles(self)   @@ -27,11 +26,11 @@
  if self._buffers:   self._buffers[-1].extend([(str(a), label) for a in args])   else: - self.output += self.label(''.join(args), label) + self.output.append(self.label(''.join(args), label))     def write_err(self, *args, **opts):   label = opts.get('label', 'ui.error') - self.error += self.label(''.join(args), label) + self.error.append(self.label(''.join(args), label))     def label(self, msg, label):   msg = hglib.tounicode(msg) @@ -51,8 +50,8 @@
  return True     def getdata(self): - d, e = self.output, self.error - self.output, self.error = '', '' + d, e = ''.join(self.output), ''.join(self.error) + self.output, self.error = [], []   return d, e    if __name__ == "__main__":