Show More
@@ -94,23 +94,18 b' def colorstatus(orig, ui, repo, *pats, *' | |||||
94 |
|
94 | |||
95 | delimiter = opts['print0'] and '\0' or '\n' |
|
95 | delimiter = opts['print0'] and '\0' or '\n' | |
96 |
|
96 | |||
97 | # run status and capture it's output |
|
97 | nostatus = opts.get('no_status') | |
|
98 | opts['no_status'] = False | |||
|
99 | # run status and capture its output | |||
98 | ui.pushbuffer() |
|
100 | ui.pushbuffer() | |
99 | retval = orig(ui, repo, *pats, **opts) |
|
101 | retval = orig(ui, repo, *pats, **opts) | |
100 | # filter out empty strings |
|
102 | # filter out empty strings | |
101 | lines = [ line for line in ui.popbuffer().split(delimiter) if line ] |
|
103 | lines_with_status = [ line for line in ui.popbuffer().split(delimiter) if line ] | |
102 |
|
104 | |||
103 |
if |
|
105 | if nostatus: | |
104 | # if --no-status, run the command again without that option to get |
|
106 | lines = [l[2:] for l in lines_with_status] | |
105 | # output with status abbreviations |
|
|||
106 | opts['no_status'] = False |
|
|||
107 | ui.pushbuffer() |
|
|||
108 | orig(ui, repo, *pats, **opts) |
|
|||
109 | # filter out empty strings |
|
|||
110 | lines_with_status = [ line for |
|
|||
111 | line in ui.popbuffer().split(delimiter) if line ] |
|
|||
112 | else: |
|
107 | else: | |
113 |
lines |
|
108 | lines = lines_with_status | |
114 |
|
109 | |||
115 | # apply color to output and display it |
|
110 | # apply color to output and display it | |
116 | for i in xrange(0, len(lines)): |
|
111 | for i in xrange(0, len(lines)): |
General Comments 0
You need to be logged in to leave comments.
Login now