mercurial/commands.py
changeset 22478 a6b1413511f1
parent 22477 3c8ae79eacb0
child 22479 5d9e46d93c1d
equal deleted inserted replaced
22477:3c8ae79eacb0 22478:a6b1413511f1
   317         pieces = []
   317         pieces = []
   318 
   318 
   319         for f, sep in funcmap:
   319         for f, sep in funcmap:
   320             l = [f(n) for n, dummy in lines]
   320             l = [f(n) for n, dummy in lines]
   321             if l:
   321             if l:
   322                 sized = [(x, encoding.colwidth(x)) for x in l]
   322                 sizes = [encoding.colwidth(x) for x in l]
   323                 ml = max([w for x, w in sized])
   323                 ml = max(sizes)
   324                 formats.append([sep + ' ' * (ml - w) + '%s'
   324                 formats.append([sep + ' ' * (ml - w) + '%s' for w in sizes])
   325                                 for x, w in sized])
       
   326                 pieces.append(l)
   325                 pieces.append(l)
   327 
   326 
   328         for f, p, l in zip(zip(*formats), zip(*pieces), lines):
   327         for f, p, l in zip(zip(*formats), zip(*pieces), lines):
   329             ui.write("".join(f) % p)
   328             ui.write("".join(f) % p)
   330             ui.write(": %s" % l[1])
   329             ui.write(": %s" % l[1])