##// END OF EJS Templates
templatefuncs: do not stringify result of if*() expression...
Yuya Nishihara -
r37033:a318bb15 default
parent child Browse files
Show More
@@ -1,664 +1,664
1 # templatefuncs.py - common template functions
1 # templatefuncs.py - common template functions
2 #
2 #
3 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import re
10 import re
11
11
12 from .i18n import _
12 from .i18n import _
13 from . import (
13 from . import (
14 color,
14 color,
15 encoding,
15 encoding,
16 error,
16 error,
17 minirst,
17 minirst,
18 obsutil,
18 obsutil,
19 pycompat,
19 pycompat,
20 registrar,
20 registrar,
21 revset as revsetmod,
21 revset as revsetmod,
22 revsetlang,
22 revsetlang,
23 scmutil,
23 scmutil,
24 templatefilters,
24 templatefilters,
25 templatekw,
25 templatekw,
26 templateutil,
26 templateutil,
27 util,
27 util,
28 )
28 )
29 from .utils import dateutil
29 from .utils import dateutil
30
30
31 evalrawexp = templateutil.evalrawexp
31 evalrawexp = templateutil.evalrawexp
32 evalfuncarg = templateutil.evalfuncarg
32 evalfuncarg = templateutil.evalfuncarg
33 evalboolean = templateutil.evalboolean
33 evalboolean = templateutil.evalboolean
34 evalinteger = templateutil.evalinteger
34 evalinteger = templateutil.evalinteger
35 evalstring = templateutil.evalstring
35 evalstring = templateutil.evalstring
36 evalstringliteral = templateutil.evalstringliteral
36 evalstringliteral = templateutil.evalstringliteral
37 evalastype = templateutil.evalastype
37 evalastype = templateutil.evalastype
38
38
39 # dict of template built-in functions
39 # dict of template built-in functions
40 funcs = {}
40 funcs = {}
41 templatefunc = registrar.templatefunc(funcs)
41 templatefunc = registrar.templatefunc(funcs)
42
42
43 @templatefunc('date(date[, fmt])')
43 @templatefunc('date(date[, fmt])')
44 def date(context, mapping, args):
44 def date(context, mapping, args):
45 """Format a date. See :hg:`help dates` for formatting
45 """Format a date. See :hg:`help dates` for formatting
46 strings. The default is a Unix date format, including the timezone:
46 strings. The default is a Unix date format, including the timezone:
47 "Mon Sep 04 15:13:13 2006 0700"."""
47 "Mon Sep 04 15:13:13 2006 0700"."""
48 if not (1 <= len(args) <= 2):
48 if not (1 <= len(args) <= 2):
49 # i18n: "date" is a keyword
49 # i18n: "date" is a keyword
50 raise error.ParseError(_("date expects one or two arguments"))
50 raise error.ParseError(_("date expects one or two arguments"))
51
51
52 date = evalfuncarg(context, mapping, args[0])
52 date = evalfuncarg(context, mapping, args[0])
53 fmt = None
53 fmt = None
54 if len(args) == 2:
54 if len(args) == 2:
55 fmt = evalstring(context, mapping, args[1])
55 fmt = evalstring(context, mapping, args[1])
56 try:
56 try:
57 if fmt is None:
57 if fmt is None:
58 return dateutil.datestr(date)
58 return dateutil.datestr(date)
59 else:
59 else:
60 return dateutil.datestr(date, fmt)
60 return dateutil.datestr(date, fmt)
61 except (TypeError, ValueError):
61 except (TypeError, ValueError):
62 # i18n: "date" is a keyword
62 # i18n: "date" is a keyword
63 raise error.ParseError(_("date expects a date information"))
63 raise error.ParseError(_("date expects a date information"))
64
64
65 @templatefunc('dict([[key=]value...])', argspec='*args **kwargs')
65 @templatefunc('dict([[key=]value...])', argspec='*args **kwargs')
66 def dict_(context, mapping, args):
66 def dict_(context, mapping, args):
67 """Construct a dict from key-value pairs. A key may be omitted if
67 """Construct a dict from key-value pairs. A key may be omitted if
68 a value expression can provide an unambiguous name."""
68 a value expression can provide an unambiguous name."""
69 data = util.sortdict()
69 data = util.sortdict()
70
70
71 for v in args['args']:
71 for v in args['args']:
72 k = templateutil.findsymbolicname(v)
72 k = templateutil.findsymbolicname(v)
73 if not k:
73 if not k:
74 raise error.ParseError(_('dict key cannot be inferred'))
74 raise error.ParseError(_('dict key cannot be inferred'))
75 if k in data or k in args['kwargs']:
75 if k in data or k in args['kwargs']:
76 raise error.ParseError(_("duplicated dict key '%s' inferred") % k)
76 raise error.ParseError(_("duplicated dict key '%s' inferred") % k)
77 data[k] = evalfuncarg(context, mapping, v)
77 data[k] = evalfuncarg(context, mapping, v)
78
78
79 data.update((k, evalfuncarg(context, mapping, v))
79 data.update((k, evalfuncarg(context, mapping, v))
80 for k, v in args['kwargs'].iteritems())
80 for k, v in args['kwargs'].iteritems())
81 return templateutil.hybriddict(data)
81 return templateutil.hybriddict(data)
82
82
83 @templatefunc('diff([includepattern [, excludepattern]])')
83 @templatefunc('diff([includepattern [, excludepattern]])')
84 def diff(context, mapping, args):
84 def diff(context, mapping, args):
85 """Show a diff, optionally
85 """Show a diff, optionally
86 specifying files to include or exclude."""
86 specifying files to include or exclude."""
87 if len(args) > 2:
87 if len(args) > 2:
88 # i18n: "diff" is a keyword
88 # i18n: "diff" is a keyword
89 raise error.ParseError(_("diff expects zero, one, or two arguments"))
89 raise error.ParseError(_("diff expects zero, one, or two arguments"))
90
90
91 def getpatterns(i):
91 def getpatterns(i):
92 if i < len(args):
92 if i < len(args):
93 s = evalstring(context, mapping, args[i]).strip()
93 s = evalstring(context, mapping, args[i]).strip()
94 if s:
94 if s:
95 return [s]
95 return [s]
96 return []
96 return []
97
97
98 ctx = context.resource(mapping, 'ctx')
98 ctx = context.resource(mapping, 'ctx')
99 chunks = ctx.diff(match=ctx.match([], getpatterns(0), getpatterns(1)))
99 chunks = ctx.diff(match=ctx.match([], getpatterns(0), getpatterns(1)))
100
100
101 return ''.join(chunks)
101 return ''.join(chunks)
102
102
103 @templatefunc('extdata(source)', argspec='source')
103 @templatefunc('extdata(source)', argspec='source')
104 def extdata(context, mapping, args):
104 def extdata(context, mapping, args):
105 """Show a text read from the specified extdata source. (EXPERIMENTAL)"""
105 """Show a text read from the specified extdata source. (EXPERIMENTAL)"""
106 if 'source' not in args:
106 if 'source' not in args:
107 # i18n: "extdata" is a keyword
107 # i18n: "extdata" is a keyword
108 raise error.ParseError(_('extdata expects one argument'))
108 raise error.ParseError(_('extdata expects one argument'))
109
109
110 source = evalstring(context, mapping, args['source'])
110 source = evalstring(context, mapping, args['source'])
111 cache = context.resource(mapping, 'cache').setdefault('extdata', {})
111 cache = context.resource(mapping, 'cache').setdefault('extdata', {})
112 ctx = context.resource(mapping, 'ctx')
112 ctx = context.resource(mapping, 'ctx')
113 if source in cache:
113 if source in cache:
114 data = cache[source]
114 data = cache[source]
115 else:
115 else:
116 data = cache[source] = scmutil.extdatasource(ctx.repo(), source)
116 data = cache[source] = scmutil.extdatasource(ctx.repo(), source)
117 return data.get(ctx.rev(), '')
117 return data.get(ctx.rev(), '')
118
118
119 @templatefunc('files(pattern)')
119 @templatefunc('files(pattern)')
120 def files(context, mapping, args):
120 def files(context, mapping, args):
121 """All files of the current changeset matching the pattern. See
121 """All files of the current changeset matching the pattern. See
122 :hg:`help patterns`."""
122 :hg:`help patterns`."""
123 if not len(args) == 1:
123 if not len(args) == 1:
124 # i18n: "files" is a keyword
124 # i18n: "files" is a keyword
125 raise error.ParseError(_("files expects one argument"))
125 raise error.ParseError(_("files expects one argument"))
126
126
127 raw = evalstring(context, mapping, args[0])
127 raw = evalstring(context, mapping, args[0])
128 ctx = context.resource(mapping, 'ctx')
128 ctx = context.resource(mapping, 'ctx')
129 m = ctx.match([raw])
129 m = ctx.match([raw])
130 files = list(ctx.matches(m))
130 files = list(ctx.matches(m))
131 return templateutil.compatlist(context, mapping, "file", files)
131 return templateutil.compatlist(context, mapping, "file", files)
132
132
133 @templatefunc('fill(text[, width[, initialident[, hangindent]]])')
133 @templatefunc('fill(text[, width[, initialident[, hangindent]]])')
134 def fill(context, mapping, args):
134 def fill(context, mapping, args):
135 """Fill many
135 """Fill many
136 paragraphs with optional indentation. See the "fill" filter."""
136 paragraphs with optional indentation. See the "fill" filter."""
137 if not (1 <= len(args) <= 4):
137 if not (1 <= len(args) <= 4):
138 # i18n: "fill" is a keyword
138 # i18n: "fill" is a keyword
139 raise error.ParseError(_("fill expects one to four arguments"))
139 raise error.ParseError(_("fill expects one to four arguments"))
140
140
141 text = evalstring(context, mapping, args[0])
141 text = evalstring(context, mapping, args[0])
142 width = 76
142 width = 76
143 initindent = ''
143 initindent = ''
144 hangindent = ''
144 hangindent = ''
145 if 2 <= len(args) <= 4:
145 if 2 <= len(args) <= 4:
146 width = evalinteger(context, mapping, args[1],
146 width = evalinteger(context, mapping, args[1],
147 # i18n: "fill" is a keyword
147 # i18n: "fill" is a keyword
148 _("fill expects an integer width"))
148 _("fill expects an integer width"))
149 try:
149 try:
150 initindent = evalstring(context, mapping, args[2])
150 initindent = evalstring(context, mapping, args[2])
151 hangindent = evalstring(context, mapping, args[3])
151 hangindent = evalstring(context, mapping, args[3])
152 except IndexError:
152 except IndexError:
153 pass
153 pass
154
154
155 return templatefilters.fill(text, width, initindent, hangindent)
155 return templatefilters.fill(text, width, initindent, hangindent)
156
156
157 @templatefunc('formatnode(node)')
157 @templatefunc('formatnode(node)')
158 def formatnode(context, mapping, args):
158 def formatnode(context, mapping, args):
159 """Obtain the preferred form of a changeset hash. (DEPRECATED)"""
159 """Obtain the preferred form of a changeset hash. (DEPRECATED)"""
160 if len(args) != 1:
160 if len(args) != 1:
161 # i18n: "formatnode" is a keyword
161 # i18n: "formatnode" is a keyword
162 raise error.ParseError(_("formatnode expects one argument"))
162 raise error.ParseError(_("formatnode expects one argument"))
163
163
164 ui = context.resource(mapping, 'ui')
164 ui = context.resource(mapping, 'ui')
165 node = evalstring(context, mapping, args[0])
165 node = evalstring(context, mapping, args[0])
166 if ui.debugflag:
166 if ui.debugflag:
167 return node
167 return node
168 return templatefilters.short(node)
168 return templatefilters.short(node)
169
169
170 @templatefunc('pad(text, width[, fillchar=\' \'[, left=False]])',
170 @templatefunc('pad(text, width[, fillchar=\' \'[, left=False]])',
171 argspec='text width fillchar left')
171 argspec='text width fillchar left')
172 def pad(context, mapping, args):
172 def pad(context, mapping, args):
173 """Pad text with a
173 """Pad text with a
174 fill character."""
174 fill character."""
175 if 'text' not in args or 'width' not in args:
175 if 'text' not in args or 'width' not in args:
176 # i18n: "pad" is a keyword
176 # i18n: "pad" is a keyword
177 raise error.ParseError(_("pad() expects two to four arguments"))
177 raise error.ParseError(_("pad() expects two to four arguments"))
178
178
179 width = evalinteger(context, mapping, args['width'],
179 width = evalinteger(context, mapping, args['width'],
180 # i18n: "pad" is a keyword
180 # i18n: "pad" is a keyword
181 _("pad() expects an integer width"))
181 _("pad() expects an integer width"))
182
182
183 text = evalstring(context, mapping, args['text'])
183 text = evalstring(context, mapping, args['text'])
184
184
185 left = False
185 left = False
186 fillchar = ' '
186 fillchar = ' '
187 if 'fillchar' in args:
187 if 'fillchar' in args:
188 fillchar = evalstring(context, mapping, args['fillchar'])
188 fillchar = evalstring(context, mapping, args['fillchar'])
189 if len(color.stripeffects(fillchar)) != 1:
189 if len(color.stripeffects(fillchar)) != 1:
190 # i18n: "pad" is a keyword
190 # i18n: "pad" is a keyword
191 raise error.ParseError(_("pad() expects a single fill character"))
191 raise error.ParseError(_("pad() expects a single fill character"))
192 if 'left' in args:
192 if 'left' in args:
193 left = evalboolean(context, mapping, args['left'])
193 left = evalboolean(context, mapping, args['left'])
194
194
195 fillwidth = width - encoding.colwidth(color.stripeffects(text))
195 fillwidth = width - encoding.colwidth(color.stripeffects(text))
196 if fillwidth <= 0:
196 if fillwidth <= 0:
197 return text
197 return text
198 if left:
198 if left:
199 return fillchar * fillwidth + text
199 return fillchar * fillwidth + text
200 else:
200 else:
201 return text + fillchar * fillwidth
201 return text + fillchar * fillwidth
202
202
203 @templatefunc('indent(text, indentchars[, firstline])')
203 @templatefunc('indent(text, indentchars[, firstline])')
204 def indent(context, mapping, args):
204 def indent(context, mapping, args):
205 """Indents all non-empty lines
205 """Indents all non-empty lines
206 with the characters given in the indentchars string. An optional
206 with the characters given in the indentchars string. An optional
207 third parameter will override the indent for the first line only
207 third parameter will override the indent for the first line only
208 if present."""
208 if present."""
209 if not (2 <= len(args) <= 3):
209 if not (2 <= len(args) <= 3):
210 # i18n: "indent" is a keyword
210 # i18n: "indent" is a keyword
211 raise error.ParseError(_("indent() expects two or three arguments"))
211 raise error.ParseError(_("indent() expects two or three arguments"))
212
212
213 text = evalstring(context, mapping, args[0])
213 text = evalstring(context, mapping, args[0])
214 indent = evalstring(context, mapping, args[1])
214 indent = evalstring(context, mapping, args[1])
215
215
216 if len(args) == 3:
216 if len(args) == 3:
217 firstline = evalstring(context, mapping, args[2])
217 firstline = evalstring(context, mapping, args[2])
218 else:
218 else:
219 firstline = indent
219 firstline = indent
220
220
221 # the indent function doesn't indent the first line, so we do it here
221 # the indent function doesn't indent the first line, so we do it here
222 return templatefilters.indent(firstline + text, indent)
222 return templatefilters.indent(firstline + text, indent)
223
223
224 @templatefunc('get(dict, key)')
224 @templatefunc('get(dict, key)')
225 def get(context, mapping, args):
225 def get(context, mapping, args):
226 """Get an attribute/key from an object. Some keywords
226 """Get an attribute/key from an object. Some keywords
227 are complex types. This function allows you to obtain the value of an
227 are complex types. This function allows you to obtain the value of an
228 attribute on these types."""
228 attribute on these types."""
229 if len(args) != 2:
229 if len(args) != 2:
230 # i18n: "get" is a keyword
230 # i18n: "get" is a keyword
231 raise error.ParseError(_("get() expects two arguments"))
231 raise error.ParseError(_("get() expects two arguments"))
232
232
233 dictarg = evalfuncarg(context, mapping, args[0])
233 dictarg = evalfuncarg(context, mapping, args[0])
234 if not util.safehasattr(dictarg, 'get'):
234 if not util.safehasattr(dictarg, 'get'):
235 # i18n: "get" is a keyword
235 # i18n: "get" is a keyword
236 raise error.ParseError(_("get() expects a dict as first argument"))
236 raise error.ParseError(_("get() expects a dict as first argument"))
237
237
238 key = evalfuncarg(context, mapping, args[1])
238 key = evalfuncarg(context, mapping, args[1])
239 return templateutil.getdictitem(dictarg, key)
239 return templateutil.getdictitem(dictarg, key)
240
240
241 @templatefunc('if(expr, then[, else])')
241 @templatefunc('if(expr, then[, else])')
242 def if_(context, mapping, args):
242 def if_(context, mapping, args):
243 """Conditionally execute based on the result of
243 """Conditionally execute based on the result of
244 an expression."""
244 an expression."""
245 if not (2 <= len(args) <= 3):
245 if not (2 <= len(args) <= 3):
246 # i18n: "if" is a keyword
246 # i18n: "if" is a keyword
247 raise error.ParseError(_("if expects two or three arguments"))
247 raise error.ParseError(_("if expects two or three arguments"))
248
248
249 test = evalboolean(context, mapping, args[0])
249 test = evalboolean(context, mapping, args[0])
250 if test:
250 if test:
251 yield evalrawexp(context, mapping, args[1])
251 return evalrawexp(context, mapping, args[1])
252 elif len(args) == 3:
252 elif len(args) == 3:
253 yield evalrawexp(context, mapping, args[2])
253 return evalrawexp(context, mapping, args[2])
254
254
255 @templatefunc('ifcontains(needle, haystack, then[, else])')
255 @templatefunc('ifcontains(needle, haystack, then[, else])')
256 def ifcontains(context, mapping, args):
256 def ifcontains(context, mapping, args):
257 """Conditionally execute based
257 """Conditionally execute based
258 on whether the item "needle" is in "haystack"."""
258 on whether the item "needle" is in "haystack"."""
259 if not (3 <= len(args) <= 4):
259 if not (3 <= len(args) <= 4):
260 # i18n: "ifcontains" is a keyword
260 # i18n: "ifcontains" is a keyword
261 raise error.ParseError(_("ifcontains expects three or four arguments"))
261 raise error.ParseError(_("ifcontains expects three or four arguments"))
262
262
263 haystack = evalfuncarg(context, mapping, args[1])
263 haystack = evalfuncarg(context, mapping, args[1])
264 try:
264 try:
265 needle = evalastype(context, mapping, args[0],
265 needle = evalastype(context, mapping, args[0],
266 getattr(haystack, 'keytype', None) or bytes)
266 getattr(haystack, 'keytype', None) or bytes)
267 found = (needle in haystack)
267 found = (needle in haystack)
268 except error.ParseError:
268 except error.ParseError:
269 found = False
269 found = False
270
270
271 if found:
271 if found:
272 yield evalrawexp(context, mapping, args[2])
272 return evalrawexp(context, mapping, args[2])
273 elif len(args) == 4:
273 elif len(args) == 4:
274 yield evalrawexp(context, mapping, args[3])
274 return evalrawexp(context, mapping, args[3])
275
275
276 @templatefunc('ifeq(expr1, expr2, then[, else])')
276 @templatefunc('ifeq(expr1, expr2, then[, else])')
277 def ifeq(context, mapping, args):
277 def ifeq(context, mapping, args):
278 """Conditionally execute based on
278 """Conditionally execute based on
279 whether 2 items are equivalent."""
279 whether 2 items are equivalent."""
280 if not (3 <= len(args) <= 4):
280 if not (3 <= len(args) <= 4):
281 # i18n: "ifeq" is a keyword
281 # i18n: "ifeq" is a keyword
282 raise error.ParseError(_("ifeq expects three or four arguments"))
282 raise error.ParseError(_("ifeq expects three or four arguments"))
283
283
284 test = evalstring(context, mapping, args[0])
284 test = evalstring(context, mapping, args[0])
285 match = evalstring(context, mapping, args[1])
285 match = evalstring(context, mapping, args[1])
286 if test == match:
286 if test == match:
287 yield evalrawexp(context, mapping, args[2])
287 return evalrawexp(context, mapping, args[2])
288 elif len(args) == 4:
288 elif len(args) == 4:
289 yield evalrawexp(context, mapping, args[3])
289 return evalrawexp(context, mapping, args[3])
290
290
291 @templatefunc('join(list, sep)')
291 @templatefunc('join(list, sep)')
292 def join(context, mapping, args):
292 def join(context, mapping, args):
293 """Join items in a list with a delimiter."""
293 """Join items in a list with a delimiter."""
294 if not (1 <= len(args) <= 2):
294 if not (1 <= len(args) <= 2):
295 # i18n: "join" is a keyword
295 # i18n: "join" is a keyword
296 raise error.ParseError(_("join expects one or two arguments"))
296 raise error.ParseError(_("join expects one or two arguments"))
297
297
298 # TODO: perhaps this should be evalfuncarg(), but it can't because hgweb
298 # TODO: perhaps this should be evalfuncarg(), but it can't because hgweb
299 # abuses generator as a keyword that returns a list of dicts.
299 # abuses generator as a keyword that returns a list of dicts.
300 joinset = evalrawexp(context, mapping, args[0])
300 joinset = evalrawexp(context, mapping, args[0])
301 joinset = templateutil.unwrapvalue(joinset)
301 joinset = templateutil.unwrapvalue(joinset)
302 joinfmt = getattr(joinset, 'joinfmt', pycompat.identity)
302 joinfmt = getattr(joinset, 'joinfmt', pycompat.identity)
303 joiner = " "
303 joiner = " "
304 if len(args) > 1:
304 if len(args) > 1:
305 joiner = evalstring(context, mapping, args[1])
305 joiner = evalstring(context, mapping, args[1])
306
306
307 first = True
307 first = True
308 for x in pycompat.maybebytestr(joinset):
308 for x in pycompat.maybebytestr(joinset):
309 if first:
309 if first:
310 first = False
310 first = False
311 else:
311 else:
312 yield joiner
312 yield joiner
313 yield joinfmt(x)
313 yield joinfmt(x)
314
314
315 @templatefunc('label(label, expr)')
315 @templatefunc('label(label, expr)')
316 def label(context, mapping, args):
316 def label(context, mapping, args):
317 """Apply a label to generated content. Content with
317 """Apply a label to generated content. Content with
318 a label applied can result in additional post-processing, such as
318 a label applied can result in additional post-processing, such as
319 automatic colorization."""
319 automatic colorization."""
320 if len(args) != 2:
320 if len(args) != 2:
321 # i18n: "label" is a keyword
321 # i18n: "label" is a keyword
322 raise error.ParseError(_("label expects two arguments"))
322 raise error.ParseError(_("label expects two arguments"))
323
323
324 ui = context.resource(mapping, 'ui')
324 ui = context.resource(mapping, 'ui')
325 thing = evalstring(context, mapping, args[1])
325 thing = evalstring(context, mapping, args[1])
326 # preserve unknown symbol as literal so effects like 'red', 'bold',
326 # preserve unknown symbol as literal so effects like 'red', 'bold',
327 # etc. don't need to be quoted
327 # etc. don't need to be quoted
328 label = evalstringliteral(context, mapping, args[0])
328 label = evalstringliteral(context, mapping, args[0])
329
329
330 return ui.label(thing, label)
330 return ui.label(thing, label)
331
331
332 @templatefunc('latesttag([pattern])')
332 @templatefunc('latesttag([pattern])')
333 def latesttag(context, mapping, args):
333 def latesttag(context, mapping, args):
334 """The global tags matching the given pattern on the
334 """The global tags matching the given pattern on the
335 most recent globally tagged ancestor of this changeset.
335 most recent globally tagged ancestor of this changeset.
336 If no such tags exist, the "{tag}" template resolves to
336 If no such tags exist, the "{tag}" template resolves to
337 the string "null"."""
337 the string "null"."""
338 if len(args) > 1:
338 if len(args) > 1:
339 # i18n: "latesttag" is a keyword
339 # i18n: "latesttag" is a keyword
340 raise error.ParseError(_("latesttag expects at most one argument"))
340 raise error.ParseError(_("latesttag expects at most one argument"))
341
341
342 pattern = None
342 pattern = None
343 if len(args) == 1:
343 if len(args) == 1:
344 pattern = evalstring(context, mapping, args[0])
344 pattern = evalstring(context, mapping, args[0])
345 return templatekw.showlatesttags(context, mapping, pattern)
345 return templatekw.showlatesttags(context, mapping, pattern)
346
346
347 @templatefunc('localdate(date[, tz])')
347 @templatefunc('localdate(date[, tz])')
348 def localdate(context, mapping, args):
348 def localdate(context, mapping, args):
349 """Converts a date to the specified timezone.
349 """Converts a date to the specified timezone.
350 The default is local date."""
350 The default is local date."""
351 if not (1 <= len(args) <= 2):
351 if not (1 <= len(args) <= 2):
352 # i18n: "localdate" is a keyword
352 # i18n: "localdate" is a keyword
353 raise error.ParseError(_("localdate expects one or two arguments"))
353 raise error.ParseError(_("localdate expects one or two arguments"))
354
354
355 date = evalfuncarg(context, mapping, args[0])
355 date = evalfuncarg(context, mapping, args[0])
356 try:
356 try:
357 date = dateutil.parsedate(date)
357 date = dateutil.parsedate(date)
358 except AttributeError: # not str nor date tuple
358 except AttributeError: # not str nor date tuple
359 # i18n: "localdate" is a keyword
359 # i18n: "localdate" is a keyword
360 raise error.ParseError(_("localdate expects a date information"))
360 raise error.ParseError(_("localdate expects a date information"))
361 if len(args) >= 2:
361 if len(args) >= 2:
362 tzoffset = None
362 tzoffset = None
363 tz = evalfuncarg(context, mapping, args[1])
363 tz = evalfuncarg(context, mapping, args[1])
364 if isinstance(tz, bytes):
364 if isinstance(tz, bytes):
365 tzoffset, remainder = dateutil.parsetimezone(tz)
365 tzoffset, remainder = dateutil.parsetimezone(tz)
366 if remainder:
366 if remainder:
367 tzoffset = None
367 tzoffset = None
368 if tzoffset is None:
368 if tzoffset is None:
369 try:
369 try:
370 tzoffset = int(tz)
370 tzoffset = int(tz)
371 except (TypeError, ValueError):
371 except (TypeError, ValueError):
372 # i18n: "localdate" is a keyword
372 # i18n: "localdate" is a keyword
373 raise error.ParseError(_("localdate expects a timezone"))
373 raise error.ParseError(_("localdate expects a timezone"))
374 else:
374 else:
375 tzoffset = dateutil.makedate()[1]
375 tzoffset = dateutil.makedate()[1]
376 return (date[0], tzoffset)
376 return (date[0], tzoffset)
377
377
378 @templatefunc('max(iterable)')
378 @templatefunc('max(iterable)')
379 def max_(context, mapping, args, **kwargs):
379 def max_(context, mapping, args, **kwargs):
380 """Return the max of an iterable"""
380 """Return the max of an iterable"""
381 if len(args) != 1:
381 if len(args) != 1:
382 # i18n: "max" is a keyword
382 # i18n: "max" is a keyword
383 raise error.ParseError(_("max expects one argument"))
383 raise error.ParseError(_("max expects one argument"))
384
384
385 iterable = evalfuncarg(context, mapping, args[0])
385 iterable = evalfuncarg(context, mapping, args[0])
386 try:
386 try:
387 x = max(pycompat.maybebytestr(iterable))
387 x = max(pycompat.maybebytestr(iterable))
388 except (TypeError, ValueError):
388 except (TypeError, ValueError):
389 # i18n: "max" is a keyword
389 # i18n: "max" is a keyword
390 raise error.ParseError(_("max first argument should be an iterable"))
390 raise error.ParseError(_("max first argument should be an iterable"))
391 return templateutil.wraphybridvalue(iterable, x, x)
391 return templateutil.wraphybridvalue(iterable, x, x)
392
392
393 @templatefunc('min(iterable)')
393 @templatefunc('min(iterable)')
394 def min_(context, mapping, args, **kwargs):
394 def min_(context, mapping, args, **kwargs):
395 """Return the min of an iterable"""
395 """Return the min of an iterable"""
396 if len(args) != 1:
396 if len(args) != 1:
397 # i18n: "min" is a keyword
397 # i18n: "min" is a keyword
398 raise error.ParseError(_("min expects one argument"))
398 raise error.ParseError(_("min expects one argument"))
399
399
400 iterable = evalfuncarg(context, mapping, args[0])
400 iterable = evalfuncarg(context, mapping, args[0])
401 try:
401 try:
402 x = min(pycompat.maybebytestr(iterable))
402 x = min(pycompat.maybebytestr(iterable))
403 except (TypeError, ValueError):
403 except (TypeError, ValueError):
404 # i18n: "min" is a keyword
404 # i18n: "min" is a keyword
405 raise error.ParseError(_("min first argument should be an iterable"))
405 raise error.ParseError(_("min first argument should be an iterable"))
406 return templateutil.wraphybridvalue(iterable, x, x)
406 return templateutil.wraphybridvalue(iterable, x, x)
407
407
408 @templatefunc('mod(a, b)')
408 @templatefunc('mod(a, b)')
409 def mod(context, mapping, args):
409 def mod(context, mapping, args):
410 """Calculate a mod b such that a / b + a mod b == a"""
410 """Calculate a mod b such that a / b + a mod b == a"""
411 if not len(args) == 2:
411 if not len(args) == 2:
412 # i18n: "mod" is a keyword
412 # i18n: "mod" is a keyword
413 raise error.ParseError(_("mod expects two arguments"))
413 raise error.ParseError(_("mod expects two arguments"))
414
414
415 func = lambda a, b: a % b
415 func = lambda a, b: a % b
416 return templateutil.runarithmetic(context, mapping,
416 return templateutil.runarithmetic(context, mapping,
417 (func, args[0], args[1]))
417 (func, args[0], args[1]))
418
418
419 @templatefunc('obsfateoperations(markers)')
419 @templatefunc('obsfateoperations(markers)')
420 def obsfateoperations(context, mapping, args):
420 def obsfateoperations(context, mapping, args):
421 """Compute obsfate related information based on markers (EXPERIMENTAL)"""
421 """Compute obsfate related information based on markers (EXPERIMENTAL)"""
422 if len(args) != 1:
422 if len(args) != 1:
423 # i18n: "obsfateoperations" is a keyword
423 # i18n: "obsfateoperations" is a keyword
424 raise error.ParseError(_("obsfateoperations expects one argument"))
424 raise error.ParseError(_("obsfateoperations expects one argument"))
425
425
426 markers = evalfuncarg(context, mapping, args[0])
426 markers = evalfuncarg(context, mapping, args[0])
427
427
428 try:
428 try:
429 data = obsutil.markersoperations(markers)
429 data = obsutil.markersoperations(markers)
430 return templateutil.hybridlist(data, name='operation')
430 return templateutil.hybridlist(data, name='operation')
431 except (TypeError, KeyError):
431 except (TypeError, KeyError):
432 # i18n: "obsfateoperations" is a keyword
432 # i18n: "obsfateoperations" is a keyword
433 errmsg = _("obsfateoperations first argument should be an iterable")
433 errmsg = _("obsfateoperations first argument should be an iterable")
434 raise error.ParseError(errmsg)
434 raise error.ParseError(errmsg)
435
435
436 @templatefunc('obsfatedate(markers)')
436 @templatefunc('obsfatedate(markers)')
437 def obsfatedate(context, mapping, args):
437 def obsfatedate(context, mapping, args):
438 """Compute obsfate related information based on markers (EXPERIMENTAL)"""
438 """Compute obsfate related information based on markers (EXPERIMENTAL)"""
439 if len(args) != 1:
439 if len(args) != 1:
440 # i18n: "obsfatedate" is a keyword
440 # i18n: "obsfatedate" is a keyword
441 raise error.ParseError(_("obsfatedate expects one argument"))
441 raise error.ParseError(_("obsfatedate expects one argument"))
442
442
443 markers = evalfuncarg(context, mapping, args[0])
443 markers = evalfuncarg(context, mapping, args[0])
444
444
445 try:
445 try:
446 data = obsutil.markersdates(markers)
446 data = obsutil.markersdates(markers)
447 return templateutil.hybridlist(data, name='date', fmt='%d %d')
447 return templateutil.hybridlist(data, name='date', fmt='%d %d')
448 except (TypeError, KeyError):
448 except (TypeError, KeyError):
449 # i18n: "obsfatedate" is a keyword
449 # i18n: "obsfatedate" is a keyword
450 errmsg = _("obsfatedate first argument should be an iterable")
450 errmsg = _("obsfatedate first argument should be an iterable")
451 raise error.ParseError(errmsg)
451 raise error.ParseError(errmsg)
452
452
453 @templatefunc('obsfateusers(markers)')
453 @templatefunc('obsfateusers(markers)')
454 def obsfateusers(context, mapping, args):
454 def obsfateusers(context, mapping, args):
455 """Compute obsfate related information based on markers (EXPERIMENTAL)"""
455 """Compute obsfate related information based on markers (EXPERIMENTAL)"""
456 if len(args) != 1:
456 if len(args) != 1:
457 # i18n: "obsfateusers" is a keyword
457 # i18n: "obsfateusers" is a keyword
458 raise error.ParseError(_("obsfateusers expects one argument"))
458 raise error.ParseError(_("obsfateusers expects one argument"))
459
459
460 markers = evalfuncarg(context, mapping, args[0])
460 markers = evalfuncarg(context, mapping, args[0])
461
461
462 try:
462 try:
463 data = obsutil.markersusers(markers)
463 data = obsutil.markersusers(markers)
464 return templateutil.hybridlist(data, name='user')
464 return templateutil.hybridlist(data, name='user')
465 except (TypeError, KeyError, ValueError):
465 except (TypeError, KeyError, ValueError):
466 # i18n: "obsfateusers" is a keyword
466 # i18n: "obsfateusers" is a keyword
467 msg = _("obsfateusers first argument should be an iterable of "
467 msg = _("obsfateusers first argument should be an iterable of "
468 "obsmakers")
468 "obsmakers")
469 raise error.ParseError(msg)
469 raise error.ParseError(msg)
470
470
471 @templatefunc('obsfateverb(successors, markers)')
471 @templatefunc('obsfateverb(successors, markers)')
472 def obsfateverb(context, mapping, args):
472 def obsfateverb(context, mapping, args):
473 """Compute obsfate related information based on successors (EXPERIMENTAL)"""
473 """Compute obsfate related information based on successors (EXPERIMENTAL)"""
474 if len(args) != 2:
474 if len(args) != 2:
475 # i18n: "obsfateverb" is a keyword
475 # i18n: "obsfateverb" is a keyword
476 raise error.ParseError(_("obsfateverb expects two arguments"))
476 raise error.ParseError(_("obsfateverb expects two arguments"))
477
477
478 successors = evalfuncarg(context, mapping, args[0])
478 successors = evalfuncarg(context, mapping, args[0])
479 markers = evalfuncarg(context, mapping, args[1])
479 markers = evalfuncarg(context, mapping, args[1])
480
480
481 try:
481 try:
482 return obsutil.obsfateverb(successors, markers)
482 return obsutil.obsfateverb(successors, markers)
483 except TypeError:
483 except TypeError:
484 # i18n: "obsfateverb" is a keyword
484 # i18n: "obsfateverb" is a keyword
485 errmsg = _("obsfateverb first argument should be countable")
485 errmsg = _("obsfateverb first argument should be countable")
486 raise error.ParseError(errmsg)
486 raise error.ParseError(errmsg)
487
487
488 @templatefunc('relpath(path)')
488 @templatefunc('relpath(path)')
489 def relpath(context, mapping, args):
489 def relpath(context, mapping, args):
490 """Convert a repository-absolute path into a filesystem path relative to
490 """Convert a repository-absolute path into a filesystem path relative to
491 the current working directory."""
491 the current working directory."""
492 if len(args) != 1:
492 if len(args) != 1:
493 # i18n: "relpath" is a keyword
493 # i18n: "relpath" is a keyword
494 raise error.ParseError(_("relpath expects one argument"))
494 raise error.ParseError(_("relpath expects one argument"))
495
495
496 repo = context.resource(mapping, 'ctx').repo()
496 repo = context.resource(mapping, 'ctx').repo()
497 path = evalstring(context, mapping, args[0])
497 path = evalstring(context, mapping, args[0])
498 return repo.pathto(path)
498 return repo.pathto(path)
499
499
500 @templatefunc('revset(query[, formatargs...])')
500 @templatefunc('revset(query[, formatargs...])')
501 def revset(context, mapping, args):
501 def revset(context, mapping, args):
502 """Execute a revision set query. See
502 """Execute a revision set query. See
503 :hg:`help revset`."""
503 :hg:`help revset`."""
504 if not len(args) > 0:
504 if not len(args) > 0:
505 # i18n: "revset" is a keyword
505 # i18n: "revset" is a keyword
506 raise error.ParseError(_("revset expects one or more arguments"))
506 raise error.ParseError(_("revset expects one or more arguments"))
507
507
508 raw = evalstring(context, mapping, args[0])
508 raw = evalstring(context, mapping, args[0])
509 ctx = context.resource(mapping, 'ctx')
509 ctx = context.resource(mapping, 'ctx')
510 repo = ctx.repo()
510 repo = ctx.repo()
511
511
512 def query(expr):
512 def query(expr):
513 m = revsetmod.match(repo.ui, expr, repo=repo)
513 m = revsetmod.match(repo.ui, expr, repo=repo)
514 return m(repo)
514 return m(repo)
515
515
516 if len(args) > 1:
516 if len(args) > 1:
517 formatargs = [evalfuncarg(context, mapping, a) for a in args[1:]]
517 formatargs = [evalfuncarg(context, mapping, a) for a in args[1:]]
518 revs = query(revsetlang.formatspec(raw, *formatargs))
518 revs = query(revsetlang.formatspec(raw, *formatargs))
519 revs = list(revs)
519 revs = list(revs)
520 else:
520 else:
521 cache = context.resource(mapping, 'cache')
521 cache = context.resource(mapping, 'cache')
522 revsetcache = cache.setdefault("revsetcache", {})
522 revsetcache = cache.setdefault("revsetcache", {})
523 if raw in revsetcache:
523 if raw in revsetcache:
524 revs = revsetcache[raw]
524 revs = revsetcache[raw]
525 else:
525 else:
526 revs = query(raw)
526 revs = query(raw)
527 revs = list(revs)
527 revs = list(revs)
528 revsetcache[raw] = revs
528 revsetcache[raw] = revs
529 return templatekw.showrevslist(context, mapping, "revision", revs)
529 return templatekw.showrevslist(context, mapping, "revision", revs)
530
530
531 @templatefunc('rstdoc(text, style)')
531 @templatefunc('rstdoc(text, style)')
532 def rstdoc(context, mapping, args):
532 def rstdoc(context, mapping, args):
533 """Format reStructuredText."""
533 """Format reStructuredText."""
534 if len(args) != 2:
534 if len(args) != 2:
535 # i18n: "rstdoc" is a keyword
535 # i18n: "rstdoc" is a keyword
536 raise error.ParseError(_("rstdoc expects two arguments"))
536 raise error.ParseError(_("rstdoc expects two arguments"))
537
537
538 text = evalstring(context, mapping, args[0])
538 text = evalstring(context, mapping, args[0])
539 style = evalstring(context, mapping, args[1])
539 style = evalstring(context, mapping, args[1])
540
540
541 return minirst.format(text, style=style, keep=['verbose'])
541 return minirst.format(text, style=style, keep=['verbose'])
542
542
543 @templatefunc('separate(sep, args)', argspec='sep *args')
543 @templatefunc('separate(sep, args)', argspec='sep *args')
544 def separate(context, mapping, args):
544 def separate(context, mapping, args):
545 """Add a separator between non-empty arguments."""
545 """Add a separator between non-empty arguments."""
546 if 'sep' not in args:
546 if 'sep' not in args:
547 # i18n: "separate" is a keyword
547 # i18n: "separate" is a keyword
548 raise error.ParseError(_("separate expects at least one argument"))
548 raise error.ParseError(_("separate expects at least one argument"))
549
549
550 sep = evalstring(context, mapping, args['sep'])
550 sep = evalstring(context, mapping, args['sep'])
551 first = True
551 first = True
552 for arg in args['args']:
552 for arg in args['args']:
553 argstr = evalstring(context, mapping, arg)
553 argstr = evalstring(context, mapping, arg)
554 if not argstr:
554 if not argstr:
555 continue
555 continue
556 if first:
556 if first:
557 first = False
557 first = False
558 else:
558 else:
559 yield sep
559 yield sep
560 yield argstr
560 yield argstr
561
561
562 @templatefunc('shortest(node, minlength=4)')
562 @templatefunc('shortest(node, minlength=4)')
563 def shortest(context, mapping, args):
563 def shortest(context, mapping, args):
564 """Obtain the shortest representation of
564 """Obtain the shortest representation of
565 a node."""
565 a node."""
566 if not (1 <= len(args) <= 2):
566 if not (1 <= len(args) <= 2):
567 # i18n: "shortest" is a keyword
567 # i18n: "shortest" is a keyword
568 raise error.ParseError(_("shortest() expects one or two arguments"))
568 raise error.ParseError(_("shortest() expects one or two arguments"))
569
569
570 node = evalstring(context, mapping, args[0])
570 node = evalstring(context, mapping, args[0])
571
571
572 minlength = 4
572 minlength = 4
573 if len(args) > 1:
573 if len(args) > 1:
574 minlength = evalinteger(context, mapping, args[1],
574 minlength = evalinteger(context, mapping, args[1],
575 # i18n: "shortest" is a keyword
575 # i18n: "shortest" is a keyword
576 _("shortest() expects an integer minlength"))
576 _("shortest() expects an integer minlength"))
577
577
578 # _partialmatch() of filtered changelog could take O(len(repo)) time,
578 # _partialmatch() of filtered changelog could take O(len(repo)) time,
579 # which would be unacceptably slow. so we look for hash collision in
579 # which would be unacceptably slow. so we look for hash collision in
580 # unfiltered space, which means some hashes may be slightly longer.
580 # unfiltered space, which means some hashes may be slightly longer.
581 cl = context.resource(mapping, 'ctx')._repo.unfiltered().changelog
581 cl = context.resource(mapping, 'ctx')._repo.unfiltered().changelog
582 return cl.shortest(node, minlength)
582 return cl.shortest(node, minlength)
583
583
584 @templatefunc('strip(text[, chars])')
584 @templatefunc('strip(text[, chars])')
585 def strip(context, mapping, args):
585 def strip(context, mapping, args):
586 """Strip characters from a string. By default,
586 """Strip characters from a string. By default,
587 strips all leading and trailing whitespace."""
587 strips all leading and trailing whitespace."""
588 if not (1 <= len(args) <= 2):
588 if not (1 <= len(args) <= 2):
589 # i18n: "strip" is a keyword
589 # i18n: "strip" is a keyword
590 raise error.ParseError(_("strip expects one or two arguments"))
590 raise error.ParseError(_("strip expects one or two arguments"))
591
591
592 text = evalstring(context, mapping, args[0])
592 text = evalstring(context, mapping, args[0])
593 if len(args) == 2:
593 if len(args) == 2:
594 chars = evalstring(context, mapping, args[1])
594 chars = evalstring(context, mapping, args[1])
595 return text.strip(chars)
595 return text.strip(chars)
596 return text.strip()
596 return text.strip()
597
597
598 @templatefunc('sub(pattern, replacement, expression)')
598 @templatefunc('sub(pattern, replacement, expression)')
599 def sub(context, mapping, args):
599 def sub(context, mapping, args):
600 """Perform text substitution
600 """Perform text substitution
601 using regular expressions."""
601 using regular expressions."""
602 if len(args) != 3:
602 if len(args) != 3:
603 # i18n: "sub" is a keyword
603 # i18n: "sub" is a keyword
604 raise error.ParseError(_("sub expects three arguments"))
604 raise error.ParseError(_("sub expects three arguments"))
605
605
606 pat = evalstring(context, mapping, args[0])
606 pat = evalstring(context, mapping, args[0])
607 rpl = evalstring(context, mapping, args[1])
607 rpl = evalstring(context, mapping, args[1])
608 src = evalstring(context, mapping, args[2])
608 src = evalstring(context, mapping, args[2])
609 try:
609 try:
610 patre = re.compile(pat)
610 patre = re.compile(pat)
611 except re.error:
611 except re.error:
612 # i18n: "sub" is a keyword
612 # i18n: "sub" is a keyword
613 raise error.ParseError(_("sub got an invalid pattern: %s") % pat)
613 raise error.ParseError(_("sub got an invalid pattern: %s") % pat)
614 try:
614 try:
615 yield patre.sub(rpl, src)
615 yield patre.sub(rpl, src)
616 except re.error:
616 except re.error:
617 # i18n: "sub" is a keyword
617 # i18n: "sub" is a keyword
618 raise error.ParseError(_("sub got an invalid replacement: %s") % rpl)
618 raise error.ParseError(_("sub got an invalid replacement: %s") % rpl)
619
619
620 @templatefunc('startswith(pattern, text)')
620 @templatefunc('startswith(pattern, text)')
621 def startswith(context, mapping, args):
621 def startswith(context, mapping, args):
622 """Returns the value from the "text" argument
622 """Returns the value from the "text" argument
623 if it begins with the content from the "pattern" argument."""
623 if it begins with the content from the "pattern" argument."""
624 if len(args) != 2:
624 if len(args) != 2:
625 # i18n: "startswith" is a keyword
625 # i18n: "startswith" is a keyword
626 raise error.ParseError(_("startswith expects two arguments"))
626 raise error.ParseError(_("startswith expects two arguments"))
627
627
628 patn = evalstring(context, mapping, args[0])
628 patn = evalstring(context, mapping, args[0])
629 text = evalstring(context, mapping, args[1])
629 text = evalstring(context, mapping, args[1])
630 if text.startswith(patn):
630 if text.startswith(patn):
631 return text
631 return text
632 return ''
632 return ''
633
633
634 @templatefunc('word(number, text[, separator])')
634 @templatefunc('word(number, text[, separator])')
635 def word(context, mapping, args):
635 def word(context, mapping, args):
636 """Return the nth word from a string."""
636 """Return the nth word from a string."""
637 if not (2 <= len(args) <= 3):
637 if not (2 <= len(args) <= 3):
638 # i18n: "word" is a keyword
638 # i18n: "word" is a keyword
639 raise error.ParseError(_("word expects two or three arguments, got %d")
639 raise error.ParseError(_("word expects two or three arguments, got %d")
640 % len(args))
640 % len(args))
641
641
642 num = evalinteger(context, mapping, args[0],
642 num = evalinteger(context, mapping, args[0],
643 # i18n: "word" is a keyword
643 # i18n: "word" is a keyword
644 _("word expects an integer index"))
644 _("word expects an integer index"))
645 text = evalstring(context, mapping, args[1])
645 text = evalstring(context, mapping, args[1])
646 if len(args) == 3:
646 if len(args) == 3:
647 splitter = evalstring(context, mapping, args[2])
647 splitter = evalstring(context, mapping, args[2])
648 else:
648 else:
649 splitter = None
649 splitter = None
650
650
651 tokens = text.split(splitter)
651 tokens = text.split(splitter)
652 if num >= len(tokens) or num < -len(tokens):
652 if num >= len(tokens) or num < -len(tokens):
653 return ''
653 return ''
654 else:
654 else:
655 return tokens[num]
655 return tokens[num]
656
656
657 def loadfunction(ui, extname, registrarobj):
657 def loadfunction(ui, extname, registrarobj):
658 """Load template function from specified registrarobj
658 """Load template function from specified registrarobj
659 """
659 """
660 for name, func in registrarobj._table.iteritems():
660 for name, func in registrarobj._table.iteritems():
661 funcs[name] = func
661 funcs[name] = func
662
662
663 # tell hggettext to extract docstrings from these functions:
663 # tell hggettext to extract docstrings from these functions:
664 i18nfunctions = funcs.values()
664 i18nfunctions = funcs.values()
@@ -1,4807 +1,4836
1 $ hg init a
1 $ hg init a
2 $ cd a
2 $ cd a
3 $ echo a > a
3 $ echo a > a
4 $ hg add a
4 $ hg add a
5 $ echo line 1 > b
5 $ echo line 1 > b
6 $ echo line 2 >> b
6 $ echo line 2 >> b
7 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
7 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
8
8
9 $ hg add b
9 $ hg add b
10 $ echo other 1 > c
10 $ echo other 1 > c
11 $ echo other 2 >> c
11 $ echo other 2 >> c
12 $ echo >> c
12 $ echo >> c
13 $ echo other 3 >> c
13 $ echo other 3 >> c
14 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
14 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
15
15
16 $ hg add c
16 $ hg add c
17 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
17 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
18 $ echo c >> c
18 $ echo c >> c
19 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
19 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
20
20
21 $ echo foo > .hg/branch
21 $ echo foo > .hg/branch
22 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
22 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
23
23
24 $ hg co -q 3
24 $ hg co -q 3
25 $ echo other 4 >> d
25 $ echo other 4 >> d
26 $ hg add d
26 $ hg add d
27 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
27 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
28
28
29 $ hg merge -q foo
29 $ hg merge -q foo
30 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
30 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
31
31
32 Test arithmetic operators have the right precedence:
32 Test arithmetic operators have the right precedence:
33
33
34 $ hg log -l 1 -T '{date(date, "%Y") + 5 * 10} {date(date, "%Y") - 2 * 3}\n'
34 $ hg log -l 1 -T '{date(date, "%Y") + 5 * 10} {date(date, "%Y") - 2 * 3}\n'
35 2020 1964
35 2020 1964
36 $ hg log -l 1 -T '{date(date, "%Y") * 5 + 10} {date(date, "%Y") * 3 - 2}\n'
36 $ hg log -l 1 -T '{date(date, "%Y") * 5 + 10} {date(date, "%Y") * 3 - 2}\n'
37 9860 5908
37 9860 5908
38
38
39 Test division:
39 Test division:
40
40
41 $ hg debugtemplate -r0 -v '{5 / 2} {mod(5, 2)}\n'
41 $ hg debugtemplate -r0 -v '{5 / 2} {mod(5, 2)}\n'
42 (template
42 (template
43 (/
43 (/
44 (integer '5')
44 (integer '5')
45 (integer '2'))
45 (integer '2'))
46 (string ' ')
46 (string ' ')
47 (func
47 (func
48 (symbol 'mod')
48 (symbol 'mod')
49 (list
49 (list
50 (integer '5')
50 (integer '5')
51 (integer '2')))
51 (integer '2')))
52 (string '\n'))
52 (string '\n'))
53 2 1
53 2 1
54 $ hg debugtemplate -r0 -v '{5 / -2} {mod(5, -2)}\n'
54 $ hg debugtemplate -r0 -v '{5 / -2} {mod(5, -2)}\n'
55 (template
55 (template
56 (/
56 (/
57 (integer '5')
57 (integer '5')
58 (negate
58 (negate
59 (integer '2')))
59 (integer '2')))
60 (string ' ')
60 (string ' ')
61 (func
61 (func
62 (symbol 'mod')
62 (symbol 'mod')
63 (list
63 (list
64 (integer '5')
64 (integer '5')
65 (negate
65 (negate
66 (integer '2'))))
66 (integer '2'))))
67 (string '\n'))
67 (string '\n'))
68 -3 -1
68 -3 -1
69 $ hg debugtemplate -r0 -v '{-5 / 2} {mod(-5, 2)}\n'
69 $ hg debugtemplate -r0 -v '{-5 / 2} {mod(-5, 2)}\n'
70 (template
70 (template
71 (/
71 (/
72 (negate
72 (negate
73 (integer '5'))
73 (integer '5'))
74 (integer '2'))
74 (integer '2'))
75 (string ' ')
75 (string ' ')
76 (func
76 (func
77 (symbol 'mod')
77 (symbol 'mod')
78 (list
78 (list
79 (negate
79 (negate
80 (integer '5'))
80 (integer '5'))
81 (integer '2')))
81 (integer '2')))
82 (string '\n'))
82 (string '\n'))
83 -3 1
83 -3 1
84 $ hg debugtemplate -r0 -v '{-5 / -2} {mod(-5, -2)}\n'
84 $ hg debugtemplate -r0 -v '{-5 / -2} {mod(-5, -2)}\n'
85 (template
85 (template
86 (/
86 (/
87 (negate
87 (negate
88 (integer '5'))
88 (integer '5'))
89 (negate
89 (negate
90 (integer '2')))
90 (integer '2')))
91 (string ' ')
91 (string ' ')
92 (func
92 (func
93 (symbol 'mod')
93 (symbol 'mod')
94 (list
94 (list
95 (negate
95 (negate
96 (integer '5'))
96 (integer '5'))
97 (negate
97 (negate
98 (integer '2'))))
98 (integer '2'))))
99 (string '\n'))
99 (string '\n'))
100 2 -1
100 2 -1
101
101
102 Filters bind closer than arithmetic:
102 Filters bind closer than arithmetic:
103
103
104 $ hg debugtemplate -r0 -v '{revset(".")|count - 1}\n'
104 $ hg debugtemplate -r0 -v '{revset(".")|count - 1}\n'
105 (template
105 (template
106 (-
106 (-
107 (|
107 (|
108 (func
108 (func
109 (symbol 'revset')
109 (symbol 'revset')
110 (string '.'))
110 (string '.'))
111 (symbol 'count'))
111 (symbol 'count'))
112 (integer '1'))
112 (integer '1'))
113 (string '\n'))
113 (string '\n'))
114 0
114 0
115
115
116 But negate binds closer still:
116 But negate binds closer still:
117
117
118 $ hg debugtemplate -r0 -v '{1-3|stringify}\n'
118 $ hg debugtemplate -r0 -v '{1-3|stringify}\n'
119 (template
119 (template
120 (-
120 (-
121 (integer '1')
121 (integer '1')
122 (|
122 (|
123 (integer '3')
123 (integer '3')
124 (symbol 'stringify')))
124 (symbol 'stringify')))
125 (string '\n'))
125 (string '\n'))
126 hg: parse error: arithmetic only defined on integers
126 hg: parse error: arithmetic only defined on integers
127 [255]
127 [255]
128 $ hg debugtemplate -r0 -v '{-3|stringify}\n'
128 $ hg debugtemplate -r0 -v '{-3|stringify}\n'
129 (template
129 (template
130 (|
130 (|
131 (negate
131 (negate
132 (integer '3'))
132 (integer '3'))
133 (symbol 'stringify'))
133 (symbol 'stringify'))
134 (string '\n'))
134 (string '\n'))
135 -3
135 -3
136
136
137 Filters bind as close as map operator:
137 Filters bind as close as map operator:
138
138
139 $ hg debugtemplate -r0 -v '{desc|splitlines % "{line}\n"}'
139 $ hg debugtemplate -r0 -v '{desc|splitlines % "{line}\n"}'
140 (template
140 (template
141 (%
141 (%
142 (|
142 (|
143 (symbol 'desc')
143 (symbol 'desc')
144 (symbol 'splitlines'))
144 (symbol 'splitlines'))
145 (template
145 (template
146 (symbol 'line')
146 (symbol 'line')
147 (string '\n'))))
147 (string '\n'))))
148 line 1
148 line 1
149 line 2
149 line 2
150
150
151 Keyword arguments:
151 Keyword arguments:
152
152
153 $ hg debugtemplate -r0 -v '{foo=bar|baz}'
153 $ hg debugtemplate -r0 -v '{foo=bar|baz}'
154 (template
154 (template
155 (keyvalue
155 (keyvalue
156 (symbol 'foo')
156 (symbol 'foo')
157 (|
157 (|
158 (symbol 'bar')
158 (symbol 'bar')
159 (symbol 'baz'))))
159 (symbol 'baz'))))
160 hg: parse error: can't use a key-value pair in this context
160 hg: parse error: can't use a key-value pair in this context
161 [255]
161 [255]
162
162
163 $ hg debugtemplate '{pad("foo", width=10, left=true)}\n'
163 $ hg debugtemplate '{pad("foo", width=10, left=true)}\n'
164 foo
164 foo
165
165
166 Call function which takes named arguments by filter syntax:
166 Call function which takes named arguments by filter syntax:
167
167
168 $ hg debugtemplate '{" "|separate}'
168 $ hg debugtemplate '{" "|separate}'
169 $ hg debugtemplate '{("not", "an", "argument", "list")|separate}'
169 $ hg debugtemplate '{("not", "an", "argument", "list")|separate}'
170 hg: parse error: unknown method 'list'
170 hg: parse error: unknown method 'list'
171 [255]
171 [255]
172
172
173 Second branch starting at nullrev:
173 Second branch starting at nullrev:
174
174
175 $ hg update null
175 $ hg update null
176 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
176 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
177 $ echo second > second
177 $ echo second > second
178 $ hg add second
178 $ hg add second
179 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
179 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
180 created new head
180 created new head
181
181
182 $ echo third > third
182 $ echo third > third
183 $ hg add third
183 $ hg add third
184 $ hg mv second fourth
184 $ hg mv second fourth
185 $ hg commit -m third -d "2020-01-01 10:01"
185 $ hg commit -m third -d "2020-01-01 10:01"
186
186
187 $ hg log --template '{join(file_copies, ",\n")}\n' -r .
187 $ hg log --template '{join(file_copies, ",\n")}\n' -r .
188 fourth (second)
188 fourth (second)
189 $ hg log -T '{file_copies % "{source} -> {name}\n"}' -r .
189 $ hg log -T '{file_copies % "{source} -> {name}\n"}' -r .
190 second -> fourth
190 second -> fourth
191 $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7
191 $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7
192 8 t
192 8 t
193 7 f
193 7 f
194
194
195 Working-directory revision has special identifiers, though they are still
195 Working-directory revision has special identifiers, though they are still
196 experimental:
196 experimental:
197
197
198 $ hg log -r 'wdir()' -T '{rev}:{node}\n'
198 $ hg log -r 'wdir()' -T '{rev}:{node}\n'
199 2147483647:ffffffffffffffffffffffffffffffffffffffff
199 2147483647:ffffffffffffffffffffffffffffffffffffffff
200
200
201 Some keywords are invalid for working-directory revision, but they should
201 Some keywords are invalid for working-directory revision, but they should
202 never cause crash:
202 never cause crash:
203
203
204 $ hg log -r 'wdir()' -T '{manifest}\n'
204 $ hg log -r 'wdir()' -T '{manifest}\n'
205
205
206
206
207 Internal resources shouldn't be exposed (issue5699):
207 Internal resources shouldn't be exposed (issue5699):
208
208
209 $ hg log -r. -T '{cache}{ctx}{repo}{revcache}{templ}{ui}'
209 $ hg log -r. -T '{cache}{ctx}{repo}{revcache}{templ}{ui}'
210
210
211 Never crash on internal resource not available:
211 Never crash on internal resource not available:
212
212
213 $ hg --cwd .. debugtemplate '{"c0bebeef"|shortest}\n'
213 $ hg --cwd .. debugtemplate '{"c0bebeef"|shortest}\n'
214 abort: template resource not available: ctx
214 abort: template resource not available: ctx
215 [255]
215 [255]
216
216
217 $ hg config -T '{author}'
217 $ hg config -T '{author}'
218
218
219 Quoting for ui.logtemplate
219 Quoting for ui.logtemplate
220
220
221 $ hg tip --config "ui.logtemplate={rev}\n"
221 $ hg tip --config "ui.logtemplate={rev}\n"
222 8
222 8
223 $ hg tip --config "ui.logtemplate='{rev}\n'"
223 $ hg tip --config "ui.logtemplate='{rev}\n'"
224 8
224 8
225 $ hg tip --config 'ui.logtemplate="{rev}\n"'
225 $ hg tip --config 'ui.logtemplate="{rev}\n"'
226 8
226 8
227 $ hg tip --config 'ui.logtemplate=n{rev}\n'
227 $ hg tip --config 'ui.logtemplate=n{rev}\n'
228 n8
228 n8
229
229
230 Make sure user/global hgrc does not affect tests
230 Make sure user/global hgrc does not affect tests
231
231
232 $ echo '[ui]' > .hg/hgrc
232 $ echo '[ui]' > .hg/hgrc
233 $ echo 'logtemplate =' >> .hg/hgrc
233 $ echo 'logtemplate =' >> .hg/hgrc
234 $ echo 'style =' >> .hg/hgrc
234 $ echo 'style =' >> .hg/hgrc
235
235
236 Add some simple styles to settings
236 Add some simple styles to settings
237
237
238 $ cat <<'EOF' >> .hg/hgrc
238 $ cat <<'EOF' >> .hg/hgrc
239 > [templates]
239 > [templates]
240 > simple = "{rev}\n"
240 > simple = "{rev}\n"
241 > simple2 = {rev}\n
241 > simple2 = {rev}\n
242 > rev = "should not precede {rev} keyword\n"
242 > rev = "should not precede {rev} keyword\n"
243 > EOF
243 > EOF
244
244
245 $ hg log -l1 -Tsimple
245 $ hg log -l1 -Tsimple
246 8
246 8
247 $ hg log -l1 -Tsimple2
247 $ hg log -l1 -Tsimple2
248 8
248 8
249 $ hg log -l1 -Trev
249 $ hg log -l1 -Trev
250 should not precede 8 keyword
250 should not precede 8 keyword
251 $ hg log -l1 -T '{simple}'
251 $ hg log -l1 -T '{simple}'
252 8
252 8
253
253
254 Map file shouldn't see user templates:
254 Map file shouldn't see user templates:
255
255
256 $ cat <<EOF > tmpl
256 $ cat <<EOF > tmpl
257 > changeset = 'nothing expanded:{simple}\n'
257 > changeset = 'nothing expanded:{simple}\n'
258 > EOF
258 > EOF
259 $ hg log -l1 --style ./tmpl
259 $ hg log -l1 --style ./tmpl
260 nothing expanded:
260 nothing expanded:
261
261
262 Test templates and style maps in files:
262 Test templates and style maps in files:
263
263
264 $ echo "{rev}" > tmpl
264 $ echo "{rev}" > tmpl
265 $ hg log -l1 -T./tmpl
265 $ hg log -l1 -T./tmpl
266 8
266 8
267 $ hg log -l1 -Tblah/blah
267 $ hg log -l1 -Tblah/blah
268 blah/blah (no-eol)
268 blah/blah (no-eol)
269
269
270 $ printf 'changeset = "{rev}\\n"\n' > map-simple
270 $ printf 'changeset = "{rev}\\n"\n' > map-simple
271 $ hg log -l1 -T./map-simple
271 $ hg log -l1 -T./map-simple
272 8
272 8
273
273
274 a map file may have [templates] and [templatealias] sections:
274 a map file may have [templates] and [templatealias] sections:
275
275
276 $ cat <<'EOF' > map-simple
276 $ cat <<'EOF' > map-simple
277 > [templates]
277 > [templates]
278 > changeset = "{a}\n"
278 > changeset = "{a}\n"
279 > [templatealias]
279 > [templatealias]
280 > a = rev
280 > a = rev
281 > EOF
281 > EOF
282 $ hg log -l1 -T./map-simple
282 $ hg log -l1 -T./map-simple
283 8
283 8
284
284
285 so it can be included in hgrc
285 so it can be included in hgrc
286
286
287 $ cat <<'EOF' > myhgrc
287 $ cat <<'EOF' > myhgrc
288 > %include map-simple
288 > %include map-simple
289 > [templates]
289 > [templates]
290 > foo = "{changeset}"
290 > foo = "{changeset}"
291 > EOF
291 > EOF
292 $ HGRCPATH=./myhgrc hg log -l1 -Tfoo
292 $ HGRCPATH=./myhgrc hg log -l1 -Tfoo
293 8
293 8
294 $ HGRCPATH=./myhgrc hg log -l1 -T'{a}\n'
294 $ HGRCPATH=./myhgrc hg log -l1 -T'{a}\n'
295 8
295 8
296
296
297 Test template map inheritance
297 Test template map inheritance
298
298
299 $ echo "__base__ = map-cmdline.default" > map-simple
299 $ echo "__base__ = map-cmdline.default" > map-simple
300 $ printf 'cset = "changeset: ***{rev}***\\n"\n' >> map-simple
300 $ printf 'cset = "changeset: ***{rev}***\\n"\n' >> map-simple
301 $ hg log -l1 -T./map-simple
301 $ hg log -l1 -T./map-simple
302 changeset: ***8***
302 changeset: ***8***
303 tag: tip
303 tag: tip
304 user: test
304 user: test
305 date: Wed Jan 01 10:01:00 2020 +0000
305 date: Wed Jan 01 10:01:00 2020 +0000
306 summary: third
306 summary: third
307
307
308
308
309 Test docheader, docfooter and separator in template map
309 Test docheader, docfooter and separator in template map
310
310
311 $ cat <<'EOF' > map-myjson
311 $ cat <<'EOF' > map-myjson
312 > docheader = '\{\n'
312 > docheader = '\{\n'
313 > docfooter = '\n}\n'
313 > docfooter = '\n}\n'
314 > separator = ',\n'
314 > separator = ',\n'
315 > changeset = ' {dict(rev, node|short)|json}'
315 > changeset = ' {dict(rev, node|short)|json}'
316 > EOF
316 > EOF
317 $ hg log -l2 -T./map-myjson
317 $ hg log -l2 -T./map-myjson
318 {
318 {
319 {"node": "95c24699272e", "rev": 8},
319 {"node": "95c24699272e", "rev": 8},
320 {"node": "29114dbae42b", "rev": 7}
320 {"node": "29114dbae42b", "rev": 7}
321 }
321 }
322
322
323 Test docheader, docfooter and separator in [templates] section
323 Test docheader, docfooter and separator in [templates] section
324
324
325 $ cat <<'EOF' >> .hg/hgrc
325 $ cat <<'EOF' >> .hg/hgrc
326 > [templates]
326 > [templates]
327 > myjson = ' {dict(rev, node|short)|json}'
327 > myjson = ' {dict(rev, node|short)|json}'
328 > myjson:docheader = '\{\n'
328 > myjson:docheader = '\{\n'
329 > myjson:docfooter = '\n}\n'
329 > myjson:docfooter = '\n}\n'
330 > myjson:separator = ',\n'
330 > myjson:separator = ',\n'
331 > :docheader = 'should not be selected as a docheader for literal templates\n'
331 > :docheader = 'should not be selected as a docheader for literal templates\n'
332 > EOF
332 > EOF
333 $ hg log -l2 -Tmyjson
333 $ hg log -l2 -Tmyjson
334 {
334 {
335 {"node": "95c24699272e", "rev": 8},
335 {"node": "95c24699272e", "rev": 8},
336 {"node": "29114dbae42b", "rev": 7}
336 {"node": "29114dbae42b", "rev": 7}
337 }
337 }
338 $ hg log -l1 -T'{rev}\n'
338 $ hg log -l1 -T'{rev}\n'
339 8
339 8
340
340
341 Template should precede style option
341 Template should precede style option
342
342
343 $ hg log -l1 --style default -T '{rev}\n'
343 $ hg log -l1 --style default -T '{rev}\n'
344 8
344 8
345
345
346 Add a commit with empty description, to ensure that the templates
346 Add a commit with empty description, to ensure that the templates
347 below will omit the description line.
347 below will omit the description line.
348
348
349 $ echo c >> c
349 $ echo c >> c
350 $ hg add c
350 $ hg add c
351 $ hg commit -qm ' '
351 $ hg commit -qm ' '
352
352
353 Default style is like normal output. Phases style should be the same
353 Default style is like normal output. Phases style should be the same
354 as default style, except for extra phase lines.
354 as default style, except for extra phase lines.
355
355
356 $ hg log > log.out
356 $ hg log > log.out
357 $ hg log --style default > style.out
357 $ hg log --style default > style.out
358 $ cmp log.out style.out || diff -u log.out style.out
358 $ cmp log.out style.out || diff -u log.out style.out
359 $ hg log -T phases > phases.out
359 $ hg log -T phases > phases.out
360 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
360 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
361 +phase: draft
361 +phase: draft
362 +phase: draft
362 +phase: draft
363 +phase: draft
363 +phase: draft
364 +phase: draft
364 +phase: draft
365 +phase: draft
365 +phase: draft
366 +phase: draft
366 +phase: draft
367 +phase: draft
367 +phase: draft
368 +phase: draft
368 +phase: draft
369 +phase: draft
369 +phase: draft
370 +phase: draft
370 +phase: draft
371
371
372 $ hg log -v > log.out
372 $ hg log -v > log.out
373 $ hg log -v --style default > style.out
373 $ hg log -v --style default > style.out
374 $ cmp log.out style.out || diff -u log.out style.out
374 $ cmp log.out style.out || diff -u log.out style.out
375 $ hg log -v -T phases > phases.out
375 $ hg log -v -T phases > phases.out
376 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
376 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
377 +phase: draft
377 +phase: draft
378 +phase: draft
378 +phase: draft
379 +phase: draft
379 +phase: draft
380 +phase: draft
380 +phase: draft
381 +phase: draft
381 +phase: draft
382 +phase: draft
382 +phase: draft
383 +phase: draft
383 +phase: draft
384 +phase: draft
384 +phase: draft
385 +phase: draft
385 +phase: draft
386 +phase: draft
386 +phase: draft
387
387
388 $ hg log -q > log.out
388 $ hg log -q > log.out
389 $ hg log -q --style default > style.out
389 $ hg log -q --style default > style.out
390 $ cmp log.out style.out || diff -u log.out style.out
390 $ cmp log.out style.out || diff -u log.out style.out
391 $ hg log -q -T phases > phases.out
391 $ hg log -q -T phases > phases.out
392 $ cmp log.out phases.out || diff -u log.out phases.out
392 $ cmp log.out phases.out || diff -u log.out phases.out
393
393
394 $ hg log --debug > log.out
394 $ hg log --debug > log.out
395 $ hg log --debug --style default > style.out
395 $ hg log --debug --style default > style.out
396 $ cmp log.out style.out || diff -u log.out style.out
396 $ cmp log.out style.out || diff -u log.out style.out
397 $ hg log --debug -T phases > phases.out
397 $ hg log --debug -T phases > phases.out
398 $ cmp log.out phases.out || diff -u log.out phases.out
398 $ cmp log.out phases.out || diff -u log.out phases.out
399
399
400 Default style of working-directory revision should also be the same (but
400 Default style of working-directory revision should also be the same (but
401 date may change while running tests):
401 date may change while running tests):
402
402
403 $ hg log -r 'wdir()' | sed 's|^date:.*|date:|' > log.out
403 $ hg log -r 'wdir()' | sed 's|^date:.*|date:|' > log.out
404 $ hg log -r 'wdir()' --style default | sed 's|^date:.*|date:|' > style.out
404 $ hg log -r 'wdir()' --style default | sed 's|^date:.*|date:|' > style.out
405 $ cmp log.out style.out || diff -u log.out style.out
405 $ cmp log.out style.out || diff -u log.out style.out
406
406
407 $ hg log -r 'wdir()' -v | sed 's|^date:.*|date:|' > log.out
407 $ hg log -r 'wdir()' -v | sed 's|^date:.*|date:|' > log.out
408 $ hg log -r 'wdir()' -v --style default | sed 's|^date:.*|date:|' > style.out
408 $ hg log -r 'wdir()' -v --style default | sed 's|^date:.*|date:|' > style.out
409 $ cmp log.out style.out || diff -u log.out style.out
409 $ cmp log.out style.out || diff -u log.out style.out
410
410
411 $ hg log -r 'wdir()' -q > log.out
411 $ hg log -r 'wdir()' -q > log.out
412 $ hg log -r 'wdir()' -q --style default > style.out
412 $ hg log -r 'wdir()' -q --style default > style.out
413 $ cmp log.out style.out || diff -u log.out style.out
413 $ cmp log.out style.out || diff -u log.out style.out
414
414
415 $ hg log -r 'wdir()' --debug | sed 's|^date:.*|date:|' > log.out
415 $ hg log -r 'wdir()' --debug | sed 's|^date:.*|date:|' > log.out
416 $ hg log -r 'wdir()' --debug --style default \
416 $ hg log -r 'wdir()' --debug --style default \
417 > | sed 's|^date:.*|date:|' > style.out
417 > | sed 's|^date:.*|date:|' > style.out
418 $ cmp log.out style.out || diff -u log.out style.out
418 $ cmp log.out style.out || diff -u log.out style.out
419
419
420 Default style should also preserve color information (issue2866):
420 Default style should also preserve color information (issue2866):
421
421
422 $ cp $HGRCPATH $HGRCPATH-bak
422 $ cp $HGRCPATH $HGRCPATH-bak
423 $ cat <<EOF >> $HGRCPATH
423 $ cat <<EOF >> $HGRCPATH
424 > [extensions]
424 > [extensions]
425 > color=
425 > color=
426 > EOF
426 > EOF
427
427
428 $ hg --color=debug log > log.out
428 $ hg --color=debug log > log.out
429 $ hg --color=debug log --style default > style.out
429 $ hg --color=debug log --style default > style.out
430 $ cmp log.out style.out || diff -u log.out style.out
430 $ cmp log.out style.out || diff -u log.out style.out
431 $ hg --color=debug log -T phases > phases.out
431 $ hg --color=debug log -T phases > phases.out
432 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
432 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
433 +[log.phase|phase: draft]
433 +[log.phase|phase: draft]
434 +[log.phase|phase: draft]
434 +[log.phase|phase: draft]
435 +[log.phase|phase: draft]
435 +[log.phase|phase: draft]
436 +[log.phase|phase: draft]
436 +[log.phase|phase: draft]
437 +[log.phase|phase: draft]
437 +[log.phase|phase: draft]
438 +[log.phase|phase: draft]
438 +[log.phase|phase: draft]
439 +[log.phase|phase: draft]
439 +[log.phase|phase: draft]
440 +[log.phase|phase: draft]
440 +[log.phase|phase: draft]
441 +[log.phase|phase: draft]
441 +[log.phase|phase: draft]
442 +[log.phase|phase: draft]
442 +[log.phase|phase: draft]
443
443
444 $ hg --color=debug -v log > log.out
444 $ hg --color=debug -v log > log.out
445 $ hg --color=debug -v log --style default > style.out
445 $ hg --color=debug -v log --style default > style.out
446 $ cmp log.out style.out || diff -u log.out style.out
446 $ cmp log.out style.out || diff -u log.out style.out
447 $ hg --color=debug -v log -T phases > phases.out
447 $ hg --color=debug -v log -T phases > phases.out
448 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
448 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
449 +[log.phase|phase: draft]
449 +[log.phase|phase: draft]
450 +[log.phase|phase: draft]
450 +[log.phase|phase: draft]
451 +[log.phase|phase: draft]
451 +[log.phase|phase: draft]
452 +[log.phase|phase: draft]
452 +[log.phase|phase: draft]
453 +[log.phase|phase: draft]
453 +[log.phase|phase: draft]
454 +[log.phase|phase: draft]
454 +[log.phase|phase: draft]
455 +[log.phase|phase: draft]
455 +[log.phase|phase: draft]
456 +[log.phase|phase: draft]
456 +[log.phase|phase: draft]
457 +[log.phase|phase: draft]
457 +[log.phase|phase: draft]
458 +[log.phase|phase: draft]
458 +[log.phase|phase: draft]
459
459
460 $ hg --color=debug -q log > log.out
460 $ hg --color=debug -q log > log.out
461 $ hg --color=debug -q log --style default > style.out
461 $ hg --color=debug -q log --style default > style.out
462 $ cmp log.out style.out || diff -u log.out style.out
462 $ cmp log.out style.out || diff -u log.out style.out
463 $ hg --color=debug -q log -T phases > phases.out
463 $ hg --color=debug -q log -T phases > phases.out
464 $ cmp log.out phases.out || diff -u log.out phases.out
464 $ cmp log.out phases.out || diff -u log.out phases.out
465
465
466 $ hg --color=debug --debug log > log.out
466 $ hg --color=debug --debug log > log.out
467 $ hg --color=debug --debug log --style default > style.out
467 $ hg --color=debug --debug log --style default > style.out
468 $ cmp log.out style.out || diff -u log.out style.out
468 $ cmp log.out style.out || diff -u log.out style.out
469 $ hg --color=debug --debug log -T phases > phases.out
469 $ hg --color=debug --debug log -T phases > phases.out
470 $ cmp log.out phases.out || diff -u log.out phases.out
470 $ cmp log.out phases.out || diff -u log.out phases.out
471
471
472 $ mv $HGRCPATH-bak $HGRCPATH
472 $ mv $HGRCPATH-bak $HGRCPATH
473
473
474 Remove commit with empty commit message, so as to not pollute further
474 Remove commit with empty commit message, so as to not pollute further
475 tests.
475 tests.
476
476
477 $ hg --config extensions.strip= strip -q .
477 $ hg --config extensions.strip= strip -q .
478
478
479 Revision with no copies (used to print a traceback):
479 Revision with no copies (used to print a traceback):
480
480
481 $ hg tip -v --template '\n'
481 $ hg tip -v --template '\n'
482
482
483
483
484 Compact style works:
484 Compact style works:
485
485
486 $ hg log -Tcompact
486 $ hg log -Tcompact
487 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
487 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
488 third
488 third
489
489
490 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
490 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
491 second
491 second
492
492
493 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
493 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
494 merge
494 merge
495
495
496 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
496 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
497 new head
497 new head
498
498
499 4 bbe44766e73d 1970-01-17 04:53 +0000 person
499 4 bbe44766e73d 1970-01-17 04:53 +0000 person
500 new branch
500 new branch
501
501
502 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
502 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
503 no user, no domain
503 no user, no domain
504
504
505 2 97054abb4ab8 1970-01-14 21:20 +0000 other
505 2 97054abb4ab8 1970-01-14 21:20 +0000 other
506 no person
506 no person
507
507
508 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
508 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
509 other 1
509 other 1
510
510
511 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
511 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
512 line 1
512 line 1
513
513
514
514
515 $ hg log -v --style compact
515 $ hg log -v --style compact
516 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
516 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
517 third
517 third
518
518
519 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
519 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
520 second
520 second
521
521
522 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
522 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
523 merge
523 merge
524
524
525 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
525 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
526 new head
526 new head
527
527
528 4 bbe44766e73d 1970-01-17 04:53 +0000 person
528 4 bbe44766e73d 1970-01-17 04:53 +0000 person
529 new branch
529 new branch
530
530
531 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
531 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
532 no user, no domain
532 no user, no domain
533
533
534 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
534 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
535 no person
535 no person
536
536
537 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
537 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
538 other 1
538 other 1
539 other 2
539 other 2
540
540
541 other 3
541 other 3
542
542
543 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
543 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
544 line 1
544 line 1
545 line 2
545 line 2
546
546
547
547
548 $ hg log --debug --style compact
548 $ hg log --debug --style compact
549 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
549 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
550 third
550 third
551
551
552 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
552 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
553 second
553 second
554
554
555 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
555 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
556 merge
556 merge
557
557
558 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
558 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
559 new head
559 new head
560
560
561 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
561 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
562 new branch
562 new branch
563
563
564 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
564 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
565 no user, no domain
565 no user, no domain
566
566
567 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
567 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
568 no person
568 no person
569
569
570 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
570 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
571 other 1
571 other 1
572 other 2
572 other 2
573
573
574 other 3
574 other 3
575
575
576 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
576 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
577 line 1
577 line 1
578 line 2
578 line 2
579
579
580
580
581 Test xml styles:
581 Test xml styles:
582
582
583 $ hg log --style xml -r 'not all()'
583 $ hg log --style xml -r 'not all()'
584 <?xml version="1.0"?>
584 <?xml version="1.0"?>
585 <log>
585 <log>
586 </log>
586 </log>
587
587
588 $ hg log --style xml
588 $ hg log --style xml
589 <?xml version="1.0"?>
589 <?xml version="1.0"?>
590 <log>
590 <log>
591 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
591 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
592 <tag>tip</tag>
592 <tag>tip</tag>
593 <author email="test">test</author>
593 <author email="test">test</author>
594 <date>2020-01-01T10:01:00+00:00</date>
594 <date>2020-01-01T10:01:00+00:00</date>
595 <msg xml:space="preserve">third</msg>
595 <msg xml:space="preserve">third</msg>
596 </logentry>
596 </logentry>
597 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
597 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
598 <parent revision="-1" node="0000000000000000000000000000000000000000" />
598 <parent revision="-1" node="0000000000000000000000000000000000000000" />
599 <author email="user@hostname">User Name</author>
599 <author email="user@hostname">User Name</author>
600 <date>1970-01-12T13:46:40+00:00</date>
600 <date>1970-01-12T13:46:40+00:00</date>
601 <msg xml:space="preserve">second</msg>
601 <msg xml:space="preserve">second</msg>
602 </logentry>
602 </logentry>
603 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
603 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
604 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
604 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
605 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
605 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
606 <author email="person">person</author>
606 <author email="person">person</author>
607 <date>1970-01-18T08:40:01+00:00</date>
607 <date>1970-01-18T08:40:01+00:00</date>
608 <msg xml:space="preserve">merge</msg>
608 <msg xml:space="preserve">merge</msg>
609 </logentry>
609 </logentry>
610 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
610 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
611 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
611 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
612 <author email="person">person</author>
612 <author email="person">person</author>
613 <date>1970-01-18T08:40:00+00:00</date>
613 <date>1970-01-18T08:40:00+00:00</date>
614 <msg xml:space="preserve">new head</msg>
614 <msg xml:space="preserve">new head</msg>
615 </logentry>
615 </logentry>
616 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
616 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
617 <branch>foo</branch>
617 <branch>foo</branch>
618 <author email="person">person</author>
618 <author email="person">person</author>
619 <date>1970-01-17T04:53:20+00:00</date>
619 <date>1970-01-17T04:53:20+00:00</date>
620 <msg xml:space="preserve">new branch</msg>
620 <msg xml:space="preserve">new branch</msg>
621 </logentry>
621 </logentry>
622 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
622 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
623 <author email="person">person</author>
623 <author email="person">person</author>
624 <date>1970-01-16T01:06:40+00:00</date>
624 <date>1970-01-16T01:06:40+00:00</date>
625 <msg xml:space="preserve">no user, no domain</msg>
625 <msg xml:space="preserve">no user, no domain</msg>
626 </logentry>
626 </logentry>
627 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
627 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
628 <author email="other@place">other</author>
628 <author email="other@place">other</author>
629 <date>1970-01-14T21:20:00+00:00</date>
629 <date>1970-01-14T21:20:00+00:00</date>
630 <msg xml:space="preserve">no person</msg>
630 <msg xml:space="preserve">no person</msg>
631 </logentry>
631 </logentry>
632 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
632 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
633 <author email="other@place">A. N. Other</author>
633 <author email="other@place">A. N. Other</author>
634 <date>1970-01-13T17:33:20+00:00</date>
634 <date>1970-01-13T17:33:20+00:00</date>
635 <msg xml:space="preserve">other 1
635 <msg xml:space="preserve">other 1
636 other 2
636 other 2
637
637
638 other 3</msg>
638 other 3</msg>
639 </logentry>
639 </logentry>
640 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
640 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
641 <author email="user@hostname">User Name</author>
641 <author email="user@hostname">User Name</author>
642 <date>1970-01-12T13:46:40+00:00</date>
642 <date>1970-01-12T13:46:40+00:00</date>
643 <msg xml:space="preserve">line 1
643 <msg xml:space="preserve">line 1
644 line 2</msg>
644 line 2</msg>
645 </logentry>
645 </logentry>
646 </log>
646 </log>
647
647
648 $ hg log -v --style xml
648 $ hg log -v --style xml
649 <?xml version="1.0"?>
649 <?xml version="1.0"?>
650 <log>
650 <log>
651 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
651 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
652 <tag>tip</tag>
652 <tag>tip</tag>
653 <author email="test">test</author>
653 <author email="test">test</author>
654 <date>2020-01-01T10:01:00+00:00</date>
654 <date>2020-01-01T10:01:00+00:00</date>
655 <msg xml:space="preserve">third</msg>
655 <msg xml:space="preserve">third</msg>
656 <paths>
656 <paths>
657 <path action="A">fourth</path>
657 <path action="A">fourth</path>
658 <path action="A">third</path>
658 <path action="A">third</path>
659 <path action="R">second</path>
659 <path action="R">second</path>
660 </paths>
660 </paths>
661 <copies>
661 <copies>
662 <copy source="second">fourth</copy>
662 <copy source="second">fourth</copy>
663 </copies>
663 </copies>
664 </logentry>
664 </logentry>
665 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
665 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
666 <parent revision="-1" node="0000000000000000000000000000000000000000" />
666 <parent revision="-1" node="0000000000000000000000000000000000000000" />
667 <author email="user@hostname">User Name</author>
667 <author email="user@hostname">User Name</author>
668 <date>1970-01-12T13:46:40+00:00</date>
668 <date>1970-01-12T13:46:40+00:00</date>
669 <msg xml:space="preserve">second</msg>
669 <msg xml:space="preserve">second</msg>
670 <paths>
670 <paths>
671 <path action="A">second</path>
671 <path action="A">second</path>
672 </paths>
672 </paths>
673 </logentry>
673 </logentry>
674 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
674 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
675 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
675 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
676 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
676 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
677 <author email="person">person</author>
677 <author email="person">person</author>
678 <date>1970-01-18T08:40:01+00:00</date>
678 <date>1970-01-18T08:40:01+00:00</date>
679 <msg xml:space="preserve">merge</msg>
679 <msg xml:space="preserve">merge</msg>
680 <paths>
680 <paths>
681 </paths>
681 </paths>
682 </logentry>
682 </logentry>
683 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
683 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
684 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
684 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
685 <author email="person">person</author>
685 <author email="person">person</author>
686 <date>1970-01-18T08:40:00+00:00</date>
686 <date>1970-01-18T08:40:00+00:00</date>
687 <msg xml:space="preserve">new head</msg>
687 <msg xml:space="preserve">new head</msg>
688 <paths>
688 <paths>
689 <path action="A">d</path>
689 <path action="A">d</path>
690 </paths>
690 </paths>
691 </logentry>
691 </logentry>
692 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
692 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
693 <branch>foo</branch>
693 <branch>foo</branch>
694 <author email="person">person</author>
694 <author email="person">person</author>
695 <date>1970-01-17T04:53:20+00:00</date>
695 <date>1970-01-17T04:53:20+00:00</date>
696 <msg xml:space="preserve">new branch</msg>
696 <msg xml:space="preserve">new branch</msg>
697 <paths>
697 <paths>
698 </paths>
698 </paths>
699 </logentry>
699 </logentry>
700 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
700 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
701 <author email="person">person</author>
701 <author email="person">person</author>
702 <date>1970-01-16T01:06:40+00:00</date>
702 <date>1970-01-16T01:06:40+00:00</date>
703 <msg xml:space="preserve">no user, no domain</msg>
703 <msg xml:space="preserve">no user, no domain</msg>
704 <paths>
704 <paths>
705 <path action="M">c</path>
705 <path action="M">c</path>
706 </paths>
706 </paths>
707 </logentry>
707 </logentry>
708 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
708 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
709 <author email="other@place">other</author>
709 <author email="other@place">other</author>
710 <date>1970-01-14T21:20:00+00:00</date>
710 <date>1970-01-14T21:20:00+00:00</date>
711 <msg xml:space="preserve">no person</msg>
711 <msg xml:space="preserve">no person</msg>
712 <paths>
712 <paths>
713 <path action="A">c</path>
713 <path action="A">c</path>
714 </paths>
714 </paths>
715 </logentry>
715 </logentry>
716 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
716 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
717 <author email="other@place">A. N. Other</author>
717 <author email="other@place">A. N. Other</author>
718 <date>1970-01-13T17:33:20+00:00</date>
718 <date>1970-01-13T17:33:20+00:00</date>
719 <msg xml:space="preserve">other 1
719 <msg xml:space="preserve">other 1
720 other 2
720 other 2
721
721
722 other 3</msg>
722 other 3</msg>
723 <paths>
723 <paths>
724 <path action="A">b</path>
724 <path action="A">b</path>
725 </paths>
725 </paths>
726 </logentry>
726 </logentry>
727 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
727 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
728 <author email="user@hostname">User Name</author>
728 <author email="user@hostname">User Name</author>
729 <date>1970-01-12T13:46:40+00:00</date>
729 <date>1970-01-12T13:46:40+00:00</date>
730 <msg xml:space="preserve">line 1
730 <msg xml:space="preserve">line 1
731 line 2</msg>
731 line 2</msg>
732 <paths>
732 <paths>
733 <path action="A">a</path>
733 <path action="A">a</path>
734 </paths>
734 </paths>
735 </logentry>
735 </logentry>
736 </log>
736 </log>
737
737
738 $ hg log --debug --style xml
738 $ hg log --debug --style xml
739 <?xml version="1.0"?>
739 <?xml version="1.0"?>
740 <log>
740 <log>
741 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
741 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
742 <tag>tip</tag>
742 <tag>tip</tag>
743 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
743 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
744 <parent revision="-1" node="0000000000000000000000000000000000000000" />
744 <parent revision="-1" node="0000000000000000000000000000000000000000" />
745 <author email="test">test</author>
745 <author email="test">test</author>
746 <date>2020-01-01T10:01:00+00:00</date>
746 <date>2020-01-01T10:01:00+00:00</date>
747 <msg xml:space="preserve">third</msg>
747 <msg xml:space="preserve">third</msg>
748 <paths>
748 <paths>
749 <path action="A">fourth</path>
749 <path action="A">fourth</path>
750 <path action="A">third</path>
750 <path action="A">third</path>
751 <path action="R">second</path>
751 <path action="R">second</path>
752 </paths>
752 </paths>
753 <copies>
753 <copies>
754 <copy source="second">fourth</copy>
754 <copy source="second">fourth</copy>
755 </copies>
755 </copies>
756 <extra key="branch">default</extra>
756 <extra key="branch">default</extra>
757 </logentry>
757 </logentry>
758 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
758 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
759 <parent revision="-1" node="0000000000000000000000000000000000000000" />
759 <parent revision="-1" node="0000000000000000000000000000000000000000" />
760 <parent revision="-1" node="0000000000000000000000000000000000000000" />
760 <parent revision="-1" node="0000000000000000000000000000000000000000" />
761 <author email="user@hostname">User Name</author>
761 <author email="user@hostname">User Name</author>
762 <date>1970-01-12T13:46:40+00:00</date>
762 <date>1970-01-12T13:46:40+00:00</date>
763 <msg xml:space="preserve">second</msg>
763 <msg xml:space="preserve">second</msg>
764 <paths>
764 <paths>
765 <path action="A">second</path>
765 <path action="A">second</path>
766 </paths>
766 </paths>
767 <extra key="branch">default</extra>
767 <extra key="branch">default</extra>
768 </logentry>
768 </logentry>
769 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
769 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
770 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
770 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
771 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
771 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
772 <author email="person">person</author>
772 <author email="person">person</author>
773 <date>1970-01-18T08:40:01+00:00</date>
773 <date>1970-01-18T08:40:01+00:00</date>
774 <msg xml:space="preserve">merge</msg>
774 <msg xml:space="preserve">merge</msg>
775 <paths>
775 <paths>
776 </paths>
776 </paths>
777 <extra key="branch">default</extra>
777 <extra key="branch">default</extra>
778 </logentry>
778 </logentry>
779 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
779 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
780 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
780 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
781 <parent revision="-1" node="0000000000000000000000000000000000000000" />
781 <parent revision="-1" node="0000000000000000000000000000000000000000" />
782 <author email="person">person</author>
782 <author email="person">person</author>
783 <date>1970-01-18T08:40:00+00:00</date>
783 <date>1970-01-18T08:40:00+00:00</date>
784 <msg xml:space="preserve">new head</msg>
784 <msg xml:space="preserve">new head</msg>
785 <paths>
785 <paths>
786 <path action="A">d</path>
786 <path action="A">d</path>
787 </paths>
787 </paths>
788 <extra key="branch">default</extra>
788 <extra key="branch">default</extra>
789 </logentry>
789 </logentry>
790 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
790 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
791 <branch>foo</branch>
791 <branch>foo</branch>
792 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
792 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
793 <parent revision="-1" node="0000000000000000000000000000000000000000" />
793 <parent revision="-1" node="0000000000000000000000000000000000000000" />
794 <author email="person">person</author>
794 <author email="person">person</author>
795 <date>1970-01-17T04:53:20+00:00</date>
795 <date>1970-01-17T04:53:20+00:00</date>
796 <msg xml:space="preserve">new branch</msg>
796 <msg xml:space="preserve">new branch</msg>
797 <paths>
797 <paths>
798 </paths>
798 </paths>
799 <extra key="branch">foo</extra>
799 <extra key="branch">foo</extra>
800 </logentry>
800 </logentry>
801 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
801 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
802 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
802 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
803 <parent revision="-1" node="0000000000000000000000000000000000000000" />
803 <parent revision="-1" node="0000000000000000000000000000000000000000" />
804 <author email="person">person</author>
804 <author email="person">person</author>
805 <date>1970-01-16T01:06:40+00:00</date>
805 <date>1970-01-16T01:06:40+00:00</date>
806 <msg xml:space="preserve">no user, no domain</msg>
806 <msg xml:space="preserve">no user, no domain</msg>
807 <paths>
807 <paths>
808 <path action="M">c</path>
808 <path action="M">c</path>
809 </paths>
809 </paths>
810 <extra key="branch">default</extra>
810 <extra key="branch">default</extra>
811 </logentry>
811 </logentry>
812 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
812 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
813 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
813 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
814 <parent revision="-1" node="0000000000000000000000000000000000000000" />
814 <parent revision="-1" node="0000000000000000000000000000000000000000" />
815 <author email="other@place">other</author>
815 <author email="other@place">other</author>
816 <date>1970-01-14T21:20:00+00:00</date>
816 <date>1970-01-14T21:20:00+00:00</date>
817 <msg xml:space="preserve">no person</msg>
817 <msg xml:space="preserve">no person</msg>
818 <paths>
818 <paths>
819 <path action="A">c</path>
819 <path action="A">c</path>
820 </paths>
820 </paths>
821 <extra key="branch">default</extra>
821 <extra key="branch">default</extra>
822 </logentry>
822 </logentry>
823 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
823 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
824 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
824 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
825 <parent revision="-1" node="0000000000000000000000000000000000000000" />
825 <parent revision="-1" node="0000000000000000000000000000000000000000" />
826 <author email="other@place">A. N. Other</author>
826 <author email="other@place">A. N. Other</author>
827 <date>1970-01-13T17:33:20+00:00</date>
827 <date>1970-01-13T17:33:20+00:00</date>
828 <msg xml:space="preserve">other 1
828 <msg xml:space="preserve">other 1
829 other 2
829 other 2
830
830
831 other 3</msg>
831 other 3</msg>
832 <paths>
832 <paths>
833 <path action="A">b</path>
833 <path action="A">b</path>
834 </paths>
834 </paths>
835 <extra key="branch">default</extra>
835 <extra key="branch">default</extra>
836 </logentry>
836 </logentry>
837 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
837 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
838 <parent revision="-1" node="0000000000000000000000000000000000000000" />
838 <parent revision="-1" node="0000000000000000000000000000000000000000" />
839 <parent revision="-1" node="0000000000000000000000000000000000000000" />
839 <parent revision="-1" node="0000000000000000000000000000000000000000" />
840 <author email="user@hostname">User Name</author>
840 <author email="user@hostname">User Name</author>
841 <date>1970-01-12T13:46:40+00:00</date>
841 <date>1970-01-12T13:46:40+00:00</date>
842 <msg xml:space="preserve">line 1
842 <msg xml:space="preserve">line 1
843 line 2</msg>
843 line 2</msg>
844 <paths>
844 <paths>
845 <path action="A">a</path>
845 <path action="A">a</path>
846 </paths>
846 </paths>
847 <extra key="branch">default</extra>
847 <extra key="branch">default</extra>
848 </logentry>
848 </logentry>
849 </log>
849 </log>
850
850
851
851
852 Test JSON style:
852 Test JSON style:
853
853
854 $ hg log -k nosuch -Tjson
854 $ hg log -k nosuch -Tjson
855 []
855 []
856
856
857 $ hg log -qr . -Tjson
857 $ hg log -qr . -Tjson
858 [
858 [
859 {
859 {
860 "rev": 8,
860 "rev": 8,
861 "node": "95c24699272ef57d062b8bccc32c878bf841784a"
861 "node": "95c24699272ef57d062b8bccc32c878bf841784a"
862 }
862 }
863 ]
863 ]
864
864
865 $ hg log -vpr . -Tjson --stat
865 $ hg log -vpr . -Tjson --stat
866 [
866 [
867 {
867 {
868 "rev": 8,
868 "rev": 8,
869 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
869 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
870 "branch": "default",
870 "branch": "default",
871 "phase": "draft",
871 "phase": "draft",
872 "user": "test",
872 "user": "test",
873 "date": [1577872860, 0],
873 "date": [1577872860, 0],
874 "desc": "third",
874 "desc": "third",
875 "bookmarks": [],
875 "bookmarks": [],
876 "tags": ["tip"],
876 "tags": ["tip"],
877 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
877 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
878 "files": ["fourth", "second", "third"],
878 "files": ["fourth", "second", "third"],
879 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
879 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
880 "diff": "diff -r 29114dbae42b -r 95c24699272e fourth\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/fourth\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+second\ndiff -r 29114dbae42b -r 95c24699272e second\n--- a/second\tMon Jan 12 13:46:40 1970 +0000\n+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +0,0 @@\n-second\ndiff -r 29114dbae42b -r 95c24699272e third\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/third\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+third\n"
880 "diff": "diff -r 29114dbae42b -r 95c24699272e fourth\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/fourth\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+second\ndiff -r 29114dbae42b -r 95c24699272e second\n--- a/second\tMon Jan 12 13:46:40 1970 +0000\n+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +0,0 @@\n-second\ndiff -r 29114dbae42b -r 95c24699272e third\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/third\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+third\n"
881 }
881 }
882 ]
882 ]
883
883
884 honor --git but not format-breaking diffopts
884 honor --git but not format-breaking diffopts
885 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
885 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
886 [
886 [
887 {
887 {
888 "rev": 8,
888 "rev": 8,
889 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
889 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
890 "branch": "default",
890 "branch": "default",
891 "phase": "draft",
891 "phase": "draft",
892 "user": "test",
892 "user": "test",
893 "date": [1577872860, 0],
893 "date": [1577872860, 0],
894 "desc": "third",
894 "desc": "third",
895 "bookmarks": [],
895 "bookmarks": [],
896 "tags": ["tip"],
896 "tags": ["tip"],
897 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
897 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
898 "files": ["fourth", "second", "third"],
898 "files": ["fourth", "second", "third"],
899 "diff": "diff --git a/second b/fourth\nrename from second\nrename to fourth\ndiff --git a/third b/third\nnew file mode 100644\n--- /dev/null\n+++ b/third\n@@ -0,0 +1,1 @@\n+third\n"
899 "diff": "diff --git a/second b/fourth\nrename from second\nrename to fourth\ndiff --git a/third b/third\nnew file mode 100644\n--- /dev/null\n+++ b/third\n@@ -0,0 +1,1 @@\n+third\n"
900 }
900 }
901 ]
901 ]
902
902
903 $ hg log -T json
903 $ hg log -T json
904 [
904 [
905 {
905 {
906 "rev": 8,
906 "rev": 8,
907 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
907 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
908 "branch": "default",
908 "branch": "default",
909 "phase": "draft",
909 "phase": "draft",
910 "user": "test",
910 "user": "test",
911 "date": [1577872860, 0],
911 "date": [1577872860, 0],
912 "desc": "third",
912 "desc": "third",
913 "bookmarks": [],
913 "bookmarks": [],
914 "tags": ["tip"],
914 "tags": ["tip"],
915 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"]
915 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"]
916 },
916 },
917 {
917 {
918 "rev": 7,
918 "rev": 7,
919 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
919 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
920 "branch": "default",
920 "branch": "default",
921 "phase": "draft",
921 "phase": "draft",
922 "user": "User Name <user@hostname>",
922 "user": "User Name <user@hostname>",
923 "date": [1000000, 0],
923 "date": [1000000, 0],
924 "desc": "second",
924 "desc": "second",
925 "bookmarks": [],
925 "bookmarks": [],
926 "tags": [],
926 "tags": [],
927 "parents": ["0000000000000000000000000000000000000000"]
927 "parents": ["0000000000000000000000000000000000000000"]
928 },
928 },
929 {
929 {
930 "rev": 6,
930 "rev": 6,
931 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
931 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
932 "branch": "default",
932 "branch": "default",
933 "phase": "draft",
933 "phase": "draft",
934 "user": "person",
934 "user": "person",
935 "date": [1500001, 0],
935 "date": [1500001, 0],
936 "desc": "merge",
936 "desc": "merge",
937 "bookmarks": [],
937 "bookmarks": [],
938 "tags": [],
938 "tags": [],
939 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"]
939 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"]
940 },
940 },
941 {
941 {
942 "rev": 5,
942 "rev": 5,
943 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
943 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
944 "branch": "default",
944 "branch": "default",
945 "phase": "draft",
945 "phase": "draft",
946 "user": "person",
946 "user": "person",
947 "date": [1500000, 0],
947 "date": [1500000, 0],
948 "desc": "new head",
948 "desc": "new head",
949 "bookmarks": [],
949 "bookmarks": [],
950 "tags": [],
950 "tags": [],
951 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
951 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
952 },
952 },
953 {
953 {
954 "rev": 4,
954 "rev": 4,
955 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
955 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
956 "branch": "foo",
956 "branch": "foo",
957 "phase": "draft",
957 "phase": "draft",
958 "user": "person",
958 "user": "person",
959 "date": [1400000, 0],
959 "date": [1400000, 0],
960 "desc": "new branch",
960 "desc": "new branch",
961 "bookmarks": [],
961 "bookmarks": [],
962 "tags": [],
962 "tags": [],
963 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
963 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
964 },
964 },
965 {
965 {
966 "rev": 3,
966 "rev": 3,
967 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
967 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
968 "branch": "default",
968 "branch": "default",
969 "phase": "draft",
969 "phase": "draft",
970 "user": "person",
970 "user": "person",
971 "date": [1300000, 0],
971 "date": [1300000, 0],
972 "desc": "no user, no domain",
972 "desc": "no user, no domain",
973 "bookmarks": [],
973 "bookmarks": [],
974 "tags": [],
974 "tags": [],
975 "parents": ["97054abb4ab824450e9164180baf491ae0078465"]
975 "parents": ["97054abb4ab824450e9164180baf491ae0078465"]
976 },
976 },
977 {
977 {
978 "rev": 2,
978 "rev": 2,
979 "node": "97054abb4ab824450e9164180baf491ae0078465",
979 "node": "97054abb4ab824450e9164180baf491ae0078465",
980 "branch": "default",
980 "branch": "default",
981 "phase": "draft",
981 "phase": "draft",
982 "user": "other@place",
982 "user": "other@place",
983 "date": [1200000, 0],
983 "date": [1200000, 0],
984 "desc": "no person",
984 "desc": "no person",
985 "bookmarks": [],
985 "bookmarks": [],
986 "tags": [],
986 "tags": [],
987 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"]
987 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"]
988 },
988 },
989 {
989 {
990 "rev": 1,
990 "rev": 1,
991 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
991 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
992 "branch": "default",
992 "branch": "default",
993 "phase": "draft",
993 "phase": "draft",
994 "user": "A. N. Other <other@place>",
994 "user": "A. N. Other <other@place>",
995 "date": [1100000, 0],
995 "date": [1100000, 0],
996 "desc": "other 1\nother 2\n\nother 3",
996 "desc": "other 1\nother 2\n\nother 3",
997 "bookmarks": [],
997 "bookmarks": [],
998 "tags": [],
998 "tags": [],
999 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"]
999 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"]
1000 },
1000 },
1001 {
1001 {
1002 "rev": 0,
1002 "rev": 0,
1003 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1003 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1004 "branch": "default",
1004 "branch": "default",
1005 "phase": "draft",
1005 "phase": "draft",
1006 "user": "User Name <user@hostname>",
1006 "user": "User Name <user@hostname>",
1007 "date": [1000000, 0],
1007 "date": [1000000, 0],
1008 "desc": "line 1\nline 2",
1008 "desc": "line 1\nline 2",
1009 "bookmarks": [],
1009 "bookmarks": [],
1010 "tags": [],
1010 "tags": [],
1011 "parents": ["0000000000000000000000000000000000000000"]
1011 "parents": ["0000000000000000000000000000000000000000"]
1012 }
1012 }
1013 ]
1013 ]
1014
1014
1015 $ hg heads -v -Tjson
1015 $ hg heads -v -Tjson
1016 [
1016 [
1017 {
1017 {
1018 "rev": 8,
1018 "rev": 8,
1019 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1019 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1020 "branch": "default",
1020 "branch": "default",
1021 "phase": "draft",
1021 "phase": "draft",
1022 "user": "test",
1022 "user": "test",
1023 "date": [1577872860, 0],
1023 "date": [1577872860, 0],
1024 "desc": "third",
1024 "desc": "third",
1025 "bookmarks": [],
1025 "bookmarks": [],
1026 "tags": ["tip"],
1026 "tags": ["tip"],
1027 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1027 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1028 "files": ["fourth", "second", "third"]
1028 "files": ["fourth", "second", "third"]
1029 },
1029 },
1030 {
1030 {
1031 "rev": 6,
1031 "rev": 6,
1032 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1032 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1033 "branch": "default",
1033 "branch": "default",
1034 "phase": "draft",
1034 "phase": "draft",
1035 "user": "person",
1035 "user": "person",
1036 "date": [1500001, 0],
1036 "date": [1500001, 0],
1037 "desc": "merge",
1037 "desc": "merge",
1038 "bookmarks": [],
1038 "bookmarks": [],
1039 "tags": [],
1039 "tags": [],
1040 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1040 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1041 "files": []
1041 "files": []
1042 },
1042 },
1043 {
1043 {
1044 "rev": 4,
1044 "rev": 4,
1045 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1045 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1046 "branch": "foo",
1046 "branch": "foo",
1047 "phase": "draft",
1047 "phase": "draft",
1048 "user": "person",
1048 "user": "person",
1049 "date": [1400000, 0],
1049 "date": [1400000, 0],
1050 "desc": "new branch",
1050 "desc": "new branch",
1051 "bookmarks": [],
1051 "bookmarks": [],
1052 "tags": [],
1052 "tags": [],
1053 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1053 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1054 "files": []
1054 "files": []
1055 }
1055 }
1056 ]
1056 ]
1057
1057
1058 $ hg log --debug -Tjson
1058 $ hg log --debug -Tjson
1059 [
1059 [
1060 {
1060 {
1061 "rev": 8,
1061 "rev": 8,
1062 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1062 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1063 "branch": "default",
1063 "branch": "default",
1064 "phase": "draft",
1064 "phase": "draft",
1065 "user": "test",
1065 "user": "test",
1066 "date": [1577872860, 0],
1066 "date": [1577872860, 0],
1067 "desc": "third",
1067 "desc": "third",
1068 "bookmarks": [],
1068 "bookmarks": [],
1069 "tags": ["tip"],
1069 "tags": ["tip"],
1070 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1070 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1071 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
1071 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
1072 "extra": {"branch": "default"},
1072 "extra": {"branch": "default"},
1073 "modified": [],
1073 "modified": [],
1074 "added": ["fourth", "third"],
1074 "added": ["fourth", "third"],
1075 "removed": ["second"]
1075 "removed": ["second"]
1076 },
1076 },
1077 {
1077 {
1078 "rev": 7,
1078 "rev": 7,
1079 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
1079 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
1080 "branch": "default",
1080 "branch": "default",
1081 "phase": "draft",
1081 "phase": "draft",
1082 "user": "User Name <user@hostname>",
1082 "user": "User Name <user@hostname>",
1083 "date": [1000000, 0],
1083 "date": [1000000, 0],
1084 "desc": "second",
1084 "desc": "second",
1085 "bookmarks": [],
1085 "bookmarks": [],
1086 "tags": [],
1086 "tags": [],
1087 "parents": ["0000000000000000000000000000000000000000"],
1087 "parents": ["0000000000000000000000000000000000000000"],
1088 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
1088 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
1089 "extra": {"branch": "default"},
1089 "extra": {"branch": "default"},
1090 "modified": [],
1090 "modified": [],
1091 "added": ["second"],
1091 "added": ["second"],
1092 "removed": []
1092 "removed": []
1093 },
1093 },
1094 {
1094 {
1095 "rev": 6,
1095 "rev": 6,
1096 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1096 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1097 "branch": "default",
1097 "branch": "default",
1098 "phase": "draft",
1098 "phase": "draft",
1099 "user": "person",
1099 "user": "person",
1100 "date": [1500001, 0],
1100 "date": [1500001, 0],
1101 "desc": "merge",
1101 "desc": "merge",
1102 "bookmarks": [],
1102 "bookmarks": [],
1103 "tags": [],
1103 "tags": [],
1104 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1104 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1105 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1105 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1106 "extra": {"branch": "default"},
1106 "extra": {"branch": "default"},
1107 "modified": [],
1107 "modified": [],
1108 "added": [],
1108 "added": [],
1109 "removed": []
1109 "removed": []
1110 },
1110 },
1111 {
1111 {
1112 "rev": 5,
1112 "rev": 5,
1113 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
1113 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
1114 "branch": "default",
1114 "branch": "default",
1115 "phase": "draft",
1115 "phase": "draft",
1116 "user": "person",
1116 "user": "person",
1117 "date": [1500000, 0],
1117 "date": [1500000, 0],
1118 "desc": "new head",
1118 "desc": "new head",
1119 "bookmarks": [],
1119 "bookmarks": [],
1120 "tags": [],
1120 "tags": [],
1121 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1121 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1122 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1122 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1123 "extra": {"branch": "default"},
1123 "extra": {"branch": "default"},
1124 "modified": [],
1124 "modified": [],
1125 "added": ["d"],
1125 "added": ["d"],
1126 "removed": []
1126 "removed": []
1127 },
1127 },
1128 {
1128 {
1129 "rev": 4,
1129 "rev": 4,
1130 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1130 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1131 "branch": "foo",
1131 "branch": "foo",
1132 "phase": "draft",
1132 "phase": "draft",
1133 "user": "person",
1133 "user": "person",
1134 "date": [1400000, 0],
1134 "date": [1400000, 0],
1135 "desc": "new branch",
1135 "desc": "new branch",
1136 "bookmarks": [],
1136 "bookmarks": [],
1137 "tags": [],
1137 "tags": [],
1138 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1138 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1139 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1139 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1140 "extra": {"branch": "foo"},
1140 "extra": {"branch": "foo"},
1141 "modified": [],
1141 "modified": [],
1142 "added": [],
1142 "added": [],
1143 "removed": []
1143 "removed": []
1144 },
1144 },
1145 {
1145 {
1146 "rev": 3,
1146 "rev": 3,
1147 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
1147 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
1148 "branch": "default",
1148 "branch": "default",
1149 "phase": "draft",
1149 "phase": "draft",
1150 "user": "person",
1150 "user": "person",
1151 "date": [1300000, 0],
1151 "date": [1300000, 0],
1152 "desc": "no user, no domain",
1152 "desc": "no user, no domain",
1153 "bookmarks": [],
1153 "bookmarks": [],
1154 "tags": [],
1154 "tags": [],
1155 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
1155 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
1156 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1156 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1157 "extra": {"branch": "default"},
1157 "extra": {"branch": "default"},
1158 "modified": ["c"],
1158 "modified": ["c"],
1159 "added": [],
1159 "added": [],
1160 "removed": []
1160 "removed": []
1161 },
1161 },
1162 {
1162 {
1163 "rev": 2,
1163 "rev": 2,
1164 "node": "97054abb4ab824450e9164180baf491ae0078465",
1164 "node": "97054abb4ab824450e9164180baf491ae0078465",
1165 "branch": "default",
1165 "branch": "default",
1166 "phase": "draft",
1166 "phase": "draft",
1167 "user": "other@place",
1167 "user": "other@place",
1168 "date": [1200000, 0],
1168 "date": [1200000, 0],
1169 "desc": "no person",
1169 "desc": "no person",
1170 "bookmarks": [],
1170 "bookmarks": [],
1171 "tags": [],
1171 "tags": [],
1172 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
1172 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
1173 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
1173 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
1174 "extra": {"branch": "default"},
1174 "extra": {"branch": "default"},
1175 "modified": [],
1175 "modified": [],
1176 "added": ["c"],
1176 "added": ["c"],
1177 "removed": []
1177 "removed": []
1178 },
1178 },
1179 {
1179 {
1180 "rev": 1,
1180 "rev": 1,
1181 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
1181 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
1182 "branch": "default",
1182 "branch": "default",
1183 "phase": "draft",
1183 "phase": "draft",
1184 "user": "A. N. Other <other@place>",
1184 "user": "A. N. Other <other@place>",
1185 "date": [1100000, 0],
1185 "date": [1100000, 0],
1186 "desc": "other 1\nother 2\n\nother 3",
1186 "desc": "other 1\nother 2\n\nother 3",
1187 "bookmarks": [],
1187 "bookmarks": [],
1188 "tags": [],
1188 "tags": [],
1189 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
1189 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
1190 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
1190 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
1191 "extra": {"branch": "default"},
1191 "extra": {"branch": "default"},
1192 "modified": [],
1192 "modified": [],
1193 "added": ["b"],
1193 "added": ["b"],
1194 "removed": []
1194 "removed": []
1195 },
1195 },
1196 {
1196 {
1197 "rev": 0,
1197 "rev": 0,
1198 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1198 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1199 "branch": "default",
1199 "branch": "default",
1200 "phase": "draft",
1200 "phase": "draft",
1201 "user": "User Name <user@hostname>",
1201 "user": "User Name <user@hostname>",
1202 "date": [1000000, 0],
1202 "date": [1000000, 0],
1203 "desc": "line 1\nline 2",
1203 "desc": "line 1\nline 2",
1204 "bookmarks": [],
1204 "bookmarks": [],
1205 "tags": [],
1205 "tags": [],
1206 "parents": ["0000000000000000000000000000000000000000"],
1206 "parents": ["0000000000000000000000000000000000000000"],
1207 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
1207 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
1208 "extra": {"branch": "default"},
1208 "extra": {"branch": "default"},
1209 "modified": [],
1209 "modified": [],
1210 "added": ["a"],
1210 "added": ["a"],
1211 "removed": []
1211 "removed": []
1212 }
1212 }
1213 ]
1213 ]
1214
1214
1215 Error if style not readable:
1215 Error if style not readable:
1216
1216
1217 #if unix-permissions no-root
1217 #if unix-permissions no-root
1218 $ touch q
1218 $ touch q
1219 $ chmod 0 q
1219 $ chmod 0 q
1220 $ hg log --style ./q
1220 $ hg log --style ./q
1221 abort: Permission denied: ./q
1221 abort: Permission denied: ./q
1222 [255]
1222 [255]
1223 #endif
1223 #endif
1224
1224
1225 Error if no style:
1225 Error if no style:
1226
1226
1227 $ hg log --style notexist
1227 $ hg log --style notexist
1228 abort: style 'notexist' not found
1228 abort: style 'notexist' not found
1229 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
1229 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
1230 [255]
1230 [255]
1231
1231
1232 $ hg log -T list
1232 $ hg log -T list
1233 available styles: bisect, changelog, compact, default, phases, show, status, xml
1233 available styles: bisect, changelog, compact, default, phases, show, status, xml
1234 abort: specify a template
1234 abort: specify a template
1235 [255]
1235 [255]
1236
1236
1237 Error if style missing key:
1237 Error if style missing key:
1238
1238
1239 $ echo 'q = q' > t
1239 $ echo 'q = q' > t
1240 $ hg log --style ./t
1240 $ hg log --style ./t
1241 abort: "changeset" not in template map
1241 abort: "changeset" not in template map
1242 [255]
1242 [255]
1243
1243
1244 Error if style missing value:
1244 Error if style missing value:
1245
1245
1246 $ echo 'changeset =' > t
1246 $ echo 'changeset =' > t
1247 $ hg log --style t
1247 $ hg log --style t
1248 hg: parse error at t:1: missing value
1248 hg: parse error at t:1: missing value
1249 [255]
1249 [255]
1250
1250
1251 Error if include fails:
1251 Error if include fails:
1252
1252
1253 $ echo 'changeset = q' >> t
1253 $ echo 'changeset = q' >> t
1254 #if unix-permissions no-root
1254 #if unix-permissions no-root
1255 $ hg log --style ./t
1255 $ hg log --style ./t
1256 abort: template file ./q: Permission denied
1256 abort: template file ./q: Permission denied
1257 [255]
1257 [255]
1258 $ rm -f q
1258 $ rm -f q
1259 #endif
1259 #endif
1260
1260
1261 Include works:
1261 Include works:
1262
1262
1263 $ echo '{rev}' > q
1263 $ echo '{rev}' > q
1264 $ hg log --style ./t
1264 $ hg log --style ./t
1265 8
1265 8
1266 7
1266 7
1267 6
1267 6
1268 5
1268 5
1269 4
1269 4
1270 3
1270 3
1271 2
1271 2
1272 1
1272 1
1273 0
1273 0
1274
1274
1275 Check that recursive reference does not fall into RuntimeError (issue4758):
1275 Check that recursive reference does not fall into RuntimeError (issue4758):
1276
1276
1277 common mistake:
1277 common mistake:
1278
1278
1279 $ cat << EOF > issue4758
1279 $ cat << EOF > issue4758
1280 > changeset = '{changeset}\n'
1280 > changeset = '{changeset}\n'
1281 > EOF
1281 > EOF
1282 $ hg log --style ./issue4758
1282 $ hg log --style ./issue4758
1283 abort: recursive reference 'changeset' in template
1283 abort: recursive reference 'changeset' in template
1284 [255]
1284 [255]
1285
1285
1286 circular reference:
1286 circular reference:
1287
1287
1288 $ cat << EOF > issue4758
1288 $ cat << EOF > issue4758
1289 > changeset = '{foo}'
1289 > changeset = '{foo}'
1290 > foo = '{changeset}'
1290 > foo = '{changeset}'
1291 > EOF
1291 > EOF
1292 $ hg log --style ./issue4758
1292 $ hg log --style ./issue4758
1293 abort: recursive reference 'foo' in template
1293 abort: recursive reference 'foo' in template
1294 [255]
1294 [255]
1295
1295
1296 buildmap() -> gettemplate(), where no thunk was made:
1296 buildmap() -> gettemplate(), where no thunk was made:
1297
1297
1298 $ cat << EOF > issue4758
1298 $ cat << EOF > issue4758
1299 > changeset = '{files % changeset}\n'
1299 > changeset = '{files % changeset}\n'
1300 > EOF
1300 > EOF
1301 $ hg log --style ./issue4758
1301 $ hg log --style ./issue4758
1302 abort: recursive reference 'changeset' in template
1302 abort: recursive reference 'changeset' in template
1303 [255]
1303 [255]
1304
1304
1305 not a recursion if a keyword of the same name exists:
1305 not a recursion if a keyword of the same name exists:
1306
1306
1307 $ cat << EOF > issue4758
1307 $ cat << EOF > issue4758
1308 > changeset = '{tags % rev}'
1308 > changeset = '{tags % rev}'
1309 > rev = '{rev} {tag}\n'
1309 > rev = '{rev} {tag}\n'
1310 > EOF
1310 > EOF
1311 $ hg log --style ./issue4758 -r tip
1311 $ hg log --style ./issue4758 -r tip
1312 8 tip
1312 8 tip
1313
1313
1314 Check that {phase} works correctly on parents:
1314 Check that {phase} works correctly on parents:
1315
1315
1316 $ cat << EOF > parentphase
1316 $ cat << EOF > parentphase
1317 > changeset_debug = '{rev} ({phase}):{parents}\n'
1317 > changeset_debug = '{rev} ({phase}):{parents}\n'
1318 > parent = ' {rev} ({phase})'
1318 > parent = ' {rev} ({phase})'
1319 > EOF
1319 > EOF
1320 $ hg phase -r 5 --public
1320 $ hg phase -r 5 --public
1321 $ hg phase -r 7 --secret --force
1321 $ hg phase -r 7 --secret --force
1322 $ hg log --debug -G --style ./parentphase
1322 $ hg log --debug -G --style ./parentphase
1323 @ 8 (secret): 7 (secret) -1 (public)
1323 @ 8 (secret): 7 (secret) -1 (public)
1324 |
1324 |
1325 o 7 (secret): -1 (public) -1 (public)
1325 o 7 (secret): -1 (public) -1 (public)
1326
1326
1327 o 6 (draft): 5 (public) 4 (draft)
1327 o 6 (draft): 5 (public) 4 (draft)
1328 |\
1328 |\
1329 | o 5 (public): 3 (public) -1 (public)
1329 | o 5 (public): 3 (public) -1 (public)
1330 | |
1330 | |
1331 o | 4 (draft): 3 (public) -1 (public)
1331 o | 4 (draft): 3 (public) -1 (public)
1332 |/
1332 |/
1333 o 3 (public): 2 (public) -1 (public)
1333 o 3 (public): 2 (public) -1 (public)
1334 |
1334 |
1335 o 2 (public): 1 (public) -1 (public)
1335 o 2 (public): 1 (public) -1 (public)
1336 |
1336 |
1337 o 1 (public): 0 (public) -1 (public)
1337 o 1 (public): 0 (public) -1 (public)
1338 |
1338 |
1339 o 0 (public): -1 (public) -1 (public)
1339 o 0 (public): -1 (public) -1 (public)
1340
1340
1341
1341
1342 Missing non-standard names give no error (backward compatibility):
1342 Missing non-standard names give no error (backward compatibility):
1343
1343
1344 $ echo "changeset = '{c}'" > t
1344 $ echo "changeset = '{c}'" > t
1345 $ hg log --style ./t
1345 $ hg log --style ./t
1346
1346
1347 Defining non-standard name works:
1347 Defining non-standard name works:
1348
1348
1349 $ cat <<EOF > t
1349 $ cat <<EOF > t
1350 > changeset = '{c}'
1350 > changeset = '{c}'
1351 > c = q
1351 > c = q
1352 > EOF
1352 > EOF
1353 $ hg log --style ./t
1353 $ hg log --style ./t
1354 8
1354 8
1355 7
1355 7
1356 6
1356 6
1357 5
1357 5
1358 4
1358 4
1359 3
1359 3
1360 2
1360 2
1361 1
1361 1
1362 0
1362 0
1363
1363
1364 ui.style works:
1364 ui.style works:
1365
1365
1366 $ echo '[ui]' > .hg/hgrc
1366 $ echo '[ui]' > .hg/hgrc
1367 $ echo 'style = t' >> .hg/hgrc
1367 $ echo 'style = t' >> .hg/hgrc
1368 $ hg log
1368 $ hg log
1369 8
1369 8
1370 7
1370 7
1371 6
1371 6
1372 5
1372 5
1373 4
1373 4
1374 3
1374 3
1375 2
1375 2
1376 1
1376 1
1377 0
1377 0
1378
1378
1379
1379
1380 Issue338:
1380 Issue338:
1381
1381
1382 $ hg log --style=changelog > changelog
1382 $ hg log --style=changelog > changelog
1383
1383
1384 $ cat changelog
1384 $ cat changelog
1385 2020-01-01 test <test>
1385 2020-01-01 test <test>
1386
1386
1387 * fourth, second, third:
1387 * fourth, second, third:
1388 third
1388 third
1389 [95c24699272e] [tip]
1389 [95c24699272e] [tip]
1390
1390
1391 1970-01-12 User Name <user@hostname>
1391 1970-01-12 User Name <user@hostname>
1392
1392
1393 * second:
1393 * second:
1394 second
1394 second
1395 [29114dbae42b]
1395 [29114dbae42b]
1396
1396
1397 1970-01-18 person <person>
1397 1970-01-18 person <person>
1398
1398
1399 * merge
1399 * merge
1400 [d41e714fe50d]
1400 [d41e714fe50d]
1401
1401
1402 * d:
1402 * d:
1403 new head
1403 new head
1404 [13207e5a10d9]
1404 [13207e5a10d9]
1405
1405
1406 1970-01-17 person <person>
1406 1970-01-17 person <person>
1407
1407
1408 * new branch
1408 * new branch
1409 [bbe44766e73d] <foo>
1409 [bbe44766e73d] <foo>
1410
1410
1411 1970-01-16 person <person>
1411 1970-01-16 person <person>
1412
1412
1413 * c:
1413 * c:
1414 no user, no domain
1414 no user, no domain
1415 [10e46f2dcbf4]
1415 [10e46f2dcbf4]
1416
1416
1417 1970-01-14 other <other@place>
1417 1970-01-14 other <other@place>
1418
1418
1419 * c:
1419 * c:
1420 no person
1420 no person
1421 [97054abb4ab8]
1421 [97054abb4ab8]
1422
1422
1423 1970-01-13 A. N. Other <other@place>
1423 1970-01-13 A. N. Other <other@place>
1424
1424
1425 * b:
1425 * b:
1426 other 1 other 2
1426 other 1 other 2
1427
1427
1428 other 3
1428 other 3
1429 [b608e9d1a3f0]
1429 [b608e9d1a3f0]
1430
1430
1431 1970-01-12 User Name <user@hostname>
1431 1970-01-12 User Name <user@hostname>
1432
1432
1433 * a:
1433 * a:
1434 line 1 line 2
1434 line 1 line 2
1435 [1e4e1b8f71e0]
1435 [1e4e1b8f71e0]
1436
1436
1437
1437
1438 Issue2130: xml output for 'hg heads' is malformed
1438 Issue2130: xml output for 'hg heads' is malformed
1439
1439
1440 $ hg heads --style changelog
1440 $ hg heads --style changelog
1441 2020-01-01 test <test>
1441 2020-01-01 test <test>
1442
1442
1443 * fourth, second, third:
1443 * fourth, second, third:
1444 third
1444 third
1445 [95c24699272e] [tip]
1445 [95c24699272e] [tip]
1446
1446
1447 1970-01-18 person <person>
1447 1970-01-18 person <person>
1448
1448
1449 * merge
1449 * merge
1450 [d41e714fe50d]
1450 [d41e714fe50d]
1451
1451
1452 1970-01-17 person <person>
1452 1970-01-17 person <person>
1453
1453
1454 * new branch
1454 * new branch
1455 [bbe44766e73d] <foo>
1455 [bbe44766e73d] <foo>
1456
1456
1457
1457
1458 Keys work:
1458 Keys work:
1459
1459
1460 $ for key in author branch branches date desc file_adds file_dels file_mods \
1460 $ for key in author branch branches date desc file_adds file_dels file_mods \
1461 > file_copies file_copies_switch files \
1461 > file_copies file_copies_switch files \
1462 > manifest node parents rev tags diffstat extras \
1462 > manifest node parents rev tags diffstat extras \
1463 > p1rev p2rev p1node p2node; do
1463 > p1rev p2rev p1node p2node; do
1464 > for mode in '' --verbose --debug; do
1464 > for mode in '' --verbose --debug; do
1465 > hg log $mode --template "$key$mode: {$key}\n"
1465 > hg log $mode --template "$key$mode: {$key}\n"
1466 > done
1466 > done
1467 > done
1467 > done
1468 author: test
1468 author: test
1469 author: User Name <user@hostname>
1469 author: User Name <user@hostname>
1470 author: person
1470 author: person
1471 author: person
1471 author: person
1472 author: person
1472 author: person
1473 author: person
1473 author: person
1474 author: other@place
1474 author: other@place
1475 author: A. N. Other <other@place>
1475 author: A. N. Other <other@place>
1476 author: User Name <user@hostname>
1476 author: User Name <user@hostname>
1477 author--verbose: test
1477 author--verbose: test
1478 author--verbose: User Name <user@hostname>
1478 author--verbose: User Name <user@hostname>
1479 author--verbose: person
1479 author--verbose: person
1480 author--verbose: person
1480 author--verbose: person
1481 author--verbose: person
1481 author--verbose: person
1482 author--verbose: person
1482 author--verbose: person
1483 author--verbose: other@place
1483 author--verbose: other@place
1484 author--verbose: A. N. Other <other@place>
1484 author--verbose: A. N. Other <other@place>
1485 author--verbose: User Name <user@hostname>
1485 author--verbose: User Name <user@hostname>
1486 author--debug: test
1486 author--debug: test
1487 author--debug: User Name <user@hostname>
1487 author--debug: User Name <user@hostname>
1488 author--debug: person
1488 author--debug: person
1489 author--debug: person
1489 author--debug: person
1490 author--debug: person
1490 author--debug: person
1491 author--debug: person
1491 author--debug: person
1492 author--debug: other@place
1492 author--debug: other@place
1493 author--debug: A. N. Other <other@place>
1493 author--debug: A. N. Other <other@place>
1494 author--debug: User Name <user@hostname>
1494 author--debug: User Name <user@hostname>
1495 branch: default
1495 branch: default
1496 branch: default
1496 branch: default
1497 branch: default
1497 branch: default
1498 branch: default
1498 branch: default
1499 branch: foo
1499 branch: foo
1500 branch: default
1500 branch: default
1501 branch: default
1501 branch: default
1502 branch: default
1502 branch: default
1503 branch: default
1503 branch: default
1504 branch--verbose: default
1504 branch--verbose: default
1505 branch--verbose: default
1505 branch--verbose: default
1506 branch--verbose: default
1506 branch--verbose: default
1507 branch--verbose: default
1507 branch--verbose: default
1508 branch--verbose: foo
1508 branch--verbose: foo
1509 branch--verbose: default
1509 branch--verbose: default
1510 branch--verbose: default
1510 branch--verbose: default
1511 branch--verbose: default
1511 branch--verbose: default
1512 branch--verbose: default
1512 branch--verbose: default
1513 branch--debug: default
1513 branch--debug: default
1514 branch--debug: default
1514 branch--debug: default
1515 branch--debug: default
1515 branch--debug: default
1516 branch--debug: default
1516 branch--debug: default
1517 branch--debug: foo
1517 branch--debug: foo
1518 branch--debug: default
1518 branch--debug: default
1519 branch--debug: default
1519 branch--debug: default
1520 branch--debug: default
1520 branch--debug: default
1521 branch--debug: default
1521 branch--debug: default
1522 branches:
1522 branches:
1523 branches:
1523 branches:
1524 branches:
1524 branches:
1525 branches:
1525 branches:
1526 branches: foo
1526 branches: foo
1527 branches:
1527 branches:
1528 branches:
1528 branches:
1529 branches:
1529 branches:
1530 branches:
1530 branches:
1531 branches--verbose:
1531 branches--verbose:
1532 branches--verbose:
1532 branches--verbose:
1533 branches--verbose:
1533 branches--verbose:
1534 branches--verbose:
1534 branches--verbose:
1535 branches--verbose: foo
1535 branches--verbose: foo
1536 branches--verbose:
1536 branches--verbose:
1537 branches--verbose:
1537 branches--verbose:
1538 branches--verbose:
1538 branches--verbose:
1539 branches--verbose:
1539 branches--verbose:
1540 branches--debug:
1540 branches--debug:
1541 branches--debug:
1541 branches--debug:
1542 branches--debug:
1542 branches--debug:
1543 branches--debug:
1543 branches--debug:
1544 branches--debug: foo
1544 branches--debug: foo
1545 branches--debug:
1545 branches--debug:
1546 branches--debug:
1546 branches--debug:
1547 branches--debug:
1547 branches--debug:
1548 branches--debug:
1548 branches--debug:
1549 date: 1577872860.00
1549 date: 1577872860.00
1550 date: 1000000.00
1550 date: 1000000.00
1551 date: 1500001.00
1551 date: 1500001.00
1552 date: 1500000.00
1552 date: 1500000.00
1553 date: 1400000.00
1553 date: 1400000.00
1554 date: 1300000.00
1554 date: 1300000.00
1555 date: 1200000.00
1555 date: 1200000.00
1556 date: 1100000.00
1556 date: 1100000.00
1557 date: 1000000.00
1557 date: 1000000.00
1558 date--verbose: 1577872860.00
1558 date--verbose: 1577872860.00
1559 date--verbose: 1000000.00
1559 date--verbose: 1000000.00
1560 date--verbose: 1500001.00
1560 date--verbose: 1500001.00
1561 date--verbose: 1500000.00
1561 date--verbose: 1500000.00
1562 date--verbose: 1400000.00
1562 date--verbose: 1400000.00
1563 date--verbose: 1300000.00
1563 date--verbose: 1300000.00
1564 date--verbose: 1200000.00
1564 date--verbose: 1200000.00
1565 date--verbose: 1100000.00
1565 date--verbose: 1100000.00
1566 date--verbose: 1000000.00
1566 date--verbose: 1000000.00
1567 date--debug: 1577872860.00
1567 date--debug: 1577872860.00
1568 date--debug: 1000000.00
1568 date--debug: 1000000.00
1569 date--debug: 1500001.00
1569 date--debug: 1500001.00
1570 date--debug: 1500000.00
1570 date--debug: 1500000.00
1571 date--debug: 1400000.00
1571 date--debug: 1400000.00
1572 date--debug: 1300000.00
1572 date--debug: 1300000.00
1573 date--debug: 1200000.00
1573 date--debug: 1200000.00
1574 date--debug: 1100000.00
1574 date--debug: 1100000.00
1575 date--debug: 1000000.00
1575 date--debug: 1000000.00
1576 desc: third
1576 desc: third
1577 desc: second
1577 desc: second
1578 desc: merge
1578 desc: merge
1579 desc: new head
1579 desc: new head
1580 desc: new branch
1580 desc: new branch
1581 desc: no user, no domain
1581 desc: no user, no domain
1582 desc: no person
1582 desc: no person
1583 desc: other 1
1583 desc: other 1
1584 other 2
1584 other 2
1585
1585
1586 other 3
1586 other 3
1587 desc: line 1
1587 desc: line 1
1588 line 2
1588 line 2
1589 desc--verbose: third
1589 desc--verbose: third
1590 desc--verbose: second
1590 desc--verbose: second
1591 desc--verbose: merge
1591 desc--verbose: merge
1592 desc--verbose: new head
1592 desc--verbose: new head
1593 desc--verbose: new branch
1593 desc--verbose: new branch
1594 desc--verbose: no user, no domain
1594 desc--verbose: no user, no domain
1595 desc--verbose: no person
1595 desc--verbose: no person
1596 desc--verbose: other 1
1596 desc--verbose: other 1
1597 other 2
1597 other 2
1598
1598
1599 other 3
1599 other 3
1600 desc--verbose: line 1
1600 desc--verbose: line 1
1601 line 2
1601 line 2
1602 desc--debug: third
1602 desc--debug: third
1603 desc--debug: second
1603 desc--debug: second
1604 desc--debug: merge
1604 desc--debug: merge
1605 desc--debug: new head
1605 desc--debug: new head
1606 desc--debug: new branch
1606 desc--debug: new branch
1607 desc--debug: no user, no domain
1607 desc--debug: no user, no domain
1608 desc--debug: no person
1608 desc--debug: no person
1609 desc--debug: other 1
1609 desc--debug: other 1
1610 other 2
1610 other 2
1611
1611
1612 other 3
1612 other 3
1613 desc--debug: line 1
1613 desc--debug: line 1
1614 line 2
1614 line 2
1615 file_adds: fourth third
1615 file_adds: fourth third
1616 file_adds: second
1616 file_adds: second
1617 file_adds:
1617 file_adds:
1618 file_adds: d
1618 file_adds: d
1619 file_adds:
1619 file_adds:
1620 file_adds:
1620 file_adds:
1621 file_adds: c
1621 file_adds: c
1622 file_adds: b
1622 file_adds: b
1623 file_adds: a
1623 file_adds: a
1624 file_adds--verbose: fourth third
1624 file_adds--verbose: fourth third
1625 file_adds--verbose: second
1625 file_adds--verbose: second
1626 file_adds--verbose:
1626 file_adds--verbose:
1627 file_adds--verbose: d
1627 file_adds--verbose: d
1628 file_adds--verbose:
1628 file_adds--verbose:
1629 file_adds--verbose:
1629 file_adds--verbose:
1630 file_adds--verbose: c
1630 file_adds--verbose: c
1631 file_adds--verbose: b
1631 file_adds--verbose: b
1632 file_adds--verbose: a
1632 file_adds--verbose: a
1633 file_adds--debug: fourth third
1633 file_adds--debug: fourth third
1634 file_adds--debug: second
1634 file_adds--debug: second
1635 file_adds--debug:
1635 file_adds--debug:
1636 file_adds--debug: d
1636 file_adds--debug: d
1637 file_adds--debug:
1637 file_adds--debug:
1638 file_adds--debug:
1638 file_adds--debug:
1639 file_adds--debug: c
1639 file_adds--debug: c
1640 file_adds--debug: b
1640 file_adds--debug: b
1641 file_adds--debug: a
1641 file_adds--debug: a
1642 file_dels: second
1642 file_dels: second
1643 file_dels:
1643 file_dels:
1644 file_dels:
1644 file_dels:
1645 file_dels:
1645 file_dels:
1646 file_dels:
1646 file_dels:
1647 file_dels:
1647 file_dels:
1648 file_dels:
1648 file_dels:
1649 file_dels:
1649 file_dels:
1650 file_dels:
1650 file_dels:
1651 file_dels--verbose: second
1651 file_dels--verbose: second
1652 file_dels--verbose:
1652 file_dels--verbose:
1653 file_dels--verbose:
1653 file_dels--verbose:
1654 file_dels--verbose:
1654 file_dels--verbose:
1655 file_dels--verbose:
1655 file_dels--verbose:
1656 file_dels--verbose:
1656 file_dels--verbose:
1657 file_dels--verbose:
1657 file_dels--verbose:
1658 file_dels--verbose:
1658 file_dels--verbose:
1659 file_dels--verbose:
1659 file_dels--verbose:
1660 file_dels--debug: second
1660 file_dels--debug: second
1661 file_dels--debug:
1661 file_dels--debug:
1662 file_dels--debug:
1662 file_dels--debug:
1663 file_dels--debug:
1663 file_dels--debug:
1664 file_dels--debug:
1664 file_dels--debug:
1665 file_dels--debug:
1665 file_dels--debug:
1666 file_dels--debug:
1666 file_dels--debug:
1667 file_dels--debug:
1667 file_dels--debug:
1668 file_dels--debug:
1668 file_dels--debug:
1669 file_mods:
1669 file_mods:
1670 file_mods:
1670 file_mods:
1671 file_mods:
1671 file_mods:
1672 file_mods:
1672 file_mods:
1673 file_mods:
1673 file_mods:
1674 file_mods: c
1674 file_mods: c
1675 file_mods:
1675 file_mods:
1676 file_mods:
1676 file_mods:
1677 file_mods:
1677 file_mods:
1678 file_mods--verbose:
1678 file_mods--verbose:
1679 file_mods--verbose:
1679 file_mods--verbose:
1680 file_mods--verbose:
1680 file_mods--verbose:
1681 file_mods--verbose:
1681 file_mods--verbose:
1682 file_mods--verbose:
1682 file_mods--verbose:
1683 file_mods--verbose: c
1683 file_mods--verbose: c
1684 file_mods--verbose:
1684 file_mods--verbose:
1685 file_mods--verbose:
1685 file_mods--verbose:
1686 file_mods--verbose:
1686 file_mods--verbose:
1687 file_mods--debug:
1687 file_mods--debug:
1688 file_mods--debug:
1688 file_mods--debug:
1689 file_mods--debug:
1689 file_mods--debug:
1690 file_mods--debug:
1690 file_mods--debug:
1691 file_mods--debug:
1691 file_mods--debug:
1692 file_mods--debug: c
1692 file_mods--debug: c
1693 file_mods--debug:
1693 file_mods--debug:
1694 file_mods--debug:
1694 file_mods--debug:
1695 file_mods--debug:
1695 file_mods--debug:
1696 file_copies: fourth (second)
1696 file_copies: fourth (second)
1697 file_copies:
1697 file_copies:
1698 file_copies:
1698 file_copies:
1699 file_copies:
1699 file_copies:
1700 file_copies:
1700 file_copies:
1701 file_copies:
1701 file_copies:
1702 file_copies:
1702 file_copies:
1703 file_copies:
1703 file_copies:
1704 file_copies:
1704 file_copies:
1705 file_copies--verbose: fourth (second)
1705 file_copies--verbose: fourth (second)
1706 file_copies--verbose:
1706 file_copies--verbose:
1707 file_copies--verbose:
1707 file_copies--verbose:
1708 file_copies--verbose:
1708 file_copies--verbose:
1709 file_copies--verbose:
1709 file_copies--verbose:
1710 file_copies--verbose:
1710 file_copies--verbose:
1711 file_copies--verbose:
1711 file_copies--verbose:
1712 file_copies--verbose:
1712 file_copies--verbose:
1713 file_copies--verbose:
1713 file_copies--verbose:
1714 file_copies--debug: fourth (second)
1714 file_copies--debug: fourth (second)
1715 file_copies--debug:
1715 file_copies--debug:
1716 file_copies--debug:
1716 file_copies--debug:
1717 file_copies--debug:
1717 file_copies--debug:
1718 file_copies--debug:
1718 file_copies--debug:
1719 file_copies--debug:
1719 file_copies--debug:
1720 file_copies--debug:
1720 file_copies--debug:
1721 file_copies--debug:
1721 file_copies--debug:
1722 file_copies--debug:
1722 file_copies--debug:
1723 file_copies_switch:
1723 file_copies_switch:
1724 file_copies_switch:
1724 file_copies_switch:
1725 file_copies_switch:
1725 file_copies_switch:
1726 file_copies_switch:
1726 file_copies_switch:
1727 file_copies_switch:
1727 file_copies_switch:
1728 file_copies_switch:
1728 file_copies_switch:
1729 file_copies_switch:
1729 file_copies_switch:
1730 file_copies_switch:
1730 file_copies_switch:
1731 file_copies_switch:
1731 file_copies_switch:
1732 file_copies_switch--verbose:
1732 file_copies_switch--verbose:
1733 file_copies_switch--verbose:
1733 file_copies_switch--verbose:
1734 file_copies_switch--verbose:
1734 file_copies_switch--verbose:
1735 file_copies_switch--verbose:
1735 file_copies_switch--verbose:
1736 file_copies_switch--verbose:
1736 file_copies_switch--verbose:
1737 file_copies_switch--verbose:
1737 file_copies_switch--verbose:
1738 file_copies_switch--verbose:
1738 file_copies_switch--verbose:
1739 file_copies_switch--verbose:
1739 file_copies_switch--verbose:
1740 file_copies_switch--verbose:
1740 file_copies_switch--verbose:
1741 file_copies_switch--debug:
1741 file_copies_switch--debug:
1742 file_copies_switch--debug:
1742 file_copies_switch--debug:
1743 file_copies_switch--debug:
1743 file_copies_switch--debug:
1744 file_copies_switch--debug:
1744 file_copies_switch--debug:
1745 file_copies_switch--debug:
1745 file_copies_switch--debug:
1746 file_copies_switch--debug:
1746 file_copies_switch--debug:
1747 file_copies_switch--debug:
1747 file_copies_switch--debug:
1748 file_copies_switch--debug:
1748 file_copies_switch--debug:
1749 file_copies_switch--debug:
1749 file_copies_switch--debug:
1750 files: fourth second third
1750 files: fourth second third
1751 files: second
1751 files: second
1752 files:
1752 files:
1753 files: d
1753 files: d
1754 files:
1754 files:
1755 files: c
1755 files: c
1756 files: c
1756 files: c
1757 files: b
1757 files: b
1758 files: a
1758 files: a
1759 files--verbose: fourth second third
1759 files--verbose: fourth second third
1760 files--verbose: second
1760 files--verbose: second
1761 files--verbose:
1761 files--verbose:
1762 files--verbose: d
1762 files--verbose: d
1763 files--verbose:
1763 files--verbose:
1764 files--verbose: c
1764 files--verbose: c
1765 files--verbose: c
1765 files--verbose: c
1766 files--verbose: b
1766 files--verbose: b
1767 files--verbose: a
1767 files--verbose: a
1768 files--debug: fourth second third
1768 files--debug: fourth second third
1769 files--debug: second
1769 files--debug: second
1770 files--debug:
1770 files--debug:
1771 files--debug: d
1771 files--debug: d
1772 files--debug:
1772 files--debug:
1773 files--debug: c
1773 files--debug: c
1774 files--debug: c
1774 files--debug: c
1775 files--debug: b
1775 files--debug: b
1776 files--debug: a
1776 files--debug: a
1777 manifest: 6:94961b75a2da
1777 manifest: 6:94961b75a2da
1778 manifest: 5:f2dbc354b94e
1778 manifest: 5:f2dbc354b94e
1779 manifest: 4:4dc3def4f9b4
1779 manifest: 4:4dc3def4f9b4
1780 manifest: 4:4dc3def4f9b4
1780 manifest: 4:4dc3def4f9b4
1781 manifest: 3:cb5a1327723b
1781 manifest: 3:cb5a1327723b
1782 manifest: 3:cb5a1327723b
1782 manifest: 3:cb5a1327723b
1783 manifest: 2:6e0e82995c35
1783 manifest: 2:6e0e82995c35
1784 manifest: 1:4e8d705b1e53
1784 manifest: 1:4e8d705b1e53
1785 manifest: 0:a0c8bcbbb45c
1785 manifest: 0:a0c8bcbbb45c
1786 manifest--verbose: 6:94961b75a2da
1786 manifest--verbose: 6:94961b75a2da
1787 manifest--verbose: 5:f2dbc354b94e
1787 manifest--verbose: 5:f2dbc354b94e
1788 manifest--verbose: 4:4dc3def4f9b4
1788 manifest--verbose: 4:4dc3def4f9b4
1789 manifest--verbose: 4:4dc3def4f9b4
1789 manifest--verbose: 4:4dc3def4f9b4
1790 manifest--verbose: 3:cb5a1327723b
1790 manifest--verbose: 3:cb5a1327723b
1791 manifest--verbose: 3:cb5a1327723b
1791 manifest--verbose: 3:cb5a1327723b
1792 manifest--verbose: 2:6e0e82995c35
1792 manifest--verbose: 2:6e0e82995c35
1793 manifest--verbose: 1:4e8d705b1e53
1793 manifest--verbose: 1:4e8d705b1e53
1794 manifest--verbose: 0:a0c8bcbbb45c
1794 manifest--verbose: 0:a0c8bcbbb45c
1795 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
1795 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
1796 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
1796 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
1797 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1797 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1798 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1798 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1799 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1799 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1800 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1800 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1801 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1801 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1802 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1802 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1803 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1803 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1804 node: 95c24699272ef57d062b8bccc32c878bf841784a
1804 node: 95c24699272ef57d062b8bccc32c878bf841784a
1805 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1805 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1806 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1806 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1807 node: 13207e5a10d9fd28ec424934298e176197f2c67f
1807 node: 13207e5a10d9fd28ec424934298e176197f2c67f
1808 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1808 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1809 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1809 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1810 node: 97054abb4ab824450e9164180baf491ae0078465
1810 node: 97054abb4ab824450e9164180baf491ae0078465
1811 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1811 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1812 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1812 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1813 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
1813 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
1814 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1814 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1815 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1815 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1816 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1816 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1817 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1817 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1818 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1818 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1819 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1819 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1820 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1820 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1821 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1821 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1822 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
1822 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
1823 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1823 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1824 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1824 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1825 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1825 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1826 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1826 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1827 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1827 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1828 node--debug: 97054abb4ab824450e9164180baf491ae0078465
1828 node--debug: 97054abb4ab824450e9164180baf491ae0078465
1829 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1829 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1830 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1830 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1831 parents:
1831 parents:
1832 parents: -1:000000000000
1832 parents: -1:000000000000
1833 parents: 5:13207e5a10d9 4:bbe44766e73d
1833 parents: 5:13207e5a10d9 4:bbe44766e73d
1834 parents: 3:10e46f2dcbf4
1834 parents: 3:10e46f2dcbf4
1835 parents:
1835 parents:
1836 parents:
1836 parents:
1837 parents:
1837 parents:
1838 parents:
1838 parents:
1839 parents:
1839 parents:
1840 parents--verbose:
1840 parents--verbose:
1841 parents--verbose: -1:000000000000
1841 parents--verbose: -1:000000000000
1842 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
1842 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
1843 parents--verbose: 3:10e46f2dcbf4
1843 parents--verbose: 3:10e46f2dcbf4
1844 parents--verbose:
1844 parents--verbose:
1845 parents--verbose:
1845 parents--verbose:
1846 parents--verbose:
1846 parents--verbose:
1847 parents--verbose:
1847 parents--verbose:
1848 parents--verbose:
1848 parents--verbose:
1849 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
1849 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
1850 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1850 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1851 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1851 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1852 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1852 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1853 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1853 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1854 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
1854 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
1855 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
1855 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
1856 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
1856 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
1857 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1857 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1858 rev: 8
1858 rev: 8
1859 rev: 7
1859 rev: 7
1860 rev: 6
1860 rev: 6
1861 rev: 5
1861 rev: 5
1862 rev: 4
1862 rev: 4
1863 rev: 3
1863 rev: 3
1864 rev: 2
1864 rev: 2
1865 rev: 1
1865 rev: 1
1866 rev: 0
1866 rev: 0
1867 rev--verbose: 8
1867 rev--verbose: 8
1868 rev--verbose: 7
1868 rev--verbose: 7
1869 rev--verbose: 6
1869 rev--verbose: 6
1870 rev--verbose: 5
1870 rev--verbose: 5
1871 rev--verbose: 4
1871 rev--verbose: 4
1872 rev--verbose: 3
1872 rev--verbose: 3
1873 rev--verbose: 2
1873 rev--verbose: 2
1874 rev--verbose: 1
1874 rev--verbose: 1
1875 rev--verbose: 0
1875 rev--verbose: 0
1876 rev--debug: 8
1876 rev--debug: 8
1877 rev--debug: 7
1877 rev--debug: 7
1878 rev--debug: 6
1878 rev--debug: 6
1879 rev--debug: 5
1879 rev--debug: 5
1880 rev--debug: 4
1880 rev--debug: 4
1881 rev--debug: 3
1881 rev--debug: 3
1882 rev--debug: 2
1882 rev--debug: 2
1883 rev--debug: 1
1883 rev--debug: 1
1884 rev--debug: 0
1884 rev--debug: 0
1885 tags: tip
1885 tags: tip
1886 tags:
1886 tags:
1887 tags:
1887 tags:
1888 tags:
1888 tags:
1889 tags:
1889 tags:
1890 tags:
1890 tags:
1891 tags:
1891 tags:
1892 tags:
1892 tags:
1893 tags:
1893 tags:
1894 tags--verbose: tip
1894 tags--verbose: tip
1895 tags--verbose:
1895 tags--verbose:
1896 tags--verbose:
1896 tags--verbose:
1897 tags--verbose:
1897 tags--verbose:
1898 tags--verbose:
1898 tags--verbose:
1899 tags--verbose:
1899 tags--verbose:
1900 tags--verbose:
1900 tags--verbose:
1901 tags--verbose:
1901 tags--verbose:
1902 tags--verbose:
1902 tags--verbose:
1903 tags--debug: tip
1903 tags--debug: tip
1904 tags--debug:
1904 tags--debug:
1905 tags--debug:
1905 tags--debug:
1906 tags--debug:
1906 tags--debug:
1907 tags--debug:
1907 tags--debug:
1908 tags--debug:
1908 tags--debug:
1909 tags--debug:
1909 tags--debug:
1910 tags--debug:
1910 tags--debug:
1911 tags--debug:
1911 tags--debug:
1912 diffstat: 3: +2/-1
1912 diffstat: 3: +2/-1
1913 diffstat: 1: +1/-0
1913 diffstat: 1: +1/-0
1914 diffstat: 0: +0/-0
1914 diffstat: 0: +0/-0
1915 diffstat: 1: +1/-0
1915 diffstat: 1: +1/-0
1916 diffstat: 0: +0/-0
1916 diffstat: 0: +0/-0
1917 diffstat: 1: +1/-0
1917 diffstat: 1: +1/-0
1918 diffstat: 1: +4/-0
1918 diffstat: 1: +4/-0
1919 diffstat: 1: +2/-0
1919 diffstat: 1: +2/-0
1920 diffstat: 1: +1/-0
1920 diffstat: 1: +1/-0
1921 diffstat--verbose: 3: +2/-1
1921 diffstat--verbose: 3: +2/-1
1922 diffstat--verbose: 1: +1/-0
1922 diffstat--verbose: 1: +1/-0
1923 diffstat--verbose: 0: +0/-0
1923 diffstat--verbose: 0: +0/-0
1924 diffstat--verbose: 1: +1/-0
1924 diffstat--verbose: 1: +1/-0
1925 diffstat--verbose: 0: +0/-0
1925 diffstat--verbose: 0: +0/-0
1926 diffstat--verbose: 1: +1/-0
1926 diffstat--verbose: 1: +1/-0
1927 diffstat--verbose: 1: +4/-0
1927 diffstat--verbose: 1: +4/-0
1928 diffstat--verbose: 1: +2/-0
1928 diffstat--verbose: 1: +2/-0
1929 diffstat--verbose: 1: +1/-0
1929 diffstat--verbose: 1: +1/-0
1930 diffstat--debug: 3: +2/-1
1930 diffstat--debug: 3: +2/-1
1931 diffstat--debug: 1: +1/-0
1931 diffstat--debug: 1: +1/-0
1932 diffstat--debug: 0: +0/-0
1932 diffstat--debug: 0: +0/-0
1933 diffstat--debug: 1: +1/-0
1933 diffstat--debug: 1: +1/-0
1934 diffstat--debug: 0: +0/-0
1934 diffstat--debug: 0: +0/-0
1935 diffstat--debug: 1: +1/-0
1935 diffstat--debug: 1: +1/-0
1936 diffstat--debug: 1: +4/-0
1936 diffstat--debug: 1: +4/-0
1937 diffstat--debug: 1: +2/-0
1937 diffstat--debug: 1: +2/-0
1938 diffstat--debug: 1: +1/-0
1938 diffstat--debug: 1: +1/-0
1939 extras: branch=default
1939 extras: branch=default
1940 extras: branch=default
1940 extras: branch=default
1941 extras: branch=default
1941 extras: branch=default
1942 extras: branch=default
1942 extras: branch=default
1943 extras: branch=foo
1943 extras: branch=foo
1944 extras: branch=default
1944 extras: branch=default
1945 extras: branch=default
1945 extras: branch=default
1946 extras: branch=default
1946 extras: branch=default
1947 extras: branch=default
1947 extras: branch=default
1948 extras--verbose: branch=default
1948 extras--verbose: branch=default
1949 extras--verbose: branch=default
1949 extras--verbose: branch=default
1950 extras--verbose: branch=default
1950 extras--verbose: branch=default
1951 extras--verbose: branch=default
1951 extras--verbose: branch=default
1952 extras--verbose: branch=foo
1952 extras--verbose: branch=foo
1953 extras--verbose: branch=default
1953 extras--verbose: branch=default
1954 extras--verbose: branch=default
1954 extras--verbose: branch=default
1955 extras--verbose: branch=default
1955 extras--verbose: branch=default
1956 extras--verbose: branch=default
1956 extras--verbose: branch=default
1957 extras--debug: branch=default
1957 extras--debug: branch=default
1958 extras--debug: branch=default
1958 extras--debug: branch=default
1959 extras--debug: branch=default
1959 extras--debug: branch=default
1960 extras--debug: branch=default
1960 extras--debug: branch=default
1961 extras--debug: branch=foo
1961 extras--debug: branch=foo
1962 extras--debug: branch=default
1962 extras--debug: branch=default
1963 extras--debug: branch=default
1963 extras--debug: branch=default
1964 extras--debug: branch=default
1964 extras--debug: branch=default
1965 extras--debug: branch=default
1965 extras--debug: branch=default
1966 p1rev: 7
1966 p1rev: 7
1967 p1rev: -1
1967 p1rev: -1
1968 p1rev: 5
1968 p1rev: 5
1969 p1rev: 3
1969 p1rev: 3
1970 p1rev: 3
1970 p1rev: 3
1971 p1rev: 2
1971 p1rev: 2
1972 p1rev: 1
1972 p1rev: 1
1973 p1rev: 0
1973 p1rev: 0
1974 p1rev: -1
1974 p1rev: -1
1975 p1rev--verbose: 7
1975 p1rev--verbose: 7
1976 p1rev--verbose: -1
1976 p1rev--verbose: -1
1977 p1rev--verbose: 5
1977 p1rev--verbose: 5
1978 p1rev--verbose: 3
1978 p1rev--verbose: 3
1979 p1rev--verbose: 3
1979 p1rev--verbose: 3
1980 p1rev--verbose: 2
1980 p1rev--verbose: 2
1981 p1rev--verbose: 1
1981 p1rev--verbose: 1
1982 p1rev--verbose: 0
1982 p1rev--verbose: 0
1983 p1rev--verbose: -1
1983 p1rev--verbose: -1
1984 p1rev--debug: 7
1984 p1rev--debug: 7
1985 p1rev--debug: -1
1985 p1rev--debug: -1
1986 p1rev--debug: 5
1986 p1rev--debug: 5
1987 p1rev--debug: 3
1987 p1rev--debug: 3
1988 p1rev--debug: 3
1988 p1rev--debug: 3
1989 p1rev--debug: 2
1989 p1rev--debug: 2
1990 p1rev--debug: 1
1990 p1rev--debug: 1
1991 p1rev--debug: 0
1991 p1rev--debug: 0
1992 p1rev--debug: -1
1992 p1rev--debug: -1
1993 p2rev: -1
1993 p2rev: -1
1994 p2rev: -1
1994 p2rev: -1
1995 p2rev: 4
1995 p2rev: 4
1996 p2rev: -1
1996 p2rev: -1
1997 p2rev: -1
1997 p2rev: -1
1998 p2rev: -1
1998 p2rev: -1
1999 p2rev: -1
1999 p2rev: -1
2000 p2rev: -1
2000 p2rev: -1
2001 p2rev: -1
2001 p2rev: -1
2002 p2rev--verbose: -1
2002 p2rev--verbose: -1
2003 p2rev--verbose: -1
2003 p2rev--verbose: -1
2004 p2rev--verbose: 4
2004 p2rev--verbose: 4
2005 p2rev--verbose: -1
2005 p2rev--verbose: -1
2006 p2rev--verbose: -1
2006 p2rev--verbose: -1
2007 p2rev--verbose: -1
2007 p2rev--verbose: -1
2008 p2rev--verbose: -1
2008 p2rev--verbose: -1
2009 p2rev--verbose: -1
2009 p2rev--verbose: -1
2010 p2rev--verbose: -1
2010 p2rev--verbose: -1
2011 p2rev--debug: -1
2011 p2rev--debug: -1
2012 p2rev--debug: -1
2012 p2rev--debug: -1
2013 p2rev--debug: 4
2013 p2rev--debug: 4
2014 p2rev--debug: -1
2014 p2rev--debug: -1
2015 p2rev--debug: -1
2015 p2rev--debug: -1
2016 p2rev--debug: -1
2016 p2rev--debug: -1
2017 p2rev--debug: -1
2017 p2rev--debug: -1
2018 p2rev--debug: -1
2018 p2rev--debug: -1
2019 p2rev--debug: -1
2019 p2rev--debug: -1
2020 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2020 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2021 p1node: 0000000000000000000000000000000000000000
2021 p1node: 0000000000000000000000000000000000000000
2022 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
2022 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
2023 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2023 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2024 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2024 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2025 p1node: 97054abb4ab824450e9164180baf491ae0078465
2025 p1node: 97054abb4ab824450e9164180baf491ae0078465
2026 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2026 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2027 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
2027 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
2028 p1node: 0000000000000000000000000000000000000000
2028 p1node: 0000000000000000000000000000000000000000
2029 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2029 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2030 p1node--verbose: 0000000000000000000000000000000000000000
2030 p1node--verbose: 0000000000000000000000000000000000000000
2031 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
2031 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
2032 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2032 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2033 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2033 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2034 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
2034 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
2035 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2035 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2036 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
2036 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
2037 p1node--verbose: 0000000000000000000000000000000000000000
2037 p1node--verbose: 0000000000000000000000000000000000000000
2038 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2038 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2039 p1node--debug: 0000000000000000000000000000000000000000
2039 p1node--debug: 0000000000000000000000000000000000000000
2040 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
2040 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
2041 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2041 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2042 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2042 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2043 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
2043 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
2044 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2044 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2045 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
2045 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
2046 p1node--debug: 0000000000000000000000000000000000000000
2046 p1node--debug: 0000000000000000000000000000000000000000
2047 p2node: 0000000000000000000000000000000000000000
2047 p2node: 0000000000000000000000000000000000000000
2048 p2node: 0000000000000000000000000000000000000000
2048 p2node: 0000000000000000000000000000000000000000
2049 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2049 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2050 p2node: 0000000000000000000000000000000000000000
2050 p2node: 0000000000000000000000000000000000000000
2051 p2node: 0000000000000000000000000000000000000000
2051 p2node: 0000000000000000000000000000000000000000
2052 p2node: 0000000000000000000000000000000000000000
2052 p2node: 0000000000000000000000000000000000000000
2053 p2node: 0000000000000000000000000000000000000000
2053 p2node: 0000000000000000000000000000000000000000
2054 p2node: 0000000000000000000000000000000000000000
2054 p2node: 0000000000000000000000000000000000000000
2055 p2node: 0000000000000000000000000000000000000000
2055 p2node: 0000000000000000000000000000000000000000
2056 p2node--verbose: 0000000000000000000000000000000000000000
2056 p2node--verbose: 0000000000000000000000000000000000000000
2057 p2node--verbose: 0000000000000000000000000000000000000000
2057 p2node--verbose: 0000000000000000000000000000000000000000
2058 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2058 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2059 p2node--verbose: 0000000000000000000000000000000000000000
2059 p2node--verbose: 0000000000000000000000000000000000000000
2060 p2node--verbose: 0000000000000000000000000000000000000000
2060 p2node--verbose: 0000000000000000000000000000000000000000
2061 p2node--verbose: 0000000000000000000000000000000000000000
2061 p2node--verbose: 0000000000000000000000000000000000000000
2062 p2node--verbose: 0000000000000000000000000000000000000000
2062 p2node--verbose: 0000000000000000000000000000000000000000
2063 p2node--verbose: 0000000000000000000000000000000000000000
2063 p2node--verbose: 0000000000000000000000000000000000000000
2064 p2node--verbose: 0000000000000000000000000000000000000000
2064 p2node--verbose: 0000000000000000000000000000000000000000
2065 p2node--debug: 0000000000000000000000000000000000000000
2065 p2node--debug: 0000000000000000000000000000000000000000
2066 p2node--debug: 0000000000000000000000000000000000000000
2066 p2node--debug: 0000000000000000000000000000000000000000
2067 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2067 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2068 p2node--debug: 0000000000000000000000000000000000000000
2068 p2node--debug: 0000000000000000000000000000000000000000
2069 p2node--debug: 0000000000000000000000000000000000000000
2069 p2node--debug: 0000000000000000000000000000000000000000
2070 p2node--debug: 0000000000000000000000000000000000000000
2070 p2node--debug: 0000000000000000000000000000000000000000
2071 p2node--debug: 0000000000000000000000000000000000000000
2071 p2node--debug: 0000000000000000000000000000000000000000
2072 p2node--debug: 0000000000000000000000000000000000000000
2072 p2node--debug: 0000000000000000000000000000000000000000
2073 p2node--debug: 0000000000000000000000000000000000000000
2073 p2node--debug: 0000000000000000000000000000000000000000
2074
2074
2075 Filters work:
2075 Filters work:
2076
2076
2077 $ hg log --template '{author|domain}\n'
2077 $ hg log --template '{author|domain}\n'
2078
2078
2079 hostname
2079 hostname
2080
2080
2081
2081
2082
2082
2083
2083
2084 place
2084 place
2085 place
2085 place
2086 hostname
2086 hostname
2087
2087
2088 $ hg log --template '{author|person}\n'
2088 $ hg log --template '{author|person}\n'
2089 test
2089 test
2090 User Name
2090 User Name
2091 person
2091 person
2092 person
2092 person
2093 person
2093 person
2094 person
2094 person
2095 other
2095 other
2096 A. N. Other
2096 A. N. Other
2097 User Name
2097 User Name
2098
2098
2099 $ hg log --template '{author|user}\n'
2099 $ hg log --template '{author|user}\n'
2100 test
2100 test
2101 user
2101 user
2102 person
2102 person
2103 person
2103 person
2104 person
2104 person
2105 person
2105 person
2106 other
2106 other
2107 other
2107 other
2108 user
2108 user
2109
2109
2110 $ hg log --template '{date|date}\n'
2110 $ hg log --template '{date|date}\n'
2111 Wed Jan 01 10:01:00 2020 +0000
2111 Wed Jan 01 10:01:00 2020 +0000
2112 Mon Jan 12 13:46:40 1970 +0000
2112 Mon Jan 12 13:46:40 1970 +0000
2113 Sun Jan 18 08:40:01 1970 +0000
2113 Sun Jan 18 08:40:01 1970 +0000
2114 Sun Jan 18 08:40:00 1970 +0000
2114 Sun Jan 18 08:40:00 1970 +0000
2115 Sat Jan 17 04:53:20 1970 +0000
2115 Sat Jan 17 04:53:20 1970 +0000
2116 Fri Jan 16 01:06:40 1970 +0000
2116 Fri Jan 16 01:06:40 1970 +0000
2117 Wed Jan 14 21:20:00 1970 +0000
2117 Wed Jan 14 21:20:00 1970 +0000
2118 Tue Jan 13 17:33:20 1970 +0000
2118 Tue Jan 13 17:33:20 1970 +0000
2119 Mon Jan 12 13:46:40 1970 +0000
2119 Mon Jan 12 13:46:40 1970 +0000
2120
2120
2121 $ hg log --template '{date|isodate}\n'
2121 $ hg log --template '{date|isodate}\n'
2122 2020-01-01 10:01 +0000
2122 2020-01-01 10:01 +0000
2123 1970-01-12 13:46 +0000
2123 1970-01-12 13:46 +0000
2124 1970-01-18 08:40 +0000
2124 1970-01-18 08:40 +0000
2125 1970-01-18 08:40 +0000
2125 1970-01-18 08:40 +0000
2126 1970-01-17 04:53 +0000
2126 1970-01-17 04:53 +0000
2127 1970-01-16 01:06 +0000
2127 1970-01-16 01:06 +0000
2128 1970-01-14 21:20 +0000
2128 1970-01-14 21:20 +0000
2129 1970-01-13 17:33 +0000
2129 1970-01-13 17:33 +0000
2130 1970-01-12 13:46 +0000
2130 1970-01-12 13:46 +0000
2131
2131
2132 $ hg log --template '{date|isodatesec}\n'
2132 $ hg log --template '{date|isodatesec}\n'
2133 2020-01-01 10:01:00 +0000
2133 2020-01-01 10:01:00 +0000
2134 1970-01-12 13:46:40 +0000
2134 1970-01-12 13:46:40 +0000
2135 1970-01-18 08:40:01 +0000
2135 1970-01-18 08:40:01 +0000
2136 1970-01-18 08:40:00 +0000
2136 1970-01-18 08:40:00 +0000
2137 1970-01-17 04:53:20 +0000
2137 1970-01-17 04:53:20 +0000
2138 1970-01-16 01:06:40 +0000
2138 1970-01-16 01:06:40 +0000
2139 1970-01-14 21:20:00 +0000
2139 1970-01-14 21:20:00 +0000
2140 1970-01-13 17:33:20 +0000
2140 1970-01-13 17:33:20 +0000
2141 1970-01-12 13:46:40 +0000
2141 1970-01-12 13:46:40 +0000
2142
2142
2143 $ hg log --template '{date|rfc822date}\n'
2143 $ hg log --template '{date|rfc822date}\n'
2144 Wed, 01 Jan 2020 10:01:00 +0000
2144 Wed, 01 Jan 2020 10:01:00 +0000
2145 Mon, 12 Jan 1970 13:46:40 +0000
2145 Mon, 12 Jan 1970 13:46:40 +0000
2146 Sun, 18 Jan 1970 08:40:01 +0000
2146 Sun, 18 Jan 1970 08:40:01 +0000
2147 Sun, 18 Jan 1970 08:40:00 +0000
2147 Sun, 18 Jan 1970 08:40:00 +0000
2148 Sat, 17 Jan 1970 04:53:20 +0000
2148 Sat, 17 Jan 1970 04:53:20 +0000
2149 Fri, 16 Jan 1970 01:06:40 +0000
2149 Fri, 16 Jan 1970 01:06:40 +0000
2150 Wed, 14 Jan 1970 21:20:00 +0000
2150 Wed, 14 Jan 1970 21:20:00 +0000
2151 Tue, 13 Jan 1970 17:33:20 +0000
2151 Tue, 13 Jan 1970 17:33:20 +0000
2152 Mon, 12 Jan 1970 13:46:40 +0000
2152 Mon, 12 Jan 1970 13:46:40 +0000
2153
2153
2154 $ hg log --template '{desc|firstline}\n'
2154 $ hg log --template '{desc|firstline}\n'
2155 third
2155 third
2156 second
2156 second
2157 merge
2157 merge
2158 new head
2158 new head
2159 new branch
2159 new branch
2160 no user, no domain
2160 no user, no domain
2161 no person
2161 no person
2162 other 1
2162 other 1
2163 line 1
2163 line 1
2164
2164
2165 $ hg log --template '{node|short}\n'
2165 $ hg log --template '{node|short}\n'
2166 95c24699272e
2166 95c24699272e
2167 29114dbae42b
2167 29114dbae42b
2168 d41e714fe50d
2168 d41e714fe50d
2169 13207e5a10d9
2169 13207e5a10d9
2170 bbe44766e73d
2170 bbe44766e73d
2171 10e46f2dcbf4
2171 10e46f2dcbf4
2172 97054abb4ab8
2172 97054abb4ab8
2173 b608e9d1a3f0
2173 b608e9d1a3f0
2174 1e4e1b8f71e0
2174 1e4e1b8f71e0
2175
2175
2176 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
2176 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
2177 <changeset author="test"/>
2177 <changeset author="test"/>
2178 <changeset author="User Name &lt;user@hostname&gt;"/>
2178 <changeset author="User Name &lt;user@hostname&gt;"/>
2179 <changeset author="person"/>
2179 <changeset author="person"/>
2180 <changeset author="person"/>
2180 <changeset author="person"/>
2181 <changeset author="person"/>
2181 <changeset author="person"/>
2182 <changeset author="person"/>
2182 <changeset author="person"/>
2183 <changeset author="other@place"/>
2183 <changeset author="other@place"/>
2184 <changeset author="A. N. Other &lt;other@place&gt;"/>
2184 <changeset author="A. N. Other &lt;other@place&gt;"/>
2185 <changeset author="User Name &lt;user@hostname&gt;"/>
2185 <changeset author="User Name &lt;user@hostname&gt;"/>
2186
2186
2187 $ hg log --template '{rev}: {children}\n'
2187 $ hg log --template '{rev}: {children}\n'
2188 8:
2188 8:
2189 7: 8:95c24699272e
2189 7: 8:95c24699272e
2190 6:
2190 6:
2191 5: 6:d41e714fe50d
2191 5: 6:d41e714fe50d
2192 4: 6:d41e714fe50d
2192 4: 6:d41e714fe50d
2193 3: 4:bbe44766e73d 5:13207e5a10d9
2193 3: 4:bbe44766e73d 5:13207e5a10d9
2194 2: 3:10e46f2dcbf4
2194 2: 3:10e46f2dcbf4
2195 1: 2:97054abb4ab8
2195 1: 2:97054abb4ab8
2196 0: 1:b608e9d1a3f0
2196 0: 1:b608e9d1a3f0
2197
2197
2198 Formatnode filter works:
2198 Formatnode filter works:
2199
2199
2200 $ hg -q log -r 0 --template '{node|formatnode}\n'
2200 $ hg -q log -r 0 --template '{node|formatnode}\n'
2201 1e4e1b8f71e0
2201 1e4e1b8f71e0
2202
2202
2203 $ hg log -r 0 --template '{node|formatnode}\n'
2203 $ hg log -r 0 --template '{node|formatnode}\n'
2204 1e4e1b8f71e0
2204 1e4e1b8f71e0
2205
2205
2206 $ hg -v log -r 0 --template '{node|formatnode}\n'
2206 $ hg -v log -r 0 --template '{node|formatnode}\n'
2207 1e4e1b8f71e0
2207 1e4e1b8f71e0
2208
2208
2209 $ hg --debug log -r 0 --template '{node|formatnode}\n'
2209 $ hg --debug log -r 0 --template '{node|formatnode}\n'
2210 1e4e1b8f71e05681d422154f5421e385fec3454f
2210 1e4e1b8f71e05681d422154f5421e385fec3454f
2211
2211
2212 Age filter:
2212 Age filter:
2213
2213
2214 $ hg init unstable-hash
2214 $ hg init unstable-hash
2215 $ cd unstable-hash
2215 $ cd unstable-hash
2216 $ hg log --template '{date|age}\n' > /dev/null || exit 1
2216 $ hg log --template '{date|age}\n' > /dev/null || exit 1
2217
2217
2218 >>> from __future__ import absolute_import
2218 >>> from __future__ import absolute_import
2219 >>> import datetime
2219 >>> import datetime
2220 >>> fp = open('a', 'wb')
2220 >>> fp = open('a', 'wb')
2221 >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
2221 >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
2222 >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day)) and None
2222 >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day)) and None
2223 >>> fp.close()
2223 >>> fp.close()
2224 $ hg add a
2224 $ hg add a
2225 $ hg commit -m future -d "`cat a`"
2225 $ hg commit -m future -d "`cat a`"
2226
2226
2227 $ hg log -l1 --template '{date|age}\n'
2227 $ hg log -l1 --template '{date|age}\n'
2228 7 years from now
2228 7 years from now
2229
2229
2230 $ cd ..
2230 $ cd ..
2231 $ rm -rf unstable-hash
2231 $ rm -rf unstable-hash
2232
2232
2233 Filename filters:
2233 Filename filters:
2234
2234
2235 $ hg debugtemplate '{"foo/bar"|basename}|{"foo/"|basename}|{"foo"|basename}|\n'
2235 $ hg debugtemplate '{"foo/bar"|basename}|{"foo/"|basename}|{"foo"|basename}|\n'
2236 bar||foo|
2236 bar||foo|
2237 $ hg debugtemplate '{"foo/bar"|dirname}|{"foo/"|dirname}|{"foo"|dirname}|\n'
2237 $ hg debugtemplate '{"foo/bar"|dirname}|{"foo/"|dirname}|{"foo"|dirname}|\n'
2238 foo|foo||
2238 foo|foo||
2239 $ hg debugtemplate '{"foo/bar"|stripdir}|{"foo/"|stripdir}|{"foo"|stripdir}|\n'
2239 $ hg debugtemplate '{"foo/bar"|stripdir}|{"foo/"|stripdir}|{"foo"|stripdir}|\n'
2240 foo|foo|foo|
2240 foo|foo|foo|
2241
2241
2242 Add a dummy commit to make up for the instability of the above:
2242 Add a dummy commit to make up for the instability of the above:
2243
2243
2244 $ echo a > a
2244 $ echo a > a
2245 $ hg add a
2245 $ hg add a
2246 $ hg ci -m future
2246 $ hg ci -m future
2247
2247
2248 Count filter:
2248 Count filter:
2249
2249
2250 $ hg log -l1 --template '{node|count} {node|short|count}\n'
2250 $ hg log -l1 --template '{node|count} {node|short|count}\n'
2251 40 12
2251 40 12
2252
2252
2253 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n'
2253 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n'
2254 0 1 4
2254 0 1 4
2255
2255
2256 $ hg log -G --template '{rev}: children: {children|count}, \
2256 $ hg log -G --template '{rev}: children: {children|count}, \
2257 > tags: {tags|count}, file_adds: {file_adds|count}, \
2257 > tags: {tags|count}, file_adds: {file_adds|count}, \
2258 > ancestors: {revset("ancestors(%s)", rev)|count}'
2258 > ancestors: {revset("ancestors(%s)", rev)|count}'
2259 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
2259 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
2260 |
2260 |
2261 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
2261 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
2262 |
2262 |
2263 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
2263 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
2264
2264
2265 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
2265 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
2266 |\
2266 |\
2267 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
2267 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
2268 | |
2268 | |
2269 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
2269 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
2270 |/
2270 |/
2271 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
2271 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
2272 |
2272 |
2273 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
2273 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
2274 |
2274 |
2275 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
2275 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
2276 |
2276 |
2277 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
2277 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
2278
2278
2279
2279
2280 Upper/lower filters:
2280 Upper/lower filters:
2281
2281
2282 $ hg log -r0 --template '{branch|upper}\n'
2282 $ hg log -r0 --template '{branch|upper}\n'
2283 DEFAULT
2283 DEFAULT
2284 $ hg log -r0 --template '{author|lower}\n'
2284 $ hg log -r0 --template '{author|lower}\n'
2285 user name <user@hostname>
2285 user name <user@hostname>
2286 $ hg log -r0 --template '{date|upper}\n'
2286 $ hg log -r0 --template '{date|upper}\n'
2287 abort: template filter 'upper' is not compatible with keyword 'date'
2287 abort: template filter 'upper' is not compatible with keyword 'date'
2288 [255]
2288 [255]
2289
2289
2290 Add a commit that does all possible modifications at once
2290 Add a commit that does all possible modifications at once
2291
2291
2292 $ echo modify >> third
2292 $ echo modify >> third
2293 $ touch b
2293 $ touch b
2294 $ hg add b
2294 $ hg add b
2295 $ hg mv fourth fifth
2295 $ hg mv fourth fifth
2296 $ hg rm a
2296 $ hg rm a
2297 $ hg ci -m "Modify, add, remove, rename"
2297 $ hg ci -m "Modify, add, remove, rename"
2298
2298
2299 Check the status template
2299 Check the status template
2300
2300
2301 $ cat <<EOF >> $HGRCPATH
2301 $ cat <<EOF >> $HGRCPATH
2302 > [extensions]
2302 > [extensions]
2303 > color=
2303 > color=
2304 > EOF
2304 > EOF
2305
2305
2306 $ hg log -T status -r 10
2306 $ hg log -T status -r 10
2307 changeset: 10:0f9759ec227a
2307 changeset: 10:0f9759ec227a
2308 tag: tip
2308 tag: tip
2309 user: test
2309 user: test
2310 date: Thu Jan 01 00:00:00 1970 +0000
2310 date: Thu Jan 01 00:00:00 1970 +0000
2311 summary: Modify, add, remove, rename
2311 summary: Modify, add, remove, rename
2312 files:
2312 files:
2313 M third
2313 M third
2314 A b
2314 A b
2315 A fifth
2315 A fifth
2316 R a
2316 R a
2317 R fourth
2317 R fourth
2318
2318
2319 $ hg log -T status -C -r 10
2319 $ hg log -T status -C -r 10
2320 changeset: 10:0f9759ec227a
2320 changeset: 10:0f9759ec227a
2321 tag: tip
2321 tag: tip
2322 user: test
2322 user: test
2323 date: Thu Jan 01 00:00:00 1970 +0000
2323 date: Thu Jan 01 00:00:00 1970 +0000
2324 summary: Modify, add, remove, rename
2324 summary: Modify, add, remove, rename
2325 files:
2325 files:
2326 M third
2326 M third
2327 A b
2327 A b
2328 A fifth
2328 A fifth
2329 fourth
2329 fourth
2330 R a
2330 R a
2331 R fourth
2331 R fourth
2332
2332
2333 $ hg log -T status -C -r 10 -v
2333 $ hg log -T status -C -r 10 -v
2334 changeset: 10:0f9759ec227a
2334 changeset: 10:0f9759ec227a
2335 tag: tip
2335 tag: tip
2336 user: test
2336 user: test
2337 date: Thu Jan 01 00:00:00 1970 +0000
2337 date: Thu Jan 01 00:00:00 1970 +0000
2338 description:
2338 description:
2339 Modify, add, remove, rename
2339 Modify, add, remove, rename
2340
2340
2341 files:
2341 files:
2342 M third
2342 M third
2343 A b
2343 A b
2344 A fifth
2344 A fifth
2345 fourth
2345 fourth
2346 R a
2346 R a
2347 R fourth
2347 R fourth
2348
2348
2349 $ hg log -T status -C -r 10 --debug
2349 $ hg log -T status -C -r 10 --debug
2350 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2350 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2351 tag: tip
2351 tag: tip
2352 phase: secret
2352 phase: secret
2353 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2353 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2354 parent: -1:0000000000000000000000000000000000000000
2354 parent: -1:0000000000000000000000000000000000000000
2355 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2355 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2356 user: test
2356 user: test
2357 date: Thu Jan 01 00:00:00 1970 +0000
2357 date: Thu Jan 01 00:00:00 1970 +0000
2358 extra: branch=default
2358 extra: branch=default
2359 description:
2359 description:
2360 Modify, add, remove, rename
2360 Modify, add, remove, rename
2361
2361
2362 files:
2362 files:
2363 M third
2363 M third
2364 A b
2364 A b
2365 A fifth
2365 A fifth
2366 fourth
2366 fourth
2367 R a
2367 R a
2368 R fourth
2368 R fourth
2369
2369
2370 $ hg log -T status -C -r 10 --quiet
2370 $ hg log -T status -C -r 10 --quiet
2371 10:0f9759ec227a
2371 10:0f9759ec227a
2372 $ hg --color=debug log -T status -r 10
2372 $ hg --color=debug log -T status -r 10
2373 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2373 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2374 [log.tag|tag: tip]
2374 [log.tag|tag: tip]
2375 [log.user|user: test]
2375 [log.user|user: test]
2376 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2376 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2377 [log.summary|summary: Modify, add, remove, rename]
2377 [log.summary|summary: Modify, add, remove, rename]
2378 [ui.note log.files|files:]
2378 [ui.note log.files|files:]
2379 [status.modified|M third]
2379 [status.modified|M third]
2380 [status.added|A b]
2380 [status.added|A b]
2381 [status.added|A fifth]
2381 [status.added|A fifth]
2382 [status.removed|R a]
2382 [status.removed|R a]
2383 [status.removed|R fourth]
2383 [status.removed|R fourth]
2384
2384
2385 $ hg --color=debug log -T status -C -r 10
2385 $ hg --color=debug log -T status -C -r 10
2386 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2386 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2387 [log.tag|tag: tip]
2387 [log.tag|tag: tip]
2388 [log.user|user: test]
2388 [log.user|user: test]
2389 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2389 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2390 [log.summary|summary: Modify, add, remove, rename]
2390 [log.summary|summary: Modify, add, remove, rename]
2391 [ui.note log.files|files:]
2391 [ui.note log.files|files:]
2392 [status.modified|M third]
2392 [status.modified|M third]
2393 [status.added|A b]
2393 [status.added|A b]
2394 [status.added|A fifth]
2394 [status.added|A fifth]
2395 [status.copied| fourth]
2395 [status.copied| fourth]
2396 [status.removed|R a]
2396 [status.removed|R a]
2397 [status.removed|R fourth]
2397 [status.removed|R fourth]
2398
2398
2399 $ hg --color=debug log -T status -C -r 10 -v
2399 $ hg --color=debug log -T status -C -r 10 -v
2400 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2400 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2401 [log.tag|tag: tip]
2401 [log.tag|tag: tip]
2402 [log.user|user: test]
2402 [log.user|user: test]
2403 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2403 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2404 [ui.note log.description|description:]
2404 [ui.note log.description|description:]
2405 [ui.note log.description|Modify, add, remove, rename]
2405 [ui.note log.description|Modify, add, remove, rename]
2406
2406
2407 [ui.note log.files|files:]
2407 [ui.note log.files|files:]
2408 [status.modified|M third]
2408 [status.modified|M third]
2409 [status.added|A b]
2409 [status.added|A b]
2410 [status.added|A fifth]
2410 [status.added|A fifth]
2411 [status.copied| fourth]
2411 [status.copied| fourth]
2412 [status.removed|R a]
2412 [status.removed|R a]
2413 [status.removed|R fourth]
2413 [status.removed|R fourth]
2414
2414
2415 $ hg --color=debug log -T status -C -r 10 --debug
2415 $ hg --color=debug log -T status -C -r 10 --debug
2416 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2416 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2417 [log.tag|tag: tip]
2417 [log.tag|tag: tip]
2418 [log.phase|phase: secret]
2418 [log.phase|phase: secret]
2419 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2419 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2420 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2420 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2421 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2421 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2422 [log.user|user: test]
2422 [log.user|user: test]
2423 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2423 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2424 [ui.debug log.extra|extra: branch=default]
2424 [ui.debug log.extra|extra: branch=default]
2425 [ui.note log.description|description:]
2425 [ui.note log.description|description:]
2426 [ui.note log.description|Modify, add, remove, rename]
2426 [ui.note log.description|Modify, add, remove, rename]
2427
2427
2428 [ui.note log.files|files:]
2428 [ui.note log.files|files:]
2429 [status.modified|M third]
2429 [status.modified|M third]
2430 [status.added|A b]
2430 [status.added|A b]
2431 [status.added|A fifth]
2431 [status.added|A fifth]
2432 [status.copied| fourth]
2432 [status.copied| fourth]
2433 [status.removed|R a]
2433 [status.removed|R a]
2434 [status.removed|R fourth]
2434 [status.removed|R fourth]
2435
2435
2436 $ hg --color=debug log -T status -C -r 10 --quiet
2436 $ hg --color=debug log -T status -C -r 10 --quiet
2437 [log.node|10:0f9759ec227a]
2437 [log.node|10:0f9759ec227a]
2438
2438
2439 Check the bisect template
2439 Check the bisect template
2440
2440
2441 $ hg bisect -g 1
2441 $ hg bisect -g 1
2442 $ hg bisect -b 3 --noupdate
2442 $ hg bisect -b 3 --noupdate
2443 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2443 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2444 $ hg log -T bisect -r 0:4
2444 $ hg log -T bisect -r 0:4
2445 changeset: 0:1e4e1b8f71e0
2445 changeset: 0:1e4e1b8f71e0
2446 bisect: good (implicit)
2446 bisect: good (implicit)
2447 user: User Name <user@hostname>
2447 user: User Name <user@hostname>
2448 date: Mon Jan 12 13:46:40 1970 +0000
2448 date: Mon Jan 12 13:46:40 1970 +0000
2449 summary: line 1
2449 summary: line 1
2450
2450
2451 changeset: 1:b608e9d1a3f0
2451 changeset: 1:b608e9d1a3f0
2452 bisect: good
2452 bisect: good
2453 user: A. N. Other <other@place>
2453 user: A. N. Other <other@place>
2454 date: Tue Jan 13 17:33:20 1970 +0000
2454 date: Tue Jan 13 17:33:20 1970 +0000
2455 summary: other 1
2455 summary: other 1
2456
2456
2457 changeset: 2:97054abb4ab8
2457 changeset: 2:97054abb4ab8
2458 bisect: untested
2458 bisect: untested
2459 user: other@place
2459 user: other@place
2460 date: Wed Jan 14 21:20:00 1970 +0000
2460 date: Wed Jan 14 21:20:00 1970 +0000
2461 summary: no person
2461 summary: no person
2462
2462
2463 changeset: 3:10e46f2dcbf4
2463 changeset: 3:10e46f2dcbf4
2464 bisect: bad
2464 bisect: bad
2465 user: person
2465 user: person
2466 date: Fri Jan 16 01:06:40 1970 +0000
2466 date: Fri Jan 16 01:06:40 1970 +0000
2467 summary: no user, no domain
2467 summary: no user, no domain
2468
2468
2469 changeset: 4:bbe44766e73d
2469 changeset: 4:bbe44766e73d
2470 bisect: bad (implicit)
2470 bisect: bad (implicit)
2471 branch: foo
2471 branch: foo
2472 user: person
2472 user: person
2473 date: Sat Jan 17 04:53:20 1970 +0000
2473 date: Sat Jan 17 04:53:20 1970 +0000
2474 summary: new branch
2474 summary: new branch
2475
2475
2476 $ hg log --debug -T bisect -r 0:4
2476 $ hg log --debug -T bisect -r 0:4
2477 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2477 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2478 bisect: good (implicit)
2478 bisect: good (implicit)
2479 phase: public
2479 phase: public
2480 parent: -1:0000000000000000000000000000000000000000
2480 parent: -1:0000000000000000000000000000000000000000
2481 parent: -1:0000000000000000000000000000000000000000
2481 parent: -1:0000000000000000000000000000000000000000
2482 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2482 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2483 user: User Name <user@hostname>
2483 user: User Name <user@hostname>
2484 date: Mon Jan 12 13:46:40 1970 +0000
2484 date: Mon Jan 12 13:46:40 1970 +0000
2485 files+: a
2485 files+: a
2486 extra: branch=default
2486 extra: branch=default
2487 description:
2487 description:
2488 line 1
2488 line 1
2489 line 2
2489 line 2
2490
2490
2491
2491
2492 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2492 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2493 bisect: good
2493 bisect: good
2494 phase: public
2494 phase: public
2495 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2495 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2496 parent: -1:0000000000000000000000000000000000000000
2496 parent: -1:0000000000000000000000000000000000000000
2497 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2497 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2498 user: A. N. Other <other@place>
2498 user: A. N. Other <other@place>
2499 date: Tue Jan 13 17:33:20 1970 +0000
2499 date: Tue Jan 13 17:33:20 1970 +0000
2500 files+: b
2500 files+: b
2501 extra: branch=default
2501 extra: branch=default
2502 description:
2502 description:
2503 other 1
2503 other 1
2504 other 2
2504 other 2
2505
2505
2506 other 3
2506 other 3
2507
2507
2508
2508
2509 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2509 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2510 bisect: untested
2510 bisect: untested
2511 phase: public
2511 phase: public
2512 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2512 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2513 parent: -1:0000000000000000000000000000000000000000
2513 parent: -1:0000000000000000000000000000000000000000
2514 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2514 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2515 user: other@place
2515 user: other@place
2516 date: Wed Jan 14 21:20:00 1970 +0000
2516 date: Wed Jan 14 21:20:00 1970 +0000
2517 files+: c
2517 files+: c
2518 extra: branch=default
2518 extra: branch=default
2519 description:
2519 description:
2520 no person
2520 no person
2521
2521
2522
2522
2523 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2523 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2524 bisect: bad
2524 bisect: bad
2525 phase: public
2525 phase: public
2526 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2526 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2527 parent: -1:0000000000000000000000000000000000000000
2527 parent: -1:0000000000000000000000000000000000000000
2528 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2528 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2529 user: person
2529 user: person
2530 date: Fri Jan 16 01:06:40 1970 +0000
2530 date: Fri Jan 16 01:06:40 1970 +0000
2531 files: c
2531 files: c
2532 extra: branch=default
2532 extra: branch=default
2533 description:
2533 description:
2534 no user, no domain
2534 no user, no domain
2535
2535
2536
2536
2537 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2537 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2538 bisect: bad (implicit)
2538 bisect: bad (implicit)
2539 branch: foo
2539 branch: foo
2540 phase: draft
2540 phase: draft
2541 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2541 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2542 parent: -1:0000000000000000000000000000000000000000
2542 parent: -1:0000000000000000000000000000000000000000
2543 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2543 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2544 user: person
2544 user: person
2545 date: Sat Jan 17 04:53:20 1970 +0000
2545 date: Sat Jan 17 04:53:20 1970 +0000
2546 extra: branch=foo
2546 extra: branch=foo
2547 description:
2547 description:
2548 new branch
2548 new branch
2549
2549
2550
2550
2551 $ hg log -v -T bisect -r 0:4
2551 $ hg log -v -T bisect -r 0:4
2552 changeset: 0:1e4e1b8f71e0
2552 changeset: 0:1e4e1b8f71e0
2553 bisect: good (implicit)
2553 bisect: good (implicit)
2554 user: User Name <user@hostname>
2554 user: User Name <user@hostname>
2555 date: Mon Jan 12 13:46:40 1970 +0000
2555 date: Mon Jan 12 13:46:40 1970 +0000
2556 files: a
2556 files: a
2557 description:
2557 description:
2558 line 1
2558 line 1
2559 line 2
2559 line 2
2560
2560
2561
2561
2562 changeset: 1:b608e9d1a3f0
2562 changeset: 1:b608e9d1a3f0
2563 bisect: good
2563 bisect: good
2564 user: A. N. Other <other@place>
2564 user: A. N. Other <other@place>
2565 date: Tue Jan 13 17:33:20 1970 +0000
2565 date: Tue Jan 13 17:33:20 1970 +0000
2566 files: b
2566 files: b
2567 description:
2567 description:
2568 other 1
2568 other 1
2569 other 2
2569 other 2
2570
2570
2571 other 3
2571 other 3
2572
2572
2573
2573
2574 changeset: 2:97054abb4ab8
2574 changeset: 2:97054abb4ab8
2575 bisect: untested
2575 bisect: untested
2576 user: other@place
2576 user: other@place
2577 date: Wed Jan 14 21:20:00 1970 +0000
2577 date: Wed Jan 14 21:20:00 1970 +0000
2578 files: c
2578 files: c
2579 description:
2579 description:
2580 no person
2580 no person
2581
2581
2582
2582
2583 changeset: 3:10e46f2dcbf4
2583 changeset: 3:10e46f2dcbf4
2584 bisect: bad
2584 bisect: bad
2585 user: person
2585 user: person
2586 date: Fri Jan 16 01:06:40 1970 +0000
2586 date: Fri Jan 16 01:06:40 1970 +0000
2587 files: c
2587 files: c
2588 description:
2588 description:
2589 no user, no domain
2589 no user, no domain
2590
2590
2591
2591
2592 changeset: 4:bbe44766e73d
2592 changeset: 4:bbe44766e73d
2593 bisect: bad (implicit)
2593 bisect: bad (implicit)
2594 branch: foo
2594 branch: foo
2595 user: person
2595 user: person
2596 date: Sat Jan 17 04:53:20 1970 +0000
2596 date: Sat Jan 17 04:53:20 1970 +0000
2597 description:
2597 description:
2598 new branch
2598 new branch
2599
2599
2600
2600
2601 $ hg --color=debug log -T bisect -r 0:4
2601 $ hg --color=debug log -T bisect -r 0:4
2602 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2602 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2603 [log.bisect bisect.good|bisect: good (implicit)]
2603 [log.bisect bisect.good|bisect: good (implicit)]
2604 [log.user|user: User Name <user@hostname>]
2604 [log.user|user: User Name <user@hostname>]
2605 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2605 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2606 [log.summary|summary: line 1]
2606 [log.summary|summary: line 1]
2607
2607
2608 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2608 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2609 [log.bisect bisect.good|bisect: good]
2609 [log.bisect bisect.good|bisect: good]
2610 [log.user|user: A. N. Other <other@place>]
2610 [log.user|user: A. N. Other <other@place>]
2611 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2611 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2612 [log.summary|summary: other 1]
2612 [log.summary|summary: other 1]
2613
2613
2614 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2614 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2615 [log.bisect bisect.untested|bisect: untested]
2615 [log.bisect bisect.untested|bisect: untested]
2616 [log.user|user: other@place]
2616 [log.user|user: other@place]
2617 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2617 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2618 [log.summary|summary: no person]
2618 [log.summary|summary: no person]
2619
2619
2620 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2620 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2621 [log.bisect bisect.bad|bisect: bad]
2621 [log.bisect bisect.bad|bisect: bad]
2622 [log.user|user: person]
2622 [log.user|user: person]
2623 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2623 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2624 [log.summary|summary: no user, no domain]
2624 [log.summary|summary: no user, no domain]
2625
2625
2626 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2626 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2627 [log.bisect bisect.bad|bisect: bad (implicit)]
2627 [log.bisect bisect.bad|bisect: bad (implicit)]
2628 [log.branch|branch: foo]
2628 [log.branch|branch: foo]
2629 [log.user|user: person]
2629 [log.user|user: person]
2630 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2630 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2631 [log.summary|summary: new branch]
2631 [log.summary|summary: new branch]
2632
2632
2633 $ hg --color=debug log --debug -T bisect -r 0:4
2633 $ hg --color=debug log --debug -T bisect -r 0:4
2634 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2634 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2635 [log.bisect bisect.good|bisect: good (implicit)]
2635 [log.bisect bisect.good|bisect: good (implicit)]
2636 [log.phase|phase: public]
2636 [log.phase|phase: public]
2637 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2637 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2638 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2638 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2639 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2639 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2640 [log.user|user: User Name <user@hostname>]
2640 [log.user|user: User Name <user@hostname>]
2641 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2641 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2642 [ui.debug log.files|files+: a]
2642 [ui.debug log.files|files+: a]
2643 [ui.debug log.extra|extra: branch=default]
2643 [ui.debug log.extra|extra: branch=default]
2644 [ui.note log.description|description:]
2644 [ui.note log.description|description:]
2645 [ui.note log.description|line 1
2645 [ui.note log.description|line 1
2646 line 2]
2646 line 2]
2647
2647
2648
2648
2649 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2649 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2650 [log.bisect bisect.good|bisect: good]
2650 [log.bisect bisect.good|bisect: good]
2651 [log.phase|phase: public]
2651 [log.phase|phase: public]
2652 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2652 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2653 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2653 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2654 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2654 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2655 [log.user|user: A. N. Other <other@place>]
2655 [log.user|user: A. N. Other <other@place>]
2656 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2656 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2657 [ui.debug log.files|files+: b]
2657 [ui.debug log.files|files+: b]
2658 [ui.debug log.extra|extra: branch=default]
2658 [ui.debug log.extra|extra: branch=default]
2659 [ui.note log.description|description:]
2659 [ui.note log.description|description:]
2660 [ui.note log.description|other 1
2660 [ui.note log.description|other 1
2661 other 2
2661 other 2
2662
2662
2663 other 3]
2663 other 3]
2664
2664
2665
2665
2666 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2666 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2667 [log.bisect bisect.untested|bisect: untested]
2667 [log.bisect bisect.untested|bisect: untested]
2668 [log.phase|phase: public]
2668 [log.phase|phase: public]
2669 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2669 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2670 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2670 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2671 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2671 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2672 [log.user|user: other@place]
2672 [log.user|user: other@place]
2673 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2673 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2674 [ui.debug log.files|files+: c]
2674 [ui.debug log.files|files+: c]
2675 [ui.debug log.extra|extra: branch=default]
2675 [ui.debug log.extra|extra: branch=default]
2676 [ui.note log.description|description:]
2676 [ui.note log.description|description:]
2677 [ui.note log.description|no person]
2677 [ui.note log.description|no person]
2678
2678
2679
2679
2680 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2680 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2681 [log.bisect bisect.bad|bisect: bad]
2681 [log.bisect bisect.bad|bisect: bad]
2682 [log.phase|phase: public]
2682 [log.phase|phase: public]
2683 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2683 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2684 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2684 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2685 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2685 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2686 [log.user|user: person]
2686 [log.user|user: person]
2687 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2687 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2688 [ui.debug log.files|files: c]
2688 [ui.debug log.files|files: c]
2689 [ui.debug log.extra|extra: branch=default]
2689 [ui.debug log.extra|extra: branch=default]
2690 [ui.note log.description|description:]
2690 [ui.note log.description|description:]
2691 [ui.note log.description|no user, no domain]
2691 [ui.note log.description|no user, no domain]
2692
2692
2693
2693
2694 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2694 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2695 [log.bisect bisect.bad|bisect: bad (implicit)]
2695 [log.bisect bisect.bad|bisect: bad (implicit)]
2696 [log.branch|branch: foo]
2696 [log.branch|branch: foo]
2697 [log.phase|phase: draft]
2697 [log.phase|phase: draft]
2698 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2698 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2699 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2699 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2700 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2700 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2701 [log.user|user: person]
2701 [log.user|user: person]
2702 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2702 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2703 [ui.debug log.extra|extra: branch=foo]
2703 [ui.debug log.extra|extra: branch=foo]
2704 [ui.note log.description|description:]
2704 [ui.note log.description|description:]
2705 [ui.note log.description|new branch]
2705 [ui.note log.description|new branch]
2706
2706
2707
2707
2708 $ hg --color=debug log -v -T bisect -r 0:4
2708 $ hg --color=debug log -v -T bisect -r 0:4
2709 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2709 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2710 [log.bisect bisect.good|bisect: good (implicit)]
2710 [log.bisect bisect.good|bisect: good (implicit)]
2711 [log.user|user: User Name <user@hostname>]
2711 [log.user|user: User Name <user@hostname>]
2712 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2712 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2713 [ui.note log.files|files: a]
2713 [ui.note log.files|files: a]
2714 [ui.note log.description|description:]
2714 [ui.note log.description|description:]
2715 [ui.note log.description|line 1
2715 [ui.note log.description|line 1
2716 line 2]
2716 line 2]
2717
2717
2718
2718
2719 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2719 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2720 [log.bisect bisect.good|bisect: good]
2720 [log.bisect bisect.good|bisect: good]
2721 [log.user|user: A. N. Other <other@place>]
2721 [log.user|user: A. N. Other <other@place>]
2722 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2722 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2723 [ui.note log.files|files: b]
2723 [ui.note log.files|files: b]
2724 [ui.note log.description|description:]
2724 [ui.note log.description|description:]
2725 [ui.note log.description|other 1
2725 [ui.note log.description|other 1
2726 other 2
2726 other 2
2727
2727
2728 other 3]
2728 other 3]
2729
2729
2730
2730
2731 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2731 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2732 [log.bisect bisect.untested|bisect: untested]
2732 [log.bisect bisect.untested|bisect: untested]
2733 [log.user|user: other@place]
2733 [log.user|user: other@place]
2734 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2734 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2735 [ui.note log.files|files: c]
2735 [ui.note log.files|files: c]
2736 [ui.note log.description|description:]
2736 [ui.note log.description|description:]
2737 [ui.note log.description|no person]
2737 [ui.note log.description|no person]
2738
2738
2739
2739
2740 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2740 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2741 [log.bisect bisect.bad|bisect: bad]
2741 [log.bisect bisect.bad|bisect: bad]
2742 [log.user|user: person]
2742 [log.user|user: person]
2743 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2743 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2744 [ui.note log.files|files: c]
2744 [ui.note log.files|files: c]
2745 [ui.note log.description|description:]
2745 [ui.note log.description|description:]
2746 [ui.note log.description|no user, no domain]
2746 [ui.note log.description|no user, no domain]
2747
2747
2748
2748
2749 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2749 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2750 [log.bisect bisect.bad|bisect: bad (implicit)]
2750 [log.bisect bisect.bad|bisect: bad (implicit)]
2751 [log.branch|branch: foo]
2751 [log.branch|branch: foo]
2752 [log.user|user: person]
2752 [log.user|user: person]
2753 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2753 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2754 [ui.note log.description|description:]
2754 [ui.note log.description|description:]
2755 [ui.note log.description|new branch]
2755 [ui.note log.description|new branch]
2756
2756
2757
2757
2758 $ hg bisect --reset
2758 $ hg bisect --reset
2759
2759
2760 Error on syntax:
2760 Error on syntax:
2761
2761
2762 $ echo 'x = "f' >> t
2762 $ echo 'x = "f' >> t
2763 $ hg log
2763 $ hg log
2764 hg: parse error at t:3: unmatched quotes
2764 hg: parse error at t:3: unmatched quotes
2765 [255]
2765 [255]
2766
2766
2767 $ hg log -T '{date'
2767 $ hg log -T '{date'
2768 hg: parse error at 1: unterminated template expansion
2768 hg: parse error at 1: unterminated template expansion
2769 ({date
2769 ({date
2770 ^ here)
2770 ^ here)
2771 [255]
2771 [255]
2772 $ hg log -T '{date(}'
2772 $ hg log -T '{date(}'
2773 hg: parse error at 6: not a prefix: end
2773 hg: parse error at 6: not a prefix: end
2774 ({date(}
2774 ({date(}
2775 ^ here)
2775 ^ here)
2776 [255]
2776 [255]
2777 $ hg log -T '{date)}'
2777 $ hg log -T '{date)}'
2778 hg: parse error at 5: invalid token
2778 hg: parse error at 5: invalid token
2779 ({date)}
2779 ({date)}
2780 ^ here)
2780 ^ here)
2781 [255]
2781 [255]
2782 $ hg log -T '{date date}'
2782 $ hg log -T '{date date}'
2783 hg: parse error at 6: invalid token
2783 hg: parse error at 6: invalid token
2784 ({date date}
2784 ({date date}
2785 ^ here)
2785 ^ here)
2786 [255]
2786 [255]
2787
2787
2788 $ hg log -T '{}'
2788 $ hg log -T '{}'
2789 hg: parse error at 1: not a prefix: end
2789 hg: parse error at 1: not a prefix: end
2790 ({}
2790 ({}
2791 ^ here)
2791 ^ here)
2792 [255]
2792 [255]
2793 $ hg debugtemplate -v '{()}'
2793 $ hg debugtemplate -v '{()}'
2794 (template
2794 (template
2795 (group
2795 (group
2796 None))
2796 None))
2797 hg: parse error: missing argument
2797 hg: parse error: missing argument
2798 [255]
2798 [255]
2799
2799
2800 Behind the scenes, this will throw TypeError
2800 Behind the scenes, this will throw TypeError
2801
2801
2802 $ hg log -l 3 --template '{date|obfuscate}\n'
2802 $ hg log -l 3 --template '{date|obfuscate}\n'
2803 abort: template filter 'obfuscate' is not compatible with keyword 'date'
2803 abort: template filter 'obfuscate' is not compatible with keyword 'date'
2804 [255]
2804 [255]
2805
2805
2806 Behind the scenes, this will throw a ValueError
2806 Behind the scenes, this will throw a ValueError
2807
2807
2808 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
2808 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
2809 abort: template filter 'shortdate' is not compatible with keyword 'desc'
2809 abort: template filter 'shortdate' is not compatible with keyword 'desc'
2810 [255]
2810 [255]
2811
2811
2812 Behind the scenes, this will throw AttributeError
2812 Behind the scenes, this will throw AttributeError
2813
2813
2814 $ hg log -l 3 --template 'line: {date|escape}\n'
2814 $ hg log -l 3 --template 'line: {date|escape}\n'
2815 abort: template filter 'escape' is not compatible with keyword 'date'
2815 abort: template filter 'escape' is not compatible with keyword 'date'
2816 [255]
2816 [255]
2817
2817
2818 $ hg log -l 3 --template 'line: {extras|localdate}\n'
2818 $ hg log -l 3 --template 'line: {extras|localdate}\n'
2819 hg: parse error: localdate expects a date information
2819 hg: parse error: localdate expects a date information
2820 [255]
2820 [255]
2821
2821
2822 Behind the scenes, this will throw ValueError
2822 Behind the scenes, this will throw ValueError
2823
2823
2824 $ hg tip --template '{author|email|date}\n'
2824 $ hg tip --template '{author|email|date}\n'
2825 hg: parse error: date expects a date information
2825 hg: parse error: date expects a date information
2826 [255]
2826 [255]
2827
2827
2828 $ hg tip -T '{author|email|shortdate}\n'
2828 $ hg tip -T '{author|email|shortdate}\n'
2829 abort: template filter 'shortdate' is not compatible with keyword 'author'
2829 abort: template filter 'shortdate' is not compatible with keyword 'author'
2830 [255]
2830 [255]
2831
2831
2832 $ hg tip -T '{get(extras, "branch")|shortdate}\n'
2832 $ hg tip -T '{get(extras, "branch")|shortdate}\n'
2833 abort: incompatible use of template filter 'shortdate'
2833 abort: incompatible use of template filter 'shortdate'
2834 [255]
2834 [255]
2835
2835
2836 Error in nested template:
2836 Error in nested template:
2837
2837
2838 $ hg log -T '{"date'
2838 $ hg log -T '{"date'
2839 hg: parse error at 2: unterminated string
2839 hg: parse error at 2: unterminated string
2840 ({"date
2840 ({"date
2841 ^ here)
2841 ^ here)
2842 [255]
2842 [255]
2843
2843
2844 $ hg log -T '{"foo{date|?}"}'
2844 $ hg log -T '{"foo{date|?}"}'
2845 hg: parse error at 11: syntax error
2845 hg: parse error at 11: syntax error
2846 ({"foo{date|?}"}
2846 ({"foo{date|?}"}
2847 ^ here)
2847 ^ here)
2848 [255]
2848 [255]
2849
2849
2850 Thrown an error if a template function doesn't exist
2850 Thrown an error if a template function doesn't exist
2851
2851
2852 $ hg tip --template '{foo()}\n'
2852 $ hg tip --template '{foo()}\n'
2853 hg: parse error: unknown function 'foo'
2853 hg: parse error: unknown function 'foo'
2854 [255]
2854 [255]
2855
2855
2856 Pass generator object created by template function to filter
2856 Pass generator object created by template function to filter
2857
2857
2858 $ hg log -l 1 --template '{if(author, author)|user}\n'
2858 $ hg log -l 1 --template '{if(author, author)|user}\n'
2859 test
2859 test
2860
2860
2861 Test index keyword:
2861 Test index keyword:
2862
2862
2863 $ hg log -l 2 -T '{index + 10}{files % " {index}:{file}"}\n'
2863 $ hg log -l 2 -T '{index + 10}{files % " {index}:{file}"}\n'
2864 10 0:a 1:b 2:fifth 3:fourth 4:third
2864 10 0:a 1:b 2:fifth 3:fourth 4:third
2865 11 0:a
2865 11 0:a
2866
2866
2867 $ hg branches -T '{index} {branch}\n'
2867 $ hg branches -T '{index} {branch}\n'
2868 0 default
2868 0 default
2869 1 foo
2869 1 foo
2870
2870
2871 Test diff function:
2871 Test diff function:
2872
2872
2873 $ hg diff -c 8
2873 $ hg diff -c 8
2874 diff -r 29114dbae42b -r 95c24699272e fourth
2874 diff -r 29114dbae42b -r 95c24699272e fourth
2875 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2875 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2876 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2876 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2877 @@ -0,0 +1,1 @@
2877 @@ -0,0 +1,1 @@
2878 +second
2878 +second
2879 diff -r 29114dbae42b -r 95c24699272e second
2879 diff -r 29114dbae42b -r 95c24699272e second
2880 --- a/second Mon Jan 12 13:46:40 1970 +0000
2880 --- a/second Mon Jan 12 13:46:40 1970 +0000
2881 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2881 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2882 @@ -1,1 +0,0 @@
2882 @@ -1,1 +0,0 @@
2883 -second
2883 -second
2884 diff -r 29114dbae42b -r 95c24699272e third
2884 diff -r 29114dbae42b -r 95c24699272e third
2885 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2885 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2886 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2886 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2887 @@ -0,0 +1,1 @@
2887 @@ -0,0 +1,1 @@
2888 +third
2888 +third
2889
2889
2890 $ hg log -r 8 -T "{diff()}"
2890 $ hg log -r 8 -T "{diff()}"
2891 diff -r 29114dbae42b -r 95c24699272e fourth
2891 diff -r 29114dbae42b -r 95c24699272e fourth
2892 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2892 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2893 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2893 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2894 @@ -0,0 +1,1 @@
2894 @@ -0,0 +1,1 @@
2895 +second
2895 +second
2896 diff -r 29114dbae42b -r 95c24699272e second
2896 diff -r 29114dbae42b -r 95c24699272e second
2897 --- a/second Mon Jan 12 13:46:40 1970 +0000
2897 --- a/second Mon Jan 12 13:46:40 1970 +0000
2898 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2898 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2899 @@ -1,1 +0,0 @@
2899 @@ -1,1 +0,0 @@
2900 -second
2900 -second
2901 diff -r 29114dbae42b -r 95c24699272e third
2901 diff -r 29114dbae42b -r 95c24699272e third
2902 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2902 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2903 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2903 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2904 @@ -0,0 +1,1 @@
2904 @@ -0,0 +1,1 @@
2905 +third
2905 +third
2906
2906
2907 $ hg log -r 8 -T "{diff('glob:f*')}"
2907 $ hg log -r 8 -T "{diff('glob:f*')}"
2908 diff -r 29114dbae42b -r 95c24699272e fourth
2908 diff -r 29114dbae42b -r 95c24699272e fourth
2909 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2909 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2910 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2910 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2911 @@ -0,0 +1,1 @@
2911 @@ -0,0 +1,1 @@
2912 +second
2912 +second
2913
2913
2914 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
2914 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
2915 diff -r 29114dbae42b -r 95c24699272e second
2915 diff -r 29114dbae42b -r 95c24699272e second
2916 --- a/second Mon Jan 12 13:46:40 1970 +0000
2916 --- a/second Mon Jan 12 13:46:40 1970 +0000
2917 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2917 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2918 @@ -1,1 +0,0 @@
2918 @@ -1,1 +0,0 @@
2919 -second
2919 -second
2920 diff -r 29114dbae42b -r 95c24699272e third
2920 diff -r 29114dbae42b -r 95c24699272e third
2921 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2921 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2922 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2922 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2923 @@ -0,0 +1,1 @@
2923 @@ -0,0 +1,1 @@
2924 +third
2924 +third
2925
2925
2926 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2926 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2927 diff -r 29114dbae42b -r 95c24699272e fourth
2927 diff -r 29114dbae42b -r 95c24699272e fourth
2928 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2928 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2929 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2929 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2930 @@ -0,0 +1,1 @@
2930 @@ -0,0 +1,1 @@
2931 +second
2931 +second
2932
2932
2933 ui verbosity:
2933 ui verbosity:
2934
2934
2935 $ hg log -l1 -T '{verbosity}\n'
2935 $ hg log -l1 -T '{verbosity}\n'
2936
2936
2937 $ hg log -l1 -T '{verbosity}\n' --debug
2937 $ hg log -l1 -T '{verbosity}\n' --debug
2938 debug
2938 debug
2939 $ hg log -l1 -T '{verbosity}\n' --quiet
2939 $ hg log -l1 -T '{verbosity}\n' --quiet
2940 quiet
2940 quiet
2941 $ hg log -l1 -T '{verbosity}\n' --verbose
2941 $ hg log -l1 -T '{verbosity}\n' --verbose
2942 verbose
2942 verbose
2943
2943
2944 $ cd ..
2944 $ cd ..
2945
2945
2946
2946
2947 latesttag:
2947 latesttag:
2948
2948
2949 $ hg init latesttag
2949 $ hg init latesttag
2950 $ cd latesttag
2950 $ cd latesttag
2951
2951
2952 $ echo a > file
2952 $ echo a > file
2953 $ hg ci -Am a -d '0 0'
2953 $ hg ci -Am a -d '0 0'
2954 adding file
2954 adding file
2955
2955
2956 $ echo b >> file
2956 $ echo b >> file
2957 $ hg ci -m b -d '1 0'
2957 $ hg ci -m b -d '1 0'
2958
2958
2959 $ echo c >> head1
2959 $ echo c >> head1
2960 $ hg ci -Am h1c -d '2 0'
2960 $ hg ci -Am h1c -d '2 0'
2961 adding head1
2961 adding head1
2962
2962
2963 $ hg update -q 1
2963 $ hg update -q 1
2964 $ echo d >> head2
2964 $ echo d >> head2
2965 $ hg ci -Am h2d -d '3 0'
2965 $ hg ci -Am h2d -d '3 0'
2966 adding head2
2966 adding head2
2967 created new head
2967 created new head
2968
2968
2969 $ echo e >> head2
2969 $ echo e >> head2
2970 $ hg ci -m h2e -d '4 0'
2970 $ hg ci -m h2e -d '4 0'
2971
2971
2972 $ hg merge -q
2972 $ hg merge -q
2973 $ hg ci -m merge -d '5 -3600'
2973 $ hg ci -m merge -d '5 -3600'
2974
2974
2975 No tag set:
2975 No tag set:
2976
2976
2977 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
2977 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
2978 @ 5: null+5
2978 @ 5: null+5
2979 |\
2979 |\
2980 | o 4: null+4
2980 | o 4: null+4
2981 | |
2981 | |
2982 | o 3: null+3
2982 | o 3: null+3
2983 | |
2983 | |
2984 o | 2: null+3
2984 o | 2: null+3
2985 |/
2985 |/
2986 o 1: null+2
2986 o 1: null+2
2987 |
2987 |
2988 o 0: null+1
2988 o 0: null+1
2989
2989
2990
2990
2991 One common tag: longest path wins for {latesttagdistance}:
2991 One common tag: longest path wins for {latesttagdistance}:
2992
2992
2993 $ hg tag -r 1 -m t1 -d '6 0' t1
2993 $ hg tag -r 1 -m t1 -d '6 0' t1
2994 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
2994 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
2995 @ 6: t1+4
2995 @ 6: t1+4
2996 |
2996 |
2997 o 5: t1+3
2997 o 5: t1+3
2998 |\
2998 |\
2999 | o 4: t1+2
2999 | o 4: t1+2
3000 | |
3000 | |
3001 | o 3: t1+1
3001 | o 3: t1+1
3002 | |
3002 | |
3003 o | 2: t1+1
3003 o | 2: t1+1
3004 |/
3004 |/
3005 o 1: t1+0
3005 o 1: t1+0
3006 |
3006 |
3007 o 0: null+1
3007 o 0: null+1
3008
3008
3009
3009
3010 One ancestor tag: closest wins:
3010 One ancestor tag: closest wins:
3011
3011
3012 $ hg tag -r 2 -m t2 -d '7 0' t2
3012 $ hg tag -r 2 -m t2 -d '7 0' t2
3013 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3013 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3014 @ 7: t2+3
3014 @ 7: t2+3
3015 |
3015 |
3016 o 6: t2+2
3016 o 6: t2+2
3017 |
3017 |
3018 o 5: t2+1
3018 o 5: t2+1
3019 |\
3019 |\
3020 | o 4: t1+2
3020 | o 4: t1+2
3021 | |
3021 | |
3022 | o 3: t1+1
3022 | o 3: t1+1
3023 | |
3023 | |
3024 o | 2: t2+0
3024 o | 2: t2+0
3025 |/
3025 |/
3026 o 1: t1+0
3026 o 1: t1+0
3027 |
3027 |
3028 o 0: null+1
3028 o 0: null+1
3029
3029
3030
3030
3031 Two branch tags: more recent wins if same number of changes:
3031 Two branch tags: more recent wins if same number of changes:
3032
3032
3033 $ hg tag -r 3 -m t3 -d '8 0' t3
3033 $ hg tag -r 3 -m t3 -d '8 0' t3
3034 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3034 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3035 @ 8: t3+5
3035 @ 8: t3+5
3036 |
3036 |
3037 o 7: t3+4
3037 o 7: t3+4
3038 |
3038 |
3039 o 6: t3+3
3039 o 6: t3+3
3040 |
3040 |
3041 o 5: t3+2
3041 o 5: t3+2
3042 |\
3042 |\
3043 | o 4: t3+1
3043 | o 4: t3+1
3044 | |
3044 | |
3045 | o 3: t3+0
3045 | o 3: t3+0
3046 | |
3046 | |
3047 o | 2: t2+0
3047 o | 2: t2+0
3048 |/
3048 |/
3049 o 1: t1+0
3049 o 1: t1+0
3050 |
3050 |
3051 o 0: null+1
3051 o 0: null+1
3052
3052
3053
3053
3054 Two branch tags: fewest changes wins:
3054 Two branch tags: fewest changes wins:
3055
3055
3056 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter
3056 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter
3057 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3057 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3058 @ 9: t4+5,6
3058 @ 9: t4+5,6
3059 |
3059 |
3060 o 8: t4+4,5
3060 o 8: t4+4,5
3061 |
3061 |
3062 o 7: t4+3,4
3062 o 7: t4+3,4
3063 |
3063 |
3064 o 6: t4+2,3
3064 o 6: t4+2,3
3065 |
3065 |
3066 o 5: t4+1,2
3066 o 5: t4+1,2
3067 |\
3067 |\
3068 | o 4: t4+0,0
3068 | o 4: t4+0,0
3069 | |
3069 | |
3070 | o 3: t3+0,0
3070 | o 3: t3+0,0
3071 | |
3071 | |
3072 o | 2: t2+0,0
3072 o | 2: t2+0,0
3073 |/
3073 |/
3074 o 1: t1+0,0
3074 o 1: t1+0,0
3075 |
3075 |
3076 o 0: null+1,1
3076 o 0: null+1,1
3077
3077
3078
3078
3079 Merged tag overrides:
3079 Merged tag overrides:
3080
3080
3081 $ hg tag -r 5 -m t5 -d '9 0' t5
3081 $ hg tag -r 5 -m t5 -d '9 0' t5
3082 $ hg tag -r 3 -m at3 -d '10 0' at3
3082 $ hg tag -r 3 -m at3 -d '10 0' at3
3083 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3083 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3084 @ 11: t5+6
3084 @ 11: t5+6
3085 |
3085 |
3086 o 10: t5+5
3086 o 10: t5+5
3087 |
3087 |
3088 o 9: t5+4
3088 o 9: t5+4
3089 |
3089 |
3090 o 8: t5+3
3090 o 8: t5+3
3091 |
3091 |
3092 o 7: t5+2
3092 o 7: t5+2
3093 |
3093 |
3094 o 6: t5+1
3094 o 6: t5+1
3095 |
3095 |
3096 o 5: t5+0
3096 o 5: t5+0
3097 |\
3097 |\
3098 | o 4: t4+0
3098 | o 4: t4+0
3099 | |
3099 | |
3100 | o 3: at3:t3+0
3100 | o 3: at3:t3+0
3101 | |
3101 | |
3102 o | 2: t2+0
3102 o | 2: t2+0
3103 |/
3103 |/
3104 o 1: t1+0
3104 o 1: t1+0
3105 |
3105 |
3106 o 0: null+1
3106 o 0: null+1
3107
3107
3108
3108
3109 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3109 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3110 @ 11: t5+6,6
3110 @ 11: t5+6,6
3111 |
3111 |
3112 o 10: t5+5,5
3112 o 10: t5+5,5
3113 |
3113 |
3114 o 9: t5+4,4
3114 o 9: t5+4,4
3115 |
3115 |
3116 o 8: t5+3,3
3116 o 8: t5+3,3
3117 |
3117 |
3118 o 7: t5+2,2
3118 o 7: t5+2,2
3119 |
3119 |
3120 o 6: t5+1,1
3120 o 6: t5+1,1
3121 |
3121 |
3122 o 5: t5+0,0
3122 o 5: t5+0,0
3123 |\
3123 |\
3124 | o 4: t4+0,0
3124 | o 4: t4+0,0
3125 | |
3125 | |
3126 | o 3: at3+0,0 t3+0,0
3126 | o 3: at3+0,0 t3+0,0
3127 | |
3127 | |
3128 o | 2: t2+0,0
3128 o | 2: t2+0,0
3129 |/
3129 |/
3130 o 1: t1+0,0
3130 o 1: t1+0,0
3131 |
3131 |
3132 o 0: null+1,1
3132 o 0: null+1,1
3133
3133
3134
3134
3135 $ hg log -G --template "{rev}: {latesttag('re:^t[13]$') % '{tag}, C: {changes}, D: {distance}'}\n"
3135 $ hg log -G --template "{rev}: {latesttag('re:^t[13]$') % '{tag}, C: {changes}, D: {distance}'}\n"
3136 @ 11: t3, C: 9, D: 8
3136 @ 11: t3, C: 9, D: 8
3137 |
3137 |
3138 o 10: t3, C: 8, D: 7
3138 o 10: t3, C: 8, D: 7
3139 |
3139 |
3140 o 9: t3, C: 7, D: 6
3140 o 9: t3, C: 7, D: 6
3141 |
3141 |
3142 o 8: t3, C: 6, D: 5
3142 o 8: t3, C: 6, D: 5
3143 |
3143 |
3144 o 7: t3, C: 5, D: 4
3144 o 7: t3, C: 5, D: 4
3145 |
3145 |
3146 o 6: t3, C: 4, D: 3
3146 o 6: t3, C: 4, D: 3
3147 |
3147 |
3148 o 5: t3, C: 3, D: 2
3148 o 5: t3, C: 3, D: 2
3149 |\
3149 |\
3150 | o 4: t3, C: 1, D: 1
3150 | o 4: t3, C: 1, D: 1
3151 | |
3151 | |
3152 | o 3: t3, C: 0, D: 0
3152 | o 3: t3, C: 0, D: 0
3153 | |
3153 | |
3154 o | 2: t1, C: 1, D: 1
3154 o | 2: t1, C: 1, D: 1
3155 |/
3155 |/
3156 o 1: t1, C: 0, D: 0
3156 o 1: t1, C: 0, D: 0
3157 |
3157 |
3158 o 0: null, C: 1, D: 1
3158 o 0: null, C: 1, D: 1
3159
3159
3160
3160
3161 $ cd ..
3161 $ cd ..
3162
3162
3163
3163
3164 Style path expansion: issue1948 - ui.style option doesn't work on OSX
3164 Style path expansion: issue1948 - ui.style option doesn't work on OSX
3165 if it is a relative path
3165 if it is a relative path
3166
3166
3167 $ mkdir -p home/styles
3167 $ mkdir -p home/styles
3168
3168
3169 $ cat > home/styles/teststyle <<EOF
3169 $ cat > home/styles/teststyle <<EOF
3170 > changeset = 'test {rev}:{node|short}\n'
3170 > changeset = 'test {rev}:{node|short}\n'
3171 > EOF
3171 > EOF
3172
3172
3173 $ HOME=`pwd`/home; export HOME
3173 $ HOME=`pwd`/home; export HOME
3174
3174
3175 $ cat > latesttag/.hg/hgrc <<EOF
3175 $ cat > latesttag/.hg/hgrc <<EOF
3176 > [ui]
3176 > [ui]
3177 > style = ~/styles/teststyle
3177 > style = ~/styles/teststyle
3178 > EOF
3178 > EOF
3179
3179
3180 $ hg -R latesttag tip
3180 $ hg -R latesttag tip
3181 test 11:97e5943b523a
3181 test 11:97e5943b523a
3182
3182
3183 Test recursive showlist template (issue1989):
3183 Test recursive showlist template (issue1989):
3184
3184
3185 $ cat > style1989 <<EOF
3185 $ cat > style1989 <<EOF
3186 > changeset = '{file_mods}{manifest}{extras}'
3186 > changeset = '{file_mods}{manifest}{extras}'
3187 > file_mod = 'M|{author|person}\n'
3187 > file_mod = 'M|{author|person}\n'
3188 > manifest = '{rev},{author}\n'
3188 > manifest = '{rev},{author}\n'
3189 > extra = '{key}: {author}\n'
3189 > extra = '{key}: {author}\n'
3190 > EOF
3190 > EOF
3191
3191
3192 $ hg -R latesttag log -r tip --style=style1989
3192 $ hg -R latesttag log -r tip --style=style1989
3193 M|test
3193 M|test
3194 11,test
3194 11,test
3195 branch: test
3195 branch: test
3196
3196
3197 Test new-style inline templating:
3197 Test new-style inline templating:
3198
3198
3199 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
3199 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
3200 modified files: .hgtags
3200 modified files: .hgtags
3201
3201
3202
3202
3203 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
3203 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
3204 hg: parse error: keyword 'rev' is not iterable
3204 hg: parse error: keyword 'rev' is not iterable
3205 [255]
3205 [255]
3206 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
3206 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
3207 hg: parse error: None is not iterable
3207 hg: parse error: None is not iterable
3208 [255]
3208 [255]
3209
3209
3210 Test new-style inline templating of non-list/dict type:
3210 Test new-style inline templating of non-list/dict type:
3211
3211
3212 $ hg log -R latesttag -r tip -T '{manifest}\n'
3212 $ hg log -R latesttag -r tip -T '{manifest}\n'
3213 11:2bc6e9006ce2
3213 11:2bc6e9006ce2
3214 $ hg log -R latesttag -r tip -T 'string length: {manifest|count}\n'
3214 $ hg log -R latesttag -r tip -T 'string length: {manifest|count}\n'
3215 string length: 15
3215 string length: 15
3216 $ hg log -R latesttag -r tip -T '{manifest % "{rev}:{node}"}\n'
3216 $ hg log -R latesttag -r tip -T '{manifest % "{rev}:{node}"}\n'
3217 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc
3217 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc
3218
3218
3219 $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}'
3219 $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}'
3220 branch: default
3220 branch: default
3221 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}'
3221 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}'
3222 hg: parse error: None is not iterable
3222 hg: parse error: None is not iterable
3223 [255]
3223 [255]
3224 $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}'
3224 $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}'
3225 branch: default
3225 branch: default
3226 $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}'
3226 $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}'
3227 0:ce3cec86e6c2
3227 0:ce3cec86e6c2
3228 $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}'
3228 $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}'
3229 9:fbc7cd862e9c
3229 9:fbc7cd862e9c
3230
3230
3231 Test manifest/get() can be join()-ed as before, though it's silly:
3231 Test manifest/get() can be join()-ed as before, though it's silly:
3232
3232
3233 $ hg log -R latesttag -r tip -T '{join(manifest, "")}\n'
3233 $ hg log -R latesttag -r tip -T '{join(manifest, "")}\n'
3234 11:2bc6e9006ce2
3234 11:2bc6e9006ce2
3235 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), "")}\n'
3235 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), "")}\n'
3236 default
3236 default
3237
3237
3238 Test min/max of integers
3238 Test min/max of integers
3239
3239
3240 $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'
3240 $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'
3241 9
3241 9
3242 $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n'
3242 $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n'
3243 10
3243 10
3244
3244
3245 Test min/max of if() result
3246
3247 $ cd latesttag
3248 $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
3249 9
3250 $ hg log -l1 -T '{max(if(false, "", revset("9:10")))}\n'
3251 10
3252 $ hg log -l1 -T '{min(ifcontains("a", "aa", revset("9:10"), ""))}\n'
3253 9
3254 $ hg log -l1 -T '{max(ifcontains("a", "bb", "", revset("9:10")))}\n'
3255 10
3256 $ hg log -l1 -T '{min(ifeq(0, 0, revset("9:10"), ""))}\n'
3257 9
3258 $ hg log -l1 -T '{max(ifeq(0, 1, "", revset("9:10")))}\n'
3259 10
3260 $ cd ..
3261
3262 Test laziness of if() then/else clause
3263
3264 $ hg debugtemplate '{count(0)}'
3265 abort: incompatible use of template filter 'count'
3266 [255]
3267 $ hg debugtemplate '{if(true, "", count(0))}'
3268 $ hg debugtemplate '{if(false, count(0), "")}'
3269 $ hg debugtemplate '{ifcontains("a", "aa", "", count(0))}'
3270 $ hg debugtemplate '{ifcontains("a", "bb", count(0), "")}'
3271 $ hg debugtemplate '{ifeq(0, 0, "", count(0))}'
3272 $ hg debugtemplate '{ifeq(0, 1, count(0), "")}'
3273
3245 Test dot operator precedence:
3274 Test dot operator precedence:
3246
3275
3247 $ hg debugtemplate -R latesttag -r0 -v '{manifest.node|short}\n'
3276 $ hg debugtemplate -R latesttag -r0 -v '{manifest.node|short}\n'
3248 (template
3277 (template
3249 (|
3278 (|
3250 (.
3279 (.
3251 (symbol 'manifest')
3280 (symbol 'manifest')
3252 (symbol 'node'))
3281 (symbol 'node'))
3253 (symbol 'short'))
3282 (symbol 'short'))
3254 (string '\n'))
3283 (string '\n'))
3255 89f4071fec70
3284 89f4071fec70
3256
3285
3257 (the following examples are invalid, but seem natural in parsing POV)
3286 (the following examples are invalid, but seem natural in parsing POV)
3258
3287
3259 $ hg debugtemplate -R latesttag -r0 -v '{foo|bar.baz}\n' 2> /dev/null
3288 $ hg debugtemplate -R latesttag -r0 -v '{foo|bar.baz}\n' 2> /dev/null
3260 (template
3289 (template
3261 (|
3290 (|
3262 (symbol 'foo')
3291 (symbol 'foo')
3263 (.
3292 (.
3264 (symbol 'bar')
3293 (symbol 'bar')
3265 (symbol 'baz')))
3294 (symbol 'baz')))
3266 (string '\n'))
3295 (string '\n'))
3267 [255]
3296 [255]
3268 $ hg debugtemplate -R latesttag -r0 -v '{foo.bar()}\n' 2> /dev/null
3297 $ hg debugtemplate -R latesttag -r0 -v '{foo.bar()}\n' 2> /dev/null
3269 (template
3298 (template
3270 (.
3299 (.
3271 (symbol 'foo')
3300 (symbol 'foo')
3272 (func
3301 (func
3273 (symbol 'bar')
3302 (symbol 'bar')
3274 None))
3303 None))
3275 (string '\n'))
3304 (string '\n'))
3276 [255]
3305 [255]
3277
3306
3278 Test evaluation of dot operator:
3307 Test evaluation of dot operator:
3279
3308
3280 $ hg log -R latesttag -l1 -T '{min(revset("0:9")).node}\n'
3309 $ hg log -R latesttag -l1 -T '{min(revset("0:9")).node}\n'
3281 ce3cec86e6c26bd9bdfc590a6b92abc9680f1796
3310 ce3cec86e6c26bd9bdfc590a6b92abc9680f1796
3282 $ hg log -R latesttag -r0 -T '{extras.branch}\n'
3311 $ hg log -R latesttag -r0 -T '{extras.branch}\n'
3283 default
3312 default
3284
3313
3285 $ hg log -R latesttag -l1 -T '{author.invalid}\n'
3314 $ hg log -R latesttag -l1 -T '{author.invalid}\n'
3286 hg: parse error: keyword 'author' has no member
3315 hg: parse error: keyword 'author' has no member
3287 [255]
3316 [255]
3288 $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n'
3317 $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n'
3289 hg: parse error: 'a' has no member
3318 hg: parse error: 'a' has no member
3290 [255]
3319 [255]
3291
3320
3292 Test the sub function of templating for expansion:
3321 Test the sub function of templating for expansion:
3293
3322
3294 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
3323 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
3295 xx
3324 xx
3296
3325
3297 $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n'
3326 $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n'
3298 hg: parse error: sub got an invalid pattern: [
3327 hg: parse error: sub got an invalid pattern: [
3299 [255]
3328 [255]
3300 $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n'
3329 $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n'
3301 hg: parse error: sub got an invalid replacement: \1
3330 hg: parse error: sub got an invalid replacement: \1
3302 [255]
3331 [255]
3303
3332
3304 Test the strip function with chars specified:
3333 Test the strip function with chars specified:
3305
3334
3306 $ hg log -R latesttag --template '{desc}\n'
3335 $ hg log -R latesttag --template '{desc}\n'
3307 at3
3336 at3
3308 t5
3337 t5
3309 t4
3338 t4
3310 t3
3339 t3
3311 t2
3340 t2
3312 t1
3341 t1
3313 merge
3342 merge
3314 h2e
3343 h2e
3315 h2d
3344 h2d
3316 h1c
3345 h1c
3317 b
3346 b
3318 a
3347 a
3319
3348
3320 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
3349 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
3321 at3
3350 at3
3322 5
3351 5
3323 4
3352 4
3324 3
3353 3
3325 2
3354 2
3326 1
3355 1
3327 merg
3356 merg
3328 h2
3357 h2
3329 h2d
3358 h2d
3330 h1c
3359 h1c
3331 b
3360 b
3332 a
3361 a
3333
3362
3334 Test date format:
3363 Test date format:
3335
3364
3336 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
3365 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
3337 date: 70 01 01 10 +0000
3366 date: 70 01 01 10 +0000
3338 date: 70 01 01 09 +0000
3367 date: 70 01 01 09 +0000
3339 date: 70 01 01 04 +0000
3368 date: 70 01 01 04 +0000
3340 date: 70 01 01 08 +0000
3369 date: 70 01 01 08 +0000
3341 date: 70 01 01 07 +0000
3370 date: 70 01 01 07 +0000
3342 date: 70 01 01 06 +0000
3371 date: 70 01 01 06 +0000
3343 date: 70 01 01 05 +0100
3372 date: 70 01 01 05 +0100
3344 date: 70 01 01 04 +0000
3373 date: 70 01 01 04 +0000
3345 date: 70 01 01 03 +0000
3374 date: 70 01 01 03 +0000
3346 date: 70 01 01 02 +0000
3375 date: 70 01 01 02 +0000
3347 date: 70 01 01 01 +0000
3376 date: 70 01 01 01 +0000
3348 date: 70 01 01 00 +0000
3377 date: 70 01 01 00 +0000
3349
3378
3350 Test invalid date:
3379 Test invalid date:
3351
3380
3352 $ hg log -R latesttag -T '{date(rev)}\n'
3381 $ hg log -R latesttag -T '{date(rev)}\n'
3353 hg: parse error: date expects a date information
3382 hg: parse error: date expects a date information
3354 [255]
3383 [255]
3355
3384
3356 Test integer literal:
3385 Test integer literal:
3357
3386
3358 $ hg debugtemplate -v '{(0)}\n'
3387 $ hg debugtemplate -v '{(0)}\n'
3359 (template
3388 (template
3360 (group
3389 (group
3361 (integer '0'))
3390 (integer '0'))
3362 (string '\n'))
3391 (string '\n'))
3363 0
3392 0
3364 $ hg debugtemplate -v '{(123)}\n'
3393 $ hg debugtemplate -v '{(123)}\n'
3365 (template
3394 (template
3366 (group
3395 (group
3367 (integer '123'))
3396 (integer '123'))
3368 (string '\n'))
3397 (string '\n'))
3369 123
3398 123
3370 $ hg debugtemplate -v '{(-4)}\n'
3399 $ hg debugtemplate -v '{(-4)}\n'
3371 (template
3400 (template
3372 (group
3401 (group
3373 (negate
3402 (negate
3374 (integer '4')))
3403 (integer '4')))
3375 (string '\n'))
3404 (string '\n'))
3376 -4
3405 -4
3377 $ hg debugtemplate '{(-)}\n'
3406 $ hg debugtemplate '{(-)}\n'
3378 hg: parse error at 3: not a prefix: )
3407 hg: parse error at 3: not a prefix: )
3379 ({(-)}\n
3408 ({(-)}\n
3380 ^ here)
3409 ^ here)
3381 [255]
3410 [255]
3382 $ hg debugtemplate '{(-a)}\n'
3411 $ hg debugtemplate '{(-a)}\n'
3383 hg: parse error: negation needs an integer argument
3412 hg: parse error: negation needs an integer argument
3384 [255]
3413 [255]
3385
3414
3386 top-level integer literal is interpreted as symbol (i.e. variable name):
3415 top-level integer literal is interpreted as symbol (i.e. variable name):
3387
3416
3388 $ hg debugtemplate -D 1=one -v '{1}\n'
3417 $ hg debugtemplate -D 1=one -v '{1}\n'
3389 (template
3418 (template
3390 (integer '1')
3419 (integer '1')
3391 (string '\n'))
3420 (string '\n'))
3392 one
3421 one
3393 $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n'
3422 $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n'
3394 (template
3423 (template
3395 (func
3424 (func
3396 (symbol 'if')
3425 (symbol 'if')
3397 (list
3426 (list
3398 (string 't')
3427 (string 't')
3399 (template
3428 (template
3400 (integer '1'))))
3429 (integer '1'))))
3401 (string '\n'))
3430 (string '\n'))
3402 one
3431 one
3403 $ hg debugtemplate -D 1=one -v '{1|stringify}\n'
3432 $ hg debugtemplate -D 1=one -v '{1|stringify}\n'
3404 (template
3433 (template
3405 (|
3434 (|
3406 (integer '1')
3435 (integer '1')
3407 (symbol 'stringify'))
3436 (symbol 'stringify'))
3408 (string '\n'))
3437 (string '\n'))
3409 one
3438 one
3410
3439
3411 unless explicit symbol is expected:
3440 unless explicit symbol is expected:
3412
3441
3413 $ hg log -Ra -r0 -T '{desc|1}\n'
3442 $ hg log -Ra -r0 -T '{desc|1}\n'
3414 hg: parse error: expected a symbol, got 'integer'
3443 hg: parse error: expected a symbol, got 'integer'
3415 [255]
3444 [255]
3416 $ hg log -Ra -r0 -T '{1()}\n'
3445 $ hg log -Ra -r0 -T '{1()}\n'
3417 hg: parse error: expected a symbol, got 'integer'
3446 hg: parse error: expected a symbol, got 'integer'
3418 [255]
3447 [255]
3419
3448
3420 Test string literal:
3449 Test string literal:
3421
3450
3422 $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n'
3451 $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n'
3423 (template
3452 (template
3424 (string 'string with no template fragment')
3453 (string 'string with no template fragment')
3425 (string '\n'))
3454 (string '\n'))
3426 string with no template fragment
3455 string with no template fragment
3427 $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n'
3456 $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n'
3428 (template
3457 (template
3429 (template
3458 (template
3430 (string 'template: ')
3459 (string 'template: ')
3431 (symbol 'rev'))
3460 (symbol 'rev'))
3432 (string '\n'))
3461 (string '\n'))
3433 template: 0
3462 template: 0
3434 $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n'
3463 $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n'
3435 (template
3464 (template
3436 (string 'rawstring: {rev}')
3465 (string 'rawstring: {rev}')
3437 (string '\n'))
3466 (string '\n'))
3438 rawstring: {rev}
3467 rawstring: {rev}
3439 $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n'
3468 $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n'
3440 (template
3469 (template
3441 (%
3470 (%
3442 (symbol 'files')
3471 (symbol 'files')
3443 (string 'rawstring: {file}'))
3472 (string 'rawstring: {file}'))
3444 (string '\n'))
3473 (string '\n'))
3445 rawstring: {file}
3474 rawstring: {file}
3446
3475
3447 Test string escaping:
3476 Test string escaping:
3448
3477
3449 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3478 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3450 >
3479 >
3451 <>\n<[>
3480 <>\n<[>
3452 <>\n<]>
3481 <>\n<]>
3453 <>\n<
3482 <>\n<
3454
3483
3455 $ hg log -R latesttag -r 0 \
3484 $ hg log -R latesttag -r 0 \
3456 > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3485 > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3457 >
3486 >
3458 <>\n<[>
3487 <>\n<[>
3459 <>\n<]>
3488 <>\n<]>
3460 <>\n<
3489 <>\n<
3461
3490
3462 $ hg log -R latesttag -r 0 -T esc \
3491 $ hg log -R latesttag -r 0 -T esc \
3463 > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3492 > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3464 >
3493 >
3465 <>\n<[>
3494 <>\n<[>
3466 <>\n<]>
3495 <>\n<]>
3467 <>\n<
3496 <>\n<
3468
3497
3469 $ cat <<'EOF' > esctmpl
3498 $ cat <<'EOF' > esctmpl
3470 > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3499 > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3471 > EOF
3500 > EOF
3472 $ hg log -R latesttag -r 0 --style ./esctmpl
3501 $ hg log -R latesttag -r 0 --style ./esctmpl
3473 >
3502 >
3474 <>\n<[>
3503 <>\n<[>
3475 <>\n<]>
3504 <>\n<]>
3476 <>\n<
3505 <>\n<
3477
3506
3478 Test string escaping of quotes:
3507 Test string escaping of quotes:
3479
3508
3480 $ hg log -Ra -r0 -T '{"\""}\n'
3509 $ hg log -Ra -r0 -T '{"\""}\n'
3481 "
3510 "
3482 $ hg log -Ra -r0 -T '{"\\\""}\n'
3511 $ hg log -Ra -r0 -T '{"\\\""}\n'
3483 \"
3512 \"
3484 $ hg log -Ra -r0 -T '{r"\""}\n'
3513 $ hg log -Ra -r0 -T '{r"\""}\n'
3485 \"
3514 \"
3486 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3515 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3487 \\\"
3516 \\\"
3488
3517
3489
3518
3490 $ hg log -Ra -r0 -T '{"\""}\n'
3519 $ hg log -Ra -r0 -T '{"\""}\n'
3491 "
3520 "
3492 $ hg log -Ra -r0 -T '{"\\\""}\n'
3521 $ hg log -Ra -r0 -T '{"\\\""}\n'
3493 \"
3522 \"
3494 $ hg log -Ra -r0 -T '{r"\""}\n'
3523 $ hg log -Ra -r0 -T '{r"\""}\n'
3495 \"
3524 \"
3496 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3525 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3497 \\\"
3526 \\\"
3498
3527
3499 Test exception in quoted template. single backslash before quotation mark is
3528 Test exception in quoted template. single backslash before quotation mark is
3500 stripped before parsing:
3529 stripped before parsing:
3501
3530
3502 $ cat <<'EOF' > escquotetmpl
3531 $ cat <<'EOF' > escquotetmpl
3503 > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n"
3532 > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n"
3504 > EOF
3533 > EOF
3505 $ cd latesttag
3534 $ cd latesttag
3506 $ hg log -r 2 --style ../escquotetmpl
3535 $ hg log -r 2 --style ../escquotetmpl
3507 " \" \" \\" head1
3536 " \" \" \\" head1
3508
3537
3509 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"'
3538 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"'
3510 valid
3539 valid
3511 $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'"
3540 $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'"
3512 valid
3541 valid
3513
3542
3514 Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested
3543 Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested
3515 _evalifliteral() templates (issue4733):
3544 _evalifliteral() templates (issue4733):
3516
3545
3517 $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n'
3546 $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n'
3518 "2
3547 "2
3519 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n'
3548 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n'
3520 "2
3549 "2
3521 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n'
3550 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n'
3522 "2
3551 "2
3523
3552
3524 $ hg log -r 2 -T '{if(rev, "\\\"")}\n'
3553 $ hg log -r 2 -T '{if(rev, "\\\"")}\n'
3525 \"
3554 \"
3526 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n'
3555 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n'
3527 \"
3556 \"
3528 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3557 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3529 \"
3558 \"
3530
3559
3531 $ hg log -r 2 -T '{if(rev, r"\\\"")}\n'
3560 $ hg log -r 2 -T '{if(rev, r"\\\"")}\n'
3532 \\\"
3561 \\\"
3533 $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n'
3562 $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n'
3534 \\\"
3563 \\\"
3535 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3564 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3536 \\\"
3565 \\\"
3537
3566
3538 escaped single quotes and errors:
3567 escaped single quotes and errors:
3539
3568
3540 $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n'
3569 $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n'
3541 foo
3570 foo
3542 $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n'
3571 $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n'
3543 foo
3572 foo
3544 $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n'
3573 $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n'
3545 hg: parse error at 21: unterminated string
3574 hg: parse error at 21: unterminated string
3546 ({if(rev, "{if(rev, \")}")}\n
3575 ({if(rev, "{if(rev, \")}")}\n
3547 ^ here)
3576 ^ here)
3548 [255]
3577 [255]
3549 $ hg log -r 2 -T '{if(rev, \"\\"")}\n'
3578 $ hg log -r 2 -T '{if(rev, \"\\"")}\n'
3550 hg: parse error: trailing \ in string
3579 hg: parse error: trailing \ in string
3551 [255]
3580 [255]
3552 $ hg log -r 2 -T '{if(rev, r\"\\"")}\n'
3581 $ hg log -r 2 -T '{if(rev, r\"\\"")}\n'
3553 hg: parse error: trailing \ in string
3582 hg: parse error: trailing \ in string
3554 [255]
3583 [255]
3555
3584
3556 $ cd ..
3585 $ cd ..
3557
3586
3558 Test leading backslashes:
3587 Test leading backslashes:
3559
3588
3560 $ cd latesttag
3589 $ cd latesttag
3561 $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n'
3590 $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n'
3562 {rev} {file}
3591 {rev} {file}
3563 $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n'
3592 $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n'
3564 \2 \head1
3593 \2 \head1
3565 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n'
3594 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n'
3566 \{rev} \{file}
3595 \{rev} \{file}
3567 $ cd ..
3596 $ cd ..
3568
3597
3569 Test leading backslashes in "if" expression (issue4714):
3598 Test leading backslashes in "if" expression (issue4714):
3570
3599
3571 $ cd latesttag
3600 $ cd latesttag
3572 $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n'
3601 $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n'
3573 {rev} \{rev}
3602 {rev} \{rev}
3574 $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n'
3603 $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n'
3575 \2 \\{rev}
3604 \2 \\{rev}
3576 $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n'
3605 $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n'
3577 \{rev} \\\{rev}
3606 \{rev} \\\{rev}
3578 $ cd ..
3607 $ cd ..
3579
3608
3580 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
3609 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
3581
3610
3582 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
3611 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
3583 \x6e
3612 \x6e
3584 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
3613 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
3585 \x5c\x786e
3614 \x5c\x786e
3586 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
3615 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
3587 \x6e
3616 \x6e
3588 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
3617 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
3589 \x5c\x786e
3618 \x5c\x786e
3590
3619
3591 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
3620 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
3592 \x6e
3621 \x6e
3593 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
3622 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
3594 \x5c\x786e
3623 \x5c\x786e
3595 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
3624 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
3596 \x6e
3625 \x6e
3597 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
3626 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
3598 \x5c\x786e
3627 \x5c\x786e
3599
3628
3600 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
3629 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
3601 fourth
3630 fourth
3602 second
3631 second
3603 third
3632 third
3604 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
3633 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
3605 fourth\nsecond\nthird
3634 fourth\nsecond\nthird
3606
3635
3607 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
3636 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
3608 <p>
3637 <p>
3609 1st
3638 1st
3610 </p>
3639 </p>
3611 <p>
3640 <p>
3612 2nd
3641 2nd
3613 </p>
3642 </p>
3614 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
3643 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
3615 <p>
3644 <p>
3616 1st\n\n2nd
3645 1st\n\n2nd
3617 </p>
3646 </p>
3618 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
3647 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
3619 1st
3648 1st
3620
3649
3621 2nd
3650 2nd
3622
3651
3623 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
3652 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
3624 o perso
3653 o perso
3625 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
3654 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
3626 no person
3655 no person
3627 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
3656 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
3628 o perso
3657 o perso
3629 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
3658 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
3630 no perso
3659 no perso
3631
3660
3632 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
3661 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
3633 -o perso-
3662 -o perso-
3634 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
3663 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
3635 no person
3664 no person
3636 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
3665 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
3637 \x2do perso\x2d
3666 \x2do perso\x2d
3638 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
3667 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
3639 -o perso-
3668 -o perso-
3640 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
3669 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
3641 \x2do perso\x6e
3670 \x2do perso\x6e
3642
3671
3643 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
3672 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
3644 fourth
3673 fourth
3645 second
3674 second
3646 third
3675 third
3647
3676
3648 Test string escaping in nested expression:
3677 Test string escaping in nested expression:
3649
3678
3650 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
3679 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
3651 fourth\x6esecond\x6ethird
3680 fourth\x6esecond\x6ethird
3652 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
3681 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
3653 fourth\x6esecond\x6ethird
3682 fourth\x6esecond\x6ethird
3654
3683
3655 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
3684 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
3656 fourth\x6esecond\x6ethird
3685 fourth\x6esecond\x6ethird
3657 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
3686 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
3658 fourth\x5c\x786esecond\x5c\x786ethird
3687 fourth\x5c\x786esecond\x5c\x786ethird
3659
3688
3660 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
3689 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
3661 3:\x6eo user, \x6eo domai\x6e
3690 3:\x6eo user, \x6eo domai\x6e
3662 4:\x5c\x786eew bra\x5c\x786ech
3691 4:\x5c\x786eew bra\x5c\x786ech
3663
3692
3664 Test quotes in nested expression are evaluated just like a $(command)
3693 Test quotes in nested expression are evaluated just like a $(command)
3665 substitution in POSIX shells:
3694 substitution in POSIX shells:
3666
3695
3667 $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n'
3696 $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n'
3668 8:95c24699272e
3697 8:95c24699272e
3669 $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n'
3698 $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n'
3670 {8} "95c24699272e"
3699 {8} "95c24699272e"
3671
3700
3672 Test recursive evaluation:
3701 Test recursive evaluation:
3673
3702
3674 $ hg init r
3703 $ hg init r
3675 $ cd r
3704 $ cd r
3676 $ echo a > a
3705 $ echo a > a
3677 $ hg ci -Am '{rev}'
3706 $ hg ci -Am '{rev}'
3678 adding a
3707 adding a
3679 $ hg log -r 0 --template '{if(rev, desc)}\n'
3708 $ hg log -r 0 --template '{if(rev, desc)}\n'
3680 {rev}
3709 {rev}
3681 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
3710 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
3682 test 0
3711 test 0
3683
3712
3684 $ hg branch -q 'text.{rev}'
3713 $ hg branch -q 'text.{rev}'
3685 $ echo aa >> aa
3714 $ echo aa >> aa
3686 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
3715 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
3687
3716
3688 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
3717 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
3689 {node|short}desc to
3718 {node|short}desc to
3690 text.{rev}be wrapped
3719 text.{rev}be wrapped
3691 text.{rev}desc to be
3720 text.{rev}desc to be
3692 text.{rev}wrapped (no-eol)
3721 text.{rev}wrapped (no-eol)
3693 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
3722 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
3694 bcc7ff960b8e:desc to
3723 bcc7ff960b8e:desc to
3695 text.1:be wrapped
3724 text.1:be wrapped
3696 text.1:desc to be
3725 text.1:desc to be
3697 text.1:wrapped (no-eol)
3726 text.1:wrapped (no-eol)
3698 $ hg log -l1 -T '{fill(desc, date, "", "")}\n'
3727 $ hg log -l1 -T '{fill(desc, date, "", "")}\n'
3699 hg: parse error: fill expects an integer width
3728 hg: parse error: fill expects an integer width
3700 [255]
3729 [255]
3701
3730
3702 $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}'
3731 $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}'
3703 bcc7ff960b8e:desc to be
3732 bcc7ff960b8e:desc to be
3704 termwidth.1:wrapped desc
3733 termwidth.1:wrapped desc
3705 termwidth.1:to be wrapped (no-eol)
3734 termwidth.1:to be wrapped (no-eol)
3706
3735
3707 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3736 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3708 {node|short} (no-eol)
3737 {node|short} (no-eol)
3709 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
3738 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
3710 bcc-ff---b-e (no-eol)
3739 bcc-ff---b-e (no-eol)
3711
3740
3712 $ cat >> .hg/hgrc <<EOF
3741 $ cat >> .hg/hgrc <<EOF
3713 > [extensions]
3742 > [extensions]
3714 > color=
3743 > color=
3715 > [color]
3744 > [color]
3716 > mode=ansi
3745 > mode=ansi
3717 > text.{rev} = red
3746 > text.{rev} = red
3718 > text.1 = green
3747 > text.1 = green
3719 > EOF
3748 > EOF
3720 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
3749 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
3721 \x1b[0;31mtext\x1b[0m (esc)
3750 \x1b[0;31mtext\x1b[0m (esc)
3722 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
3751 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
3723 \x1b[0;32mtext\x1b[0m (esc)
3752 \x1b[0;32mtext\x1b[0m (esc)
3724
3753
3725 color effect can be specified without quoting:
3754 color effect can be specified without quoting:
3726
3755
3727 $ hg log --color=always -l 1 --template '{label(red, "text\n")}'
3756 $ hg log --color=always -l 1 --template '{label(red, "text\n")}'
3728 \x1b[0;31mtext\x1b[0m (esc)
3757 \x1b[0;31mtext\x1b[0m (esc)
3729
3758
3730 color effects can be nested (issue5413)
3759 color effects can be nested (issue5413)
3731
3760
3732 $ hg debugtemplate --color=always \
3761 $ hg debugtemplate --color=always \
3733 > '{label(red, "red{label(magenta, "ma{label(cyan, "cyan")}{label(yellow, "yellow")}genta")}")}\n'
3762 > '{label(red, "red{label(magenta, "ma{label(cyan, "cyan")}{label(yellow, "yellow")}genta")}")}\n'
3734 \x1b[0;31mred\x1b[0;35mma\x1b[0;36mcyan\x1b[0m\x1b[0;31m\x1b[0;35m\x1b[0;33myellow\x1b[0m\x1b[0;31m\x1b[0;35mgenta\x1b[0m (esc)
3763 \x1b[0;31mred\x1b[0;35mma\x1b[0;36mcyan\x1b[0m\x1b[0;31m\x1b[0;35m\x1b[0;33myellow\x1b[0m\x1b[0;31m\x1b[0;35mgenta\x1b[0m (esc)
3735
3764
3736 pad() should interact well with color codes (issue5416)
3765 pad() should interact well with color codes (issue5416)
3737
3766
3738 $ hg debugtemplate --color=always \
3767 $ hg debugtemplate --color=always \
3739 > '{pad(label(red, "red"), 5, label(cyan, "-"))}\n'
3768 > '{pad(label(red, "red"), 5, label(cyan, "-"))}\n'
3740 \x1b[0;31mred\x1b[0m\x1b[0;36m-\x1b[0m\x1b[0;36m-\x1b[0m (esc)
3769 \x1b[0;31mred\x1b[0m\x1b[0;36m-\x1b[0m\x1b[0;36m-\x1b[0m (esc)
3741
3770
3742 label should be no-op if color is disabled:
3771 label should be no-op if color is disabled:
3743
3772
3744 $ hg log --color=never -l 1 --template '{label(red, "text\n")}'
3773 $ hg log --color=never -l 1 --template '{label(red, "text\n")}'
3745 text
3774 text
3746 $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}'
3775 $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}'
3747 text
3776 text
3748
3777
3749 Test branches inside if statement:
3778 Test branches inside if statement:
3750
3779
3751 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
3780 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
3752 no
3781 no
3753
3782
3754 Test dict constructor:
3783 Test dict constructor:
3755
3784
3756 $ hg log -r 0 -T '{dict(y=node|short, x=rev)}\n'
3785 $ hg log -r 0 -T '{dict(y=node|short, x=rev)}\n'
3757 y=f7769ec2ab97 x=0
3786 y=f7769ec2ab97 x=0
3758 $ hg log -r 0 -T '{dict(x=rev, y=node|short) % "{key}={value}\n"}'
3787 $ hg log -r 0 -T '{dict(x=rev, y=node|short) % "{key}={value}\n"}'
3759 x=0
3788 x=0
3760 y=f7769ec2ab97
3789 y=f7769ec2ab97
3761 $ hg log -r 0 -T '{dict(x=rev, y=node|short)|json}\n'
3790 $ hg log -r 0 -T '{dict(x=rev, y=node|short)|json}\n'
3762 {"x": 0, "y": "f7769ec2ab97"}
3791 {"x": 0, "y": "f7769ec2ab97"}
3763 $ hg log -r 0 -T '{dict()|json}\n'
3792 $ hg log -r 0 -T '{dict()|json}\n'
3764 {}
3793 {}
3765
3794
3766 $ hg log -r 0 -T '{dict(rev, node=node|short)}\n'
3795 $ hg log -r 0 -T '{dict(rev, node=node|short)}\n'
3767 rev=0 node=f7769ec2ab97
3796 rev=0 node=f7769ec2ab97
3768 $ hg log -r 0 -T '{dict(rev, node|short)}\n'
3797 $ hg log -r 0 -T '{dict(rev, node|short)}\n'
3769 rev=0 node=f7769ec2ab97
3798 rev=0 node=f7769ec2ab97
3770
3799
3771 $ hg log -r 0 -T '{dict(rev, rev=rev)}\n'
3800 $ hg log -r 0 -T '{dict(rev, rev=rev)}\n'
3772 hg: parse error: duplicated dict key 'rev' inferred
3801 hg: parse error: duplicated dict key 'rev' inferred
3773 [255]
3802 [255]
3774 $ hg log -r 0 -T '{dict(node, node|short)}\n'
3803 $ hg log -r 0 -T '{dict(node, node|short)}\n'
3775 hg: parse error: duplicated dict key 'node' inferred
3804 hg: parse error: duplicated dict key 'node' inferred
3776 [255]
3805 [255]
3777 $ hg log -r 0 -T '{dict(1 + 2)}'
3806 $ hg log -r 0 -T '{dict(1 + 2)}'
3778 hg: parse error: dict key cannot be inferred
3807 hg: parse error: dict key cannot be inferred
3779 [255]
3808 [255]
3780
3809
3781 $ hg log -r 0 -T '{dict(x=rev, x=node)}'
3810 $ hg log -r 0 -T '{dict(x=rev, x=node)}'
3782 hg: parse error: dict got multiple values for keyword argument 'x'
3811 hg: parse error: dict got multiple values for keyword argument 'x'
3783 [255]
3812 [255]
3784
3813
3785 Test get function:
3814 Test get function:
3786
3815
3787 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3816 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3788 default
3817 default
3789 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
3818 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
3790 default
3819 default
3791 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3820 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3792 hg: parse error: get() expects a dict as first argument
3821 hg: parse error: get() expects a dict as first argument
3793 [255]
3822 [255]
3794
3823
3795 Test json filter applied to hybrid object:
3824 Test json filter applied to hybrid object:
3796
3825
3797 $ hg log -r0 -T '{files|json}\n'
3826 $ hg log -r0 -T '{files|json}\n'
3798 ["a"]
3827 ["a"]
3799 $ hg log -r0 -T '{extras|json}\n'
3828 $ hg log -r0 -T '{extras|json}\n'
3800 {"branch": "default"}
3829 {"branch": "default"}
3801
3830
3802 Test localdate(date, tz) function:
3831 Test localdate(date, tz) function:
3803
3832
3804 $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
3833 $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
3805 1970-01-01 09:00 +0900
3834 1970-01-01 09:00 +0900
3806 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n'
3835 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n'
3807 1970-01-01 00:00 +0000
3836 1970-01-01 00:00 +0000
3808 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "blahUTC")|isodate}\n'
3837 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "blahUTC")|isodate}\n'
3809 hg: parse error: localdate expects a timezone
3838 hg: parse error: localdate expects a timezone
3810 [255]
3839 [255]
3811 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n'
3840 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n'
3812 1970-01-01 02:00 +0200
3841 1970-01-01 02:00 +0200
3813 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n'
3842 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n'
3814 1970-01-01 00:00 +0000
3843 1970-01-01 00:00 +0000
3815 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n'
3844 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n'
3816 1970-01-01 00:00 +0000
3845 1970-01-01 00:00 +0000
3817 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n'
3846 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n'
3818 hg: parse error: localdate expects a timezone
3847 hg: parse error: localdate expects a timezone
3819 [255]
3848 [255]
3820 $ hg log -r0 -T '{localdate(date, date)|isodate}\n'
3849 $ hg log -r0 -T '{localdate(date, date)|isodate}\n'
3821 hg: parse error: localdate expects a timezone
3850 hg: parse error: localdate expects a timezone
3822 [255]
3851 [255]
3823
3852
3824 Test shortest(node) function:
3853 Test shortest(node) function:
3825
3854
3826 $ echo b > b
3855 $ echo b > b
3827 $ hg ci -qAm b
3856 $ hg ci -qAm b
3828 $ hg log --template '{shortest(node)}\n'
3857 $ hg log --template '{shortest(node)}\n'
3829 e777
3858 e777
3830 bcc7
3859 bcc7
3831 f776
3860 f776
3832 $ hg log --template '{shortest(node, 10)}\n'
3861 $ hg log --template '{shortest(node, 10)}\n'
3833 e777603221
3862 e777603221
3834 bcc7ff960b
3863 bcc7ff960b
3835 f7769ec2ab
3864 f7769ec2ab
3836 $ hg log --template '{node|shortest}\n' -l1
3865 $ hg log --template '{node|shortest}\n' -l1
3837 e777
3866 e777
3838
3867
3839 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
3868 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
3840 f7769ec2ab
3869 f7769ec2ab
3841 $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
3870 $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
3842 hg: parse error: shortest() expects an integer minlength
3871 hg: parse error: shortest() expects an integer minlength
3843 [255]
3872 [255]
3844
3873
3845 $ hg log -r 'wdir()' -T '{node|shortest}\n'
3874 $ hg log -r 'wdir()' -T '{node|shortest}\n'
3846 ffff
3875 ffff
3847
3876
3848 $ cd ..
3877 $ cd ..
3849
3878
3850 Test shortest(node) with the repo having short hash collision:
3879 Test shortest(node) with the repo having short hash collision:
3851
3880
3852 $ hg init hashcollision
3881 $ hg init hashcollision
3853 $ cd hashcollision
3882 $ cd hashcollision
3854 $ cat <<EOF >> .hg/hgrc
3883 $ cat <<EOF >> .hg/hgrc
3855 > [experimental]
3884 > [experimental]
3856 > evolution.createmarkers=True
3885 > evolution.createmarkers=True
3857 > EOF
3886 > EOF
3858 $ echo 0 > a
3887 $ echo 0 > a
3859 $ hg ci -qAm 0
3888 $ hg ci -qAm 0
3860 $ for i in 17 129 248 242 480 580 617 1057 2857 4025; do
3889 $ for i in 17 129 248 242 480 580 617 1057 2857 4025; do
3861 > hg up -q 0
3890 > hg up -q 0
3862 > echo $i > a
3891 > echo $i > a
3863 > hg ci -qm $i
3892 > hg ci -qm $i
3864 > done
3893 > done
3865 $ hg up -q null
3894 $ hg up -q null
3866 $ hg log -r0: -T '{rev}:{node}\n'
3895 $ hg log -r0: -T '{rev}:{node}\n'
3867 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
3896 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
3868 1:11424df6dc1dd4ea255eae2b58eaca7831973bbc
3897 1:11424df6dc1dd4ea255eae2b58eaca7831973bbc
3869 2:11407b3f1b9c3e76a79c1ec5373924df096f0499
3898 2:11407b3f1b9c3e76a79c1ec5373924df096f0499
3870 3:11dd92fe0f39dfdaacdaa5f3997edc533875cfc4
3899 3:11dd92fe0f39dfdaacdaa5f3997edc533875cfc4
3871 4:10776689e627b465361ad5c296a20a487e153ca4
3900 4:10776689e627b465361ad5c296a20a487e153ca4
3872 5:a00be79088084cb3aff086ab799f8790e01a976b
3901 5:a00be79088084cb3aff086ab799f8790e01a976b
3873 6:a0b0acd79b4498d0052993d35a6a748dd51d13e6
3902 6:a0b0acd79b4498d0052993d35a6a748dd51d13e6
3874 7:a0457b3450b8e1b778f1163b31a435802987fe5d
3903 7:a0457b3450b8e1b778f1163b31a435802987fe5d
3875 8:c56256a09cd28e5764f32e8e2810d0f01e2e357a
3904 8:c56256a09cd28e5764f32e8e2810d0f01e2e357a
3876 9:c5623987d205cd6d9d8389bfc40fff9dbb670b48
3905 9:c5623987d205cd6d9d8389bfc40fff9dbb670b48
3877 10:c562ddd9c94164376c20b86b0b4991636a3bf84f
3906 10:c562ddd9c94164376c20b86b0b4991636a3bf84f
3878 $ hg debugobsolete a00be79088084cb3aff086ab799f8790e01a976b
3907 $ hg debugobsolete a00be79088084cb3aff086ab799f8790e01a976b
3879 obsoleted 1 changesets
3908 obsoleted 1 changesets
3880 $ hg debugobsolete c5623987d205cd6d9d8389bfc40fff9dbb670b48
3909 $ hg debugobsolete c5623987d205cd6d9d8389bfc40fff9dbb670b48
3881 obsoleted 1 changesets
3910 obsoleted 1 changesets
3882 $ hg debugobsolete c562ddd9c94164376c20b86b0b4991636a3bf84f
3911 $ hg debugobsolete c562ddd9c94164376c20b86b0b4991636a3bf84f
3883 obsoleted 1 changesets
3912 obsoleted 1 changesets
3884
3913
3885 nodes starting with '11' (we don't have the revision number '11' though)
3914 nodes starting with '11' (we don't have the revision number '11' though)
3886
3915
3887 $ hg log -r 1:3 -T '{rev}:{shortest(node, 0)}\n'
3916 $ hg log -r 1:3 -T '{rev}:{shortest(node, 0)}\n'
3888 1:1142
3917 1:1142
3889 2:1140
3918 2:1140
3890 3:11d
3919 3:11d
3891
3920
3892 '5:a00' is hidden, but still we have two nodes starting with 'a0'
3921 '5:a00' is hidden, but still we have two nodes starting with 'a0'
3893
3922
3894 $ hg log -r 6:7 -T '{rev}:{shortest(node, 0)}\n'
3923 $ hg log -r 6:7 -T '{rev}:{shortest(node, 0)}\n'
3895 6:a0b
3924 6:a0b
3896 7:a04
3925 7:a04
3897
3926
3898 node '10' conflicts with the revision number '10' even if it is hidden
3927 node '10' conflicts with the revision number '10' even if it is hidden
3899 (we could exclude hidden revision numbers, but currently we don't)
3928 (we could exclude hidden revision numbers, but currently we don't)
3900
3929
3901 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n'
3930 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n'
3902 4:107
3931 4:107
3903 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
3932 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
3904 4:107
3933 4:107
3905
3934
3906 node 'c562' should be unique if the other 'c562' nodes are hidden
3935 node 'c562' should be unique if the other 'c562' nodes are hidden
3907 (but we don't try the slow path to filter out hidden nodes for now)
3936 (but we don't try the slow path to filter out hidden nodes for now)
3908
3937
3909 $ hg log -r 8 -T '{rev}:{node|shortest}\n'
3938 $ hg log -r 8 -T '{rev}:{node|shortest}\n'
3910 8:c5625
3939 8:c5625
3911 $ hg log -r 8:10 -T '{rev}:{node|shortest}\n' --hidden
3940 $ hg log -r 8:10 -T '{rev}:{node|shortest}\n' --hidden
3912 8:c5625
3941 8:c5625
3913 9:c5623
3942 9:c5623
3914 10:c562d
3943 10:c562d
3915
3944
3916 $ cd ..
3945 $ cd ..
3917
3946
3918 Test pad function
3947 Test pad function
3919
3948
3920 $ cd r
3949 $ cd r
3921
3950
3922 $ hg log --template '{pad(rev, 20)} {author|user}\n'
3951 $ hg log --template '{pad(rev, 20)} {author|user}\n'
3923 2 test
3952 2 test
3924 1 {node|short}
3953 1 {node|short}
3925 0 test
3954 0 test
3926
3955
3927 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
3956 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
3928 2 test
3957 2 test
3929 1 {node|short}
3958 1 {node|short}
3930 0 test
3959 0 test
3931
3960
3932 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
3961 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
3933 2------------------- test
3962 2------------------- test
3934 1------------------- {node|short}
3963 1------------------- {node|short}
3935 0------------------- test
3964 0------------------- test
3936
3965
3937 Test template string in pad function
3966 Test template string in pad function
3938
3967
3939 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
3968 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
3940 {0} test
3969 {0} test
3941
3970
3942 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
3971 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
3943 \{rev} test
3972 \{rev} test
3944
3973
3945 Test width argument passed to pad function
3974 Test width argument passed to pad function
3946
3975
3947 $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n'
3976 $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n'
3948 0 test
3977 0 test
3949 $ hg log -r 0 -T '{pad(rev, "not an int")}\n'
3978 $ hg log -r 0 -T '{pad(rev, "not an int")}\n'
3950 hg: parse error: pad() expects an integer width
3979 hg: parse error: pad() expects an integer width
3951 [255]
3980 [255]
3952
3981
3953 Test invalid fillchar passed to pad function
3982 Test invalid fillchar passed to pad function
3954
3983
3955 $ hg log -r 0 -T '{pad(rev, 10, "")}\n'
3984 $ hg log -r 0 -T '{pad(rev, 10, "")}\n'
3956 hg: parse error: pad() expects a single fill character
3985 hg: parse error: pad() expects a single fill character
3957 [255]
3986 [255]
3958 $ hg log -r 0 -T '{pad(rev, 10, "--")}\n'
3987 $ hg log -r 0 -T '{pad(rev, 10, "--")}\n'
3959 hg: parse error: pad() expects a single fill character
3988 hg: parse error: pad() expects a single fill character
3960 [255]
3989 [255]
3961
3990
3962 Test boolean argument passed to pad function
3991 Test boolean argument passed to pad function
3963
3992
3964 no crash
3993 no crash
3965
3994
3966 $ hg log -r 0 -T '{pad(rev, 10, "-", "f{"oo"}")}\n'
3995 $ hg log -r 0 -T '{pad(rev, 10, "-", "f{"oo"}")}\n'
3967 ---------0
3996 ---------0
3968
3997
3969 string/literal
3998 string/literal
3970
3999
3971 $ hg log -r 0 -T '{pad(rev, 10, "-", "false")}\n'
4000 $ hg log -r 0 -T '{pad(rev, 10, "-", "false")}\n'
3972 ---------0
4001 ---------0
3973 $ hg log -r 0 -T '{pad(rev, 10, "-", false)}\n'
4002 $ hg log -r 0 -T '{pad(rev, 10, "-", false)}\n'
3974 0---------
4003 0---------
3975 $ hg log -r 0 -T '{pad(rev, 10, "-", "")}\n'
4004 $ hg log -r 0 -T '{pad(rev, 10, "-", "")}\n'
3976 0---------
4005 0---------
3977
4006
3978 unknown keyword is evaluated to ''
4007 unknown keyword is evaluated to ''
3979
4008
3980 $ hg log -r 0 -T '{pad(rev, 10, "-", unknownkeyword)}\n'
4009 $ hg log -r 0 -T '{pad(rev, 10, "-", unknownkeyword)}\n'
3981 0---------
4010 0---------
3982
4011
3983 Test separate function
4012 Test separate function
3984
4013
3985 $ hg log -r 0 -T '{separate("-", "", "a", "b", "", "", "c", "")}\n'
4014 $ hg log -r 0 -T '{separate("-", "", "a", "b", "", "", "c", "")}\n'
3986 a-b-c
4015 a-b-c
3987 $ hg log -r 0 -T '{separate(" ", "{rev}:{node|short}", author|user, branch)}\n'
4016 $ hg log -r 0 -T '{separate(" ", "{rev}:{node|short}", author|user, branch)}\n'
3988 0:f7769ec2ab97 test default
4017 0:f7769ec2ab97 test default
3989 $ hg log -r 0 --color=always -T '{separate(" ", "a", label(red, "b"), "c", label(red, ""), "d")}\n'
4018 $ hg log -r 0 --color=always -T '{separate(" ", "a", label(red, "b"), "c", label(red, ""), "d")}\n'
3990 a \x1b[0;31mb\x1b[0m c d (esc)
4019 a \x1b[0;31mb\x1b[0m c d (esc)
3991
4020
3992 Test boolean expression/literal passed to if function
4021 Test boolean expression/literal passed to if function
3993
4022
3994 $ hg log -r 0 -T '{if(rev, "rev 0 is True")}\n'
4023 $ hg log -r 0 -T '{if(rev, "rev 0 is True")}\n'
3995 rev 0 is True
4024 rev 0 is True
3996 $ hg log -r 0 -T '{if(0, "literal 0 is True as well")}\n'
4025 $ hg log -r 0 -T '{if(0, "literal 0 is True as well")}\n'
3997 literal 0 is True as well
4026 literal 0 is True as well
3998 $ hg log -r 0 -T '{if("", "", "empty string is False")}\n'
4027 $ hg log -r 0 -T '{if("", "", "empty string is False")}\n'
3999 empty string is False
4028 empty string is False
4000 $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n'
4029 $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n'
4001 empty list is False
4030 empty list is False
4002 $ hg log -r 0 -T '{if(true, "true is True")}\n'
4031 $ hg log -r 0 -T '{if(true, "true is True")}\n'
4003 true is True
4032 true is True
4004 $ hg log -r 0 -T '{if(false, "", "false is False")}\n'
4033 $ hg log -r 0 -T '{if(false, "", "false is False")}\n'
4005 false is False
4034 false is False
4006 $ hg log -r 0 -T '{if("false", "non-empty string is True")}\n'
4035 $ hg log -r 0 -T '{if("false", "non-empty string is True")}\n'
4007 non-empty string is True
4036 non-empty string is True
4008
4037
4009 Test ifcontains function
4038 Test ifcontains function
4010
4039
4011 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
4040 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
4012 2 is in the string
4041 2 is in the string
4013 1 is not
4042 1 is not
4014 0 is in the string
4043 0 is in the string
4015
4044
4016 $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n'
4045 $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n'
4017 2 is in the string
4046 2 is in the string
4018 1 is not
4047 1 is not
4019 0 is in the string
4048 0 is in the string
4020
4049
4021 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
4050 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
4022 2 did not add a
4051 2 did not add a
4023 1 did not add a
4052 1 did not add a
4024 0 added a
4053 0 added a
4025
4054
4026 $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
4055 $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
4027 2 is parent of 1
4056 2 is parent of 1
4028 1
4057 1
4029 0
4058 0
4030
4059
4031 Test revset function
4060 Test revset function
4032
4061
4033 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
4062 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
4034 2 current rev
4063 2 current rev
4035 1 not current rev
4064 1 not current rev
4036 0 not current rev
4065 0 not current rev
4037
4066
4038 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
4067 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
4039 2 match rev
4068 2 match rev
4040 1 match rev
4069 1 match rev
4041 0 not match rev
4070 0 not match rev
4042
4071
4043 $ hg log -T '{ifcontains(desc, revset(":"), "", "type not match")}\n' -l1
4072 $ hg log -T '{ifcontains(desc, revset(":"), "", "type not match")}\n' -l1
4044 type not match
4073 type not match
4045
4074
4046 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
4075 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
4047 2 Parents: 1
4076 2 Parents: 1
4048 1 Parents: 0
4077 1 Parents: 0
4049 0 Parents:
4078 0 Parents:
4050
4079
4051 $ cat >> .hg/hgrc <<EOF
4080 $ cat >> .hg/hgrc <<EOF
4052 > [revsetalias]
4081 > [revsetalias]
4053 > myparents(\$1) = parents(\$1)
4082 > myparents(\$1) = parents(\$1)
4054 > EOF
4083 > EOF
4055 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
4084 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
4056 2 Parents: 1
4085 2 Parents: 1
4057 1 Parents: 0
4086 1 Parents: 0
4058 0 Parents:
4087 0 Parents:
4059
4088
4060 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
4089 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
4061 Rev: 2
4090 Rev: 2
4062 Ancestor: 0
4091 Ancestor: 0
4063 Ancestor: 1
4092 Ancestor: 1
4064 Ancestor: 2
4093 Ancestor: 2
4065
4094
4066 Rev: 1
4095 Rev: 1
4067 Ancestor: 0
4096 Ancestor: 0
4068 Ancestor: 1
4097 Ancestor: 1
4069
4098
4070 Rev: 0
4099 Rev: 0
4071 Ancestor: 0
4100 Ancestor: 0
4072
4101
4073 $ hg log --template '{revset("TIP"|lower)}\n' -l1
4102 $ hg log --template '{revset("TIP"|lower)}\n' -l1
4074 2
4103 2
4075
4104
4076 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1
4105 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1
4077 2
4106 2
4078
4107
4079 a list template is evaluated for each item of revset/parents
4108 a list template is evaluated for each item of revset/parents
4080
4109
4081 $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
4110 $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
4082 2 p: 1:bcc7ff960b8e
4111 2 p: 1:bcc7ff960b8e
4083 1 p: 0:f7769ec2ab97
4112 1 p: 0:f7769ec2ab97
4084 0 p:
4113 0 p:
4085
4114
4086 $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
4115 $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
4087 2 p: 1:bcc7ff960b8e -1:000000000000
4116 2 p: 1:bcc7ff960b8e -1:000000000000
4088 1 p: 0:f7769ec2ab97 -1:000000000000
4117 1 p: 0:f7769ec2ab97 -1:000000000000
4089 0 p: -1:000000000000 -1:000000000000
4118 0 p: -1:000000000000 -1:000000000000
4090
4119
4091 therefore, 'revcache' should be recreated for each rev
4120 therefore, 'revcache' should be recreated for each rev
4092
4121
4093 $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
4122 $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
4094 2 aa b
4123 2 aa b
4095 p
4124 p
4096 1
4125 1
4097 p a
4126 p a
4098 0 a
4127 0 a
4099 p
4128 p
4100
4129
4101 $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
4130 $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
4102 2 aa b
4131 2 aa b
4103 p
4132 p
4104 1
4133 1
4105 p a
4134 p a
4106 0 a
4135 0 a
4107 p
4136 p
4108
4137
4109 a revset item must be evaluated as an integer revision, not an offset from tip
4138 a revset item must be evaluated as an integer revision, not an offset from tip
4110
4139
4111 $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'
4140 $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'
4112 -1:000000000000
4141 -1:000000000000
4113 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n'
4142 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n'
4114 -1:000000000000
4143 -1:000000000000
4115
4144
4116 join() should pick '{rev}' from revset items:
4145 join() should pick '{rev}' from revset items:
4117
4146
4118 $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6
4147 $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6
4119 4, 5
4148 4, 5
4120
4149
4121 on the other hand, parents are formatted as '{rev}:{node|formatnode}' by
4150 on the other hand, parents are formatted as '{rev}:{node|formatnode}' by
4122 default. join() should agree with the default formatting:
4151 default. join() should agree with the default formatting:
4123
4152
4124 $ hg log -R ../a -T '{join(parents, ", ")}\n' -r6
4153 $ hg log -R ../a -T '{join(parents, ", ")}\n' -r6
4125 5:13207e5a10d9, 4:bbe44766e73d
4154 5:13207e5a10d9, 4:bbe44766e73d
4126
4155
4127 $ hg log -R ../a -T '{join(parents, ",\n")}\n' -r6 --debug
4156 $ hg log -R ../a -T '{join(parents, ",\n")}\n' -r6 --debug
4128 5:13207e5a10d9fd28ec424934298e176197f2c67f,
4157 5:13207e5a10d9fd28ec424934298e176197f2c67f,
4129 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
4158 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
4130
4159
4131 Invalid arguments passed to revset()
4160 Invalid arguments passed to revset()
4132
4161
4133 $ hg log -T '{revset("%whatever", 0)}\n'
4162 $ hg log -T '{revset("%whatever", 0)}\n'
4134 hg: parse error: unexpected revspec format character w
4163 hg: parse error: unexpected revspec format character w
4135 [255]
4164 [255]
4136 $ hg log -T '{revset("%lwhatever", files)}\n'
4165 $ hg log -T '{revset("%lwhatever", files)}\n'
4137 hg: parse error: unexpected revspec format character w
4166 hg: parse error: unexpected revspec format character w
4138 [255]
4167 [255]
4139 $ hg log -T '{revset("%s %s", 0)}\n'
4168 $ hg log -T '{revset("%s %s", 0)}\n'
4140 hg: parse error: missing argument for revspec
4169 hg: parse error: missing argument for revspec
4141 [255]
4170 [255]
4142 $ hg log -T '{revset("", 0)}\n'
4171 $ hg log -T '{revset("", 0)}\n'
4143 hg: parse error: too many revspec arguments specified
4172 hg: parse error: too many revspec arguments specified
4144 [255]
4173 [255]
4145 $ hg log -T '{revset("%s", 0, 1)}\n'
4174 $ hg log -T '{revset("%s", 0, 1)}\n'
4146 hg: parse error: too many revspec arguments specified
4175 hg: parse error: too many revspec arguments specified
4147 [255]
4176 [255]
4148 $ hg log -T '{revset("%", 0)}\n'
4177 $ hg log -T '{revset("%", 0)}\n'
4149 hg: parse error: incomplete revspec format character
4178 hg: parse error: incomplete revspec format character
4150 [255]
4179 [255]
4151 $ hg log -T '{revset("%l", 0)}\n'
4180 $ hg log -T '{revset("%l", 0)}\n'
4152 hg: parse error: incomplete revspec format character
4181 hg: parse error: incomplete revspec format character
4153 [255]
4182 [255]
4154 $ hg log -T '{revset("%d", 'foo')}\n'
4183 $ hg log -T '{revset("%d", 'foo')}\n'
4155 hg: parse error: invalid argument for revspec
4184 hg: parse error: invalid argument for revspec
4156 [255]
4185 [255]
4157 $ hg log -T '{revset("%ld", files)}\n'
4186 $ hg log -T '{revset("%ld", files)}\n'
4158 hg: parse error: invalid argument for revspec
4187 hg: parse error: invalid argument for revspec
4159 [255]
4188 [255]
4160 $ hg log -T '{revset("%ls", 0)}\n'
4189 $ hg log -T '{revset("%ls", 0)}\n'
4161 hg: parse error: invalid argument for revspec
4190 hg: parse error: invalid argument for revspec
4162 [255]
4191 [255]
4163 $ hg log -T '{revset("%b", 'foo')}\n'
4192 $ hg log -T '{revset("%b", 'foo')}\n'
4164 hg: parse error: invalid argument for revspec
4193 hg: parse error: invalid argument for revspec
4165 [255]
4194 [255]
4166 $ hg log -T '{revset("%lb", files)}\n'
4195 $ hg log -T '{revset("%lb", files)}\n'
4167 hg: parse error: invalid argument for revspec
4196 hg: parse error: invalid argument for revspec
4168 [255]
4197 [255]
4169 $ hg log -T '{revset("%r", 0)}\n'
4198 $ hg log -T '{revset("%r", 0)}\n'
4170 hg: parse error: invalid argument for revspec
4199 hg: parse error: invalid argument for revspec
4171 [255]
4200 [255]
4172
4201
4173 Test files function
4202 Test files function
4174
4203
4175 $ hg log -T "{rev}\n{join(files('*'), '\n')}\n"
4204 $ hg log -T "{rev}\n{join(files('*'), '\n')}\n"
4176 2
4205 2
4177 a
4206 a
4178 aa
4207 aa
4179 b
4208 b
4180 1
4209 1
4181 a
4210 a
4182 0
4211 0
4183 a
4212 a
4184
4213
4185 $ hg log -T "{rev}\n{join(files('aa'), '\n')}\n"
4214 $ hg log -T "{rev}\n{join(files('aa'), '\n')}\n"
4186 2
4215 2
4187 aa
4216 aa
4188 1
4217 1
4189
4218
4190 0
4219 0
4191
4220
4192
4221
4193 Test relpath function
4222 Test relpath function
4194
4223
4195 $ hg log -r0 -T '{files % "{file|relpath}\n"}'
4224 $ hg log -r0 -T '{files % "{file|relpath}\n"}'
4196 a
4225 a
4197 $ cd ..
4226 $ cd ..
4198 $ hg log -R r -r0 -T '{files % "{file|relpath}\n"}'
4227 $ hg log -R r -r0 -T '{files % "{file|relpath}\n"}'
4199 r/a
4228 r/a
4200 $ cd r
4229 $ cd r
4201
4230
4202 Test active bookmark templating
4231 Test active bookmark templating
4203
4232
4204 $ hg book foo
4233 $ hg book foo
4205 $ hg book bar
4234 $ hg book bar
4206 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
4235 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
4207 2 bar* foo
4236 2 bar* foo
4208 1
4237 1
4209 0
4238 0
4210 $ hg log --template "{rev} {activebookmark}\n"
4239 $ hg log --template "{rev} {activebookmark}\n"
4211 2 bar
4240 2 bar
4212 1
4241 1
4213 0
4242 0
4214 $ hg bookmarks --inactive bar
4243 $ hg bookmarks --inactive bar
4215 $ hg log --template "{rev} {activebookmark}\n"
4244 $ hg log --template "{rev} {activebookmark}\n"
4216 2
4245 2
4217 1
4246 1
4218 0
4247 0
4219 $ hg book -r1 baz
4248 $ hg book -r1 baz
4220 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
4249 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
4221 2 bar foo
4250 2 bar foo
4222 1 baz
4251 1 baz
4223 0
4252 0
4224 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
4253 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
4225 2 t
4254 2 t
4226 1 f
4255 1 f
4227 0 f
4256 0 f
4228
4257
4229 Test namespaces dict
4258 Test namespaces dict
4230
4259
4231 $ hg --config extensions.revnamesext=$TESTDIR/revnamesext.py log -T '{rev}\n{namespaces % " {namespace} color={colorname} builtin={builtin}\n {join(names, ",")}\n"}\n'
4260 $ hg --config extensions.revnamesext=$TESTDIR/revnamesext.py log -T '{rev}\n{namespaces % " {namespace} color={colorname} builtin={builtin}\n {join(names, ",")}\n"}\n'
4232 2
4261 2
4233 bookmarks color=bookmark builtin=True
4262 bookmarks color=bookmark builtin=True
4234 bar,foo
4263 bar,foo
4235 tags color=tag builtin=True
4264 tags color=tag builtin=True
4236 tip
4265 tip
4237 branches color=branch builtin=True
4266 branches color=branch builtin=True
4238 text.{rev}
4267 text.{rev}
4239 revnames color=revname builtin=False
4268 revnames color=revname builtin=False
4240 r2
4269 r2
4241
4270
4242 1
4271 1
4243 bookmarks color=bookmark builtin=True
4272 bookmarks color=bookmark builtin=True
4244 baz
4273 baz
4245 tags color=tag builtin=True
4274 tags color=tag builtin=True
4246
4275
4247 branches color=branch builtin=True
4276 branches color=branch builtin=True
4248 text.{rev}
4277 text.{rev}
4249 revnames color=revname builtin=False
4278 revnames color=revname builtin=False
4250 r1
4279 r1
4251
4280
4252 0
4281 0
4253 bookmarks color=bookmark builtin=True
4282 bookmarks color=bookmark builtin=True
4254
4283
4255 tags color=tag builtin=True
4284 tags color=tag builtin=True
4256
4285
4257 branches color=branch builtin=True
4286 branches color=branch builtin=True
4258 default
4287 default
4259 revnames color=revname builtin=False
4288 revnames color=revname builtin=False
4260 r0
4289 r0
4261
4290
4262 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}'
4291 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}'
4263 bookmarks: bar foo
4292 bookmarks: bar foo
4264 tags: tip
4293 tags: tip
4265 branches: text.{rev}
4294 branches: text.{rev}
4266 $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}'
4295 $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}'
4267 bookmarks:
4296 bookmarks:
4268 bar
4297 bar
4269 foo
4298 foo
4270 tags:
4299 tags:
4271 tip
4300 tip
4272 branches:
4301 branches:
4273 text.{rev}
4302 text.{rev}
4274 $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}'
4303 $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}'
4275 bar
4304 bar
4276 foo
4305 foo
4277 $ hg log -r2 -T '{namespaces.bookmarks % "{bookmark}\n"}'
4306 $ hg log -r2 -T '{namespaces.bookmarks % "{bookmark}\n"}'
4278 bar
4307 bar
4279 foo
4308 foo
4280
4309
4281 Test stringify on sub expressions
4310 Test stringify on sub expressions
4282
4311
4283 $ cd ..
4312 $ cd ..
4284 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
4313 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
4285 fourth, second, third
4314 fourth, second, third
4286 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
4315 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
4287 abc
4316 abc
4288
4317
4289 Test splitlines
4318 Test splitlines
4290
4319
4291 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
4320 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
4292 @ foo Modify, add, remove, rename
4321 @ foo Modify, add, remove, rename
4293 |
4322 |
4294 o foo future
4323 o foo future
4295 |
4324 |
4296 o foo third
4325 o foo third
4297 |
4326 |
4298 o foo second
4327 o foo second
4299
4328
4300 o foo merge
4329 o foo merge
4301 |\
4330 |\
4302 | o foo new head
4331 | o foo new head
4303 | |
4332 | |
4304 o | foo new branch
4333 o | foo new branch
4305 |/
4334 |/
4306 o foo no user, no domain
4335 o foo no user, no domain
4307 |
4336 |
4308 o foo no person
4337 o foo no person
4309 |
4338 |
4310 o foo other 1
4339 o foo other 1
4311 | foo other 2
4340 | foo other 2
4312 | foo
4341 | foo
4313 | foo other 3
4342 | foo other 3
4314 o foo line 1
4343 o foo line 1
4315 foo line 2
4344 foo line 2
4316
4345
4317 $ hg log -R a -r0 -T '{desc|splitlines}\n'
4346 $ hg log -R a -r0 -T '{desc|splitlines}\n'
4318 line 1 line 2
4347 line 1 line 2
4319 $ hg log -R a -r0 -T '{join(desc|splitlines, "|")}\n'
4348 $ hg log -R a -r0 -T '{join(desc|splitlines, "|")}\n'
4320 line 1|line 2
4349 line 1|line 2
4321
4350
4322 Test startswith
4351 Test startswith
4323 $ hg log -Gv -R a --template "{startswith(desc)}"
4352 $ hg log -Gv -R a --template "{startswith(desc)}"
4324 hg: parse error: startswith expects two arguments
4353 hg: parse error: startswith expects two arguments
4325 [255]
4354 [255]
4326
4355
4327 $ hg log -Gv -R a --template "{startswith('line', desc)}"
4356 $ hg log -Gv -R a --template "{startswith('line', desc)}"
4328 @
4357 @
4329 |
4358 |
4330 o
4359 o
4331 |
4360 |
4332 o
4361 o
4333 |
4362 |
4334 o
4363 o
4335
4364
4336 o
4365 o
4337 |\
4366 |\
4338 | o
4367 | o
4339 | |
4368 | |
4340 o |
4369 o |
4341 |/
4370 |/
4342 o
4371 o
4343 |
4372 |
4344 o
4373 o
4345 |
4374 |
4346 o
4375 o
4347 |
4376 |
4348 o line 1
4377 o line 1
4349 line 2
4378 line 2
4350
4379
4351 Test bad template with better error message
4380 Test bad template with better error message
4352
4381
4353 $ hg log -Gv -R a --template '{desc|user()}'
4382 $ hg log -Gv -R a --template '{desc|user()}'
4354 hg: parse error: expected a symbol, got 'func'
4383 hg: parse error: expected a symbol, got 'func'
4355 [255]
4384 [255]
4356
4385
4357 Test word function (including index out of bounds graceful failure)
4386 Test word function (including index out of bounds graceful failure)
4358
4387
4359 $ hg log -Gv -R a --template "{word('1', desc)}"
4388 $ hg log -Gv -R a --template "{word('1', desc)}"
4360 @ add,
4389 @ add,
4361 |
4390 |
4362 o
4391 o
4363 |
4392 |
4364 o
4393 o
4365 |
4394 |
4366 o
4395 o
4367
4396
4368 o
4397 o
4369 |\
4398 |\
4370 | o head
4399 | o head
4371 | |
4400 | |
4372 o | branch
4401 o | branch
4373 |/
4402 |/
4374 o user,
4403 o user,
4375 |
4404 |
4376 o person
4405 o person
4377 |
4406 |
4378 o 1
4407 o 1
4379 |
4408 |
4380 o 1
4409 o 1
4381
4410
4382
4411
4383 Test word third parameter used as splitter
4412 Test word third parameter used as splitter
4384
4413
4385 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
4414 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
4386 @ M
4415 @ M
4387 |
4416 |
4388 o future
4417 o future
4389 |
4418 |
4390 o third
4419 o third
4391 |
4420 |
4392 o sec
4421 o sec
4393
4422
4394 o merge
4423 o merge
4395 |\
4424 |\
4396 | o new head
4425 | o new head
4397 | |
4426 | |
4398 o | new branch
4427 o | new branch
4399 |/
4428 |/
4400 o n
4429 o n
4401 |
4430 |
4402 o n
4431 o n
4403 |
4432 |
4404 o
4433 o
4405 |
4434 |
4406 o line 1
4435 o line 1
4407 line 2
4436 line 2
4408
4437
4409 Test word error messages for not enough and too many arguments
4438 Test word error messages for not enough and too many arguments
4410
4439
4411 $ hg log -Gv -R a --template "{word('0')}"
4440 $ hg log -Gv -R a --template "{word('0')}"
4412 hg: parse error: word expects two or three arguments, got 1
4441 hg: parse error: word expects two or three arguments, got 1
4413 [255]
4442 [255]
4414
4443
4415 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
4444 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
4416 hg: parse error: word expects two or three arguments, got 7
4445 hg: parse error: word expects two or three arguments, got 7
4417 [255]
4446 [255]
4418
4447
4419 Test word for integer literal
4448 Test word for integer literal
4420
4449
4421 $ hg log -R a --template "{word(2, desc)}\n" -r0
4450 $ hg log -R a --template "{word(2, desc)}\n" -r0
4422 line
4451 line
4423
4452
4424 Test word for invalid numbers
4453 Test word for invalid numbers
4425
4454
4426 $ hg log -Gv -R a --template "{word('a', desc)}"
4455 $ hg log -Gv -R a --template "{word('a', desc)}"
4427 hg: parse error: word expects an integer index
4456 hg: parse error: word expects an integer index
4428 [255]
4457 [255]
4429
4458
4430 Test word for out of range
4459 Test word for out of range
4431
4460
4432 $ hg log -R a --template "{word(10000, desc)}"
4461 $ hg log -R a --template "{word(10000, desc)}"
4433 $ hg log -R a --template "{word(-10000, desc)}"
4462 $ hg log -R a --template "{word(-10000, desc)}"
4434
4463
4435 Test indent and not adding to empty lines
4464 Test indent and not adding to empty lines
4436
4465
4437 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
4466 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
4438 -----
4467 -----
4439 > line 1
4468 > line 1
4440 >> line 2
4469 >> line 2
4441 -----
4470 -----
4442 > other 1
4471 > other 1
4443 >> other 2
4472 >> other 2
4444
4473
4445 >> other 3
4474 >> other 3
4446
4475
4447 Test with non-strings like dates
4476 Test with non-strings like dates
4448
4477
4449 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
4478 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
4450 1200000.00
4479 1200000.00
4451 1300000.00
4480 1300000.00
4452
4481
4453 Test broken string escapes:
4482 Test broken string escapes:
4454
4483
4455 $ hg log -T "bogus\\" -R a
4484 $ hg log -T "bogus\\" -R a
4456 hg: parse error: trailing \ in string
4485 hg: parse error: trailing \ in string
4457 [255]
4486 [255]
4458 $ hg log -T "\\xy" -R a
4487 $ hg log -T "\\xy" -R a
4459 hg: parse error: invalid \x escape* (glob)
4488 hg: parse error: invalid \x escape* (glob)
4460 [255]
4489 [255]
4461
4490
4462 json filter should escape HTML tags so that the output can be embedded in hgweb:
4491 json filter should escape HTML tags so that the output can be embedded in hgweb:
4463
4492
4464 $ hg log -T "{'<foo@example.org>'|json}\n" -R a -l1
4493 $ hg log -T "{'<foo@example.org>'|json}\n" -R a -l1
4465 "\u003cfoo@example.org\u003e"
4494 "\u003cfoo@example.org\u003e"
4466
4495
4467 Templater supports aliases of symbol and func() styles:
4496 Templater supports aliases of symbol and func() styles:
4468
4497
4469 $ hg clone -q a aliases
4498 $ hg clone -q a aliases
4470 $ cd aliases
4499 $ cd aliases
4471 $ cat <<EOF >> .hg/hgrc
4500 $ cat <<EOF >> .hg/hgrc
4472 > [templatealias]
4501 > [templatealias]
4473 > r = rev
4502 > r = rev
4474 > rn = "{r}:{node|short}"
4503 > rn = "{r}:{node|short}"
4475 > status(c, files) = files % "{c} {file}\n"
4504 > status(c, files) = files % "{c} {file}\n"
4476 > utcdate(d) = localdate(d, "UTC")
4505 > utcdate(d) = localdate(d, "UTC")
4477 > EOF
4506 > EOF
4478
4507
4479 $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n'
4508 $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n'
4480 (template
4509 (template
4481 (symbol 'rn')
4510 (symbol 'rn')
4482 (string ' ')
4511 (string ' ')
4483 (|
4512 (|
4484 (func
4513 (func
4485 (symbol 'utcdate')
4514 (symbol 'utcdate')
4486 (symbol 'date'))
4515 (symbol 'date'))
4487 (symbol 'isodate'))
4516 (symbol 'isodate'))
4488 (string '\n'))
4517 (string '\n'))
4489 * expanded:
4518 * expanded:
4490 (template
4519 (template
4491 (template
4520 (template
4492 (symbol 'rev')
4521 (symbol 'rev')
4493 (string ':')
4522 (string ':')
4494 (|
4523 (|
4495 (symbol 'node')
4524 (symbol 'node')
4496 (symbol 'short')))
4525 (symbol 'short')))
4497 (string ' ')
4526 (string ' ')
4498 (|
4527 (|
4499 (func
4528 (func
4500 (symbol 'localdate')
4529 (symbol 'localdate')
4501 (list
4530 (list
4502 (symbol 'date')
4531 (symbol 'date')
4503 (string 'UTC')))
4532 (string 'UTC')))
4504 (symbol 'isodate'))
4533 (symbol 'isodate'))
4505 (string '\n'))
4534 (string '\n'))
4506 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4535 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4507
4536
4508 $ hg debugtemplate -vr0 '{status("A", file_adds)}'
4537 $ hg debugtemplate -vr0 '{status("A", file_adds)}'
4509 (template
4538 (template
4510 (func
4539 (func
4511 (symbol 'status')
4540 (symbol 'status')
4512 (list
4541 (list
4513 (string 'A')
4542 (string 'A')
4514 (symbol 'file_adds'))))
4543 (symbol 'file_adds'))))
4515 * expanded:
4544 * expanded:
4516 (template
4545 (template
4517 (%
4546 (%
4518 (symbol 'file_adds')
4547 (symbol 'file_adds')
4519 (template
4548 (template
4520 (string 'A')
4549 (string 'A')
4521 (string ' ')
4550 (string ' ')
4522 (symbol 'file')
4551 (symbol 'file')
4523 (string '\n'))))
4552 (string '\n'))))
4524 A a
4553 A a
4525
4554
4526 A unary function alias can be called as a filter:
4555 A unary function alias can be called as a filter:
4527
4556
4528 $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n'
4557 $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n'
4529 (template
4558 (template
4530 (|
4559 (|
4531 (|
4560 (|
4532 (symbol 'date')
4561 (symbol 'date')
4533 (symbol 'utcdate'))
4562 (symbol 'utcdate'))
4534 (symbol 'isodate'))
4563 (symbol 'isodate'))
4535 (string '\n'))
4564 (string '\n'))
4536 * expanded:
4565 * expanded:
4537 (template
4566 (template
4538 (|
4567 (|
4539 (func
4568 (func
4540 (symbol 'localdate')
4569 (symbol 'localdate')
4541 (list
4570 (list
4542 (symbol 'date')
4571 (symbol 'date')
4543 (string 'UTC')))
4572 (string 'UTC')))
4544 (symbol 'isodate'))
4573 (symbol 'isodate'))
4545 (string '\n'))
4574 (string '\n'))
4546 1970-01-12 13:46 +0000
4575 1970-01-12 13:46 +0000
4547
4576
4548 Aliases should be applied only to command arguments and templates in hgrc.
4577 Aliases should be applied only to command arguments and templates in hgrc.
4549 Otherwise, our stock styles and web templates could be corrupted:
4578 Otherwise, our stock styles and web templates could be corrupted:
4550
4579
4551 $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n'
4580 $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n'
4552 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4581 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4553
4582
4554 $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"'
4583 $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"'
4555 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4584 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4556
4585
4557 $ cat <<EOF > tmpl
4586 $ cat <<EOF > tmpl
4558 > changeset = 'nothing expanded:{rn}\n'
4587 > changeset = 'nothing expanded:{rn}\n'
4559 > EOF
4588 > EOF
4560 $ hg log -r0 --style ./tmpl
4589 $ hg log -r0 --style ./tmpl
4561 nothing expanded:
4590 nothing expanded:
4562
4591
4563 Aliases in formatter:
4592 Aliases in formatter:
4564
4593
4565 $ hg branches -T '{pad(branch, 7)} {rn}\n'
4594 $ hg branches -T '{pad(branch, 7)} {rn}\n'
4566 default 6:d41e714fe50d
4595 default 6:d41e714fe50d
4567 foo 4:bbe44766e73d
4596 foo 4:bbe44766e73d
4568
4597
4569 Aliases should honor HGPLAIN:
4598 Aliases should honor HGPLAIN:
4570
4599
4571 $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n'
4600 $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n'
4572 nothing expanded:
4601 nothing expanded:
4573 $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n'
4602 $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n'
4574 0:1e4e1b8f71e0
4603 0:1e4e1b8f71e0
4575
4604
4576 Unparsable alias:
4605 Unparsable alias:
4577
4606
4578 $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}'
4607 $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}'
4579 (template
4608 (template
4580 (symbol 'bad'))
4609 (symbol 'bad'))
4581 abort: bad definition of template alias "bad": at 2: not a prefix: end
4610 abort: bad definition of template alias "bad": at 2: not a prefix: end
4582 [255]
4611 [255]
4583 $ hg log --config templatealias.bad='x(' -T '{bad}'
4612 $ hg log --config templatealias.bad='x(' -T '{bad}'
4584 abort: bad definition of template alias "bad": at 2: not a prefix: end
4613 abort: bad definition of template alias "bad": at 2: not a prefix: end
4585 [255]
4614 [255]
4586
4615
4587 $ cd ..
4616 $ cd ..
4588
4617
4589 Set up repository for non-ascii encoding tests:
4618 Set up repository for non-ascii encoding tests:
4590
4619
4591 $ hg init nonascii
4620 $ hg init nonascii
4592 $ cd nonascii
4621 $ cd nonascii
4593 $ $PYTHON <<EOF
4622 $ $PYTHON <<EOF
4594 > open('latin1', 'wb').write(b'\xe9')
4623 > open('latin1', 'wb').write(b'\xe9')
4595 > open('utf-8', 'wb').write(b'\xc3\xa9')
4624 > open('utf-8', 'wb').write(b'\xc3\xa9')
4596 > EOF
4625 > EOF
4597 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
4626 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
4598 $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8
4627 $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8
4599
4628
4600 json filter should try round-trip conversion to utf-8:
4629 json filter should try round-trip conversion to utf-8:
4601
4630
4602 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
4631 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
4603 "\u00e9"
4632 "\u00e9"
4604 $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0
4633 $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0
4605 "non-ascii branch: \u00e9"
4634 "non-ascii branch: \u00e9"
4606
4635
4607 json filter takes input as utf-8b:
4636 json filter takes input as utf-8b:
4608
4637
4609 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
4638 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
4610 "\u00e9"
4639 "\u00e9"
4611 $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1
4640 $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1
4612 "\udce9"
4641 "\udce9"
4613
4642
4614 utf8 filter:
4643 utf8 filter:
4615
4644
4616 $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0
4645 $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0
4617 round-trip: c3a9
4646 round-trip: c3a9
4618 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1
4647 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1
4619 decoded: c3a9
4648 decoded: c3a9
4620 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1
4649 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1
4621 abort: decoding near * (glob)
4650 abort: decoding near * (glob)
4622 [255]
4651 [255]
4623 $ hg log -T "invalid type: {rev|utf8}\n" -r0
4652 $ hg log -T "invalid type: {rev|utf8}\n" -r0
4624 abort: template filter 'utf8' is not compatible with keyword 'rev'
4653 abort: template filter 'utf8' is not compatible with keyword 'rev'
4625 [255]
4654 [255]
4626
4655
4627 pad width:
4656 pad width:
4628
4657
4629 $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n"
4658 $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n"
4630 \xc3\xa9- (esc)
4659 \xc3\xa9- (esc)
4631
4660
4632 $ cd ..
4661 $ cd ..
4633
4662
4634 Test that template function in extension is registered as expected
4663 Test that template function in extension is registered as expected
4635
4664
4636 $ cd a
4665 $ cd a
4637
4666
4638 $ cat <<EOF > $TESTTMP/customfunc.py
4667 $ cat <<EOF > $TESTTMP/customfunc.py
4639 > from mercurial import registrar
4668 > from mercurial import registrar
4640 >
4669 >
4641 > templatefunc = registrar.templatefunc()
4670 > templatefunc = registrar.templatefunc()
4642 >
4671 >
4643 > @templatefunc(b'custom()')
4672 > @templatefunc(b'custom()')
4644 > def custom(context, mapping, args):
4673 > def custom(context, mapping, args):
4645 > return b'custom'
4674 > return b'custom'
4646 > EOF
4675 > EOF
4647 $ cat <<EOF > .hg/hgrc
4676 $ cat <<EOF > .hg/hgrc
4648 > [extensions]
4677 > [extensions]
4649 > customfunc = $TESTTMP/customfunc.py
4678 > customfunc = $TESTTMP/customfunc.py
4650 > EOF
4679 > EOF
4651
4680
4652 $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true
4681 $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true
4653 custom
4682 custom
4654
4683
4655 $ cd ..
4684 $ cd ..
4656
4685
4657 Test 'graphwidth' in 'hg log' on various topologies. The key here is that the
4686 Test 'graphwidth' in 'hg log' on various topologies. The key here is that the
4658 printed graphwidths 3, 5, 7, etc. should all line up in their respective
4687 printed graphwidths 3, 5, 7, etc. should all line up in their respective
4659 columns. We don't care about other aspects of the graph rendering here.
4688 columns. We don't care about other aspects of the graph rendering here.
4660
4689
4661 $ hg init graphwidth
4690 $ hg init graphwidth
4662 $ cd graphwidth
4691 $ cd graphwidth
4663
4692
4664 $ wrappabletext="a a a a a a a a a a a a"
4693 $ wrappabletext="a a a a a a a a a a a a"
4665
4694
4666 $ printf "first\n" > file
4695 $ printf "first\n" > file
4667 $ hg add file
4696 $ hg add file
4668 $ hg commit -m "$wrappabletext"
4697 $ hg commit -m "$wrappabletext"
4669
4698
4670 $ printf "first\nsecond\n" > file
4699 $ printf "first\nsecond\n" > file
4671 $ hg commit -m "$wrappabletext"
4700 $ hg commit -m "$wrappabletext"
4672
4701
4673 $ hg checkout 0
4702 $ hg checkout 0
4674 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4703 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4675 $ printf "third\nfirst\n" > file
4704 $ printf "third\nfirst\n" > file
4676 $ hg commit -m "$wrappabletext"
4705 $ hg commit -m "$wrappabletext"
4677 created new head
4706 created new head
4678
4707
4679 $ hg merge
4708 $ hg merge
4680 merging file
4709 merging file
4681 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
4710 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
4682 (branch merge, don't forget to commit)
4711 (branch merge, don't forget to commit)
4683
4712
4684 $ hg log --graph -T "{graphwidth}"
4713 $ hg log --graph -T "{graphwidth}"
4685 @ 3
4714 @ 3
4686 |
4715 |
4687 | @ 5
4716 | @ 5
4688 |/
4717 |/
4689 o 3
4718 o 3
4690
4719
4691 $ hg commit -m "$wrappabletext"
4720 $ hg commit -m "$wrappabletext"
4692
4721
4693 $ hg log --graph -T "{graphwidth}"
4722 $ hg log --graph -T "{graphwidth}"
4694 @ 5
4723 @ 5
4695 |\
4724 |\
4696 | o 5
4725 | o 5
4697 | |
4726 | |
4698 o | 5
4727 o | 5
4699 |/
4728 |/
4700 o 3
4729 o 3
4701
4730
4702
4731
4703 $ hg checkout 0
4732 $ hg checkout 0
4704 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4733 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4705 $ printf "third\nfirst\nsecond\n" > file
4734 $ printf "third\nfirst\nsecond\n" > file
4706 $ hg commit -m "$wrappabletext"
4735 $ hg commit -m "$wrappabletext"
4707 created new head
4736 created new head
4708
4737
4709 $ hg log --graph -T "{graphwidth}"
4738 $ hg log --graph -T "{graphwidth}"
4710 @ 3
4739 @ 3
4711 |
4740 |
4712 | o 7
4741 | o 7
4713 | |\
4742 | |\
4714 +---o 7
4743 +---o 7
4715 | |
4744 | |
4716 | o 5
4745 | o 5
4717 |/
4746 |/
4718 o 3
4747 o 3
4719
4748
4720
4749
4721 $ hg log --graph -T "{graphwidth}" -r 3
4750 $ hg log --graph -T "{graphwidth}" -r 3
4722 o 5
4751 o 5
4723 |\
4752 |\
4724 ~ ~
4753 ~ ~
4725
4754
4726 $ hg log --graph -T "{graphwidth}" -r 1
4755 $ hg log --graph -T "{graphwidth}" -r 1
4727 o 3
4756 o 3
4728 |
4757 |
4729 ~
4758 ~
4730
4759
4731 $ hg merge
4760 $ hg merge
4732 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4761 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4733 (branch merge, don't forget to commit)
4762 (branch merge, don't forget to commit)
4734 $ hg commit -m "$wrappabletext"
4763 $ hg commit -m "$wrappabletext"
4735
4764
4736 $ printf "seventh\n" >> file
4765 $ printf "seventh\n" >> file
4737 $ hg commit -m "$wrappabletext"
4766 $ hg commit -m "$wrappabletext"
4738
4767
4739 $ hg log --graph -T "{graphwidth}"
4768 $ hg log --graph -T "{graphwidth}"
4740 @ 3
4769 @ 3
4741 |
4770 |
4742 o 5
4771 o 5
4743 |\
4772 |\
4744 | o 5
4773 | o 5
4745 | |
4774 | |
4746 o | 7
4775 o | 7
4747 |\ \
4776 |\ \
4748 | o | 7
4777 | o | 7
4749 | |/
4778 | |/
4750 o / 5
4779 o / 5
4751 |/
4780 |/
4752 o 3
4781 o 3
4753
4782
4754
4783
4755 The point of graphwidth is to allow wrapping that accounts for the space taken
4784 The point of graphwidth is to allow wrapping that accounts for the space taken
4756 by the graph.
4785 by the graph.
4757
4786
4758 $ COLUMNS=10 hg log --graph -T "{fill(desc, termwidth - graphwidth)}"
4787 $ COLUMNS=10 hg log --graph -T "{fill(desc, termwidth - graphwidth)}"
4759 @ a a a a
4788 @ a a a a
4760 | a a a a
4789 | a a a a
4761 | a a a a
4790 | a a a a
4762 o a a a
4791 o a a a
4763 |\ a a a
4792 |\ a a a
4764 | | a a a
4793 | | a a a
4765 | | a a a
4794 | | a a a
4766 | o a a a
4795 | o a a a
4767 | | a a a
4796 | | a a a
4768 | | a a a
4797 | | a a a
4769 | | a a a
4798 | | a a a
4770 o | a a
4799 o | a a
4771 |\ \ a a
4800 |\ \ a a
4772 | | | a a
4801 | | | a a
4773 | | | a a
4802 | | | a a
4774 | | | a a
4803 | | | a a
4775 | | | a a
4804 | | | a a
4776 | o | a a
4805 | o | a a
4777 | |/ a a
4806 | |/ a a
4778 | | a a
4807 | | a a
4779 | | a a
4808 | | a a
4780 | | a a
4809 | | a a
4781 | | a a
4810 | | a a
4782 o | a a a
4811 o | a a a
4783 |/ a a a
4812 |/ a a a
4784 | a a a
4813 | a a a
4785 | a a a
4814 | a a a
4786 o a a a a
4815 o a a a a
4787 a a a a
4816 a a a a
4788 a a a a
4817 a a a a
4789
4818
4790 Something tricky happens when there are elided nodes; the next drawn row of
4819 Something tricky happens when there are elided nodes; the next drawn row of
4791 edges can be more than one column wider, but the graph width only increases by
4820 edges can be more than one column wider, but the graph width only increases by
4792 one column. The remaining columns are added in between the nodes.
4821 one column. The remaining columns are added in between the nodes.
4793
4822
4794 $ hg log --graph -T "{graphwidth}" -r "0|2|4|5"
4823 $ hg log --graph -T "{graphwidth}" -r "0|2|4|5"
4795 o 5
4824 o 5
4796 |\
4825 |\
4797 | \
4826 | \
4798 | :\
4827 | :\
4799 o : : 7
4828 o : : 7
4800 :/ /
4829 :/ /
4801 : o 5
4830 : o 5
4802 :/
4831 :/
4803 o 3
4832 o 3
4804
4833
4805
4834
4806 $ cd ..
4835 $ cd ..
4807
4836
General Comments 0
You need to be logged in to leave comments. Login now