mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
smartlog: simplify the coloration code with a list compression
Shorte, easier to read.
This commit is contained in:
parent
ad5b4b4916
commit
ab68fa3ea3
@ -43,11 +43,7 @@ def uisetup(ui):
|
|||||||
elif char == "x":
|
elif char == "x":
|
||||||
color = "\033[30m\033[1m"
|
color = "\033[30m\033[1m"
|
||||||
if color is not None:
|
if color is not None:
|
||||||
newtext = []
|
text = [color + line + "\033[0m" for line in text]
|
||||||
for line in text:
|
|
||||||
line = color + line + "\033[0m"
|
|
||||||
newtext.append(line)
|
|
||||||
text = newtext
|
|
||||||
return orig(ui, state, type, char, text, coldata)
|
return orig(ui, state, type, char, text, coldata)
|
||||||
wrapfunction(graphmod, 'ascii', ascii)
|
wrapfunction(graphmod, 'ascii', ascii)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user