##// END OF EJS Templates
Merge with crew-stable
Patrick Mezard -
r6857:e8c2dae4 merge default
parent child Browse files
Show More
@@ -40,7 +40,7 status.deleted = cyan bold underline
40 status.unknown = magenta bold underline
40 status.unknown = magenta bold underline
41 status.ignored = black bold
41 status.ignored = black bold
42
42
43 'none' turns off all effects
43 # 'none' turns off all effects
44 status.clean = none
44 status.clean = none
45 status.copied = none
45 status.copied = none
46
46
@@ -79,11 +79,12 from mercurial.i18n import _
79
79
80 def render_effects(text, *effects):
80 def render_effects(text, *effects):
81 'Wrap text in commands to turn on each effect.'
81 'Wrap text in commands to turn on each effect.'
82 start = []
82 start = [ str(_effect_params['none'][0]) ]
83 stop = []
83 stop = []
84 for effect in effects:
84 for effect in effects:
85 start.append(str(_effect_params[effect][0]))
85 start.append(str(_effect_params[effect][0]))
86 stop.append(str(_effect_params[effect][1]))
86 stop.append(str(_effect_params[effect][1]))
87 stop.append(str(_effect_params['none'][1]))
87 start = '\033[' + ';'.join(start) + 'm'
88 start = '\033[' + ';'.join(start) + 'm'
88 stop = '\033[' + ';'.join(stop) + 'm'
89 stop = '\033[' + ';'.join(stop) + 'm'
89 return start + text + stop
90 return start + text + stop
@@ -144,13 +145,17 def colorqseries(qseriesfunc, ui, repo,
144 retval = qseriesfunc(ui, repo, **opts)
145 retval = qseriesfunc(ui, repo, **opts)
145 patches = ui.popbuffer().splitlines()
146 patches = ui.popbuffer().splitlines()
146 for patch in patches:
147 for patch in patches:
148 patchname = patch
149 if opts['summary']:
150 patchname = patchname.split(': ')[0]
151 if ui.verbose:
152 patchname = patchname.split(' ', 2)[-1]
153
147 if opts['missing']:
154 if opts['missing']:
148 effects = _patch_effects['missing']
155 effects = _patch_effects['missing']
149 # Determine if patch is applied. Search for beginning of output
156 # Determine if patch is applied.
150 # line in the applied patch list, in case --summary has been used
151 # and output line isn't just the patch name.
152 elif [ applied for applied in repo.mq.applied
157 elif [ applied for applied in repo.mq.applied
153 if patch.startswith(applied.name) ]:
158 if patchname == applied.name ]:
154 effects = _patch_effects['applied']
159 effects = _patch_effects['applied']
155 else:
160 else:
156 effects = _patch_effects['unapplied']
161 effects = _patch_effects['unapplied']
@@ -166,7 +171,8 def uisetup(ui):
166 nocoloropt = ('', 'no-color', None, _("don't colorize output"))
171 nocoloropt = ('', 'no-color', None, _("don't colorize output"))
167 _decoratecmd(ui, 'status', commands.table, colorstatus, nocoloropt)
172 _decoratecmd(ui, 'status', commands.table, colorstatus, nocoloropt)
168 _configcmdeffects(ui, 'status', _status_effects);
173 _configcmdeffects(ui, 'status', _status_effects);
169 if ui.config('extensions', 'hgext.mq', default=None) is not None:
174 if ui.config('extensions', 'hgext.mq') is not None or \
175 ui.config('extensions', 'mq') is not None:
170 from hgext import mq
176 from hgext import mq
171 _decoratecmd(ui, 'qseries', mq.cmdtable, colorqseries, nocoloropt)
177 _decoratecmd(ui, 'qseries', mq.cmdtable, colorqseries, nocoloropt)
172 _configcmdeffects(ui, 'qseries', _patch_effects);
178 _configcmdeffects(ui, 'qseries', _patch_effects);
@@ -91,16 +91,15 def _filerevision(web, tmpl, fctx):
91
91
92 def file(web, req, tmpl):
92 def file(web, req, tmpl):
93 path = webutil.cleanpath(web.repo, req.form.get('file', [''])[0])
93 path = webutil.cleanpath(web.repo, req.form.get('file', [''])[0])
94 if path:
94 if not path:
95 return manifest(web, req, tmpl)
96 try:
97 return _filerevision(web, tmpl, webutil.filectx(web.repo, req))
98 except revlog.LookupError, inst:
95 try:
99 try:
96 return _filerevision(web, tmpl, webutil.filectx(web.repo, req))
100 return manifest(web, req, tmpl)
97 except revlog.LookupError, inst:
101 except ErrorResponse:
98 pass
102 raise inst
99
100 try:
101 return manifest(web, req, tmpl)
102 except ErrorResponse:
103 raise inst
104
103
105 def _search(web, tmpl, query):
104 def _search(web, tmpl, query):
106
105
General Comments 0
You need to be logged in to leave comments. Login now