Show More
@@ -1,271 +1,266 b'' | |||||
1 | # color.py color output for the status and qseries commands |
|
1 | # color.py color output for the status and qseries commands | |
2 | # |
|
2 | # | |
3 | # Copyright (C) 2007 Kevin Christen <kevin.christen@gmail.com> |
|
3 | # Copyright (C) 2007 Kevin Christen <kevin.christen@gmail.com> | |
4 | # |
|
4 | # | |
5 | # This program is free software; you can redistribute it and/or modify it |
|
5 | # This program is free software; you can redistribute it and/or modify it | |
6 | # under the terms of the GNU General Public License as published by the |
|
6 | # under the terms of the GNU General Public License as published by the | |
7 | # Free Software Foundation; either version 2 of the License, or (at your |
|
7 | # Free Software Foundation; either version 2 of the License, or (at your | |
8 | # option) any later version. |
|
8 | # option) any later version. | |
9 | # |
|
9 | # | |
10 | # This program is distributed in the hope that it will be useful, but |
|
10 | # This program is distributed in the hope that it will be useful, but | |
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | |
13 | # Public License for more details. |
|
13 | # Public License for more details. | |
14 | # |
|
14 | # | |
15 | # You should have received a copy of the GNU General Public License along |
|
15 | # You should have received a copy of the GNU General Public License along | |
16 | # with this program; if not, write to the Free Software Foundation, Inc., |
|
16 | # with this program; if not, write to the Free Software Foundation, Inc., | |
17 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
|
17 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 |
|
18 | |||
19 | '''add color output to status, qseries, and diff-related commands |
|
19 | '''add color output to status, qseries, and diff-related commands | |
20 |
|
20 | |||
21 | This extension modifies the status command to add color to its output to |
|
21 | This extension modifies the status command to add color to its output to | |
22 | reflect file status, the qseries command to add color to reflect patch status |
|
22 | reflect file status, the qseries command to add color to reflect patch status | |
23 | (applied, unapplied, missing), and to diff-related commands to highlight |
|
23 | (applied, unapplied, missing), and to diff-related commands to highlight | |
24 | additions, removals, diff headers, and trailing whitespace. |
|
24 | additions, removals, diff headers, and trailing whitespace. | |
25 |
|
25 | |||
26 | Other effects in addition to color, like bold and underlined text, are also |
|
26 | Other effects in addition to color, like bold and underlined text, are also | |
27 | available. Effects are rendered with the ECMA-48 SGR control function (aka |
|
27 | available. Effects are rendered with the ECMA-48 SGR control function (aka | |
28 | ANSI escape codes). This module also provides the render_text function, |
|
28 | ANSI escape codes). This module also provides the render_text function, | |
29 | which can be used to add effects to any text. |
|
29 | which can be used to add effects to any text. | |
30 |
|
30 | |||
31 | To enable this extension, add this to your .hgrc file: |
|
31 | To enable this extension, add this to your .hgrc file: | |
32 | [extensions] |
|
32 | [extensions] | |
33 | color = |
|
33 | color = | |
34 |
|
34 | |||
35 | Default effects my be overriden from the .hgrc file: |
|
35 | Default effects my be overriden from the .hgrc file: | |
36 |
|
36 | |||
37 | [color] |
|
37 | [color] | |
38 | status.modified = blue bold underline red_background |
|
38 | status.modified = blue bold underline red_background | |
39 | status.added = green bold |
|
39 | status.added = green bold | |
40 | status.removed = red bold blue_background |
|
40 | status.removed = red bold blue_background | |
41 | status.deleted = cyan bold underline |
|
41 | status.deleted = cyan bold underline | |
42 | status.unknown = magenta bold underline |
|
42 | status.unknown = magenta bold underline | |
43 | status.ignored = black bold |
|
43 | status.ignored = black bold | |
44 |
|
44 | |||
45 | # 'none' turns off all effects |
|
45 | # 'none' turns off all effects | |
46 | status.clean = none |
|
46 | status.clean = none | |
47 | status.copied = none |
|
47 | status.copied = none | |
48 |
|
48 | |||
49 | qseries.applied = blue bold underline |
|
49 | qseries.applied = blue bold underline | |
50 | qseries.unapplied = black bold |
|
50 | qseries.unapplied = black bold | |
51 | qseries.missing = red bold |
|
51 | qseries.missing = red bold | |
52 |
|
52 | |||
53 | diff.diffline = bold |
|
53 | diff.diffline = bold | |
54 | diff.extended = cyan bold |
|
54 | diff.extended = cyan bold | |
55 | diff.file_a = red bold |
|
55 | diff.file_a = red bold | |
56 | diff.file_b = green bold |
|
56 | diff.file_b = green bold | |
57 | diff.hunk = magenta |
|
57 | diff.hunk = magenta | |
58 | diff.deleted = red |
|
58 | diff.deleted = red | |
59 | diff.inserted = green |
|
59 | diff.inserted = green | |
60 | diff.changed = white |
|
60 | diff.changed = white | |
61 | diff.trailingwhitespace = bold red_background |
|
61 | diff.trailingwhitespace = bold red_background | |
62 | ''' |
|
62 | ''' | |
63 |
|
63 | |||
64 | import os, re, sys |
|
64 | import os, re, sys | |
65 |
|
65 | |||
66 | from mercurial import cmdutil, commands, extensions |
|
66 | from mercurial import cmdutil, commands, extensions | |
67 | from mercurial.i18n import _ |
|
67 | from mercurial.i18n import _ | |
68 |
|
68 | |||
69 | # start and stop parameters for effects |
|
69 | # start and stop parameters for effects | |
70 |
_effect_params = { |
|
70 | _effect_params = {'none': 0, | |
71 |
|
|
71 | 'black': 30, | |
72 |
|
|
72 | 'red': 31, | |
73 |
|
|
73 | 'green': 32, | |
74 |
|
|
74 | 'yellow': 33, | |
75 |
|
|
75 | 'blue': 34, | |
76 |
|
|
76 | 'magenta': 35, | |
77 |
|
|
77 | 'cyan': 36, | |
78 |
|
|
78 | 'white': 37, | |
79 |
|
|
79 | 'bold': 1, | |
80 |
|
|
80 | 'italic': 3, | |
81 |
|
|
81 | 'underline': 4, | |
82 |
|
|
82 | 'inverse': 7, | |
83 |
|
|
83 | 'black_background': 40, | |
84 |
|
|
84 | 'red_background': 41, | |
85 |
|
|
85 | 'green_background': 42, | |
86 |
|
|
86 | 'yellow_background': 43, | |
87 |
|
|
87 | 'blue_background': 44, | |
88 |
|
|
88 | 'purple_background': 45, | |
89 |
|
|
89 | 'cyan_background': 46, | |
90 |
|
|
90 | 'white_background': 47} | |
91 |
|
91 | |||
92 | def render_effects(text, *effects): |
|
92 | def render_effects(text, *effects): | |
93 | 'Wrap text in commands to turn on each effect.' |
|
93 | 'Wrap text in commands to turn on each effect.' | |
94 |
start = [ |
|
94 | start = [str(_effect_params[e]) for e in ('none',) + effects] | |
95 | stop = [] |
|
|||
96 | for effect in effects: |
|
|||
97 | start.append(str(_effect_params[effect][0])) |
|
|||
98 | stop.append(str(_effect_params[effect][1])) |
|
|||
99 | stop.append(str(_effect_params['none'][1])) |
|
|||
100 | start = '\033[' + ';'.join(start) + 'm' |
|
95 | start = '\033[' + ';'.join(start) + 'm' | |
101 |
stop = '\033[' + ' |
|
96 | stop = '\033[' + str(_effect_params['none']) + 'm' | |
102 |
return start |
|
97 | return ''.join([start, text, stop]) | |
103 |
|
98 | |||
104 | def colorstatus(orig, ui, repo, *pats, **opts): |
|
99 | def colorstatus(orig, ui, repo, *pats, **opts): | |
105 | '''run the status command with colored output''' |
|
100 | '''run the status command with colored output''' | |
106 |
|
101 | |||
107 | delimiter = opts['print0'] and '\0' or '\n' |
|
102 | delimiter = opts['print0'] and '\0' or '\n' | |
108 |
|
103 | |||
109 | nostatus = opts.get('no_status') |
|
104 | nostatus = opts.get('no_status') | |
110 | opts['no_status'] = False |
|
105 | opts['no_status'] = False | |
111 | # run status and capture its output |
|
106 | # run status and capture its output | |
112 | ui.pushbuffer() |
|
107 | ui.pushbuffer() | |
113 | retval = orig(ui, repo, *pats, **opts) |
|
108 | retval = orig(ui, repo, *pats, **opts) | |
114 | # filter out empty strings |
|
109 | # filter out empty strings | |
115 | lines_with_status = [ line for line in ui.popbuffer().split(delimiter) if line ] |
|
110 | lines_with_status = [ line for line in ui.popbuffer().split(delimiter) if line ] | |
116 |
|
111 | |||
117 | if nostatus: |
|
112 | if nostatus: | |
118 | lines = [l[2:] for l in lines_with_status] |
|
113 | lines = [l[2:] for l in lines_with_status] | |
119 | else: |
|
114 | else: | |
120 | lines = lines_with_status |
|
115 | lines = lines_with_status | |
121 |
|
116 | |||
122 | # apply color to output and display it |
|
117 | # apply color to output and display it | |
123 | for i in xrange(0, len(lines)): |
|
118 | for i in xrange(0, len(lines)): | |
124 | status = _status_abbreviations[lines_with_status[i][0]] |
|
119 | status = _status_abbreviations[lines_with_status[i][0]] | |
125 | effects = _status_effects[status] |
|
120 | effects = _status_effects[status] | |
126 | if effects: |
|
121 | if effects: | |
127 | lines[i] = render_effects(lines[i], *effects) |
|
122 | lines[i] = render_effects(lines[i], *effects) | |
128 | ui.write(lines[i] + delimiter) |
|
123 | ui.write(lines[i] + delimiter) | |
129 | return retval |
|
124 | return retval | |
130 |
|
125 | |||
131 | _status_abbreviations = { 'M': 'modified', |
|
126 | _status_abbreviations = { 'M': 'modified', | |
132 | 'A': 'added', |
|
127 | 'A': 'added', | |
133 | 'R': 'removed', |
|
128 | 'R': 'removed', | |
134 | '!': 'deleted', |
|
129 | '!': 'deleted', | |
135 | '?': 'unknown', |
|
130 | '?': 'unknown', | |
136 | 'I': 'ignored', |
|
131 | 'I': 'ignored', | |
137 | 'C': 'clean', |
|
132 | 'C': 'clean', | |
138 | ' ': 'copied', } |
|
133 | ' ': 'copied', } | |
139 |
|
134 | |||
140 | _status_effects = { 'modified': ('blue', 'bold'), |
|
135 | _status_effects = { 'modified': ('blue', 'bold'), | |
141 | 'added': ('green', 'bold'), |
|
136 | 'added': ('green', 'bold'), | |
142 | 'removed': ('red', 'bold'), |
|
137 | 'removed': ('red', 'bold'), | |
143 | 'deleted': ('cyan', 'bold', 'underline'), |
|
138 | 'deleted': ('cyan', 'bold', 'underline'), | |
144 | 'unknown': ('magenta', 'bold', 'underline'), |
|
139 | 'unknown': ('magenta', 'bold', 'underline'), | |
145 | 'ignored': ('black', 'bold'), |
|
140 | 'ignored': ('black', 'bold'), | |
146 | 'clean': ('none', ), |
|
141 | 'clean': ('none', ), | |
147 | 'copied': ('none', ), } |
|
142 | 'copied': ('none', ), } | |
148 |
|
143 | |||
149 | def colorqseries(orig, ui, repo, *dummy, **opts): |
|
144 | def colorqseries(orig, ui, repo, *dummy, **opts): | |
150 | '''run the qseries command with colored output''' |
|
145 | '''run the qseries command with colored output''' | |
151 | ui.pushbuffer() |
|
146 | ui.pushbuffer() | |
152 | retval = orig(ui, repo, **opts) |
|
147 | retval = orig(ui, repo, **opts) | |
153 | patches = ui.popbuffer().splitlines() |
|
148 | patches = ui.popbuffer().splitlines() | |
154 | for patch in patches: |
|
149 | for patch in patches: | |
155 | patchname = patch |
|
150 | patchname = patch | |
156 | if opts['summary']: |
|
151 | if opts['summary']: | |
157 | patchname = patchname.split(': ')[0] |
|
152 | patchname = patchname.split(': ')[0] | |
158 | if ui.verbose: |
|
153 | if ui.verbose: | |
159 | patchname = patchname.split(' ', 2)[-1] |
|
154 | patchname = patchname.split(' ', 2)[-1] | |
160 |
|
155 | |||
161 | if opts['missing']: |
|
156 | if opts['missing']: | |
162 | effects = _patch_effects['missing'] |
|
157 | effects = _patch_effects['missing'] | |
163 | # Determine if patch is applied. |
|
158 | # Determine if patch is applied. | |
164 | elif [ applied for applied in repo.mq.applied |
|
159 | elif [ applied for applied in repo.mq.applied | |
165 | if patchname == applied.name ]: |
|
160 | if patchname == applied.name ]: | |
166 | effects = _patch_effects['applied'] |
|
161 | effects = _patch_effects['applied'] | |
167 | else: |
|
162 | else: | |
168 | effects = _patch_effects['unapplied'] |
|
163 | effects = _patch_effects['unapplied'] | |
169 | ui.write(render_effects(patch, *effects) + '\n') |
|
164 | ui.write(render_effects(patch, *effects) + '\n') | |
170 | return retval |
|
165 | return retval | |
171 |
|
166 | |||
172 | _patch_effects = { 'applied': ('blue', 'bold', 'underline'), |
|
167 | _patch_effects = { 'applied': ('blue', 'bold', 'underline'), | |
173 | 'missing': ('red', 'bold'), |
|
168 | 'missing': ('red', 'bold'), | |
174 | 'unapplied': ('black', 'bold'), } |
|
169 | 'unapplied': ('black', 'bold'), } | |
175 |
|
170 | |||
176 | def colorwrap(orig, s): |
|
171 | def colorwrap(orig, s): | |
177 | '''wrap ui.write for colored diff output''' |
|
172 | '''wrap ui.write for colored diff output''' | |
178 | lines = s.split('\n') |
|
173 | lines = s.split('\n') | |
179 | for i, line in enumerate(lines): |
|
174 | for i, line in enumerate(lines): | |
180 | stripline = line |
|
175 | stripline = line | |
181 | if line and line[0] in '+-': |
|
176 | if line and line[0] in '+-': | |
182 | # highlight trailing whitespace, but only in changed lines |
|
177 | # highlight trailing whitespace, but only in changed lines | |
183 | stripline = line.rstrip() |
|
178 | stripline = line.rstrip() | |
184 | for prefix, style in _diff_prefixes: |
|
179 | for prefix, style in _diff_prefixes: | |
185 | if stripline.startswith(prefix): |
|
180 | if stripline.startswith(prefix): | |
186 | lines[i] = render_effects(stripline, *_diff_effects[style]) |
|
181 | lines[i] = render_effects(stripline, *_diff_effects[style]) | |
187 | break |
|
182 | break | |
188 | if line != stripline: |
|
183 | if line != stripline: | |
189 | lines[i] += render_effects( |
|
184 | lines[i] += render_effects( | |
190 | line[len(stripline):], *_diff_effects['trailingwhitespace']) |
|
185 | line[len(stripline):], *_diff_effects['trailingwhitespace']) | |
191 | orig('\n'.join(lines)) |
|
186 | orig('\n'.join(lines)) | |
192 |
|
187 | |||
193 | def colorshowpatch(orig, self, node): |
|
188 | def colorshowpatch(orig, self, node): | |
194 | '''wrap cmdutil.changeset_printer.showpatch with colored output''' |
|
189 | '''wrap cmdutil.changeset_printer.showpatch with colored output''' | |
195 | oldwrite = extensions.wrapfunction(self.ui, 'write', colorwrap) |
|
190 | oldwrite = extensions.wrapfunction(self.ui, 'write', colorwrap) | |
196 | try: |
|
191 | try: | |
197 | orig(self, node) |
|
192 | orig(self, node) | |
198 | finally: |
|
193 | finally: | |
199 | self.ui.write = oldwrite |
|
194 | self.ui.write = oldwrite | |
200 |
|
195 | |||
201 | def colordiff(orig, ui, repo, *pats, **opts): |
|
196 | def colordiff(orig, ui, repo, *pats, **opts): | |
202 | '''run the diff command with colored output''' |
|
197 | '''run the diff command with colored output''' | |
203 | oldwrite = extensions.wrapfunction(ui, 'write', colorwrap) |
|
198 | oldwrite = extensions.wrapfunction(ui, 'write', colorwrap) | |
204 | try: |
|
199 | try: | |
205 | orig(ui, repo, *pats, **opts) |
|
200 | orig(ui, repo, *pats, **opts) | |
206 | finally: |
|
201 | finally: | |
207 | ui.write = oldwrite |
|
202 | ui.write = oldwrite | |
208 |
|
203 | |||
209 | _diff_prefixes = [('diff', 'diffline'), |
|
204 | _diff_prefixes = [('diff', 'diffline'), | |
210 | ('copy', 'extended'), |
|
205 | ('copy', 'extended'), | |
211 | ('rename', 'extended'), |
|
206 | ('rename', 'extended'), | |
212 | ('new', 'extended'), |
|
207 | ('new', 'extended'), | |
213 | ('deleted', 'extended'), |
|
208 | ('deleted', 'extended'), | |
214 | ('---', 'file_a'), |
|
209 | ('---', 'file_a'), | |
215 | ('+++', 'file_b'), |
|
210 | ('+++', 'file_b'), | |
216 | ('@', 'hunk'), |
|
211 | ('@', 'hunk'), | |
217 | ('-', 'deleted'), |
|
212 | ('-', 'deleted'), | |
218 | ('+', 'inserted')] |
|
213 | ('+', 'inserted')] | |
219 |
|
214 | |||
220 | _diff_effects = {'diffline': ('bold',), |
|
215 | _diff_effects = {'diffline': ('bold',), | |
221 | 'extended': ('cyan', 'bold'), |
|
216 | 'extended': ('cyan', 'bold'), | |
222 | 'file_a': ('red', 'bold'), |
|
217 | 'file_a': ('red', 'bold'), | |
223 | 'file_b': ('green', 'bold'), |
|
218 | 'file_b': ('green', 'bold'), | |
224 | 'hunk': ('magenta',), |
|
219 | 'hunk': ('magenta',), | |
225 | 'deleted': ('red',), |
|
220 | 'deleted': ('red',), | |
226 | 'inserted': ('green',), |
|
221 | 'inserted': ('green',), | |
227 | 'changed': ('white',), |
|
222 | 'changed': ('white',), | |
228 | 'trailingwhitespace': ('bold', 'red_background'),} |
|
223 | 'trailingwhitespace': ('bold', 'red_background'),} | |
229 |
|
224 | |||
230 | def uisetup(ui): |
|
225 | def uisetup(ui): | |
231 | '''Initialize the extension.''' |
|
226 | '''Initialize the extension.''' | |
232 | _setupcmd(ui, 'diff', commands.table, colordiff, _diff_effects) |
|
227 | _setupcmd(ui, 'diff', commands.table, colordiff, _diff_effects) | |
233 | _setupcmd(ui, 'incoming', commands.table, None, _diff_effects) |
|
228 | _setupcmd(ui, 'incoming', commands.table, None, _diff_effects) | |
234 | _setupcmd(ui, 'log', commands.table, None, _diff_effects) |
|
229 | _setupcmd(ui, 'log', commands.table, None, _diff_effects) | |
235 | _setupcmd(ui, 'outgoing', commands.table, None, _diff_effects) |
|
230 | _setupcmd(ui, 'outgoing', commands.table, None, _diff_effects) | |
236 | _setupcmd(ui, 'tip', commands.table, None, _diff_effects) |
|
231 | _setupcmd(ui, 'tip', commands.table, None, _diff_effects) | |
237 | _setupcmd(ui, 'status', commands.table, colorstatus, _status_effects) |
|
232 | _setupcmd(ui, 'status', commands.table, colorstatus, _status_effects) | |
238 | if ui.config('extensions', 'hgext.mq') is not None or \ |
|
233 | if ui.config('extensions', 'hgext.mq') is not None or \ | |
239 | ui.config('extensions', 'mq') is not None: |
|
234 | ui.config('extensions', 'mq') is not None: | |
240 | from hgext import mq |
|
235 | from hgext import mq | |
241 | _setupcmd(ui, 'qdiff', mq.cmdtable, colordiff, _diff_effects) |
|
236 | _setupcmd(ui, 'qdiff', mq.cmdtable, colordiff, _diff_effects) | |
242 | _setupcmd(ui, 'qseries', mq.cmdtable, colorqseries, _patch_effects) |
|
237 | _setupcmd(ui, 'qseries', mq.cmdtable, colorqseries, _patch_effects) | |
243 |
|
238 | |||
244 | def _setupcmd(ui, cmd, table, func, effectsmap): |
|
239 | def _setupcmd(ui, cmd, table, func, effectsmap): | |
245 | '''patch in command to command table and load effect map''' |
|
240 | '''patch in command to command table and load effect map''' | |
246 | def nocolor(orig, *args, **opts): |
|
241 | def nocolor(orig, *args, **opts): | |
247 |
|
242 | |||
248 | if (opts['no_color'] or opts['color'] == 'never' or |
|
243 | if (opts['no_color'] or opts['color'] == 'never' or | |
249 | (opts['color'] == 'auto' and (os.environ.get('TERM') == 'dumb' |
|
244 | (opts['color'] == 'auto' and (os.environ.get('TERM') == 'dumb' | |
250 | or not sys.__stdout__.isatty()))): |
|
245 | or not sys.__stdout__.isatty()))): | |
251 | return orig(*args, **opts) |
|
246 | return orig(*args, **opts) | |
252 |
|
247 | |||
253 | oldshowpatch = extensions.wrapfunction(cmdutil.changeset_printer, |
|
248 | oldshowpatch = extensions.wrapfunction(cmdutil.changeset_printer, | |
254 | 'showpatch', colorshowpatch) |
|
249 | 'showpatch', colorshowpatch) | |
255 | try: |
|
250 | try: | |
256 | if func is not None: |
|
251 | if func is not None: | |
257 | return func(orig, *args, **opts) |
|
252 | return func(orig, *args, **opts) | |
258 | return orig(*args, **opts) |
|
253 | return orig(*args, **opts) | |
259 | finally: |
|
254 | finally: | |
260 | cmdutil.changeset_printer.showpatch = oldshowpatch |
|
255 | cmdutil.changeset_printer.showpatch = oldshowpatch | |
261 |
|
256 | |||
262 | entry = extensions.wrapcommand(table, cmd, nocolor) |
|
257 | entry = extensions.wrapcommand(table, cmd, nocolor) | |
263 | entry[1].extend([ |
|
258 | entry[1].extend([ | |
264 | ('', 'color', 'auto', _("when to colorize (always, auto, or never)")), |
|
259 | ('', 'color', 'auto', _("when to colorize (always, auto, or never)")), | |
265 | ('', 'no-color', None, _("don't colorize output")), |
|
260 | ('', 'no-color', None, _("don't colorize output")), | |
266 | ]) |
|
261 | ]) | |
267 |
|
262 | |||
268 | for status in effectsmap: |
|
263 | for status in effectsmap: | |
269 | effects = ui.config('color', cmd + '.' + status) |
|
264 | effects = ui.config('color', cmd + '.' + status) | |
270 | if effects: |
|
265 | if effects: | |
271 | effectsmap[status] = re.split('\W+', effects) |
|
266 | effectsmap[status] = re.split('\W+', effects) |
@@ -1,25 +1,25 b'' | |||||
1 | adding a |
|
1 | adding a | |
2 | % default context |
|
2 | % default context | |
3 |
[0;1mdiff -r cf9f4ba66af2 a[ |
|
3 | [0;1mdiff -r cf9f4ba66af2 a[0m | |
4 |
[0;31;1m--- a/a[ |
|
4 | [0;31;1m--- a/a[0m | |
5 |
[0;32;1m+++ b/a[ |
|
5 | [0;32;1m+++ b/a[0m | |
6 |
[0;35m@@ -2,7 +2,7 @@[ |
|
6 | [0;35m@@ -2,7 +2,7 @@[0m | |
7 | c |
|
7 | c | |
8 | a |
|
8 | a | |
9 | a |
|
9 | a | |
10 |
[0;31m-b[ |
|
10 | [0;31m-b[0m | |
11 |
[0;32m+dd[ |
|
11 | [0;32m+dd[0m | |
12 | a |
|
12 | a | |
13 | a |
|
13 | a | |
14 | c |
|
14 | c | |
15 | % --unified=2 |
|
15 | % --unified=2 | |
16 |
[0;1mdiff -r cf9f4ba66af2 a[ |
|
16 | [0;1mdiff -r cf9f4ba66af2 a[0m | |
17 |
[0;31;1m--- a/a[ |
|
17 | [0;31;1m--- a/a[0m | |
18 |
[0;32;1m+++ b/a[ |
|
18 | [0;32;1m+++ b/a[0m | |
19 |
[0;35m@@ -3,5 +3,5 @@[ |
|
19 | [0;35m@@ -3,5 +3,5 @@[0m | |
20 | a |
|
20 | a | |
21 | a |
|
21 | a | |
22 |
[0;31m-b[ |
|
22 | [0;31m-b[0m | |
23 |
[0;32m+dd[ |
|
23 | [0;32m+dd[0m | |
24 | a |
|
24 | a | |
25 | a |
|
25 | a |
@@ -1,126 +1,126 b'' | |||||
1 | hg status in repo root: |
|
1 | hg status in repo root: | |
2 |
[0;35;1;4m? a/1/in_a_1[ |
|
2 | [0;35;1;4m? a/1/in_a_1[0m | |
3 |
[0;35;1;4m? a/in_a[ |
|
3 | [0;35;1;4m? a/in_a[0m | |
4 |
[0;35;1;4m? b/1/in_b_1[ |
|
4 | [0;35;1;4m? b/1/in_b_1[0m | |
5 |
[0;35;1;4m? b/2/in_b_2[ |
|
5 | [0;35;1;4m? b/2/in_b_2[0m | |
6 |
[0;35;1;4m? b/in_b[ |
|
6 | [0;35;1;4m? b/in_b[0m | |
7 |
[0;35;1;4m? in_root[ |
|
7 | [0;35;1;4m? in_root[0m | |
8 | hg status . in repo root: |
|
8 | hg status . in repo root: | |
9 |
[0;35;1;4m? a/1/in_a_1[ |
|
9 | [0;35;1;4m? a/1/in_a_1[0m | |
10 |
[0;35;1;4m? a/in_a[ |
|
10 | [0;35;1;4m? a/in_a[0m | |
11 |
[0;35;1;4m? b/1/in_b_1[ |
|
11 | [0;35;1;4m? b/1/in_b_1[0m | |
12 |
[0;35;1;4m? b/2/in_b_2[ |
|
12 | [0;35;1;4m? b/2/in_b_2[0m | |
13 |
[0;35;1;4m? b/in_b[ |
|
13 | [0;35;1;4m? b/in_b[0m | |
14 |
[0;35;1;4m? in_root[ |
|
14 | [0;35;1;4m? in_root[0m | |
15 | hg status in a: |
|
15 | hg status in a: | |
16 |
[0;35;1;4m? a/1/in_a_1[ |
|
16 | [0;35;1;4m? a/1/in_a_1[0m | |
17 |
[0;35;1;4m? a/in_a[ |
|
17 | [0;35;1;4m? a/in_a[0m | |
18 |
[0;35;1;4m? b/1/in_b_1[ |
|
18 | [0;35;1;4m? b/1/in_b_1[0m | |
19 |
[0;35;1;4m? b/2/in_b_2[ |
|
19 | [0;35;1;4m? b/2/in_b_2[0m | |
20 |
[0;35;1;4m? b/in_b[ |
|
20 | [0;35;1;4m? b/in_b[0m | |
21 |
[0;35;1;4m? in_root[ |
|
21 | [0;35;1;4m? in_root[0m | |
22 | hg status . in a: |
|
22 | hg status . in a: | |
23 |
[0;35;1;4m? 1/in_a_1[ |
|
23 | [0;35;1;4m? 1/in_a_1[0m | |
24 |
[0;35;1;4m? in_a[ |
|
24 | [0;35;1;4m? in_a[0m | |
25 | hg status .. in a: |
|
25 | hg status .. in a: | |
26 |
[0;35;1;4m? 1/in_a_1[ |
|
26 | [0;35;1;4m? 1/in_a_1[0m | |
27 |
[0;35;1;4m? in_a[ |
|
27 | [0;35;1;4m? in_a[0m | |
28 |
[0;35;1;4m? ../b/1/in_b_1[ |
|
28 | [0;35;1;4m? ../b/1/in_b_1[0m | |
29 |
[0;35;1;4m? ../b/2/in_b_2[ |
|
29 | [0;35;1;4m? ../b/2/in_b_2[0m | |
30 |
[0;35;1;4m? ../b/in_b[ |
|
30 | [0;35;1;4m? ../b/in_b[0m | |
31 |
[0;35;1;4m? ../in_root[ |
|
31 | [0;35;1;4m? ../in_root[0m | |
32 | hg status in b: |
|
32 | hg status in b: | |
33 |
[0;35;1;4m? a/1/in_a_1[ |
|
33 | [0;35;1;4m? a/1/in_a_1[0m | |
34 |
[0;35;1;4m? a/in_a[ |
|
34 | [0;35;1;4m? a/in_a[0m | |
35 |
[0;35;1;4m? b/1/in_b_1[ |
|
35 | [0;35;1;4m? b/1/in_b_1[0m | |
36 |
[0;35;1;4m? b/2/in_b_2[ |
|
36 | [0;35;1;4m? b/2/in_b_2[0m | |
37 |
[0;35;1;4m? b/in_b[ |
|
37 | [0;35;1;4m? b/in_b[0m | |
38 |
[0;35;1;4m? in_root[ |
|
38 | [0;35;1;4m? in_root[0m | |
39 | hg status . in b: |
|
39 | hg status . in b: | |
40 |
[0;35;1;4m? 1/in_b_1[ |
|
40 | [0;35;1;4m? 1/in_b_1[0m | |
41 |
[0;35;1;4m? 2/in_b_2[ |
|
41 | [0;35;1;4m? 2/in_b_2[0m | |
42 |
[0;35;1;4m? in_b[ |
|
42 | [0;35;1;4m? in_b[0m | |
43 | hg status .. in b: |
|
43 | hg status .. in b: | |
44 |
[0;35;1;4m? ../a/1/in_a_1[ |
|
44 | [0;35;1;4m? ../a/1/in_a_1[0m | |
45 |
[0;35;1;4m? ../a/in_a[ |
|
45 | [0;35;1;4m? ../a/in_a[0m | |
46 |
[0;35;1;4m? 1/in_b_1[ |
|
46 | [0;35;1;4m? 1/in_b_1[0m | |
47 |
[0;35;1;4m? 2/in_b_2[ |
|
47 | [0;35;1;4m? 2/in_b_2[0m | |
48 |
[0;35;1;4m? in_b[ |
|
48 | [0;35;1;4m? in_b[0m | |
49 |
[0;35;1;4m? ../in_root[ |
|
49 | [0;35;1;4m? ../in_root[0m | |
50 | hg status in a/1: |
|
50 | hg status in a/1: | |
51 |
[0;35;1;4m? a/1/in_a_1[ |
|
51 | [0;35;1;4m? a/1/in_a_1[0m | |
52 |
[0;35;1;4m? a/in_a[ |
|
52 | [0;35;1;4m? a/in_a[0m | |
53 |
[0;35;1;4m? b/1/in_b_1[ |
|
53 | [0;35;1;4m? b/1/in_b_1[0m | |
54 |
[0;35;1;4m? b/2/in_b_2[ |
|
54 | [0;35;1;4m? b/2/in_b_2[0m | |
55 |
[0;35;1;4m? b/in_b[ |
|
55 | [0;35;1;4m? b/in_b[0m | |
56 |
[0;35;1;4m? in_root[ |
|
56 | [0;35;1;4m? in_root[0m | |
57 | hg status . in a/1: |
|
57 | hg status . in a/1: | |
58 |
[0;35;1;4m? in_a_1[ |
|
58 | [0;35;1;4m? in_a_1[0m | |
59 | hg status .. in a/1: |
|
59 | hg status .. in a/1: | |
60 |
[0;35;1;4m? in_a_1[ |
|
60 | [0;35;1;4m? in_a_1[0m | |
61 |
[0;35;1;4m? ../in_a[ |
|
61 | [0;35;1;4m? ../in_a[0m | |
62 | hg status in b/1: |
|
62 | hg status in b/1: | |
63 |
[0;35;1;4m? a/1/in_a_1[ |
|
63 | [0;35;1;4m? a/1/in_a_1[0m | |
64 |
[0;35;1;4m? a/in_a[ |
|
64 | [0;35;1;4m? a/in_a[0m | |
65 |
[0;35;1;4m? b/1/in_b_1[ |
|
65 | [0;35;1;4m? b/1/in_b_1[0m | |
66 |
[0;35;1;4m? b/2/in_b_2[ |
|
66 | [0;35;1;4m? b/2/in_b_2[0m | |
67 |
[0;35;1;4m? b/in_b[ |
|
67 | [0;35;1;4m? b/in_b[0m | |
68 |
[0;35;1;4m? in_root[ |
|
68 | [0;35;1;4m? in_root[0m | |
69 | hg status . in b/1: |
|
69 | hg status . in b/1: | |
70 |
[0;35;1;4m? in_b_1[ |
|
70 | [0;35;1;4m? in_b_1[0m | |
71 | hg status .. in b/1: |
|
71 | hg status .. in b/1: | |
72 |
[0;35;1;4m? in_b_1[ |
|
72 | [0;35;1;4m? in_b_1[0m | |
73 |
[0;35;1;4m? ../2/in_b_2[ |
|
73 | [0;35;1;4m? ../2/in_b_2[0m | |
74 |
[0;35;1;4m? ../in_b[ |
|
74 | [0;35;1;4m? ../in_b[0m | |
75 | hg status in b/2: |
|
75 | hg status in b/2: | |
76 |
[0;35;1;4m? a/1/in_a_1[ |
|
76 | [0;35;1;4m? a/1/in_a_1[0m | |
77 |
[0;35;1;4m? a/in_a[ |
|
77 | [0;35;1;4m? a/in_a[0m | |
78 |
[0;35;1;4m? b/1/in_b_1[ |
|
78 | [0;35;1;4m? b/1/in_b_1[0m | |
79 |
[0;35;1;4m? b/2/in_b_2[ |
|
79 | [0;35;1;4m? b/2/in_b_2[0m | |
80 |
[0;35;1;4m? b/in_b[ |
|
80 | [0;35;1;4m? b/in_b[0m | |
81 |
[0;35;1;4m? in_root[ |
|
81 | [0;35;1;4m? in_root[0m | |
82 | hg status . in b/2: |
|
82 | hg status . in b/2: | |
83 |
[0;35;1;4m? in_b_2[ |
|
83 | [0;35;1;4m? in_b_2[0m | |
84 | hg status .. in b/2: |
|
84 | hg status .. in b/2: | |
85 |
[0;35;1;4m? ../1/in_b_1[ |
|
85 | [0;35;1;4m? ../1/in_b_1[0m | |
86 |
[0;35;1;4m? in_b_2[ |
|
86 | [0;35;1;4m? in_b_2[0m | |
87 |
[0;35;1;4m? ../in_b[ |
|
87 | [0;35;1;4m? ../in_b[0m | |
88 | adding .hgignore |
|
88 | adding .hgignore | |
89 | adding deleted |
|
89 | adding deleted | |
90 | adding modified |
|
90 | adding modified | |
91 | adding removed |
|
91 | adding removed | |
92 | hg status: |
|
92 | hg status: | |
93 |
[0;32;1mA added[ |
|
93 | [0;32;1mA added[0m | |
94 |
[0;31;1mR removed[ |
|
94 | [0;31;1mR removed[0m | |
95 |
[0;36;1;4m! deleted[ |
|
95 | [0;36;1;4m! deleted[0m | |
96 |
[0;35;1;4m? unknown[ |
|
96 | [0;35;1;4m? unknown[0m | |
97 | hg status modified added removed deleted unknown never-existed ignored: |
|
97 | hg status modified added removed deleted unknown never-existed ignored: | |
98 | never-existed: No such file or directory |
|
98 | never-existed: No such file or directory | |
99 |
[0;32;1mA added[ |
|
99 | [0;32;1mA added[0m | |
100 |
[0;31;1mR removed[ |
|
100 | [0;31;1mR removed[0m | |
101 |
[0;36;1;4m! deleted[ |
|
101 | [0;36;1;4m! deleted[0m | |
102 |
[0;35;1;4m? unknown[ |
|
102 | [0;35;1;4m? unknown[0m | |
103 | hg status -C: |
|
103 | hg status -C: | |
104 |
[0;32;1mA added[ |
|
104 | [0;32;1mA added[0m | |
105 |
[0;32;1mA copied[ |
|
105 | [0;32;1mA copied[0m | |
106 |
[0;0m modified[0 |
|
106 | [0;0m modified[0m | |
107 |
[0;31;1mR removed[ |
|
107 | [0;31;1mR removed[0m | |
108 |
[0;36;1;4m! deleted[ |
|
108 | [0;36;1;4m! deleted[0m | |
109 |
[0;35;1;4m? unknown[ |
|
109 | [0;35;1;4m? unknown[0m | |
110 | hg status -A: |
|
110 | hg status -A: | |
111 |
[0;32;1mA added[ |
|
111 | [0;32;1mA added[0m | |
112 |
[0;32;1mA copied[ |
|
112 | [0;32;1mA copied[0m | |
113 |
[0;0m modified[0 |
|
113 | [0;0m modified[0m | |
114 |
[0;31;1mR removed[ |
|
114 | [0;31;1mR removed[0m | |
115 |
[0;36;1;4m! deleted[ |
|
115 | [0;36;1;4m! deleted[0m | |
116 |
[0;35;1;4m? unknown[ |
|
116 | [0;35;1;4m? unknown[0m | |
117 |
[0;30;1mI ignored[ |
|
117 | [0;30;1mI ignored[0m | |
118 |
[0;0mC .hgignore[0 |
|
118 | [0;0mC .hgignore[0m | |
119 |
[0;0mC modified[0 |
|
119 | [0;0mC modified[0m | |
120 | hg status ignoreddir/file: |
|
120 | hg status ignoreddir/file: | |
121 | hg status -i ignoreddir/file: |
|
121 | hg status -i ignoreddir/file: | |
122 |
[0;30;1mI ignoreddir/file[ |
|
122 | [0;30;1mI ignoreddir/file[0m | |
123 | adding .hgignore |
|
123 | adding .hgignore | |
124 | adding deleted |
|
124 | adding deleted | |
125 | adding modified |
|
125 | adding modified | |
126 | adding removed |
|
126 | adding removed |
General Comments 0
You need to be logged in to leave comments.
Login now