##// END OF EJS Templates
templater: complain about invalid application of '%' operator (BC)...
Yuya Nishihara -
r37422:7c902a83 default
parent child Browse files
Show More
@@ -1,649 +1,652 b''
1 # templateutil.py - utility for template evaluation
1 # templateutil.py - utility for template evaluation
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 abc
10 import abc
11 import types
11 import types
12
12
13 from .i18n import _
13 from .i18n import _
14 from . import (
14 from . import (
15 error,
15 error,
16 pycompat,
16 pycompat,
17 util,
17 util,
18 )
18 )
19 from .utils import (
19 from .utils import (
20 dateutil,
20 dateutil,
21 stringutil,
21 stringutil,
22 )
22 )
23
23
24 class ResourceUnavailable(error.Abort):
24 class ResourceUnavailable(error.Abort):
25 pass
25 pass
26
26
27 class TemplateNotFound(error.Abort):
27 class TemplateNotFound(error.Abort):
28 pass
28 pass
29
29
30 class wrapped(object):
30 class wrapped(object):
31 """Object requiring extra conversion prior to displaying or processing
31 """Object requiring extra conversion prior to displaying or processing
32 as value
32 as value
33
33
34 Use unwrapvalue(), unwrapastype(), or unwraphybrid() to obtain the inner
34 Use unwrapvalue(), unwrapastype(), or unwraphybrid() to obtain the inner
35 object.
35 object.
36 """
36 """
37
37
38 __metaclass__ = abc.ABCMeta
38 __metaclass__ = abc.ABCMeta
39
39
40 @abc.abstractmethod
40 @abc.abstractmethod
41 def itermaps(self, context):
41 def itermaps(self, context):
42 """Yield each template mapping"""
42 """Yield each template mapping"""
43
43
44 @abc.abstractmethod
44 @abc.abstractmethod
45 def join(self, context, mapping, sep):
45 def join(self, context, mapping, sep):
46 """Join items with the separator; Returns a bytes or (possibly nested)
46 """Join items with the separator; Returns a bytes or (possibly nested)
47 generator of bytes
47 generator of bytes
48
48
49 A pre-configured template may be rendered per item if this container
49 A pre-configured template may be rendered per item if this container
50 holds unprintable items.
50 holds unprintable items.
51 """
51 """
52
52
53 @abc.abstractmethod
53 @abc.abstractmethod
54 def show(self, context, mapping):
54 def show(self, context, mapping):
55 """Return a bytes or (possibly nested) generator of bytes representing
55 """Return a bytes or (possibly nested) generator of bytes representing
56 the underlying object
56 the underlying object
57
57
58 A pre-configured template may be rendered if the underlying object is
58 A pre-configured template may be rendered if the underlying object is
59 not printable.
59 not printable.
60 """
60 """
61
61
62 @abc.abstractmethod
62 @abc.abstractmethod
63 def tovalue(self, context, mapping):
63 def tovalue(self, context, mapping):
64 """Move the inner value object out or create a value representation
64 """Move the inner value object out or create a value representation
65
65
66 A returned value must be serializable by templaterfilters.json().
66 A returned value must be serializable by templaterfilters.json().
67 """
67 """
68
68
69 # stub for representing a date type; may be a real date type that can
69 # stub for representing a date type; may be a real date type that can
70 # provide a readable string value
70 # provide a readable string value
71 class date(object):
71 class date(object):
72 pass
72 pass
73
73
74 class hybrid(wrapped):
74 class hybrid(wrapped):
75 """Wrapper for list or dict to support legacy template
75 """Wrapper for list or dict to support legacy template
76
76
77 This class allows us to handle both:
77 This class allows us to handle both:
78 - "{files}" (legacy command-line-specific list hack) and
78 - "{files}" (legacy command-line-specific list hack) and
79 - "{files % '{file}\n'}" (hgweb-style with inlining and function support)
79 - "{files % '{file}\n'}" (hgweb-style with inlining and function support)
80 and to access raw values:
80 and to access raw values:
81 - "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
81 - "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
82 - "{get(extras, key)}"
82 - "{get(extras, key)}"
83 - "{files|json}"
83 - "{files|json}"
84 """
84 """
85
85
86 def __init__(self, gen, values, makemap, joinfmt, keytype=None):
86 def __init__(self, gen, values, makemap, joinfmt, keytype=None):
87 self._gen = gen # generator or function returning generator
87 self._gen = gen # generator or function returning generator
88 self._values = values
88 self._values = values
89 self._makemap = makemap
89 self._makemap = makemap
90 self._joinfmt = joinfmt
90 self._joinfmt = joinfmt
91 self.keytype = keytype # hint for 'x in y' where type(x) is unresolved
91 self.keytype = keytype # hint for 'x in y' where type(x) is unresolved
92
92
93 def itermaps(self, context):
93 def itermaps(self, context):
94 makemap = self._makemap
94 makemap = self._makemap
95 for x in self._values:
95 for x in self._values:
96 yield makemap(x)
96 yield makemap(x)
97
97
98 def join(self, context, mapping, sep):
98 def join(self, context, mapping, sep):
99 # TODO: switch gen to (context, mapping) API?
99 # TODO: switch gen to (context, mapping) API?
100 return joinitems((self._joinfmt(x) for x in self._values), sep)
100 return joinitems((self._joinfmt(x) for x in self._values), sep)
101
101
102 def show(self, context, mapping):
102 def show(self, context, mapping):
103 # TODO: switch gen to (context, mapping) API?
103 # TODO: switch gen to (context, mapping) API?
104 gen = self._gen
104 gen = self._gen
105 if gen is None:
105 if gen is None:
106 return self.join(context, mapping, ' ')
106 return self.join(context, mapping, ' ')
107 if callable(gen):
107 if callable(gen):
108 return gen()
108 return gen()
109 return gen
109 return gen
110
110
111 def tovalue(self, context, mapping):
111 def tovalue(self, context, mapping):
112 # TODO: return self._values and get rid of proxy methods
112 # TODO: return self._values and get rid of proxy methods
113 return self
113 return self
114
114
115 def __contains__(self, x):
115 def __contains__(self, x):
116 return x in self._values
116 return x in self._values
117 def __getitem__(self, key):
117 def __getitem__(self, key):
118 return self._values[key]
118 return self._values[key]
119 def __len__(self):
119 def __len__(self):
120 return len(self._values)
120 return len(self._values)
121 def __iter__(self):
121 def __iter__(self):
122 return iter(self._values)
122 return iter(self._values)
123 def __getattr__(self, name):
123 def __getattr__(self, name):
124 if name not in (r'get', r'items', r'iteritems', r'iterkeys',
124 if name not in (r'get', r'items', r'iteritems', r'iterkeys',
125 r'itervalues', r'keys', r'values'):
125 r'itervalues', r'keys', r'values'):
126 raise AttributeError(name)
126 raise AttributeError(name)
127 return getattr(self._values, name)
127 return getattr(self._values, name)
128
128
129 class mappable(wrapped):
129 class mappable(wrapped):
130 """Wrapper for non-list/dict object to support map operation
130 """Wrapper for non-list/dict object to support map operation
131
131
132 This class allows us to handle both:
132 This class allows us to handle both:
133 - "{manifest}"
133 - "{manifest}"
134 - "{manifest % '{rev}:{node}'}"
134 - "{manifest % '{rev}:{node}'}"
135 - "{manifest.rev}"
135 - "{manifest.rev}"
136
136
137 Unlike a hybrid, this does not simulate the behavior of the underling
137 Unlike a hybrid, this does not simulate the behavior of the underling
138 value.
138 value.
139 """
139 """
140
140
141 def __init__(self, gen, key, value, makemap):
141 def __init__(self, gen, key, value, makemap):
142 self._gen = gen # generator or function returning generator
142 self._gen = gen # generator or function returning generator
143 self._key = key
143 self._key = key
144 self._value = value # may be generator of strings
144 self._value = value # may be generator of strings
145 self._makemap = makemap
145 self._makemap = makemap
146
146
147 def tomap(self):
147 def tomap(self):
148 return self._makemap(self._key)
148 return self._makemap(self._key)
149
149
150 def itermaps(self, context):
150 def itermaps(self, context):
151 yield self.tomap()
151 yield self.tomap()
152
152
153 def join(self, context, mapping, sep):
153 def join(self, context, mapping, sep):
154 # TODO: just copies the old behavior where a value was a generator
154 # TODO: just copies the old behavior where a value was a generator
155 # yielding one item, but reconsider about it. join() over a string
155 # yielding one item, but reconsider about it. join() over a string
156 # has no consistent result because a string may be a bytes, or a
156 # has no consistent result because a string may be a bytes, or a
157 # generator yielding an item, or a generator yielding multiple items.
157 # generator yielding an item, or a generator yielding multiple items.
158 # Preserving all of the current behaviors wouldn't make any sense.
158 # Preserving all of the current behaviors wouldn't make any sense.
159 return self.show(context, mapping)
159 return self.show(context, mapping)
160
160
161 def show(self, context, mapping):
161 def show(self, context, mapping):
162 # TODO: switch gen to (context, mapping) API?
162 # TODO: switch gen to (context, mapping) API?
163 gen = self._gen
163 gen = self._gen
164 if gen is None:
164 if gen is None:
165 return pycompat.bytestr(self._value)
165 return pycompat.bytestr(self._value)
166 if callable(gen):
166 if callable(gen):
167 return gen()
167 return gen()
168 return gen
168 return gen
169
169
170 def tovalue(self, context, mapping):
170 def tovalue(self, context, mapping):
171 return _unthunk(context, mapping, self._value)
171 return _unthunk(context, mapping, self._value)
172
172
173 class _mappingsequence(wrapped):
173 class _mappingsequence(wrapped):
174 """Wrapper for sequence of template mappings
174 """Wrapper for sequence of template mappings
175
175
176 This represents an inner template structure (i.e. a list of dicts),
176 This represents an inner template structure (i.e. a list of dicts),
177 which can also be rendered by the specified named/literal template.
177 which can also be rendered by the specified named/literal template.
178
178
179 Template mappings may be nested.
179 Template mappings may be nested.
180 """
180 """
181
181
182 def __init__(self, name=None, tmpl=None, sep=''):
182 def __init__(self, name=None, tmpl=None, sep=''):
183 if name is not None and tmpl is not None:
183 if name is not None and tmpl is not None:
184 raise error.ProgrammingError('name and tmpl are mutually exclusive')
184 raise error.ProgrammingError('name and tmpl are mutually exclusive')
185 self._name = name
185 self._name = name
186 self._tmpl = tmpl
186 self._tmpl = tmpl
187 self._defaultsep = sep
187 self._defaultsep = sep
188
188
189 def join(self, context, mapping, sep):
189 def join(self, context, mapping, sep):
190 mapsiter = _iteroverlaymaps(context, mapping, self.itermaps(context))
190 mapsiter = _iteroverlaymaps(context, mapping, self.itermaps(context))
191 if self._name:
191 if self._name:
192 itemiter = (context.process(self._name, m) for m in mapsiter)
192 itemiter = (context.process(self._name, m) for m in mapsiter)
193 elif self._tmpl:
193 elif self._tmpl:
194 itemiter = (context.expand(self._tmpl, m) for m in mapsiter)
194 itemiter = (context.expand(self._tmpl, m) for m in mapsiter)
195 else:
195 else:
196 raise error.ParseError(_('not displayable without template'))
196 raise error.ParseError(_('not displayable without template'))
197 return joinitems(itemiter, sep)
197 return joinitems(itemiter, sep)
198
198
199 def show(self, context, mapping):
199 def show(self, context, mapping):
200 return self.join(context, mapping, self._defaultsep)
200 return self.join(context, mapping, self._defaultsep)
201
201
202 def tovalue(self, context, mapping):
202 def tovalue(self, context, mapping):
203 return list(self.itermaps(context))
203 return list(self.itermaps(context))
204
204
205 class mappinggenerator(_mappingsequence):
205 class mappinggenerator(_mappingsequence):
206 """Wrapper for generator of template mappings
206 """Wrapper for generator of template mappings
207
207
208 The function ``make(context, *args)`` should return a generator of
208 The function ``make(context, *args)`` should return a generator of
209 mapping dicts.
209 mapping dicts.
210 """
210 """
211
211
212 def __init__(self, make, args=(), name=None, tmpl=None, sep=''):
212 def __init__(self, make, args=(), name=None, tmpl=None, sep=''):
213 super(mappinggenerator, self).__init__(name, tmpl, sep)
213 super(mappinggenerator, self).__init__(name, tmpl, sep)
214 self._make = make
214 self._make = make
215 self._args = args
215 self._args = args
216
216
217 def itermaps(self, context):
217 def itermaps(self, context):
218 return self._make(context, *self._args)
218 return self._make(context, *self._args)
219
219
220 class mappinglist(_mappingsequence):
220 class mappinglist(_mappingsequence):
221 """Wrapper for list of template mappings"""
221 """Wrapper for list of template mappings"""
222
222
223 def __init__(self, mappings, name=None, tmpl=None, sep=''):
223 def __init__(self, mappings, name=None, tmpl=None, sep=''):
224 super(mappinglist, self).__init__(name, tmpl, sep)
224 super(mappinglist, self).__init__(name, tmpl, sep)
225 self._mappings = mappings
225 self._mappings = mappings
226
226
227 def itermaps(self, context):
227 def itermaps(self, context):
228 return iter(self._mappings)
228 return iter(self._mappings)
229
229
230 def hybriddict(data, key='key', value='value', fmt=None, gen=None):
230 def hybriddict(data, key='key', value='value', fmt=None, gen=None):
231 """Wrap data to support both dict-like and string-like operations"""
231 """Wrap data to support both dict-like and string-like operations"""
232 prefmt = pycompat.identity
232 prefmt = pycompat.identity
233 if fmt is None:
233 if fmt is None:
234 fmt = '%s=%s'
234 fmt = '%s=%s'
235 prefmt = pycompat.bytestr
235 prefmt = pycompat.bytestr
236 return hybrid(gen, data, lambda k: {key: k, value: data[k]},
236 return hybrid(gen, data, lambda k: {key: k, value: data[k]},
237 lambda k: fmt % (prefmt(k), prefmt(data[k])))
237 lambda k: fmt % (prefmt(k), prefmt(data[k])))
238
238
239 def hybridlist(data, name, fmt=None, gen=None):
239 def hybridlist(data, name, fmt=None, gen=None):
240 """Wrap data to support both list-like and string-like operations"""
240 """Wrap data to support both list-like and string-like operations"""
241 prefmt = pycompat.identity
241 prefmt = pycompat.identity
242 if fmt is None:
242 if fmt is None:
243 fmt = '%s'
243 fmt = '%s'
244 prefmt = pycompat.bytestr
244 prefmt = pycompat.bytestr
245 return hybrid(gen, data, lambda x: {name: x}, lambda x: fmt % prefmt(x))
245 return hybrid(gen, data, lambda x: {name: x}, lambda x: fmt % prefmt(x))
246
246
247 def unwraphybrid(context, mapping, thing):
247 def unwraphybrid(context, mapping, thing):
248 """Return an object which can be stringified possibly by using a legacy
248 """Return an object which can be stringified possibly by using a legacy
249 template"""
249 template"""
250 if not isinstance(thing, wrapped):
250 if not isinstance(thing, wrapped):
251 return thing
251 return thing
252 return thing.show(context, mapping)
252 return thing.show(context, mapping)
253
253
254 def unwrapvalue(context, mapping, thing):
254 def unwrapvalue(context, mapping, thing):
255 """Move the inner value object out of the wrapper"""
255 """Move the inner value object out of the wrapper"""
256 if not isinstance(thing, wrapped):
256 if not isinstance(thing, wrapped):
257 return thing
257 return thing
258 return thing.tovalue(context, mapping)
258 return thing.tovalue(context, mapping)
259
259
260 def wraphybridvalue(container, key, value):
260 def wraphybridvalue(container, key, value):
261 """Wrap an element of hybrid container to be mappable
261 """Wrap an element of hybrid container to be mappable
262
262
263 The key is passed to the makemap function of the given container, which
263 The key is passed to the makemap function of the given container, which
264 should be an item generated by iter(container).
264 should be an item generated by iter(container).
265 """
265 """
266 makemap = getattr(container, '_makemap', None)
266 makemap = getattr(container, '_makemap', None)
267 if makemap is None:
267 if makemap is None:
268 return value
268 return value
269 if util.safehasattr(value, '_makemap'):
269 if util.safehasattr(value, '_makemap'):
270 # a nested hybrid list/dict, which has its own way of map operation
270 # a nested hybrid list/dict, which has its own way of map operation
271 return value
271 return value
272 return mappable(None, key, value, makemap)
272 return mappable(None, key, value, makemap)
273
273
274 def compatdict(context, mapping, name, data, key='key', value='value',
274 def compatdict(context, mapping, name, data, key='key', value='value',
275 fmt=None, plural=None, separator=' '):
275 fmt=None, plural=None, separator=' '):
276 """Wrap data like hybriddict(), but also supports old-style list template
276 """Wrap data like hybriddict(), but also supports old-style list template
277
277
278 This exists for backward compatibility with the old-style template. Use
278 This exists for backward compatibility with the old-style template. Use
279 hybriddict() for new template keywords.
279 hybriddict() for new template keywords.
280 """
280 """
281 c = [{key: k, value: v} for k, v in data.iteritems()]
281 c = [{key: k, value: v} for k, v in data.iteritems()]
282 f = _showcompatlist(context, mapping, name, c, plural, separator)
282 f = _showcompatlist(context, mapping, name, c, plural, separator)
283 return hybriddict(data, key=key, value=value, fmt=fmt, gen=f)
283 return hybriddict(data, key=key, value=value, fmt=fmt, gen=f)
284
284
285 def compatlist(context, mapping, name, data, element=None, fmt=None,
285 def compatlist(context, mapping, name, data, element=None, fmt=None,
286 plural=None, separator=' '):
286 plural=None, separator=' '):
287 """Wrap data like hybridlist(), but also supports old-style list template
287 """Wrap data like hybridlist(), but also supports old-style list template
288
288
289 This exists for backward compatibility with the old-style template. Use
289 This exists for backward compatibility with the old-style template. Use
290 hybridlist() for new template keywords.
290 hybridlist() for new template keywords.
291 """
291 """
292 f = _showcompatlist(context, mapping, name, data, plural, separator)
292 f = _showcompatlist(context, mapping, name, data, plural, separator)
293 return hybridlist(data, name=element or name, fmt=fmt, gen=f)
293 return hybridlist(data, name=element or name, fmt=fmt, gen=f)
294
294
295 def _showcompatlist(context, mapping, name, values, plural=None, separator=' '):
295 def _showcompatlist(context, mapping, name, values, plural=None, separator=' '):
296 """Return a generator that renders old-style list template
296 """Return a generator that renders old-style list template
297
297
298 name is name of key in template map.
298 name is name of key in template map.
299 values is list of strings or dicts.
299 values is list of strings or dicts.
300 plural is plural of name, if not simply name + 's'.
300 plural is plural of name, if not simply name + 's'.
301 separator is used to join values as a string
301 separator is used to join values as a string
302
302
303 expansion works like this, given name 'foo'.
303 expansion works like this, given name 'foo'.
304
304
305 if values is empty, expand 'no_foos'.
305 if values is empty, expand 'no_foos'.
306
306
307 if 'foo' not in template map, return values as a string,
307 if 'foo' not in template map, return values as a string,
308 joined by 'separator'.
308 joined by 'separator'.
309
309
310 expand 'start_foos'.
310 expand 'start_foos'.
311
311
312 for each value, expand 'foo'. if 'last_foo' in template
312 for each value, expand 'foo'. if 'last_foo' in template
313 map, expand it instead of 'foo' for last key.
313 map, expand it instead of 'foo' for last key.
314
314
315 expand 'end_foos'.
315 expand 'end_foos'.
316 """
316 """
317 if not plural:
317 if not plural:
318 plural = name + 's'
318 plural = name + 's'
319 if not values:
319 if not values:
320 noname = 'no_' + plural
320 noname = 'no_' + plural
321 if context.preload(noname):
321 if context.preload(noname):
322 yield context.process(noname, mapping)
322 yield context.process(noname, mapping)
323 return
323 return
324 if not context.preload(name):
324 if not context.preload(name):
325 if isinstance(values[0], bytes):
325 if isinstance(values[0], bytes):
326 yield separator.join(values)
326 yield separator.join(values)
327 else:
327 else:
328 for v in values:
328 for v in values:
329 r = dict(v)
329 r = dict(v)
330 r.update(mapping)
330 r.update(mapping)
331 yield r
331 yield r
332 return
332 return
333 startname = 'start_' + plural
333 startname = 'start_' + plural
334 if context.preload(startname):
334 if context.preload(startname):
335 yield context.process(startname, mapping)
335 yield context.process(startname, mapping)
336 def one(v, tag=name):
336 def one(v, tag=name):
337 vmapping = {}
337 vmapping = {}
338 try:
338 try:
339 vmapping.update(v)
339 vmapping.update(v)
340 # Python 2 raises ValueError if the type of v is wrong. Python
340 # Python 2 raises ValueError if the type of v is wrong. Python
341 # 3 raises TypeError.
341 # 3 raises TypeError.
342 except (AttributeError, TypeError, ValueError):
342 except (AttributeError, TypeError, ValueError):
343 try:
343 try:
344 # Python 2 raises ValueError trying to destructure an e.g.
344 # Python 2 raises ValueError trying to destructure an e.g.
345 # bytes. Python 3 raises TypeError.
345 # bytes. Python 3 raises TypeError.
346 for a, b in v:
346 for a, b in v:
347 vmapping[a] = b
347 vmapping[a] = b
348 except (TypeError, ValueError):
348 except (TypeError, ValueError):
349 vmapping[name] = v
349 vmapping[name] = v
350 vmapping = context.overlaymap(mapping, vmapping)
350 vmapping = context.overlaymap(mapping, vmapping)
351 return context.process(tag, vmapping)
351 return context.process(tag, vmapping)
352 lastname = 'last_' + name
352 lastname = 'last_' + name
353 if context.preload(lastname):
353 if context.preload(lastname):
354 last = values.pop()
354 last = values.pop()
355 else:
355 else:
356 last = None
356 last = None
357 for v in values:
357 for v in values:
358 yield one(v)
358 yield one(v)
359 if last is not None:
359 if last is not None:
360 yield one(last, tag=lastname)
360 yield one(last, tag=lastname)
361 endname = 'end_' + plural
361 endname = 'end_' + plural
362 if context.preload(endname):
362 if context.preload(endname):
363 yield context.process(endname, mapping)
363 yield context.process(endname, mapping)
364
364
365 def flatten(context, mapping, thing):
365 def flatten(context, mapping, thing):
366 """Yield a single stream from a possibly nested set of iterators"""
366 """Yield a single stream from a possibly nested set of iterators"""
367 thing = unwraphybrid(context, mapping, thing)
367 thing = unwraphybrid(context, mapping, thing)
368 if isinstance(thing, bytes):
368 if isinstance(thing, bytes):
369 yield thing
369 yield thing
370 elif isinstance(thing, str):
370 elif isinstance(thing, str):
371 # We can only hit this on Python 3, and it's here to guard
371 # We can only hit this on Python 3, and it's here to guard
372 # against infinite recursion.
372 # against infinite recursion.
373 raise error.ProgrammingError('Mercurial IO including templates is done'
373 raise error.ProgrammingError('Mercurial IO including templates is done'
374 ' with bytes, not strings, got %r' % thing)
374 ' with bytes, not strings, got %r' % thing)
375 elif thing is None:
375 elif thing is None:
376 pass
376 pass
377 elif not util.safehasattr(thing, '__iter__'):
377 elif not util.safehasattr(thing, '__iter__'):
378 yield pycompat.bytestr(thing)
378 yield pycompat.bytestr(thing)
379 else:
379 else:
380 for i in thing:
380 for i in thing:
381 i = unwraphybrid(context, mapping, i)
381 i = unwraphybrid(context, mapping, i)
382 if isinstance(i, bytes):
382 if isinstance(i, bytes):
383 yield i
383 yield i
384 elif i is None:
384 elif i is None:
385 pass
385 pass
386 elif not util.safehasattr(i, '__iter__'):
386 elif not util.safehasattr(i, '__iter__'):
387 yield pycompat.bytestr(i)
387 yield pycompat.bytestr(i)
388 else:
388 else:
389 for j in flatten(context, mapping, i):
389 for j in flatten(context, mapping, i):
390 yield j
390 yield j
391
391
392 def stringify(context, mapping, thing):
392 def stringify(context, mapping, thing):
393 """Turn values into bytes by converting into text and concatenating them"""
393 """Turn values into bytes by converting into text and concatenating them"""
394 if isinstance(thing, bytes):
394 if isinstance(thing, bytes):
395 return thing # retain localstr to be round-tripped
395 return thing # retain localstr to be round-tripped
396 return b''.join(flatten(context, mapping, thing))
396 return b''.join(flatten(context, mapping, thing))
397
397
398 def findsymbolicname(arg):
398 def findsymbolicname(arg):
399 """Find symbolic name for the given compiled expression; returns None
399 """Find symbolic name for the given compiled expression; returns None
400 if nothing found reliably"""
400 if nothing found reliably"""
401 while True:
401 while True:
402 func, data = arg
402 func, data = arg
403 if func is runsymbol:
403 if func is runsymbol:
404 return data
404 return data
405 elif func is runfilter:
405 elif func is runfilter:
406 arg = data[0]
406 arg = data[0]
407 else:
407 else:
408 return None
408 return None
409
409
410 def _unthunk(context, mapping, thing):
410 def _unthunk(context, mapping, thing):
411 """Evaluate a lazy byte string into value"""
411 """Evaluate a lazy byte string into value"""
412 if not isinstance(thing, types.GeneratorType):
412 if not isinstance(thing, types.GeneratorType):
413 return thing
413 return thing
414 return stringify(context, mapping, thing)
414 return stringify(context, mapping, thing)
415
415
416 def evalrawexp(context, mapping, arg):
416 def evalrawexp(context, mapping, arg):
417 """Evaluate given argument as a bare template object which may require
417 """Evaluate given argument as a bare template object which may require
418 further processing (such as folding generator of strings)"""
418 further processing (such as folding generator of strings)"""
419 func, data = arg
419 func, data = arg
420 return func(context, mapping, data)
420 return func(context, mapping, data)
421
421
422 def evalfuncarg(context, mapping, arg):
422 def evalfuncarg(context, mapping, arg):
423 """Evaluate given argument as value type"""
423 """Evaluate given argument as value type"""
424 return _unwrapvalue(context, mapping, evalrawexp(context, mapping, arg))
424 return _unwrapvalue(context, mapping, evalrawexp(context, mapping, arg))
425
425
426 # TODO: unify this with unwrapvalue() once the bug of templatefunc.join()
426 # TODO: unify this with unwrapvalue() once the bug of templatefunc.join()
427 # is fixed. we can't do that right now because join() has to take a generator
427 # is fixed. we can't do that right now because join() has to take a generator
428 # of byte strings as it is, not a lazy byte string.
428 # of byte strings as it is, not a lazy byte string.
429 def _unwrapvalue(context, mapping, thing):
429 def _unwrapvalue(context, mapping, thing):
430 thing = unwrapvalue(context, mapping, thing)
430 thing = unwrapvalue(context, mapping, thing)
431 # evalrawexp() may return string, generator of strings or arbitrary object
431 # evalrawexp() may return string, generator of strings or arbitrary object
432 # such as date tuple, but filter does not want generator.
432 # such as date tuple, but filter does not want generator.
433 return _unthunk(context, mapping, thing)
433 return _unthunk(context, mapping, thing)
434
434
435 def evalboolean(context, mapping, arg):
435 def evalboolean(context, mapping, arg):
436 """Evaluate given argument as boolean, but also takes boolean literals"""
436 """Evaluate given argument as boolean, but also takes boolean literals"""
437 func, data = arg
437 func, data = arg
438 if func is runsymbol:
438 if func is runsymbol:
439 thing = func(context, mapping, data, default=None)
439 thing = func(context, mapping, data, default=None)
440 if thing is None:
440 if thing is None:
441 # not a template keyword, takes as a boolean literal
441 # not a template keyword, takes as a boolean literal
442 thing = stringutil.parsebool(data)
442 thing = stringutil.parsebool(data)
443 else:
443 else:
444 thing = func(context, mapping, data)
444 thing = func(context, mapping, data)
445 thing = unwrapvalue(context, mapping, thing)
445 thing = unwrapvalue(context, mapping, thing)
446 if isinstance(thing, bool):
446 if isinstance(thing, bool):
447 return thing
447 return thing
448 # other objects are evaluated as strings, which means 0 is True, but
448 # other objects are evaluated as strings, which means 0 is True, but
449 # empty dict/list should be False as they are expected to be ''
449 # empty dict/list should be False as they are expected to be ''
450 return bool(stringify(context, mapping, thing))
450 return bool(stringify(context, mapping, thing))
451
451
452 def evaldate(context, mapping, arg, err=None):
452 def evaldate(context, mapping, arg, err=None):
453 """Evaluate given argument as a date tuple or a date string; returns
453 """Evaluate given argument as a date tuple or a date string; returns
454 a (unixtime, offset) tuple"""
454 a (unixtime, offset) tuple"""
455 thing = evalrawexp(context, mapping, arg)
455 thing = evalrawexp(context, mapping, arg)
456 return unwrapdate(context, mapping, thing, err)
456 return unwrapdate(context, mapping, thing, err)
457
457
458 def unwrapdate(context, mapping, thing, err=None):
458 def unwrapdate(context, mapping, thing, err=None):
459 thing = _unwrapvalue(context, mapping, thing)
459 thing = _unwrapvalue(context, mapping, thing)
460 try:
460 try:
461 return dateutil.parsedate(thing)
461 return dateutil.parsedate(thing)
462 except AttributeError:
462 except AttributeError:
463 raise error.ParseError(err or _('not a date tuple nor a string'))
463 raise error.ParseError(err or _('not a date tuple nor a string'))
464 except error.ParseError:
464 except error.ParseError:
465 if not err:
465 if not err:
466 raise
466 raise
467 raise error.ParseError(err)
467 raise error.ParseError(err)
468
468
469 def evalinteger(context, mapping, arg, err=None):
469 def evalinteger(context, mapping, arg, err=None):
470 thing = evalrawexp(context, mapping, arg)
470 thing = evalrawexp(context, mapping, arg)
471 return unwrapinteger(context, mapping, thing, err)
471 return unwrapinteger(context, mapping, thing, err)
472
472
473 def unwrapinteger(context, mapping, thing, err=None):
473 def unwrapinteger(context, mapping, thing, err=None):
474 thing = _unwrapvalue(context, mapping, thing)
474 thing = _unwrapvalue(context, mapping, thing)
475 try:
475 try:
476 return int(thing)
476 return int(thing)
477 except (TypeError, ValueError):
477 except (TypeError, ValueError):
478 raise error.ParseError(err or _('not an integer'))
478 raise error.ParseError(err or _('not an integer'))
479
479
480 def evalstring(context, mapping, arg):
480 def evalstring(context, mapping, arg):
481 return stringify(context, mapping, evalrawexp(context, mapping, arg))
481 return stringify(context, mapping, evalrawexp(context, mapping, arg))
482
482
483 def evalstringliteral(context, mapping, arg):
483 def evalstringliteral(context, mapping, arg):
484 """Evaluate given argument as string template, but returns symbol name
484 """Evaluate given argument as string template, but returns symbol name
485 if it is unknown"""
485 if it is unknown"""
486 func, data = arg
486 func, data = arg
487 if func is runsymbol:
487 if func is runsymbol:
488 thing = func(context, mapping, data, default=data)
488 thing = func(context, mapping, data, default=data)
489 else:
489 else:
490 thing = func(context, mapping, data)
490 thing = func(context, mapping, data)
491 return stringify(context, mapping, thing)
491 return stringify(context, mapping, thing)
492
492
493 _unwrapfuncbytype = {
493 _unwrapfuncbytype = {
494 None: _unwrapvalue,
494 None: _unwrapvalue,
495 bytes: stringify,
495 bytes: stringify,
496 date: unwrapdate,
496 date: unwrapdate,
497 int: unwrapinteger,
497 int: unwrapinteger,
498 }
498 }
499
499
500 def unwrapastype(context, mapping, thing, typ):
500 def unwrapastype(context, mapping, thing, typ):
501 """Move the inner value object out of the wrapper and coerce its type"""
501 """Move the inner value object out of the wrapper and coerce its type"""
502 try:
502 try:
503 f = _unwrapfuncbytype[typ]
503 f = _unwrapfuncbytype[typ]
504 except KeyError:
504 except KeyError:
505 raise error.ProgrammingError('invalid type specified: %r' % typ)
505 raise error.ProgrammingError('invalid type specified: %r' % typ)
506 return f(context, mapping, thing)
506 return f(context, mapping, thing)
507
507
508 def runinteger(context, mapping, data):
508 def runinteger(context, mapping, data):
509 return int(data)
509 return int(data)
510
510
511 def runstring(context, mapping, data):
511 def runstring(context, mapping, data):
512 return data
512 return data
513
513
514 def _recursivesymbolblocker(key):
514 def _recursivesymbolblocker(key):
515 def showrecursion(**args):
515 def showrecursion(**args):
516 raise error.Abort(_("recursive reference '%s' in template") % key)
516 raise error.Abort(_("recursive reference '%s' in template") % key)
517 return showrecursion
517 return showrecursion
518
518
519 def runsymbol(context, mapping, key, default=''):
519 def runsymbol(context, mapping, key, default=''):
520 v = context.symbol(mapping, key)
520 v = context.symbol(mapping, key)
521 if v is None:
521 if v is None:
522 # put poison to cut recursion. we can't move this to parsing phase
522 # put poison to cut recursion. we can't move this to parsing phase
523 # because "x = {x}" is allowed if "x" is a keyword. (issue4758)
523 # because "x = {x}" is allowed if "x" is a keyword. (issue4758)
524 safemapping = mapping.copy()
524 safemapping = mapping.copy()
525 safemapping[key] = _recursivesymbolblocker(key)
525 safemapping[key] = _recursivesymbolblocker(key)
526 try:
526 try:
527 v = context.process(key, safemapping)
527 v = context.process(key, safemapping)
528 except TemplateNotFound:
528 except TemplateNotFound:
529 v = default
529 v = default
530 if callable(v) and getattr(v, '_requires', None) is None:
530 if callable(v) and getattr(v, '_requires', None) is None:
531 # old templatekw: expand all keywords and resources
531 # old templatekw: expand all keywords and resources
532 # (TODO: deprecate this after porting web template keywords to new API)
532 # (TODO: deprecate this after porting web template keywords to new API)
533 props = {k: context._resources.lookup(context, mapping, k)
533 props = {k: context._resources.lookup(context, mapping, k)
534 for k in context._resources.knownkeys()}
534 for k in context._resources.knownkeys()}
535 # pass context to _showcompatlist() through templatekw._showlist()
535 # pass context to _showcompatlist() through templatekw._showlist()
536 props['templ'] = context
536 props['templ'] = context
537 props.update(mapping)
537 props.update(mapping)
538 return v(**pycompat.strkwargs(props))
538 return v(**pycompat.strkwargs(props))
539 if callable(v):
539 if callable(v):
540 # new templatekw
540 # new templatekw
541 try:
541 try:
542 return v(context, mapping)
542 return v(context, mapping)
543 except ResourceUnavailable:
543 except ResourceUnavailable:
544 # unsupported keyword is mapped to empty just like unknown keyword
544 # unsupported keyword is mapped to empty just like unknown keyword
545 return None
545 return None
546 return v
546 return v
547
547
548 def runtemplate(context, mapping, template):
548 def runtemplate(context, mapping, template):
549 for arg in template:
549 for arg in template:
550 yield evalrawexp(context, mapping, arg)
550 yield evalrawexp(context, mapping, arg)
551
551
552 def runfilter(context, mapping, data):
552 def runfilter(context, mapping, data):
553 arg, filt = data
553 arg, filt = data
554 thing = evalrawexp(context, mapping, arg)
554 thing = evalrawexp(context, mapping, arg)
555 intype = getattr(filt, '_intype', None)
555 intype = getattr(filt, '_intype', None)
556 try:
556 try:
557 thing = unwrapastype(context, mapping, thing, intype)
557 thing = unwrapastype(context, mapping, thing, intype)
558 return filt(thing)
558 return filt(thing)
559 except error.ParseError as e:
559 except error.ParseError as e:
560 raise error.ParseError(bytes(e), hint=_formatfiltererror(arg, filt))
560 raise error.ParseError(bytes(e), hint=_formatfiltererror(arg, filt))
561
561
562 def _formatfiltererror(arg, filt):
562 def _formatfiltererror(arg, filt):
563 fn = pycompat.sysbytes(filt.__name__)
563 fn = pycompat.sysbytes(filt.__name__)
564 sym = findsymbolicname(arg)
564 sym = findsymbolicname(arg)
565 if not sym:
565 if not sym:
566 return _("incompatible use of template filter '%s'") % fn
566 return _("incompatible use of template filter '%s'") % fn
567 return (_("template filter '%s' is not compatible with keyword '%s'")
567 return (_("template filter '%s' is not compatible with keyword '%s'")
568 % (fn, sym))
568 % (fn, sym))
569
569
570 def _checkeditermaps(darg, d):
571 try:
572 for v in d:
573 if not isinstance(v, dict):
574 raise TypeError
575 yield v
576 except TypeError:
577 sym = findsymbolicname(darg)
578 if sym:
579 raise error.ParseError(_("keyword '%s' is not iterable of mappings")
580 % sym)
581 else:
582 raise error.ParseError(_("%r is not iterable of mappings") % d)
583
570 def _iteroverlaymaps(context, origmapping, newmappings):
584 def _iteroverlaymaps(context, origmapping, newmappings):
571 """Generate combined mappings from the original mapping and an iterable
585 """Generate combined mappings from the original mapping and an iterable
572 of partial mappings to override the original"""
586 of partial mappings to override the original"""
573 for i, nm in enumerate(newmappings):
587 for i, nm in enumerate(newmappings):
574 lm = context.overlaymap(origmapping, nm)
588 lm = context.overlaymap(origmapping, nm)
575 lm['index'] = i
589 lm['index'] = i
576 yield lm
590 yield lm
577
591
578 def runmap(context, mapping, data):
592 def runmap(context, mapping, data):
579 darg, targ = data
593 darg, targ = data
580 d = evalrawexp(context, mapping, darg)
594 d = evalrawexp(context, mapping, darg)
595 # TODO: a generator should be rejected because it is a thunk of lazy
596 # string, but we can't because hgweb abuses generator as a keyword
597 # that returns a list of dicts.
581 if isinstance(d, wrapped):
598 if isinstance(d, wrapped):
582 diter = d.itermaps(context)
599 diter = d.itermaps(context)
583 else:
600 else:
584 try:
601 diter = _checkeditermaps(darg, d)
585 diter = iter(d)
586 except TypeError:
587 sym = findsymbolicname(darg)
588 if sym:
589 raise error.ParseError(_("keyword '%s' is not iterable") % sym)
590 else:
591 raise error.ParseError(_("%r is not iterable") % d)
592
593 for i, v in enumerate(diter):
602 for i, v in enumerate(diter):
594 if isinstance(v, dict):
595 lm = context.overlaymap(mapping, v)
603 lm = context.overlaymap(mapping, v)
596 lm['index'] = i
604 lm['index'] = i
597 yield evalrawexp(context, lm, targ)
605 yield evalrawexp(context, lm, targ)
598 else:
599 # v is not an iterable of dicts, this happen when 'key'
600 # has been fully expanded already and format is useless.
601 # If so, return the expanded value.
602 yield v
603
606
604 def runmember(context, mapping, data):
607 def runmember(context, mapping, data):
605 darg, memb = data
608 darg, memb = data
606 d = evalrawexp(context, mapping, darg)
609 d = evalrawexp(context, mapping, darg)
607 if util.safehasattr(d, 'tomap'):
610 if util.safehasattr(d, 'tomap'):
608 lm = context.overlaymap(mapping, d.tomap())
611 lm = context.overlaymap(mapping, d.tomap())
609 return runsymbol(context, lm, memb)
612 return runsymbol(context, lm, memb)
610 if util.safehasattr(d, 'get'):
613 if util.safehasattr(d, 'get'):
611 return getdictitem(d, memb)
614 return getdictitem(d, memb)
612
615
613 sym = findsymbolicname(darg)
616 sym = findsymbolicname(darg)
614 if sym:
617 if sym:
615 raise error.ParseError(_("keyword '%s' has no member") % sym)
618 raise error.ParseError(_("keyword '%s' has no member") % sym)
616 else:
619 else:
617 raise error.ParseError(_("%r has no member") % pycompat.bytestr(d))
620 raise error.ParseError(_("%r has no member") % pycompat.bytestr(d))
618
621
619 def runnegate(context, mapping, data):
622 def runnegate(context, mapping, data):
620 data = evalinteger(context, mapping, data,
623 data = evalinteger(context, mapping, data,
621 _('negation needs an integer argument'))
624 _('negation needs an integer argument'))
622 return -data
625 return -data
623
626
624 def runarithmetic(context, mapping, data):
627 def runarithmetic(context, mapping, data):
625 func, left, right = data
628 func, left, right = data
626 left = evalinteger(context, mapping, left,
629 left = evalinteger(context, mapping, left,
627 _('arithmetic only defined on integers'))
630 _('arithmetic only defined on integers'))
628 right = evalinteger(context, mapping, right,
631 right = evalinteger(context, mapping, right,
629 _('arithmetic only defined on integers'))
632 _('arithmetic only defined on integers'))
630 try:
633 try:
631 return func(left, right)
634 return func(left, right)
632 except ZeroDivisionError:
635 except ZeroDivisionError:
633 raise error.Abort(_('division by zero is not defined'))
636 raise error.Abort(_('division by zero is not defined'))
634
637
635 def getdictitem(dictarg, key):
638 def getdictitem(dictarg, key):
636 val = dictarg.get(key)
639 val = dictarg.get(key)
637 if val is None:
640 if val is None:
638 return
641 return
639 return wraphybridvalue(dictarg, key, val)
642 return wraphybridvalue(dictarg, key, val)
640
643
641 def joinitems(itemiter, sep):
644 def joinitems(itemiter, sep):
642 """Join items with the separator; Returns generator of bytes"""
645 """Join items with the separator; Returns generator of bytes"""
643 first = True
646 first = True
644 for x in itemiter:
647 for x in itemiter:
645 if first:
648 if first:
646 first = False
649 first = False
647 elif sep:
650 elif sep:
648 yield sep
651 yield sep
649 yield x
652 yield x
@@ -1,4852 +1,4855 b''
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 $ hg log -l1 -T '{termwidth|count}\n'
2280 $ hg log -l1 -T '{termwidth|count}\n'
2281 hg: parse error: not countable
2281 hg: parse error: not countable
2282 (template filter 'count' is not compatible with keyword 'termwidth')
2282 (template filter 'count' is not compatible with keyword 'termwidth')
2283 [255]
2283 [255]
2284
2284
2285 Upper/lower filters:
2285 Upper/lower filters:
2286
2286
2287 $ hg log -r0 --template '{branch|upper}\n'
2287 $ hg log -r0 --template '{branch|upper}\n'
2288 DEFAULT
2288 DEFAULT
2289 $ hg log -r0 --template '{author|lower}\n'
2289 $ hg log -r0 --template '{author|lower}\n'
2290 user name <user@hostname>
2290 user name <user@hostname>
2291 $ hg log -r0 --template '{date|upper}\n'
2291 $ hg log -r0 --template '{date|upper}\n'
2292 1000000.00
2292 1000000.00
2293
2293
2294 Add a commit that does all possible modifications at once
2294 Add a commit that does all possible modifications at once
2295
2295
2296 $ echo modify >> third
2296 $ echo modify >> third
2297 $ touch b
2297 $ touch b
2298 $ hg add b
2298 $ hg add b
2299 $ hg mv fourth fifth
2299 $ hg mv fourth fifth
2300 $ hg rm a
2300 $ hg rm a
2301 $ hg ci -m "Modify, add, remove, rename"
2301 $ hg ci -m "Modify, add, remove, rename"
2302
2302
2303 Check the status template
2303 Check the status template
2304
2304
2305 $ cat <<EOF >> $HGRCPATH
2305 $ cat <<EOF >> $HGRCPATH
2306 > [extensions]
2306 > [extensions]
2307 > color=
2307 > color=
2308 > EOF
2308 > EOF
2309
2309
2310 $ hg log -T status -r 10
2310 $ hg log -T status -r 10
2311 changeset: 10:0f9759ec227a
2311 changeset: 10:0f9759ec227a
2312 tag: tip
2312 tag: tip
2313 user: test
2313 user: test
2314 date: Thu Jan 01 00:00:00 1970 +0000
2314 date: Thu Jan 01 00:00:00 1970 +0000
2315 summary: Modify, add, remove, rename
2315 summary: Modify, add, remove, rename
2316 files:
2316 files:
2317 M third
2317 M third
2318 A b
2318 A b
2319 A fifth
2319 A fifth
2320 R a
2320 R a
2321 R fourth
2321 R fourth
2322
2322
2323 $ hg log -T status -C -r 10
2323 $ hg log -T status -C -r 10
2324 changeset: 10:0f9759ec227a
2324 changeset: 10:0f9759ec227a
2325 tag: tip
2325 tag: tip
2326 user: test
2326 user: test
2327 date: Thu Jan 01 00:00:00 1970 +0000
2327 date: Thu Jan 01 00:00:00 1970 +0000
2328 summary: Modify, add, remove, rename
2328 summary: Modify, add, remove, rename
2329 files:
2329 files:
2330 M third
2330 M third
2331 A b
2331 A b
2332 A fifth
2332 A fifth
2333 fourth
2333 fourth
2334 R a
2334 R a
2335 R fourth
2335 R fourth
2336
2336
2337 $ hg log -T status -C -r 10 -v
2337 $ hg log -T status -C -r 10 -v
2338 changeset: 10:0f9759ec227a
2338 changeset: 10:0f9759ec227a
2339 tag: tip
2339 tag: tip
2340 user: test
2340 user: test
2341 date: Thu Jan 01 00:00:00 1970 +0000
2341 date: Thu Jan 01 00:00:00 1970 +0000
2342 description:
2342 description:
2343 Modify, add, remove, rename
2343 Modify, add, remove, rename
2344
2344
2345 files:
2345 files:
2346 M third
2346 M third
2347 A b
2347 A b
2348 A fifth
2348 A fifth
2349 fourth
2349 fourth
2350 R a
2350 R a
2351 R fourth
2351 R fourth
2352
2352
2353 $ hg log -T status -C -r 10 --debug
2353 $ hg log -T status -C -r 10 --debug
2354 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2354 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2355 tag: tip
2355 tag: tip
2356 phase: secret
2356 phase: secret
2357 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2357 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2358 parent: -1:0000000000000000000000000000000000000000
2358 parent: -1:0000000000000000000000000000000000000000
2359 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2359 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2360 user: test
2360 user: test
2361 date: Thu Jan 01 00:00:00 1970 +0000
2361 date: Thu Jan 01 00:00:00 1970 +0000
2362 extra: branch=default
2362 extra: branch=default
2363 description:
2363 description:
2364 Modify, add, remove, rename
2364 Modify, add, remove, rename
2365
2365
2366 files:
2366 files:
2367 M third
2367 M third
2368 A b
2368 A b
2369 A fifth
2369 A fifth
2370 fourth
2370 fourth
2371 R a
2371 R a
2372 R fourth
2372 R fourth
2373
2373
2374 $ hg log -T status -C -r 10 --quiet
2374 $ hg log -T status -C -r 10 --quiet
2375 10:0f9759ec227a
2375 10:0f9759ec227a
2376 $ hg --color=debug log -T status -r 10
2376 $ hg --color=debug log -T status -r 10
2377 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2377 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2378 [log.tag|tag: tip]
2378 [log.tag|tag: tip]
2379 [log.user|user: test]
2379 [log.user|user: test]
2380 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2380 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2381 [log.summary|summary: Modify, add, remove, rename]
2381 [log.summary|summary: Modify, add, remove, rename]
2382 [ui.note log.files|files:]
2382 [ui.note log.files|files:]
2383 [status.modified|M third]
2383 [status.modified|M third]
2384 [status.added|A b]
2384 [status.added|A b]
2385 [status.added|A fifth]
2385 [status.added|A fifth]
2386 [status.removed|R a]
2386 [status.removed|R a]
2387 [status.removed|R fourth]
2387 [status.removed|R fourth]
2388
2388
2389 $ hg --color=debug log -T status -C -r 10
2389 $ hg --color=debug log -T status -C -r 10
2390 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2390 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2391 [log.tag|tag: tip]
2391 [log.tag|tag: tip]
2392 [log.user|user: test]
2392 [log.user|user: test]
2393 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2393 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2394 [log.summary|summary: Modify, add, remove, rename]
2394 [log.summary|summary: Modify, add, remove, rename]
2395 [ui.note log.files|files:]
2395 [ui.note log.files|files:]
2396 [status.modified|M third]
2396 [status.modified|M third]
2397 [status.added|A b]
2397 [status.added|A b]
2398 [status.added|A fifth]
2398 [status.added|A fifth]
2399 [status.copied| fourth]
2399 [status.copied| fourth]
2400 [status.removed|R a]
2400 [status.removed|R a]
2401 [status.removed|R fourth]
2401 [status.removed|R fourth]
2402
2402
2403 $ hg --color=debug log -T status -C -r 10 -v
2403 $ hg --color=debug log -T status -C -r 10 -v
2404 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2404 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2405 [log.tag|tag: tip]
2405 [log.tag|tag: tip]
2406 [log.user|user: test]
2406 [log.user|user: test]
2407 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2407 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2408 [ui.note log.description|description:]
2408 [ui.note log.description|description:]
2409 [ui.note log.description|Modify, add, remove, rename]
2409 [ui.note log.description|Modify, add, remove, rename]
2410
2410
2411 [ui.note log.files|files:]
2411 [ui.note log.files|files:]
2412 [status.modified|M third]
2412 [status.modified|M third]
2413 [status.added|A b]
2413 [status.added|A b]
2414 [status.added|A fifth]
2414 [status.added|A fifth]
2415 [status.copied| fourth]
2415 [status.copied| fourth]
2416 [status.removed|R a]
2416 [status.removed|R a]
2417 [status.removed|R fourth]
2417 [status.removed|R fourth]
2418
2418
2419 $ hg --color=debug log -T status -C -r 10 --debug
2419 $ hg --color=debug log -T status -C -r 10 --debug
2420 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2420 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2421 [log.tag|tag: tip]
2421 [log.tag|tag: tip]
2422 [log.phase|phase: secret]
2422 [log.phase|phase: secret]
2423 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2423 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2424 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2424 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2425 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2425 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2426 [log.user|user: test]
2426 [log.user|user: test]
2427 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2427 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2428 [ui.debug log.extra|extra: branch=default]
2428 [ui.debug log.extra|extra: branch=default]
2429 [ui.note log.description|description:]
2429 [ui.note log.description|description:]
2430 [ui.note log.description|Modify, add, remove, rename]
2430 [ui.note log.description|Modify, add, remove, rename]
2431
2431
2432 [ui.note log.files|files:]
2432 [ui.note log.files|files:]
2433 [status.modified|M third]
2433 [status.modified|M third]
2434 [status.added|A b]
2434 [status.added|A b]
2435 [status.added|A fifth]
2435 [status.added|A fifth]
2436 [status.copied| fourth]
2436 [status.copied| fourth]
2437 [status.removed|R a]
2437 [status.removed|R a]
2438 [status.removed|R fourth]
2438 [status.removed|R fourth]
2439
2439
2440 $ hg --color=debug log -T status -C -r 10 --quiet
2440 $ hg --color=debug log -T status -C -r 10 --quiet
2441 [log.node|10:0f9759ec227a]
2441 [log.node|10:0f9759ec227a]
2442
2442
2443 Check the bisect template
2443 Check the bisect template
2444
2444
2445 $ hg bisect -g 1
2445 $ hg bisect -g 1
2446 $ hg bisect -b 3 --noupdate
2446 $ hg bisect -b 3 --noupdate
2447 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2447 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2448 $ hg log -T bisect -r 0:4
2448 $ hg log -T bisect -r 0:4
2449 changeset: 0:1e4e1b8f71e0
2449 changeset: 0:1e4e1b8f71e0
2450 bisect: good (implicit)
2450 bisect: good (implicit)
2451 user: User Name <user@hostname>
2451 user: User Name <user@hostname>
2452 date: Mon Jan 12 13:46:40 1970 +0000
2452 date: Mon Jan 12 13:46:40 1970 +0000
2453 summary: line 1
2453 summary: line 1
2454
2454
2455 changeset: 1:b608e9d1a3f0
2455 changeset: 1:b608e9d1a3f0
2456 bisect: good
2456 bisect: good
2457 user: A. N. Other <other@place>
2457 user: A. N. Other <other@place>
2458 date: Tue Jan 13 17:33:20 1970 +0000
2458 date: Tue Jan 13 17:33:20 1970 +0000
2459 summary: other 1
2459 summary: other 1
2460
2460
2461 changeset: 2:97054abb4ab8
2461 changeset: 2:97054abb4ab8
2462 bisect: untested
2462 bisect: untested
2463 user: other@place
2463 user: other@place
2464 date: Wed Jan 14 21:20:00 1970 +0000
2464 date: Wed Jan 14 21:20:00 1970 +0000
2465 summary: no person
2465 summary: no person
2466
2466
2467 changeset: 3:10e46f2dcbf4
2467 changeset: 3:10e46f2dcbf4
2468 bisect: bad
2468 bisect: bad
2469 user: person
2469 user: person
2470 date: Fri Jan 16 01:06:40 1970 +0000
2470 date: Fri Jan 16 01:06:40 1970 +0000
2471 summary: no user, no domain
2471 summary: no user, no domain
2472
2472
2473 changeset: 4:bbe44766e73d
2473 changeset: 4:bbe44766e73d
2474 bisect: bad (implicit)
2474 bisect: bad (implicit)
2475 branch: foo
2475 branch: foo
2476 user: person
2476 user: person
2477 date: Sat Jan 17 04:53:20 1970 +0000
2477 date: Sat Jan 17 04:53:20 1970 +0000
2478 summary: new branch
2478 summary: new branch
2479
2479
2480 $ hg log --debug -T bisect -r 0:4
2480 $ hg log --debug -T bisect -r 0:4
2481 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2481 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2482 bisect: good (implicit)
2482 bisect: good (implicit)
2483 phase: public
2483 phase: public
2484 parent: -1:0000000000000000000000000000000000000000
2484 parent: -1:0000000000000000000000000000000000000000
2485 parent: -1:0000000000000000000000000000000000000000
2485 parent: -1:0000000000000000000000000000000000000000
2486 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2486 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2487 user: User Name <user@hostname>
2487 user: User Name <user@hostname>
2488 date: Mon Jan 12 13:46:40 1970 +0000
2488 date: Mon Jan 12 13:46:40 1970 +0000
2489 files+: a
2489 files+: a
2490 extra: branch=default
2490 extra: branch=default
2491 description:
2491 description:
2492 line 1
2492 line 1
2493 line 2
2493 line 2
2494
2494
2495
2495
2496 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2496 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2497 bisect: good
2497 bisect: good
2498 phase: public
2498 phase: public
2499 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2499 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2500 parent: -1:0000000000000000000000000000000000000000
2500 parent: -1:0000000000000000000000000000000000000000
2501 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2501 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2502 user: A. N. Other <other@place>
2502 user: A. N. Other <other@place>
2503 date: Tue Jan 13 17:33:20 1970 +0000
2503 date: Tue Jan 13 17:33:20 1970 +0000
2504 files+: b
2504 files+: b
2505 extra: branch=default
2505 extra: branch=default
2506 description:
2506 description:
2507 other 1
2507 other 1
2508 other 2
2508 other 2
2509
2509
2510 other 3
2510 other 3
2511
2511
2512
2512
2513 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2513 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2514 bisect: untested
2514 bisect: untested
2515 phase: public
2515 phase: public
2516 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2516 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2517 parent: -1:0000000000000000000000000000000000000000
2517 parent: -1:0000000000000000000000000000000000000000
2518 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2518 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2519 user: other@place
2519 user: other@place
2520 date: Wed Jan 14 21:20:00 1970 +0000
2520 date: Wed Jan 14 21:20:00 1970 +0000
2521 files+: c
2521 files+: c
2522 extra: branch=default
2522 extra: branch=default
2523 description:
2523 description:
2524 no person
2524 no person
2525
2525
2526
2526
2527 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2527 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2528 bisect: bad
2528 bisect: bad
2529 phase: public
2529 phase: public
2530 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2530 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2531 parent: -1:0000000000000000000000000000000000000000
2531 parent: -1:0000000000000000000000000000000000000000
2532 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2532 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2533 user: person
2533 user: person
2534 date: Fri Jan 16 01:06:40 1970 +0000
2534 date: Fri Jan 16 01:06:40 1970 +0000
2535 files: c
2535 files: c
2536 extra: branch=default
2536 extra: branch=default
2537 description:
2537 description:
2538 no user, no domain
2538 no user, no domain
2539
2539
2540
2540
2541 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2541 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2542 bisect: bad (implicit)
2542 bisect: bad (implicit)
2543 branch: foo
2543 branch: foo
2544 phase: draft
2544 phase: draft
2545 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2545 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2546 parent: -1:0000000000000000000000000000000000000000
2546 parent: -1:0000000000000000000000000000000000000000
2547 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2547 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2548 user: person
2548 user: person
2549 date: Sat Jan 17 04:53:20 1970 +0000
2549 date: Sat Jan 17 04:53:20 1970 +0000
2550 extra: branch=foo
2550 extra: branch=foo
2551 description:
2551 description:
2552 new branch
2552 new branch
2553
2553
2554
2554
2555 $ hg log -v -T bisect -r 0:4
2555 $ hg log -v -T bisect -r 0:4
2556 changeset: 0:1e4e1b8f71e0
2556 changeset: 0:1e4e1b8f71e0
2557 bisect: good (implicit)
2557 bisect: good (implicit)
2558 user: User Name <user@hostname>
2558 user: User Name <user@hostname>
2559 date: Mon Jan 12 13:46:40 1970 +0000
2559 date: Mon Jan 12 13:46:40 1970 +0000
2560 files: a
2560 files: a
2561 description:
2561 description:
2562 line 1
2562 line 1
2563 line 2
2563 line 2
2564
2564
2565
2565
2566 changeset: 1:b608e9d1a3f0
2566 changeset: 1:b608e9d1a3f0
2567 bisect: good
2567 bisect: good
2568 user: A. N. Other <other@place>
2568 user: A. N. Other <other@place>
2569 date: Tue Jan 13 17:33:20 1970 +0000
2569 date: Tue Jan 13 17:33:20 1970 +0000
2570 files: b
2570 files: b
2571 description:
2571 description:
2572 other 1
2572 other 1
2573 other 2
2573 other 2
2574
2574
2575 other 3
2575 other 3
2576
2576
2577
2577
2578 changeset: 2:97054abb4ab8
2578 changeset: 2:97054abb4ab8
2579 bisect: untested
2579 bisect: untested
2580 user: other@place
2580 user: other@place
2581 date: Wed Jan 14 21:20:00 1970 +0000
2581 date: Wed Jan 14 21:20:00 1970 +0000
2582 files: c
2582 files: c
2583 description:
2583 description:
2584 no person
2584 no person
2585
2585
2586
2586
2587 changeset: 3:10e46f2dcbf4
2587 changeset: 3:10e46f2dcbf4
2588 bisect: bad
2588 bisect: bad
2589 user: person
2589 user: person
2590 date: Fri Jan 16 01:06:40 1970 +0000
2590 date: Fri Jan 16 01:06:40 1970 +0000
2591 files: c
2591 files: c
2592 description:
2592 description:
2593 no user, no domain
2593 no user, no domain
2594
2594
2595
2595
2596 changeset: 4:bbe44766e73d
2596 changeset: 4:bbe44766e73d
2597 bisect: bad (implicit)
2597 bisect: bad (implicit)
2598 branch: foo
2598 branch: foo
2599 user: person
2599 user: person
2600 date: Sat Jan 17 04:53:20 1970 +0000
2600 date: Sat Jan 17 04:53:20 1970 +0000
2601 description:
2601 description:
2602 new branch
2602 new branch
2603
2603
2604
2604
2605 $ hg --color=debug log -T bisect -r 0:4
2605 $ hg --color=debug log -T bisect -r 0:4
2606 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2606 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2607 [log.bisect bisect.good|bisect: good (implicit)]
2607 [log.bisect bisect.good|bisect: good (implicit)]
2608 [log.user|user: User Name <user@hostname>]
2608 [log.user|user: User Name <user@hostname>]
2609 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2609 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2610 [log.summary|summary: line 1]
2610 [log.summary|summary: line 1]
2611
2611
2612 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2612 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2613 [log.bisect bisect.good|bisect: good]
2613 [log.bisect bisect.good|bisect: good]
2614 [log.user|user: A. N. Other <other@place>]
2614 [log.user|user: A. N. Other <other@place>]
2615 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2615 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2616 [log.summary|summary: other 1]
2616 [log.summary|summary: other 1]
2617
2617
2618 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2618 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2619 [log.bisect bisect.untested|bisect: untested]
2619 [log.bisect bisect.untested|bisect: untested]
2620 [log.user|user: other@place]
2620 [log.user|user: other@place]
2621 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2621 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2622 [log.summary|summary: no person]
2622 [log.summary|summary: no person]
2623
2623
2624 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2624 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2625 [log.bisect bisect.bad|bisect: bad]
2625 [log.bisect bisect.bad|bisect: bad]
2626 [log.user|user: person]
2626 [log.user|user: person]
2627 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2627 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2628 [log.summary|summary: no user, no domain]
2628 [log.summary|summary: no user, no domain]
2629
2629
2630 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2630 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2631 [log.bisect bisect.bad|bisect: bad (implicit)]
2631 [log.bisect bisect.bad|bisect: bad (implicit)]
2632 [log.branch|branch: foo]
2632 [log.branch|branch: foo]
2633 [log.user|user: person]
2633 [log.user|user: person]
2634 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2634 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2635 [log.summary|summary: new branch]
2635 [log.summary|summary: new branch]
2636
2636
2637 $ hg --color=debug log --debug -T bisect -r 0:4
2637 $ hg --color=debug log --debug -T bisect -r 0:4
2638 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2638 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2639 [log.bisect bisect.good|bisect: good (implicit)]
2639 [log.bisect bisect.good|bisect: good (implicit)]
2640 [log.phase|phase: public]
2640 [log.phase|phase: public]
2641 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2641 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2642 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2642 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2643 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2643 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2644 [log.user|user: User Name <user@hostname>]
2644 [log.user|user: User Name <user@hostname>]
2645 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2645 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2646 [ui.debug log.files|files+: a]
2646 [ui.debug log.files|files+: a]
2647 [ui.debug log.extra|extra: branch=default]
2647 [ui.debug log.extra|extra: branch=default]
2648 [ui.note log.description|description:]
2648 [ui.note log.description|description:]
2649 [ui.note log.description|line 1
2649 [ui.note log.description|line 1
2650 line 2]
2650 line 2]
2651
2651
2652
2652
2653 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2653 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2654 [log.bisect bisect.good|bisect: good]
2654 [log.bisect bisect.good|bisect: good]
2655 [log.phase|phase: public]
2655 [log.phase|phase: public]
2656 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2656 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2657 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2657 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2658 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2658 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2659 [log.user|user: A. N. Other <other@place>]
2659 [log.user|user: A. N. Other <other@place>]
2660 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2660 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2661 [ui.debug log.files|files+: b]
2661 [ui.debug log.files|files+: b]
2662 [ui.debug log.extra|extra: branch=default]
2662 [ui.debug log.extra|extra: branch=default]
2663 [ui.note log.description|description:]
2663 [ui.note log.description|description:]
2664 [ui.note log.description|other 1
2664 [ui.note log.description|other 1
2665 other 2
2665 other 2
2666
2666
2667 other 3]
2667 other 3]
2668
2668
2669
2669
2670 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2670 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2671 [log.bisect bisect.untested|bisect: untested]
2671 [log.bisect bisect.untested|bisect: untested]
2672 [log.phase|phase: public]
2672 [log.phase|phase: public]
2673 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2673 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2674 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2674 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2675 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2675 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2676 [log.user|user: other@place]
2676 [log.user|user: other@place]
2677 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2677 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2678 [ui.debug log.files|files+: c]
2678 [ui.debug log.files|files+: c]
2679 [ui.debug log.extra|extra: branch=default]
2679 [ui.debug log.extra|extra: branch=default]
2680 [ui.note log.description|description:]
2680 [ui.note log.description|description:]
2681 [ui.note log.description|no person]
2681 [ui.note log.description|no person]
2682
2682
2683
2683
2684 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2684 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2685 [log.bisect bisect.bad|bisect: bad]
2685 [log.bisect bisect.bad|bisect: bad]
2686 [log.phase|phase: public]
2686 [log.phase|phase: public]
2687 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2687 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2688 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2688 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2689 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2689 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2690 [log.user|user: person]
2690 [log.user|user: person]
2691 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2691 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2692 [ui.debug log.files|files: c]
2692 [ui.debug log.files|files: c]
2693 [ui.debug log.extra|extra: branch=default]
2693 [ui.debug log.extra|extra: branch=default]
2694 [ui.note log.description|description:]
2694 [ui.note log.description|description:]
2695 [ui.note log.description|no user, no domain]
2695 [ui.note log.description|no user, no domain]
2696
2696
2697
2697
2698 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2698 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2699 [log.bisect bisect.bad|bisect: bad (implicit)]
2699 [log.bisect bisect.bad|bisect: bad (implicit)]
2700 [log.branch|branch: foo]
2700 [log.branch|branch: foo]
2701 [log.phase|phase: draft]
2701 [log.phase|phase: draft]
2702 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2702 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2703 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2703 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2704 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2704 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2705 [log.user|user: person]
2705 [log.user|user: person]
2706 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2706 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2707 [ui.debug log.extra|extra: branch=foo]
2707 [ui.debug log.extra|extra: branch=foo]
2708 [ui.note log.description|description:]
2708 [ui.note log.description|description:]
2709 [ui.note log.description|new branch]
2709 [ui.note log.description|new branch]
2710
2710
2711
2711
2712 $ hg --color=debug log -v -T bisect -r 0:4
2712 $ hg --color=debug log -v -T bisect -r 0:4
2713 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2713 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2714 [log.bisect bisect.good|bisect: good (implicit)]
2714 [log.bisect bisect.good|bisect: good (implicit)]
2715 [log.user|user: User Name <user@hostname>]
2715 [log.user|user: User Name <user@hostname>]
2716 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2716 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2717 [ui.note log.files|files: a]
2717 [ui.note log.files|files: a]
2718 [ui.note log.description|description:]
2718 [ui.note log.description|description:]
2719 [ui.note log.description|line 1
2719 [ui.note log.description|line 1
2720 line 2]
2720 line 2]
2721
2721
2722
2722
2723 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2723 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2724 [log.bisect bisect.good|bisect: good]
2724 [log.bisect bisect.good|bisect: good]
2725 [log.user|user: A. N. Other <other@place>]
2725 [log.user|user: A. N. Other <other@place>]
2726 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2726 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2727 [ui.note log.files|files: b]
2727 [ui.note log.files|files: b]
2728 [ui.note log.description|description:]
2728 [ui.note log.description|description:]
2729 [ui.note log.description|other 1
2729 [ui.note log.description|other 1
2730 other 2
2730 other 2
2731
2731
2732 other 3]
2732 other 3]
2733
2733
2734
2734
2735 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2735 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2736 [log.bisect bisect.untested|bisect: untested]
2736 [log.bisect bisect.untested|bisect: untested]
2737 [log.user|user: other@place]
2737 [log.user|user: other@place]
2738 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2738 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2739 [ui.note log.files|files: c]
2739 [ui.note log.files|files: c]
2740 [ui.note log.description|description:]
2740 [ui.note log.description|description:]
2741 [ui.note log.description|no person]
2741 [ui.note log.description|no person]
2742
2742
2743
2743
2744 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2744 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2745 [log.bisect bisect.bad|bisect: bad]
2745 [log.bisect bisect.bad|bisect: bad]
2746 [log.user|user: person]
2746 [log.user|user: person]
2747 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2747 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2748 [ui.note log.files|files: c]
2748 [ui.note log.files|files: c]
2749 [ui.note log.description|description:]
2749 [ui.note log.description|description:]
2750 [ui.note log.description|no user, no domain]
2750 [ui.note log.description|no user, no domain]
2751
2751
2752
2752
2753 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2753 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2754 [log.bisect bisect.bad|bisect: bad (implicit)]
2754 [log.bisect bisect.bad|bisect: bad (implicit)]
2755 [log.branch|branch: foo]
2755 [log.branch|branch: foo]
2756 [log.user|user: person]
2756 [log.user|user: person]
2757 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2757 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2758 [ui.note log.description|description:]
2758 [ui.note log.description|description:]
2759 [ui.note log.description|new branch]
2759 [ui.note log.description|new branch]
2760
2760
2761
2761
2762 $ hg bisect --reset
2762 $ hg bisect --reset
2763
2763
2764 Error on syntax:
2764 Error on syntax:
2765
2765
2766 $ echo 'x = "f' >> t
2766 $ echo 'x = "f' >> t
2767 $ hg log
2767 $ hg log
2768 hg: parse error at t:3: unmatched quotes
2768 hg: parse error at t:3: unmatched quotes
2769 [255]
2769 [255]
2770
2770
2771 $ hg log -T '{date'
2771 $ hg log -T '{date'
2772 hg: parse error at 1: unterminated template expansion
2772 hg: parse error at 1: unterminated template expansion
2773 ({date
2773 ({date
2774 ^ here)
2774 ^ here)
2775 [255]
2775 [255]
2776 $ hg log -T '{date(}'
2776 $ hg log -T '{date(}'
2777 hg: parse error at 6: not a prefix: end
2777 hg: parse error at 6: not a prefix: end
2778 ({date(}
2778 ({date(}
2779 ^ here)
2779 ^ here)
2780 [255]
2780 [255]
2781 $ hg log -T '{date)}'
2781 $ hg log -T '{date)}'
2782 hg: parse error at 5: invalid token
2782 hg: parse error at 5: invalid token
2783 ({date)}
2783 ({date)}
2784 ^ here)
2784 ^ here)
2785 [255]
2785 [255]
2786 $ hg log -T '{date date}'
2786 $ hg log -T '{date date}'
2787 hg: parse error at 6: invalid token
2787 hg: parse error at 6: invalid token
2788 ({date date}
2788 ({date date}
2789 ^ here)
2789 ^ here)
2790 [255]
2790 [255]
2791
2791
2792 $ hg log -T '{}'
2792 $ hg log -T '{}'
2793 hg: parse error at 1: not a prefix: end
2793 hg: parse error at 1: not a prefix: end
2794 ({}
2794 ({}
2795 ^ here)
2795 ^ here)
2796 [255]
2796 [255]
2797 $ hg debugtemplate -v '{()}'
2797 $ hg debugtemplate -v '{()}'
2798 (template
2798 (template
2799 (group
2799 (group
2800 None))
2800 None))
2801 hg: parse error: missing argument
2801 hg: parse error: missing argument
2802 [255]
2802 [255]
2803
2803
2804 Behind the scenes, this would throw TypeError without intype=bytes
2804 Behind the scenes, this would throw TypeError without intype=bytes
2805
2805
2806 $ hg log -l 3 --template '{date|obfuscate}\n'
2806 $ hg log -l 3 --template '{date|obfuscate}\n'
2807 &#48;&#46;&#48;&#48;
2807 &#48;&#46;&#48;&#48;
2808 &#48;&#46;&#48;&#48;
2808 &#48;&#46;&#48;&#48;
2809 &#49;&#53;&#55;&#55;&#56;&#55;&#50;&#56;&#54;&#48;&#46;&#48;&#48;
2809 &#49;&#53;&#55;&#55;&#56;&#55;&#50;&#56;&#54;&#48;&#46;&#48;&#48;
2810
2810
2811 Behind the scenes, this will throw a ValueError
2811 Behind the scenes, this will throw a ValueError
2812
2812
2813 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
2813 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
2814 hg: parse error: invalid date: 'Modify, add, remove, rename'
2814 hg: parse error: invalid date: 'Modify, add, remove, rename'
2815 (template filter 'shortdate' is not compatible with keyword 'desc')
2815 (template filter 'shortdate' is not compatible with keyword 'desc')
2816 [255]
2816 [255]
2817
2817
2818 Behind the scenes, this would throw AttributeError without intype=bytes
2818 Behind the scenes, this would throw AttributeError without intype=bytes
2819
2819
2820 $ hg log -l 3 --template 'line: {date|escape}\n'
2820 $ hg log -l 3 --template 'line: {date|escape}\n'
2821 line: 0.00
2821 line: 0.00
2822 line: 0.00
2822 line: 0.00
2823 line: 1577872860.00
2823 line: 1577872860.00
2824
2824
2825 $ hg log -l 3 --template 'line: {extras|localdate}\n'
2825 $ hg log -l 3 --template 'line: {extras|localdate}\n'
2826 hg: parse error: localdate expects a date information
2826 hg: parse error: localdate expects a date information
2827 [255]
2827 [255]
2828
2828
2829 Behind the scenes, this will throw ValueError
2829 Behind the scenes, this will throw ValueError
2830
2830
2831 $ hg tip --template '{author|email|date}\n'
2831 $ hg tip --template '{author|email|date}\n'
2832 hg: parse error: date expects a date information
2832 hg: parse error: date expects a date information
2833 [255]
2833 [255]
2834
2834
2835 $ hg tip -T '{author|email|shortdate}\n'
2835 $ hg tip -T '{author|email|shortdate}\n'
2836 hg: parse error: invalid date: 'test'
2836 hg: parse error: invalid date: 'test'
2837 (template filter 'shortdate' is not compatible with keyword 'author')
2837 (template filter 'shortdate' is not compatible with keyword 'author')
2838 [255]
2838 [255]
2839
2839
2840 $ hg tip -T '{get(extras, "branch")|shortdate}\n'
2840 $ hg tip -T '{get(extras, "branch")|shortdate}\n'
2841 hg: parse error: invalid date: 'default'
2841 hg: parse error: invalid date: 'default'
2842 (incompatible use of template filter 'shortdate')
2842 (incompatible use of template filter 'shortdate')
2843 [255]
2843 [255]
2844
2844
2845 Error in nested template:
2845 Error in nested template:
2846
2846
2847 $ hg log -T '{"date'
2847 $ hg log -T '{"date'
2848 hg: parse error at 2: unterminated string
2848 hg: parse error at 2: unterminated string
2849 ({"date
2849 ({"date
2850 ^ here)
2850 ^ here)
2851 [255]
2851 [255]
2852
2852
2853 $ hg log -T '{"foo{date|?}"}'
2853 $ hg log -T '{"foo{date|?}"}'
2854 hg: parse error at 11: syntax error
2854 hg: parse error at 11: syntax error
2855 ({"foo{date|?}"}
2855 ({"foo{date|?}"}
2856 ^ here)
2856 ^ here)
2857 [255]
2857 [255]
2858
2858
2859 Thrown an error if a template function doesn't exist
2859 Thrown an error if a template function doesn't exist
2860
2860
2861 $ hg tip --template '{foo()}\n'
2861 $ hg tip --template '{foo()}\n'
2862 hg: parse error: unknown function 'foo'
2862 hg: parse error: unknown function 'foo'
2863 [255]
2863 [255]
2864
2864
2865 Pass generator object created by template function to filter
2865 Pass generator object created by template function to filter
2866
2866
2867 $ hg log -l 1 --template '{if(author, author)|user}\n'
2867 $ hg log -l 1 --template '{if(author, author)|user}\n'
2868 test
2868 test
2869
2869
2870 Test index keyword:
2870 Test index keyword:
2871
2871
2872 $ hg log -l 2 -T '{index + 10}{files % " {index}:{file}"}\n'
2872 $ hg log -l 2 -T '{index + 10}{files % " {index}:{file}"}\n'
2873 10 0:a 1:b 2:fifth 3:fourth 4:third
2873 10 0:a 1:b 2:fifth 3:fourth 4:third
2874 11 0:a
2874 11 0:a
2875
2875
2876 $ hg branches -T '{index} {branch}\n'
2876 $ hg branches -T '{index} {branch}\n'
2877 0 default
2877 0 default
2878 1 foo
2878 1 foo
2879
2879
2880 Test diff function:
2880 Test diff function:
2881
2881
2882 $ hg diff -c 8
2882 $ hg diff -c 8
2883 diff -r 29114dbae42b -r 95c24699272e fourth
2883 diff -r 29114dbae42b -r 95c24699272e fourth
2884 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2884 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2885 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2885 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2886 @@ -0,0 +1,1 @@
2886 @@ -0,0 +1,1 @@
2887 +second
2887 +second
2888 diff -r 29114dbae42b -r 95c24699272e second
2888 diff -r 29114dbae42b -r 95c24699272e second
2889 --- a/second Mon Jan 12 13:46:40 1970 +0000
2889 --- a/second Mon Jan 12 13:46:40 1970 +0000
2890 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2890 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2891 @@ -1,1 +0,0 @@
2891 @@ -1,1 +0,0 @@
2892 -second
2892 -second
2893 diff -r 29114dbae42b -r 95c24699272e third
2893 diff -r 29114dbae42b -r 95c24699272e third
2894 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2894 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2895 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2895 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2896 @@ -0,0 +1,1 @@
2896 @@ -0,0 +1,1 @@
2897 +third
2897 +third
2898
2898
2899 $ hg log -r 8 -T "{diff()}"
2899 $ hg log -r 8 -T "{diff()}"
2900 diff -r 29114dbae42b -r 95c24699272e fourth
2900 diff -r 29114dbae42b -r 95c24699272e fourth
2901 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2901 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2902 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2902 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2903 @@ -0,0 +1,1 @@
2903 @@ -0,0 +1,1 @@
2904 +second
2904 +second
2905 diff -r 29114dbae42b -r 95c24699272e second
2905 diff -r 29114dbae42b -r 95c24699272e second
2906 --- a/second Mon Jan 12 13:46:40 1970 +0000
2906 --- a/second Mon Jan 12 13:46:40 1970 +0000
2907 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2907 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2908 @@ -1,1 +0,0 @@
2908 @@ -1,1 +0,0 @@
2909 -second
2909 -second
2910 diff -r 29114dbae42b -r 95c24699272e third
2910 diff -r 29114dbae42b -r 95c24699272e third
2911 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2911 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2912 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2912 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2913 @@ -0,0 +1,1 @@
2913 @@ -0,0 +1,1 @@
2914 +third
2914 +third
2915
2915
2916 $ hg log -r 8 -T "{diff('glob:f*')}"
2916 $ hg log -r 8 -T "{diff('glob:f*')}"
2917 diff -r 29114dbae42b -r 95c24699272e fourth
2917 diff -r 29114dbae42b -r 95c24699272e fourth
2918 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2918 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2919 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2919 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2920 @@ -0,0 +1,1 @@
2920 @@ -0,0 +1,1 @@
2921 +second
2921 +second
2922
2922
2923 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
2923 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
2924 diff -r 29114dbae42b -r 95c24699272e second
2924 diff -r 29114dbae42b -r 95c24699272e second
2925 --- a/second Mon Jan 12 13:46:40 1970 +0000
2925 --- a/second Mon Jan 12 13:46:40 1970 +0000
2926 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2926 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2927 @@ -1,1 +0,0 @@
2927 @@ -1,1 +0,0 @@
2928 -second
2928 -second
2929 diff -r 29114dbae42b -r 95c24699272e third
2929 diff -r 29114dbae42b -r 95c24699272e third
2930 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2930 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2931 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2931 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2932 @@ -0,0 +1,1 @@
2932 @@ -0,0 +1,1 @@
2933 +third
2933 +third
2934
2934
2935 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2935 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2936 diff -r 29114dbae42b -r 95c24699272e fourth
2936 diff -r 29114dbae42b -r 95c24699272e fourth
2937 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2937 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2938 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2938 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2939 @@ -0,0 +1,1 @@
2939 @@ -0,0 +1,1 @@
2940 +second
2940 +second
2941
2941
2942 ui verbosity:
2942 ui verbosity:
2943
2943
2944 $ hg log -l1 -T '{verbosity}\n'
2944 $ hg log -l1 -T '{verbosity}\n'
2945
2945
2946 $ hg log -l1 -T '{verbosity}\n' --debug
2946 $ hg log -l1 -T '{verbosity}\n' --debug
2947 debug
2947 debug
2948 $ hg log -l1 -T '{verbosity}\n' --quiet
2948 $ hg log -l1 -T '{verbosity}\n' --quiet
2949 quiet
2949 quiet
2950 $ hg log -l1 -T '{verbosity}\n' --verbose
2950 $ hg log -l1 -T '{verbosity}\n' --verbose
2951 verbose
2951 verbose
2952
2952
2953 $ cd ..
2953 $ cd ..
2954
2954
2955
2955
2956 latesttag:
2956 latesttag:
2957
2957
2958 $ hg init latesttag
2958 $ hg init latesttag
2959 $ cd latesttag
2959 $ cd latesttag
2960
2960
2961 $ echo a > file
2961 $ echo a > file
2962 $ hg ci -Am a -d '0 0'
2962 $ hg ci -Am a -d '0 0'
2963 adding file
2963 adding file
2964
2964
2965 $ echo b >> file
2965 $ echo b >> file
2966 $ hg ci -m b -d '1 0'
2966 $ hg ci -m b -d '1 0'
2967
2967
2968 $ echo c >> head1
2968 $ echo c >> head1
2969 $ hg ci -Am h1c -d '2 0'
2969 $ hg ci -Am h1c -d '2 0'
2970 adding head1
2970 adding head1
2971
2971
2972 $ hg update -q 1
2972 $ hg update -q 1
2973 $ echo d >> head2
2973 $ echo d >> head2
2974 $ hg ci -Am h2d -d '3 0'
2974 $ hg ci -Am h2d -d '3 0'
2975 adding head2
2975 adding head2
2976 created new head
2976 created new head
2977
2977
2978 $ echo e >> head2
2978 $ echo e >> head2
2979 $ hg ci -m h2e -d '4 0'
2979 $ hg ci -m h2e -d '4 0'
2980
2980
2981 $ hg merge -q
2981 $ hg merge -q
2982 $ hg ci -m merge -d '5 -3600'
2982 $ hg ci -m merge -d '5 -3600'
2983
2983
2984 No tag set:
2984 No tag set:
2985
2985
2986 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
2986 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
2987 @ 5: null+5
2987 @ 5: null+5
2988 |\
2988 |\
2989 | o 4: null+4
2989 | o 4: null+4
2990 | |
2990 | |
2991 | o 3: null+3
2991 | o 3: null+3
2992 | |
2992 | |
2993 o | 2: null+3
2993 o | 2: null+3
2994 |/
2994 |/
2995 o 1: null+2
2995 o 1: null+2
2996 |
2996 |
2997 o 0: null+1
2997 o 0: null+1
2998
2998
2999
2999
3000 One common tag: longest path wins for {latesttagdistance}:
3000 One common tag: longest path wins for {latesttagdistance}:
3001
3001
3002 $ hg tag -r 1 -m t1 -d '6 0' t1
3002 $ hg tag -r 1 -m t1 -d '6 0' t1
3003 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3003 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3004 @ 6: t1+4
3004 @ 6: t1+4
3005 |
3005 |
3006 o 5: t1+3
3006 o 5: t1+3
3007 |\
3007 |\
3008 | o 4: t1+2
3008 | o 4: t1+2
3009 | |
3009 | |
3010 | o 3: t1+1
3010 | o 3: t1+1
3011 | |
3011 | |
3012 o | 2: t1+1
3012 o | 2: t1+1
3013 |/
3013 |/
3014 o 1: t1+0
3014 o 1: t1+0
3015 |
3015 |
3016 o 0: null+1
3016 o 0: null+1
3017
3017
3018
3018
3019 One ancestor tag: closest wins:
3019 One ancestor tag: closest wins:
3020
3020
3021 $ hg tag -r 2 -m t2 -d '7 0' t2
3021 $ hg tag -r 2 -m t2 -d '7 0' t2
3022 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3022 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3023 @ 7: t2+3
3023 @ 7: t2+3
3024 |
3024 |
3025 o 6: t2+2
3025 o 6: t2+2
3026 |
3026 |
3027 o 5: t2+1
3027 o 5: t2+1
3028 |\
3028 |\
3029 | o 4: t1+2
3029 | o 4: t1+2
3030 | |
3030 | |
3031 | o 3: t1+1
3031 | o 3: t1+1
3032 | |
3032 | |
3033 o | 2: t2+0
3033 o | 2: t2+0
3034 |/
3034 |/
3035 o 1: t1+0
3035 o 1: t1+0
3036 |
3036 |
3037 o 0: null+1
3037 o 0: null+1
3038
3038
3039
3039
3040 Two branch tags: more recent wins if same number of changes:
3040 Two branch tags: more recent wins if same number of changes:
3041
3041
3042 $ hg tag -r 3 -m t3 -d '8 0' t3
3042 $ hg tag -r 3 -m t3 -d '8 0' t3
3043 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3043 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3044 @ 8: t3+5
3044 @ 8: t3+5
3045 |
3045 |
3046 o 7: t3+4
3046 o 7: t3+4
3047 |
3047 |
3048 o 6: t3+3
3048 o 6: t3+3
3049 |
3049 |
3050 o 5: t3+2
3050 o 5: t3+2
3051 |\
3051 |\
3052 | o 4: t3+1
3052 | o 4: t3+1
3053 | |
3053 | |
3054 | o 3: t3+0
3054 | o 3: t3+0
3055 | |
3055 | |
3056 o | 2: t2+0
3056 o | 2: t2+0
3057 |/
3057 |/
3058 o 1: t1+0
3058 o 1: t1+0
3059 |
3059 |
3060 o 0: null+1
3060 o 0: null+1
3061
3061
3062
3062
3063 Two branch tags: fewest changes wins:
3063 Two branch tags: fewest changes wins:
3064
3064
3065 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter
3065 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter
3066 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3066 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3067 @ 9: t4+5,6
3067 @ 9: t4+5,6
3068 |
3068 |
3069 o 8: t4+4,5
3069 o 8: t4+4,5
3070 |
3070 |
3071 o 7: t4+3,4
3071 o 7: t4+3,4
3072 |
3072 |
3073 o 6: t4+2,3
3073 o 6: t4+2,3
3074 |
3074 |
3075 o 5: t4+1,2
3075 o 5: t4+1,2
3076 |\
3076 |\
3077 | o 4: t4+0,0
3077 | o 4: t4+0,0
3078 | |
3078 | |
3079 | o 3: t3+0,0
3079 | o 3: t3+0,0
3080 | |
3080 | |
3081 o | 2: t2+0,0
3081 o | 2: t2+0,0
3082 |/
3082 |/
3083 o 1: t1+0,0
3083 o 1: t1+0,0
3084 |
3084 |
3085 o 0: null+1,1
3085 o 0: null+1,1
3086
3086
3087
3087
3088 Merged tag overrides:
3088 Merged tag overrides:
3089
3089
3090 $ hg tag -r 5 -m t5 -d '9 0' t5
3090 $ hg tag -r 5 -m t5 -d '9 0' t5
3091 $ hg tag -r 3 -m at3 -d '10 0' at3
3091 $ hg tag -r 3 -m at3 -d '10 0' at3
3092 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3092 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3093 @ 11: t5+6
3093 @ 11: t5+6
3094 |
3094 |
3095 o 10: t5+5
3095 o 10: t5+5
3096 |
3096 |
3097 o 9: t5+4
3097 o 9: t5+4
3098 |
3098 |
3099 o 8: t5+3
3099 o 8: t5+3
3100 |
3100 |
3101 o 7: t5+2
3101 o 7: t5+2
3102 |
3102 |
3103 o 6: t5+1
3103 o 6: t5+1
3104 |
3104 |
3105 o 5: t5+0
3105 o 5: t5+0
3106 |\
3106 |\
3107 | o 4: t4+0
3107 | o 4: t4+0
3108 | |
3108 | |
3109 | o 3: at3:t3+0
3109 | o 3: at3:t3+0
3110 | |
3110 | |
3111 o | 2: t2+0
3111 o | 2: t2+0
3112 |/
3112 |/
3113 o 1: t1+0
3113 o 1: t1+0
3114 |
3114 |
3115 o 0: null+1
3115 o 0: null+1
3116
3116
3117
3117
3118 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3118 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3119 @ 11: t5+6,6
3119 @ 11: t5+6,6
3120 |
3120 |
3121 o 10: t5+5,5
3121 o 10: t5+5,5
3122 |
3122 |
3123 o 9: t5+4,4
3123 o 9: t5+4,4
3124 |
3124 |
3125 o 8: t5+3,3
3125 o 8: t5+3,3
3126 |
3126 |
3127 o 7: t5+2,2
3127 o 7: t5+2,2
3128 |
3128 |
3129 o 6: t5+1,1
3129 o 6: t5+1,1
3130 |
3130 |
3131 o 5: t5+0,0
3131 o 5: t5+0,0
3132 |\
3132 |\
3133 | o 4: t4+0,0
3133 | o 4: t4+0,0
3134 | |
3134 | |
3135 | o 3: at3+0,0 t3+0,0
3135 | o 3: at3+0,0 t3+0,0
3136 | |
3136 | |
3137 o | 2: t2+0,0
3137 o | 2: t2+0,0
3138 |/
3138 |/
3139 o 1: t1+0,0
3139 o 1: t1+0,0
3140 |
3140 |
3141 o 0: null+1,1
3141 o 0: null+1,1
3142
3142
3143
3143
3144 $ hg log -G --template "{rev}: {latesttag('re:^t[13]$') % '{tag}, C: {changes}, D: {distance}'}\n"
3144 $ hg log -G --template "{rev}: {latesttag('re:^t[13]$') % '{tag}, C: {changes}, D: {distance}'}\n"
3145 @ 11: t3, C: 9, D: 8
3145 @ 11: t3, C: 9, D: 8
3146 |
3146 |
3147 o 10: t3, C: 8, D: 7
3147 o 10: t3, C: 8, D: 7
3148 |
3148 |
3149 o 9: t3, C: 7, D: 6
3149 o 9: t3, C: 7, D: 6
3150 |
3150 |
3151 o 8: t3, C: 6, D: 5
3151 o 8: t3, C: 6, D: 5
3152 |
3152 |
3153 o 7: t3, C: 5, D: 4
3153 o 7: t3, C: 5, D: 4
3154 |
3154 |
3155 o 6: t3, C: 4, D: 3
3155 o 6: t3, C: 4, D: 3
3156 |
3156 |
3157 o 5: t3, C: 3, D: 2
3157 o 5: t3, C: 3, D: 2
3158 |\
3158 |\
3159 | o 4: t3, C: 1, D: 1
3159 | o 4: t3, C: 1, D: 1
3160 | |
3160 | |
3161 | o 3: t3, C: 0, D: 0
3161 | o 3: t3, C: 0, D: 0
3162 | |
3162 | |
3163 o | 2: t1, C: 1, D: 1
3163 o | 2: t1, C: 1, D: 1
3164 |/
3164 |/
3165 o 1: t1, C: 0, D: 0
3165 o 1: t1, C: 0, D: 0
3166 |
3166 |
3167 o 0: null, C: 1, D: 1
3167 o 0: null, C: 1, D: 1
3168
3168
3169
3169
3170 $ cd ..
3170 $ cd ..
3171
3171
3172
3172
3173 Style path expansion: issue1948 - ui.style option doesn't work on OSX
3173 Style path expansion: issue1948 - ui.style option doesn't work on OSX
3174 if it is a relative path
3174 if it is a relative path
3175
3175
3176 $ mkdir -p home/styles
3176 $ mkdir -p home/styles
3177
3177
3178 $ cat > home/styles/teststyle <<EOF
3178 $ cat > home/styles/teststyle <<EOF
3179 > changeset = 'test {rev}:{node|short}\n'
3179 > changeset = 'test {rev}:{node|short}\n'
3180 > EOF
3180 > EOF
3181
3181
3182 $ HOME=`pwd`/home; export HOME
3182 $ HOME=`pwd`/home; export HOME
3183
3183
3184 $ cat > latesttag/.hg/hgrc <<EOF
3184 $ cat > latesttag/.hg/hgrc <<EOF
3185 > [ui]
3185 > [ui]
3186 > style = ~/styles/teststyle
3186 > style = ~/styles/teststyle
3187 > EOF
3187 > EOF
3188
3188
3189 $ hg -R latesttag tip
3189 $ hg -R latesttag tip
3190 test 11:97e5943b523a
3190 test 11:97e5943b523a
3191
3191
3192 Test recursive showlist template (issue1989):
3192 Test recursive showlist template (issue1989):
3193
3193
3194 $ cat > style1989 <<EOF
3194 $ cat > style1989 <<EOF
3195 > changeset = '{file_mods}{manifest}{extras}'
3195 > changeset = '{file_mods}{manifest}{extras}'
3196 > file_mod = 'M|{author|person}\n'
3196 > file_mod = 'M|{author|person}\n'
3197 > manifest = '{rev},{author}\n'
3197 > manifest = '{rev},{author}\n'
3198 > extra = '{key}: {author}\n'
3198 > extra = '{key}: {author}\n'
3199 > EOF
3199 > EOF
3200
3200
3201 $ hg -R latesttag log -r tip --style=style1989
3201 $ hg -R latesttag log -r tip --style=style1989
3202 M|test
3202 M|test
3203 11,test
3203 11,test
3204 branch: test
3204 branch: test
3205
3205
3206 Test new-style inline templating:
3206 Test new-style inline templating:
3207
3207
3208 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
3208 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
3209 modified files: .hgtags
3209 modified files: .hgtags
3210
3210
3211
3211
3212 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
3212 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
3213 hg: parse error: keyword 'rev' is not iterable
3213 hg: parse error: keyword 'rev' is not iterable of mappings
3214 [255]
3214 [255]
3215 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
3215 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
3216 hg: parse error: None is not iterable
3216 hg: parse error: None is not iterable of mappings
3217 [255]
3218 $ hg log -R latesttag -r tip -T '{extras % "{key}\n" % "{key}\n"}'
3219 hg: parse error: <generator *> is not iterable of mappings (glob)
3217 [255]
3220 [255]
3218
3221
3219 Test new-style inline templating of non-list/dict type:
3222 Test new-style inline templating of non-list/dict type:
3220
3223
3221 $ hg log -R latesttag -r tip -T '{manifest}\n'
3224 $ hg log -R latesttag -r tip -T '{manifest}\n'
3222 11:2bc6e9006ce2
3225 11:2bc6e9006ce2
3223 $ hg log -R latesttag -r tip -T 'string length: {manifest|count}\n'
3226 $ hg log -R latesttag -r tip -T 'string length: {manifest|count}\n'
3224 string length: 15
3227 string length: 15
3225 $ hg log -R latesttag -r tip -T '{manifest % "{rev}:{node}"}\n'
3228 $ hg log -R latesttag -r tip -T '{manifest % "{rev}:{node}"}\n'
3226 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc
3229 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc
3227
3230
3228 $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}'
3231 $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}'
3229 branch: default
3232 branch: default
3230 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}'
3233 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}'
3231 hg: parse error: None is not iterable
3234 hg: parse error: None is not iterable of mappings
3232 [255]
3235 [255]
3233 $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}'
3236 $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}'
3234 branch: default
3237 branch: default
3235 $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}'
3238 $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}'
3236 0:ce3cec86e6c2
3239 0:ce3cec86e6c2
3237 $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}'
3240 $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}'
3238 9:fbc7cd862e9c
3241 9:fbc7cd862e9c
3239
3242
3240 Test manifest/get() can be join()-ed as before, though it's silly:
3243 Test manifest/get() can be join()-ed as before, though it's silly:
3241
3244
3242 $ hg log -R latesttag -r tip -T '{join(manifest, "")}\n'
3245 $ hg log -R latesttag -r tip -T '{join(manifest, "")}\n'
3243 11:2bc6e9006ce2
3246 11:2bc6e9006ce2
3244 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), "")}\n'
3247 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), "")}\n'
3245 default
3248 default
3246
3249
3247 Test min/max of integers
3250 Test min/max of integers
3248
3251
3249 $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'
3252 $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'
3250 9
3253 9
3251 $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n'
3254 $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n'
3252 10
3255 10
3253
3256
3254 Test min/max of if() result
3257 Test min/max of if() result
3255
3258
3256 $ cd latesttag
3259 $ cd latesttag
3257 $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
3260 $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
3258 9
3261 9
3259 $ hg log -l1 -T '{max(if(false, "", revset("9:10")))}\n'
3262 $ hg log -l1 -T '{max(if(false, "", revset("9:10")))}\n'
3260 10
3263 10
3261 $ hg log -l1 -T '{min(ifcontains("a", "aa", revset("9:10"), ""))}\n'
3264 $ hg log -l1 -T '{min(ifcontains("a", "aa", revset("9:10"), ""))}\n'
3262 9
3265 9
3263 $ hg log -l1 -T '{max(ifcontains("a", "bb", "", revset("9:10")))}\n'
3266 $ hg log -l1 -T '{max(ifcontains("a", "bb", "", revset("9:10")))}\n'
3264 10
3267 10
3265 $ hg log -l1 -T '{min(ifeq(0, 0, revset("9:10"), ""))}\n'
3268 $ hg log -l1 -T '{min(ifeq(0, 0, revset("9:10"), ""))}\n'
3266 9
3269 9
3267 $ hg log -l1 -T '{max(ifeq(0, 1, "", revset("9:10")))}\n'
3270 $ hg log -l1 -T '{max(ifeq(0, 1, "", revset("9:10")))}\n'
3268 10
3271 10
3269 $ cd ..
3272 $ cd ..
3270
3273
3271 Test laziness of if() then/else clause
3274 Test laziness of if() then/else clause
3272
3275
3273 $ hg debugtemplate '{count(0)}'
3276 $ hg debugtemplate '{count(0)}'
3274 hg: parse error: not countable
3277 hg: parse error: not countable
3275 (incompatible use of template filter 'count')
3278 (incompatible use of template filter 'count')
3276 [255]
3279 [255]
3277 $ hg debugtemplate '{if(true, "", count(0))}'
3280 $ hg debugtemplate '{if(true, "", count(0))}'
3278 $ hg debugtemplate '{if(false, count(0), "")}'
3281 $ hg debugtemplate '{if(false, count(0), "")}'
3279 $ hg debugtemplate '{ifcontains("a", "aa", "", count(0))}'
3282 $ hg debugtemplate '{ifcontains("a", "aa", "", count(0))}'
3280 $ hg debugtemplate '{ifcontains("a", "bb", count(0), "")}'
3283 $ hg debugtemplate '{ifcontains("a", "bb", count(0), "")}'
3281 $ hg debugtemplate '{ifeq(0, 0, "", count(0))}'
3284 $ hg debugtemplate '{ifeq(0, 0, "", count(0))}'
3282 $ hg debugtemplate '{ifeq(0, 1, count(0), "")}'
3285 $ hg debugtemplate '{ifeq(0, 1, count(0), "")}'
3283
3286
3284 Test dot operator precedence:
3287 Test dot operator precedence:
3285
3288
3286 $ hg debugtemplate -R latesttag -r0 -v '{manifest.node|short}\n'
3289 $ hg debugtemplate -R latesttag -r0 -v '{manifest.node|short}\n'
3287 (template
3290 (template
3288 (|
3291 (|
3289 (.
3292 (.
3290 (symbol 'manifest')
3293 (symbol 'manifest')
3291 (symbol 'node'))
3294 (symbol 'node'))
3292 (symbol 'short'))
3295 (symbol 'short'))
3293 (string '\n'))
3296 (string '\n'))
3294 89f4071fec70
3297 89f4071fec70
3295
3298
3296 (the following examples are invalid, but seem natural in parsing POV)
3299 (the following examples are invalid, but seem natural in parsing POV)
3297
3300
3298 $ hg debugtemplate -R latesttag -r0 -v '{foo|bar.baz}\n' 2> /dev/null
3301 $ hg debugtemplate -R latesttag -r0 -v '{foo|bar.baz}\n' 2> /dev/null
3299 (template
3302 (template
3300 (|
3303 (|
3301 (symbol 'foo')
3304 (symbol 'foo')
3302 (.
3305 (.
3303 (symbol 'bar')
3306 (symbol 'bar')
3304 (symbol 'baz')))
3307 (symbol 'baz')))
3305 (string '\n'))
3308 (string '\n'))
3306 [255]
3309 [255]
3307 $ hg debugtemplate -R latesttag -r0 -v '{foo.bar()}\n' 2> /dev/null
3310 $ hg debugtemplate -R latesttag -r0 -v '{foo.bar()}\n' 2> /dev/null
3308 (template
3311 (template
3309 (.
3312 (.
3310 (symbol 'foo')
3313 (symbol 'foo')
3311 (func
3314 (func
3312 (symbol 'bar')
3315 (symbol 'bar')
3313 None))
3316 None))
3314 (string '\n'))
3317 (string '\n'))
3315 [255]
3318 [255]
3316
3319
3317 Test evaluation of dot operator:
3320 Test evaluation of dot operator:
3318
3321
3319 $ hg log -R latesttag -l1 -T '{min(revset("0:9")).node}\n'
3322 $ hg log -R latesttag -l1 -T '{min(revset("0:9")).node}\n'
3320 ce3cec86e6c26bd9bdfc590a6b92abc9680f1796
3323 ce3cec86e6c26bd9bdfc590a6b92abc9680f1796
3321 $ hg log -R latesttag -r0 -T '{extras.branch}\n'
3324 $ hg log -R latesttag -r0 -T '{extras.branch}\n'
3322 default
3325 default
3323
3326
3324 $ hg log -R latesttag -l1 -T '{author.invalid}\n'
3327 $ hg log -R latesttag -l1 -T '{author.invalid}\n'
3325 hg: parse error: keyword 'author' has no member
3328 hg: parse error: keyword 'author' has no member
3326 [255]
3329 [255]
3327 $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n'
3330 $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n'
3328 hg: parse error: 'a' has no member
3331 hg: parse error: 'a' has no member
3329 [255]
3332 [255]
3330
3333
3331 Test the sub function of templating for expansion:
3334 Test the sub function of templating for expansion:
3332
3335
3333 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
3336 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
3334 xx
3337 xx
3335
3338
3336 $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n'
3339 $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n'
3337 hg: parse error: sub got an invalid pattern: [
3340 hg: parse error: sub got an invalid pattern: [
3338 [255]
3341 [255]
3339 $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n'
3342 $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n'
3340 hg: parse error: sub got an invalid replacement: \1
3343 hg: parse error: sub got an invalid replacement: \1
3341 [255]
3344 [255]
3342
3345
3343 Test the strip function with chars specified:
3346 Test the strip function with chars specified:
3344
3347
3345 $ hg log -R latesttag --template '{desc}\n'
3348 $ hg log -R latesttag --template '{desc}\n'
3346 at3
3349 at3
3347 t5
3350 t5
3348 t4
3351 t4
3349 t3
3352 t3
3350 t2
3353 t2
3351 t1
3354 t1
3352 merge
3355 merge
3353 h2e
3356 h2e
3354 h2d
3357 h2d
3355 h1c
3358 h1c
3356 b
3359 b
3357 a
3360 a
3358
3361
3359 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
3362 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
3360 at3
3363 at3
3361 5
3364 5
3362 4
3365 4
3363 3
3366 3
3364 2
3367 2
3365 1
3368 1
3366 merg
3369 merg
3367 h2
3370 h2
3368 h2d
3371 h2d
3369 h1c
3372 h1c
3370 b
3373 b
3371 a
3374 a
3372
3375
3373 Test date format:
3376 Test date format:
3374
3377
3375 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
3378 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
3376 date: 70 01 01 10 +0000
3379 date: 70 01 01 10 +0000
3377 date: 70 01 01 09 +0000
3380 date: 70 01 01 09 +0000
3378 date: 70 01 01 04 +0000
3381 date: 70 01 01 04 +0000
3379 date: 70 01 01 08 +0000
3382 date: 70 01 01 08 +0000
3380 date: 70 01 01 07 +0000
3383 date: 70 01 01 07 +0000
3381 date: 70 01 01 06 +0000
3384 date: 70 01 01 06 +0000
3382 date: 70 01 01 05 +0100
3385 date: 70 01 01 05 +0100
3383 date: 70 01 01 04 +0000
3386 date: 70 01 01 04 +0000
3384 date: 70 01 01 03 +0000
3387 date: 70 01 01 03 +0000
3385 date: 70 01 01 02 +0000
3388 date: 70 01 01 02 +0000
3386 date: 70 01 01 01 +0000
3389 date: 70 01 01 01 +0000
3387 date: 70 01 01 00 +0000
3390 date: 70 01 01 00 +0000
3388
3391
3389 Test invalid date:
3392 Test invalid date:
3390
3393
3391 $ hg log -R latesttag -T '{date(rev)}\n'
3394 $ hg log -R latesttag -T '{date(rev)}\n'
3392 hg: parse error: date expects a date information
3395 hg: parse error: date expects a date information
3393 [255]
3396 [255]
3394
3397
3395 Test integer literal:
3398 Test integer literal:
3396
3399
3397 $ hg debugtemplate -v '{(0)}\n'
3400 $ hg debugtemplate -v '{(0)}\n'
3398 (template
3401 (template
3399 (group
3402 (group
3400 (integer '0'))
3403 (integer '0'))
3401 (string '\n'))
3404 (string '\n'))
3402 0
3405 0
3403 $ hg debugtemplate -v '{(123)}\n'
3406 $ hg debugtemplate -v '{(123)}\n'
3404 (template
3407 (template
3405 (group
3408 (group
3406 (integer '123'))
3409 (integer '123'))
3407 (string '\n'))
3410 (string '\n'))
3408 123
3411 123
3409 $ hg debugtemplate -v '{(-4)}\n'
3412 $ hg debugtemplate -v '{(-4)}\n'
3410 (template
3413 (template
3411 (group
3414 (group
3412 (negate
3415 (negate
3413 (integer '4')))
3416 (integer '4')))
3414 (string '\n'))
3417 (string '\n'))
3415 -4
3418 -4
3416 $ hg debugtemplate '{(-)}\n'
3419 $ hg debugtemplate '{(-)}\n'
3417 hg: parse error at 3: not a prefix: )
3420 hg: parse error at 3: not a prefix: )
3418 ({(-)}\n
3421 ({(-)}\n
3419 ^ here)
3422 ^ here)
3420 [255]
3423 [255]
3421 $ hg debugtemplate '{(-a)}\n'
3424 $ hg debugtemplate '{(-a)}\n'
3422 hg: parse error: negation needs an integer argument
3425 hg: parse error: negation needs an integer argument
3423 [255]
3426 [255]
3424
3427
3425 top-level integer literal is interpreted as symbol (i.e. variable name):
3428 top-level integer literal is interpreted as symbol (i.e. variable name):
3426
3429
3427 $ hg debugtemplate -D 1=one -v '{1}\n'
3430 $ hg debugtemplate -D 1=one -v '{1}\n'
3428 (template
3431 (template
3429 (integer '1')
3432 (integer '1')
3430 (string '\n'))
3433 (string '\n'))
3431 one
3434 one
3432 $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n'
3435 $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n'
3433 (template
3436 (template
3434 (func
3437 (func
3435 (symbol 'if')
3438 (symbol 'if')
3436 (list
3439 (list
3437 (string 't')
3440 (string 't')
3438 (template
3441 (template
3439 (integer '1'))))
3442 (integer '1'))))
3440 (string '\n'))
3443 (string '\n'))
3441 one
3444 one
3442 $ hg debugtemplate -D 1=one -v '{1|stringify}\n'
3445 $ hg debugtemplate -D 1=one -v '{1|stringify}\n'
3443 (template
3446 (template
3444 (|
3447 (|
3445 (integer '1')
3448 (integer '1')
3446 (symbol 'stringify'))
3449 (symbol 'stringify'))
3447 (string '\n'))
3450 (string '\n'))
3448 one
3451 one
3449
3452
3450 unless explicit symbol is expected:
3453 unless explicit symbol is expected:
3451
3454
3452 $ hg log -Ra -r0 -T '{desc|1}\n'
3455 $ hg log -Ra -r0 -T '{desc|1}\n'
3453 hg: parse error: expected a symbol, got 'integer'
3456 hg: parse error: expected a symbol, got 'integer'
3454 [255]
3457 [255]
3455 $ hg log -Ra -r0 -T '{1()}\n'
3458 $ hg log -Ra -r0 -T '{1()}\n'
3456 hg: parse error: expected a symbol, got 'integer'
3459 hg: parse error: expected a symbol, got 'integer'
3457 [255]
3460 [255]
3458
3461
3459 Test string literal:
3462 Test string literal:
3460
3463
3461 $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n'
3464 $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n'
3462 (template
3465 (template
3463 (string 'string with no template fragment')
3466 (string 'string with no template fragment')
3464 (string '\n'))
3467 (string '\n'))
3465 string with no template fragment
3468 string with no template fragment
3466 $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n'
3469 $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n'
3467 (template
3470 (template
3468 (template
3471 (template
3469 (string 'template: ')
3472 (string 'template: ')
3470 (symbol 'rev'))
3473 (symbol 'rev'))
3471 (string '\n'))
3474 (string '\n'))
3472 template: 0
3475 template: 0
3473 $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n'
3476 $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n'
3474 (template
3477 (template
3475 (string 'rawstring: {rev}')
3478 (string 'rawstring: {rev}')
3476 (string '\n'))
3479 (string '\n'))
3477 rawstring: {rev}
3480 rawstring: {rev}
3478 $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n'
3481 $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n'
3479 (template
3482 (template
3480 (%
3483 (%
3481 (symbol 'files')
3484 (symbol 'files')
3482 (string 'rawstring: {file}'))
3485 (string 'rawstring: {file}'))
3483 (string '\n'))
3486 (string '\n'))
3484 rawstring: {file}
3487 rawstring: {file}
3485
3488
3486 Test string escaping:
3489 Test string escaping:
3487
3490
3488 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3491 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3489 >
3492 >
3490 <>\n<[>
3493 <>\n<[>
3491 <>\n<]>
3494 <>\n<]>
3492 <>\n<
3495 <>\n<
3493
3496
3494 $ hg log -R latesttag -r 0 \
3497 $ hg log -R latesttag -r 0 \
3495 > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3498 > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3496 >
3499 >
3497 <>\n<[>
3500 <>\n<[>
3498 <>\n<]>
3501 <>\n<]>
3499 <>\n<
3502 <>\n<
3500
3503
3501 $ hg log -R latesttag -r 0 -T esc \
3504 $ hg log -R latesttag -r 0 -T esc \
3502 > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3505 > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3503 >
3506 >
3504 <>\n<[>
3507 <>\n<[>
3505 <>\n<]>
3508 <>\n<]>
3506 <>\n<
3509 <>\n<
3507
3510
3508 $ cat <<'EOF' > esctmpl
3511 $ cat <<'EOF' > esctmpl
3509 > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3512 > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3510 > EOF
3513 > EOF
3511 $ hg log -R latesttag -r 0 --style ./esctmpl
3514 $ hg log -R latesttag -r 0 --style ./esctmpl
3512 >
3515 >
3513 <>\n<[>
3516 <>\n<[>
3514 <>\n<]>
3517 <>\n<]>
3515 <>\n<
3518 <>\n<
3516
3519
3517 Test string escaping of quotes:
3520 Test string escaping of quotes:
3518
3521
3519 $ hg log -Ra -r0 -T '{"\""}\n'
3522 $ hg log -Ra -r0 -T '{"\""}\n'
3520 "
3523 "
3521 $ hg log -Ra -r0 -T '{"\\\""}\n'
3524 $ hg log -Ra -r0 -T '{"\\\""}\n'
3522 \"
3525 \"
3523 $ hg log -Ra -r0 -T '{r"\""}\n'
3526 $ hg log -Ra -r0 -T '{r"\""}\n'
3524 \"
3527 \"
3525 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3528 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3526 \\\"
3529 \\\"
3527
3530
3528
3531
3529 $ hg log -Ra -r0 -T '{"\""}\n'
3532 $ hg log -Ra -r0 -T '{"\""}\n'
3530 "
3533 "
3531 $ hg log -Ra -r0 -T '{"\\\""}\n'
3534 $ hg log -Ra -r0 -T '{"\\\""}\n'
3532 \"
3535 \"
3533 $ hg log -Ra -r0 -T '{r"\""}\n'
3536 $ hg log -Ra -r0 -T '{r"\""}\n'
3534 \"
3537 \"
3535 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3538 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3536 \\\"
3539 \\\"
3537
3540
3538 Test exception in quoted template. single backslash before quotation mark is
3541 Test exception in quoted template. single backslash before quotation mark is
3539 stripped before parsing:
3542 stripped before parsing:
3540
3543
3541 $ cat <<'EOF' > escquotetmpl
3544 $ cat <<'EOF' > escquotetmpl
3542 > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n"
3545 > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n"
3543 > EOF
3546 > EOF
3544 $ cd latesttag
3547 $ cd latesttag
3545 $ hg log -r 2 --style ../escquotetmpl
3548 $ hg log -r 2 --style ../escquotetmpl
3546 " \" \" \\" head1
3549 " \" \" \\" head1
3547
3550
3548 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"'
3551 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"'
3549 valid
3552 valid
3550 $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'"
3553 $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'"
3551 valid
3554 valid
3552
3555
3553 Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested
3556 Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested
3554 _evalifliteral() templates (issue4733):
3557 _evalifliteral() templates (issue4733):
3555
3558
3556 $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n'
3559 $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n'
3557 "2
3560 "2
3558 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n'
3561 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n'
3559 "2
3562 "2
3560 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n'
3563 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n'
3561 "2
3564 "2
3562
3565
3563 $ hg log -r 2 -T '{if(rev, "\\\"")}\n'
3566 $ hg log -r 2 -T '{if(rev, "\\\"")}\n'
3564 \"
3567 \"
3565 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n'
3568 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n'
3566 \"
3569 \"
3567 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3570 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3568 \"
3571 \"
3569
3572
3570 $ hg log -r 2 -T '{if(rev, r"\\\"")}\n'
3573 $ hg log -r 2 -T '{if(rev, r"\\\"")}\n'
3571 \\\"
3574 \\\"
3572 $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n'
3575 $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n'
3573 \\\"
3576 \\\"
3574 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3577 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3575 \\\"
3578 \\\"
3576
3579
3577 escaped single quotes and errors:
3580 escaped single quotes and errors:
3578
3581
3579 $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n'
3582 $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n'
3580 foo
3583 foo
3581 $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n'
3584 $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n'
3582 foo
3585 foo
3583 $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n'
3586 $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n'
3584 hg: parse error at 21: unterminated string
3587 hg: parse error at 21: unterminated string
3585 ({if(rev, "{if(rev, \")}")}\n
3588 ({if(rev, "{if(rev, \")}")}\n
3586 ^ here)
3589 ^ here)
3587 [255]
3590 [255]
3588 $ hg log -r 2 -T '{if(rev, \"\\"")}\n'
3591 $ hg log -r 2 -T '{if(rev, \"\\"")}\n'
3589 hg: parse error: trailing \ in string
3592 hg: parse error: trailing \ in string
3590 [255]
3593 [255]
3591 $ hg log -r 2 -T '{if(rev, r\"\\"")}\n'
3594 $ hg log -r 2 -T '{if(rev, r\"\\"")}\n'
3592 hg: parse error: trailing \ in string
3595 hg: parse error: trailing \ in string
3593 [255]
3596 [255]
3594
3597
3595 $ cd ..
3598 $ cd ..
3596
3599
3597 Test leading backslashes:
3600 Test leading backslashes:
3598
3601
3599 $ cd latesttag
3602 $ cd latesttag
3600 $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n'
3603 $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n'
3601 {rev} {file}
3604 {rev} {file}
3602 $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n'
3605 $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n'
3603 \2 \head1
3606 \2 \head1
3604 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n'
3607 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n'
3605 \{rev} \{file}
3608 \{rev} \{file}
3606 $ cd ..
3609 $ cd ..
3607
3610
3608 Test leading backslashes in "if" expression (issue4714):
3611 Test leading backslashes in "if" expression (issue4714):
3609
3612
3610 $ cd latesttag
3613 $ cd latesttag
3611 $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n'
3614 $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n'
3612 {rev} \{rev}
3615 {rev} \{rev}
3613 $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n'
3616 $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n'
3614 \2 \\{rev}
3617 \2 \\{rev}
3615 $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n'
3618 $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n'
3616 \{rev} \\\{rev}
3619 \{rev} \\\{rev}
3617 $ cd ..
3620 $ cd ..
3618
3621
3619 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
3622 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
3620
3623
3621 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
3624 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
3622 \x6e
3625 \x6e
3623 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
3626 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
3624 \x5c\x786e
3627 \x5c\x786e
3625 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
3628 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
3626 \x6e
3629 \x6e
3627 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
3630 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
3628 \x5c\x786e
3631 \x5c\x786e
3629
3632
3630 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
3633 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
3631 \x6e
3634 \x6e
3632 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
3635 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
3633 \x5c\x786e
3636 \x5c\x786e
3634 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
3637 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
3635 \x6e
3638 \x6e
3636 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
3639 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
3637 \x5c\x786e
3640 \x5c\x786e
3638
3641
3639 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
3642 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
3640 fourth
3643 fourth
3641 second
3644 second
3642 third
3645 third
3643 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
3646 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
3644 fourth\nsecond\nthird
3647 fourth\nsecond\nthird
3645
3648
3646 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
3649 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
3647 <p>
3650 <p>
3648 1st
3651 1st
3649 </p>
3652 </p>
3650 <p>
3653 <p>
3651 2nd
3654 2nd
3652 </p>
3655 </p>
3653 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
3656 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
3654 <p>
3657 <p>
3655 1st\n\n2nd
3658 1st\n\n2nd
3656 </p>
3659 </p>
3657 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
3660 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
3658 1st
3661 1st
3659
3662
3660 2nd
3663 2nd
3661
3664
3662 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
3665 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
3663 o perso
3666 o perso
3664 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
3667 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
3665 no person
3668 no person
3666 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
3669 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
3667 o perso
3670 o perso
3668 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
3671 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
3669 no perso
3672 no perso
3670
3673
3671 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
3674 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
3672 -o perso-
3675 -o perso-
3673 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
3676 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
3674 no person
3677 no person
3675 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
3678 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
3676 \x2do perso\x2d
3679 \x2do perso\x2d
3677 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
3680 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
3678 -o perso-
3681 -o perso-
3679 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
3682 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
3680 \x2do perso\x6e
3683 \x2do perso\x6e
3681
3684
3682 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
3685 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
3683 fourth
3686 fourth
3684 second
3687 second
3685 third
3688 third
3686
3689
3687 Test string escaping in nested expression:
3690 Test string escaping in nested expression:
3688
3691
3689 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
3692 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
3690 fourth\x6esecond\x6ethird
3693 fourth\x6esecond\x6ethird
3691 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
3694 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
3692 fourth\x6esecond\x6ethird
3695 fourth\x6esecond\x6ethird
3693
3696
3694 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
3697 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
3695 fourth\x6esecond\x6ethird
3698 fourth\x6esecond\x6ethird
3696 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
3699 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
3697 fourth\x5c\x786esecond\x5c\x786ethird
3700 fourth\x5c\x786esecond\x5c\x786ethird
3698
3701
3699 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
3702 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
3700 3:\x6eo user, \x6eo domai\x6e
3703 3:\x6eo user, \x6eo domai\x6e
3701 4:\x5c\x786eew bra\x5c\x786ech
3704 4:\x5c\x786eew bra\x5c\x786ech
3702
3705
3703 Test quotes in nested expression are evaluated just like a $(command)
3706 Test quotes in nested expression are evaluated just like a $(command)
3704 substitution in POSIX shells:
3707 substitution in POSIX shells:
3705
3708
3706 $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n'
3709 $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n'
3707 8:95c24699272e
3710 8:95c24699272e
3708 $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n'
3711 $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n'
3709 {8} "95c24699272e"
3712 {8} "95c24699272e"
3710
3713
3711 Test recursive evaluation:
3714 Test recursive evaluation:
3712
3715
3713 $ hg init r
3716 $ hg init r
3714 $ cd r
3717 $ cd r
3715 $ echo a > a
3718 $ echo a > a
3716 $ hg ci -Am '{rev}'
3719 $ hg ci -Am '{rev}'
3717 adding a
3720 adding a
3718 $ hg log -r 0 --template '{if(rev, desc)}\n'
3721 $ hg log -r 0 --template '{if(rev, desc)}\n'
3719 {rev}
3722 {rev}
3720 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
3723 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
3721 test 0
3724 test 0
3722
3725
3723 $ hg branch -q 'text.{rev}'
3726 $ hg branch -q 'text.{rev}'
3724 $ echo aa >> aa
3727 $ echo aa >> aa
3725 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
3728 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
3726
3729
3727 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
3730 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
3728 {node|short}desc to
3731 {node|short}desc to
3729 text.{rev}be wrapped
3732 text.{rev}be wrapped
3730 text.{rev}desc to be
3733 text.{rev}desc to be
3731 text.{rev}wrapped (no-eol)
3734 text.{rev}wrapped (no-eol)
3732 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
3735 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
3733 bcc7ff960b8e:desc to
3736 bcc7ff960b8e:desc to
3734 text.1:be wrapped
3737 text.1:be wrapped
3735 text.1:desc to be
3738 text.1:desc to be
3736 text.1:wrapped (no-eol)
3739 text.1:wrapped (no-eol)
3737 $ hg log -l1 -T '{fill(desc, date, "", "")}\n'
3740 $ hg log -l1 -T '{fill(desc, date, "", "")}\n'
3738 hg: parse error: fill expects an integer width
3741 hg: parse error: fill expects an integer width
3739 [255]
3742 [255]
3740
3743
3741 $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}'
3744 $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}'
3742 bcc7ff960b8e:desc to be
3745 bcc7ff960b8e:desc to be
3743 termwidth.1:wrapped desc
3746 termwidth.1:wrapped desc
3744 termwidth.1:to be wrapped (no-eol)
3747 termwidth.1:to be wrapped (no-eol)
3745
3748
3746 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3749 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3747 {node|short} (no-eol)
3750 {node|short} (no-eol)
3748 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
3751 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
3749 bcc-ff---b-e (no-eol)
3752 bcc-ff---b-e (no-eol)
3750
3753
3751 $ cat >> .hg/hgrc <<EOF
3754 $ cat >> .hg/hgrc <<EOF
3752 > [extensions]
3755 > [extensions]
3753 > color=
3756 > color=
3754 > [color]
3757 > [color]
3755 > mode=ansi
3758 > mode=ansi
3756 > text.{rev} = red
3759 > text.{rev} = red
3757 > text.1 = green
3760 > text.1 = green
3758 > EOF
3761 > EOF
3759 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
3762 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
3760 \x1b[0;31mtext\x1b[0m (esc)
3763 \x1b[0;31mtext\x1b[0m (esc)
3761 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
3764 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
3762 \x1b[0;32mtext\x1b[0m (esc)
3765 \x1b[0;32mtext\x1b[0m (esc)
3763
3766
3764 color effect can be specified without quoting:
3767 color effect can be specified without quoting:
3765
3768
3766 $ hg log --color=always -l 1 --template '{label(red, "text\n")}'
3769 $ hg log --color=always -l 1 --template '{label(red, "text\n")}'
3767 \x1b[0;31mtext\x1b[0m (esc)
3770 \x1b[0;31mtext\x1b[0m (esc)
3768
3771
3769 color effects can be nested (issue5413)
3772 color effects can be nested (issue5413)
3770
3773
3771 $ hg debugtemplate --color=always \
3774 $ hg debugtemplate --color=always \
3772 > '{label(red, "red{label(magenta, "ma{label(cyan, "cyan")}{label(yellow, "yellow")}genta")}")}\n'
3775 > '{label(red, "red{label(magenta, "ma{label(cyan, "cyan")}{label(yellow, "yellow")}genta")}")}\n'
3773 \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)
3776 \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)
3774
3777
3775 pad() should interact well with color codes (issue5416)
3778 pad() should interact well with color codes (issue5416)
3776
3779
3777 $ hg debugtemplate --color=always \
3780 $ hg debugtemplate --color=always \
3778 > '{pad(label(red, "red"), 5, label(cyan, "-"))}\n'
3781 > '{pad(label(red, "red"), 5, label(cyan, "-"))}\n'
3779 \x1b[0;31mred\x1b[0m\x1b[0;36m-\x1b[0m\x1b[0;36m-\x1b[0m (esc)
3782 \x1b[0;31mred\x1b[0m\x1b[0;36m-\x1b[0m\x1b[0;36m-\x1b[0m (esc)
3780
3783
3781 label should be no-op if color is disabled:
3784 label should be no-op if color is disabled:
3782
3785
3783 $ hg log --color=never -l 1 --template '{label(red, "text\n")}'
3786 $ hg log --color=never -l 1 --template '{label(red, "text\n")}'
3784 text
3787 text
3785 $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}'
3788 $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}'
3786 text
3789 text
3787
3790
3788 Test branches inside if statement:
3791 Test branches inside if statement:
3789
3792
3790 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
3793 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
3791 no
3794 no
3792
3795
3793 Test dict constructor:
3796 Test dict constructor:
3794
3797
3795 $ hg log -r 0 -T '{dict(y=node|short, x=rev)}\n'
3798 $ hg log -r 0 -T '{dict(y=node|short, x=rev)}\n'
3796 y=f7769ec2ab97 x=0
3799 y=f7769ec2ab97 x=0
3797 $ hg log -r 0 -T '{dict(x=rev, y=node|short) % "{key}={value}\n"}'
3800 $ hg log -r 0 -T '{dict(x=rev, y=node|short) % "{key}={value}\n"}'
3798 x=0
3801 x=0
3799 y=f7769ec2ab97
3802 y=f7769ec2ab97
3800 $ hg log -r 0 -T '{dict(x=rev, y=node|short)|json}\n'
3803 $ hg log -r 0 -T '{dict(x=rev, y=node|short)|json}\n'
3801 {"x": 0, "y": "f7769ec2ab97"}
3804 {"x": 0, "y": "f7769ec2ab97"}
3802 $ hg log -r 0 -T '{dict()|json}\n'
3805 $ hg log -r 0 -T '{dict()|json}\n'
3803 {}
3806 {}
3804
3807
3805 $ hg log -r 0 -T '{dict(rev, node=node|short)}\n'
3808 $ hg log -r 0 -T '{dict(rev, node=node|short)}\n'
3806 rev=0 node=f7769ec2ab97
3809 rev=0 node=f7769ec2ab97
3807 $ hg log -r 0 -T '{dict(rev, node|short)}\n'
3810 $ hg log -r 0 -T '{dict(rev, node|short)}\n'
3808 rev=0 node=f7769ec2ab97
3811 rev=0 node=f7769ec2ab97
3809
3812
3810 $ hg log -r 0 -T '{dict(rev, rev=rev)}\n'
3813 $ hg log -r 0 -T '{dict(rev, rev=rev)}\n'
3811 hg: parse error: duplicated dict key 'rev' inferred
3814 hg: parse error: duplicated dict key 'rev' inferred
3812 [255]
3815 [255]
3813 $ hg log -r 0 -T '{dict(node, node|short)}\n'
3816 $ hg log -r 0 -T '{dict(node, node|short)}\n'
3814 hg: parse error: duplicated dict key 'node' inferred
3817 hg: parse error: duplicated dict key 'node' inferred
3815 [255]
3818 [255]
3816 $ hg log -r 0 -T '{dict(1 + 2)}'
3819 $ hg log -r 0 -T '{dict(1 + 2)}'
3817 hg: parse error: dict key cannot be inferred
3820 hg: parse error: dict key cannot be inferred
3818 [255]
3821 [255]
3819
3822
3820 $ hg log -r 0 -T '{dict(x=rev, x=node)}'
3823 $ hg log -r 0 -T '{dict(x=rev, x=node)}'
3821 hg: parse error: dict got multiple values for keyword argument 'x'
3824 hg: parse error: dict got multiple values for keyword argument 'x'
3822 [255]
3825 [255]
3823
3826
3824 Test get function:
3827 Test get function:
3825
3828
3826 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3829 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3827 default
3830 default
3828 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
3831 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
3829 default
3832 default
3830 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3833 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3831 hg: parse error: get() expects a dict as first argument
3834 hg: parse error: get() expects a dict as first argument
3832 [255]
3835 [255]
3833
3836
3834 Test json filter applied to hybrid object:
3837 Test json filter applied to hybrid object:
3835
3838
3836 $ hg log -r0 -T '{files|json}\n'
3839 $ hg log -r0 -T '{files|json}\n'
3837 ["a"]
3840 ["a"]
3838 $ hg log -r0 -T '{extras|json}\n'
3841 $ hg log -r0 -T '{extras|json}\n'
3839 {"branch": "default"}
3842 {"branch": "default"}
3840
3843
3841 Test localdate(date, tz) function:
3844 Test localdate(date, tz) function:
3842
3845
3843 $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
3846 $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
3844 1970-01-01 09:00 +0900
3847 1970-01-01 09:00 +0900
3845 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n'
3848 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n'
3846 1970-01-01 00:00 +0000
3849 1970-01-01 00:00 +0000
3847 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "blahUTC")|isodate}\n'
3850 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "blahUTC")|isodate}\n'
3848 hg: parse error: localdate expects a timezone
3851 hg: parse error: localdate expects a timezone
3849 [255]
3852 [255]
3850 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n'
3853 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n'
3851 1970-01-01 02:00 +0200
3854 1970-01-01 02:00 +0200
3852 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n'
3855 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n'
3853 1970-01-01 00:00 +0000
3856 1970-01-01 00:00 +0000
3854 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n'
3857 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n'
3855 1970-01-01 00:00 +0000
3858 1970-01-01 00:00 +0000
3856 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n'
3859 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n'
3857 hg: parse error: localdate expects a timezone
3860 hg: parse error: localdate expects a timezone
3858 [255]
3861 [255]
3859 $ hg log -r0 -T '{localdate(date, date)|isodate}\n'
3862 $ hg log -r0 -T '{localdate(date, date)|isodate}\n'
3860 hg: parse error: localdate expects a timezone
3863 hg: parse error: localdate expects a timezone
3861 [255]
3864 [255]
3862
3865
3863 Test shortest(node) function:
3866 Test shortest(node) function:
3864
3867
3865 $ echo b > b
3868 $ echo b > b
3866 $ hg ci -qAm b
3869 $ hg ci -qAm b
3867 $ hg log --template '{shortest(node)}\n'
3870 $ hg log --template '{shortest(node)}\n'
3868 e777
3871 e777
3869 bcc7
3872 bcc7
3870 f776
3873 f776
3871 $ hg log --template '{shortest(node, 10)}\n'
3874 $ hg log --template '{shortest(node, 10)}\n'
3872 e777603221
3875 e777603221
3873 bcc7ff960b
3876 bcc7ff960b
3874 f7769ec2ab
3877 f7769ec2ab
3875 $ hg log --template '{node|shortest}\n' -l1
3878 $ hg log --template '{node|shortest}\n' -l1
3876 e777
3879 e777
3877
3880
3878 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
3881 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
3879 f7769ec2ab
3882 f7769ec2ab
3880 $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
3883 $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
3881 hg: parse error: shortest() expects an integer minlength
3884 hg: parse error: shortest() expects an integer minlength
3882 [255]
3885 [255]
3883
3886
3884 $ hg log -r 'wdir()' -T '{node|shortest}\n'
3887 $ hg log -r 'wdir()' -T '{node|shortest}\n'
3885 ffff
3888 ffff
3886
3889
3887 $ cd ..
3890 $ cd ..
3888
3891
3889 Test shortest(node) with the repo having short hash collision:
3892 Test shortest(node) with the repo having short hash collision:
3890
3893
3891 $ hg init hashcollision
3894 $ hg init hashcollision
3892 $ cd hashcollision
3895 $ cd hashcollision
3893 $ cat <<EOF >> .hg/hgrc
3896 $ cat <<EOF >> .hg/hgrc
3894 > [experimental]
3897 > [experimental]
3895 > evolution.createmarkers=True
3898 > evolution.createmarkers=True
3896 > EOF
3899 > EOF
3897 $ echo 0 > a
3900 $ echo 0 > a
3898 $ hg ci -qAm 0
3901 $ hg ci -qAm 0
3899 $ for i in 17 129 248 242 480 580 617 1057 2857 4025; do
3902 $ for i in 17 129 248 242 480 580 617 1057 2857 4025; do
3900 > hg up -q 0
3903 > hg up -q 0
3901 > echo $i > a
3904 > echo $i > a
3902 > hg ci -qm $i
3905 > hg ci -qm $i
3903 > done
3906 > done
3904 $ hg up -q null
3907 $ hg up -q null
3905 $ hg log -r0: -T '{rev}:{node}\n'
3908 $ hg log -r0: -T '{rev}:{node}\n'
3906 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
3909 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
3907 1:11424df6dc1dd4ea255eae2b58eaca7831973bbc
3910 1:11424df6dc1dd4ea255eae2b58eaca7831973bbc
3908 2:11407b3f1b9c3e76a79c1ec5373924df096f0499
3911 2:11407b3f1b9c3e76a79c1ec5373924df096f0499
3909 3:11dd92fe0f39dfdaacdaa5f3997edc533875cfc4
3912 3:11dd92fe0f39dfdaacdaa5f3997edc533875cfc4
3910 4:10776689e627b465361ad5c296a20a487e153ca4
3913 4:10776689e627b465361ad5c296a20a487e153ca4
3911 5:a00be79088084cb3aff086ab799f8790e01a976b
3914 5:a00be79088084cb3aff086ab799f8790e01a976b
3912 6:a0b0acd79b4498d0052993d35a6a748dd51d13e6
3915 6:a0b0acd79b4498d0052993d35a6a748dd51d13e6
3913 7:a0457b3450b8e1b778f1163b31a435802987fe5d
3916 7:a0457b3450b8e1b778f1163b31a435802987fe5d
3914 8:c56256a09cd28e5764f32e8e2810d0f01e2e357a
3917 8:c56256a09cd28e5764f32e8e2810d0f01e2e357a
3915 9:c5623987d205cd6d9d8389bfc40fff9dbb670b48
3918 9:c5623987d205cd6d9d8389bfc40fff9dbb670b48
3916 10:c562ddd9c94164376c20b86b0b4991636a3bf84f
3919 10:c562ddd9c94164376c20b86b0b4991636a3bf84f
3917 $ hg debugobsolete a00be79088084cb3aff086ab799f8790e01a976b
3920 $ hg debugobsolete a00be79088084cb3aff086ab799f8790e01a976b
3918 obsoleted 1 changesets
3921 obsoleted 1 changesets
3919 $ hg debugobsolete c5623987d205cd6d9d8389bfc40fff9dbb670b48
3922 $ hg debugobsolete c5623987d205cd6d9d8389bfc40fff9dbb670b48
3920 obsoleted 1 changesets
3923 obsoleted 1 changesets
3921 $ hg debugobsolete c562ddd9c94164376c20b86b0b4991636a3bf84f
3924 $ hg debugobsolete c562ddd9c94164376c20b86b0b4991636a3bf84f
3922 obsoleted 1 changesets
3925 obsoleted 1 changesets
3923
3926
3924 nodes starting with '11' (we don't have the revision number '11' though)
3927 nodes starting with '11' (we don't have the revision number '11' though)
3925
3928
3926 $ hg log -r 1:3 -T '{rev}:{shortest(node, 0)}\n'
3929 $ hg log -r 1:3 -T '{rev}:{shortest(node, 0)}\n'
3927 1:1142
3930 1:1142
3928 2:1140
3931 2:1140
3929 3:11d
3932 3:11d
3930
3933
3931 '5:a00' is hidden, but still we have two nodes starting with 'a0'
3934 '5:a00' is hidden, but still we have two nodes starting with 'a0'
3932
3935
3933 $ hg log -r 6:7 -T '{rev}:{shortest(node, 0)}\n'
3936 $ hg log -r 6:7 -T '{rev}:{shortest(node, 0)}\n'
3934 6:a0b
3937 6:a0b
3935 7:a04
3938 7:a04
3936
3939
3937 node '10' conflicts with the revision number '10' even if it is hidden
3940 node '10' conflicts with the revision number '10' even if it is hidden
3938 (we could exclude hidden revision numbers, but currently we don't)
3941 (we could exclude hidden revision numbers, but currently we don't)
3939
3942
3940 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n'
3943 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n'
3941 4:107
3944 4:107
3942 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
3945 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
3943 4:107
3946 4:107
3944
3947
3945 node 'c562' should be unique if the other 'c562' nodes are hidden
3948 node 'c562' should be unique if the other 'c562' nodes are hidden
3946 (but we don't try the slow path to filter out hidden nodes for now)
3949 (but we don't try the slow path to filter out hidden nodes for now)
3947
3950
3948 $ hg log -r 8 -T '{rev}:{node|shortest}\n'
3951 $ hg log -r 8 -T '{rev}:{node|shortest}\n'
3949 8:c5625
3952 8:c5625
3950 $ hg log -r 8:10 -T '{rev}:{node|shortest}\n' --hidden
3953 $ hg log -r 8:10 -T '{rev}:{node|shortest}\n' --hidden
3951 8:c5625
3954 8:c5625
3952 9:c5623
3955 9:c5623
3953 10:c562d
3956 10:c562d
3954
3957
3955 $ cd ..
3958 $ cd ..
3956
3959
3957 Test pad function
3960 Test pad function
3958
3961
3959 $ cd r
3962 $ cd r
3960
3963
3961 $ hg log --template '{pad(rev, 20)} {author|user}\n'
3964 $ hg log --template '{pad(rev, 20)} {author|user}\n'
3962 2 test
3965 2 test
3963 1 {node|short}
3966 1 {node|short}
3964 0 test
3967 0 test
3965
3968
3966 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
3969 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
3967 2 test
3970 2 test
3968 1 {node|short}
3971 1 {node|short}
3969 0 test
3972 0 test
3970
3973
3971 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
3974 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
3972 2------------------- test
3975 2------------------- test
3973 1------------------- {node|short}
3976 1------------------- {node|short}
3974 0------------------- test
3977 0------------------- test
3975
3978
3976 Test template string in pad function
3979 Test template string in pad function
3977
3980
3978 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
3981 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
3979 {0} test
3982 {0} test
3980
3983
3981 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
3984 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
3982 \{rev} test
3985 \{rev} test
3983
3986
3984 Test width argument passed to pad function
3987 Test width argument passed to pad function
3985
3988
3986 $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n'
3989 $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n'
3987 0 test
3990 0 test
3988 $ hg log -r 0 -T '{pad(rev, "not an int")}\n'
3991 $ hg log -r 0 -T '{pad(rev, "not an int")}\n'
3989 hg: parse error: pad() expects an integer width
3992 hg: parse error: pad() expects an integer width
3990 [255]
3993 [255]
3991
3994
3992 Test invalid fillchar passed to pad function
3995 Test invalid fillchar passed to pad function
3993
3996
3994 $ hg log -r 0 -T '{pad(rev, 10, "")}\n'
3997 $ hg log -r 0 -T '{pad(rev, 10, "")}\n'
3995 hg: parse error: pad() expects a single fill character
3998 hg: parse error: pad() expects a single fill character
3996 [255]
3999 [255]
3997 $ hg log -r 0 -T '{pad(rev, 10, "--")}\n'
4000 $ hg log -r 0 -T '{pad(rev, 10, "--")}\n'
3998 hg: parse error: pad() expects a single fill character
4001 hg: parse error: pad() expects a single fill character
3999 [255]
4002 [255]
4000
4003
4001 Test boolean argument passed to pad function
4004 Test boolean argument passed to pad function
4002
4005
4003 no crash
4006 no crash
4004
4007
4005 $ hg log -r 0 -T '{pad(rev, 10, "-", "f{"oo"}")}\n'
4008 $ hg log -r 0 -T '{pad(rev, 10, "-", "f{"oo"}")}\n'
4006 ---------0
4009 ---------0
4007
4010
4008 string/literal
4011 string/literal
4009
4012
4010 $ hg log -r 0 -T '{pad(rev, 10, "-", "false")}\n'
4013 $ hg log -r 0 -T '{pad(rev, 10, "-", "false")}\n'
4011 ---------0
4014 ---------0
4012 $ hg log -r 0 -T '{pad(rev, 10, "-", false)}\n'
4015 $ hg log -r 0 -T '{pad(rev, 10, "-", false)}\n'
4013 0---------
4016 0---------
4014 $ hg log -r 0 -T '{pad(rev, 10, "-", "")}\n'
4017 $ hg log -r 0 -T '{pad(rev, 10, "-", "")}\n'
4015 0---------
4018 0---------
4016
4019
4017 unknown keyword is evaluated to ''
4020 unknown keyword is evaluated to ''
4018
4021
4019 $ hg log -r 0 -T '{pad(rev, 10, "-", unknownkeyword)}\n'
4022 $ hg log -r 0 -T '{pad(rev, 10, "-", unknownkeyword)}\n'
4020 0---------
4023 0---------
4021
4024
4022 Test separate function
4025 Test separate function
4023
4026
4024 $ hg log -r 0 -T '{separate("-", "", "a", "b", "", "", "c", "")}\n'
4027 $ hg log -r 0 -T '{separate("-", "", "a", "b", "", "", "c", "")}\n'
4025 a-b-c
4028 a-b-c
4026 $ hg log -r 0 -T '{separate(" ", "{rev}:{node|short}", author|user, branch)}\n'
4029 $ hg log -r 0 -T '{separate(" ", "{rev}:{node|short}", author|user, branch)}\n'
4027 0:f7769ec2ab97 test default
4030 0:f7769ec2ab97 test default
4028 $ hg log -r 0 --color=always -T '{separate(" ", "a", label(red, "b"), "c", label(red, ""), "d")}\n'
4031 $ hg log -r 0 --color=always -T '{separate(" ", "a", label(red, "b"), "c", label(red, ""), "d")}\n'
4029 a \x1b[0;31mb\x1b[0m c d (esc)
4032 a \x1b[0;31mb\x1b[0m c d (esc)
4030
4033
4031 Test boolean expression/literal passed to if function
4034 Test boolean expression/literal passed to if function
4032
4035
4033 $ hg log -r 0 -T '{if(rev, "rev 0 is True")}\n'
4036 $ hg log -r 0 -T '{if(rev, "rev 0 is True")}\n'
4034 rev 0 is True
4037 rev 0 is True
4035 $ hg log -r 0 -T '{if(0, "literal 0 is True as well")}\n'
4038 $ hg log -r 0 -T '{if(0, "literal 0 is True as well")}\n'
4036 literal 0 is True as well
4039 literal 0 is True as well
4037 $ hg log -r 0 -T '{if("", "", "empty string is False")}\n'
4040 $ hg log -r 0 -T '{if("", "", "empty string is False")}\n'
4038 empty string is False
4041 empty string is False
4039 $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n'
4042 $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n'
4040 empty list is False
4043 empty list is False
4041 $ hg log -r 0 -T '{if(true, "true is True")}\n'
4044 $ hg log -r 0 -T '{if(true, "true is True")}\n'
4042 true is True
4045 true is True
4043 $ hg log -r 0 -T '{if(false, "", "false is False")}\n'
4046 $ hg log -r 0 -T '{if(false, "", "false is False")}\n'
4044 false is False
4047 false is False
4045 $ hg log -r 0 -T '{if("false", "non-empty string is True")}\n'
4048 $ hg log -r 0 -T '{if("false", "non-empty string is True")}\n'
4046 non-empty string is True
4049 non-empty string is True
4047
4050
4048 Test ifcontains function
4051 Test ifcontains function
4049
4052
4050 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
4053 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
4051 2 is in the string
4054 2 is in the string
4052 1 is not
4055 1 is not
4053 0 is in the string
4056 0 is in the string
4054
4057
4055 $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n'
4058 $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n'
4056 2 is in the string
4059 2 is in the string
4057 1 is not
4060 1 is not
4058 0 is in the string
4061 0 is in the string
4059
4062
4060 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
4063 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
4061 2 did not add a
4064 2 did not add a
4062 1 did not add a
4065 1 did not add a
4063 0 added a
4066 0 added a
4064
4067
4065 $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
4068 $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
4066 2 is parent of 1
4069 2 is parent of 1
4067 1
4070 1
4068 0
4071 0
4069
4072
4070 Test revset function
4073 Test revset function
4071
4074
4072 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
4075 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
4073 2 current rev
4076 2 current rev
4074 1 not current rev
4077 1 not current rev
4075 0 not current rev
4078 0 not current rev
4076
4079
4077 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
4080 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
4078 2 match rev
4081 2 match rev
4079 1 match rev
4082 1 match rev
4080 0 not match rev
4083 0 not match rev
4081
4084
4082 $ hg log -T '{ifcontains(desc, revset(":"), "", "type not match")}\n' -l1
4085 $ hg log -T '{ifcontains(desc, revset(":"), "", "type not match")}\n' -l1
4083 type not match
4086 type not match
4084
4087
4085 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
4088 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
4086 2 Parents: 1
4089 2 Parents: 1
4087 1 Parents: 0
4090 1 Parents: 0
4088 0 Parents:
4091 0 Parents:
4089
4092
4090 $ cat >> .hg/hgrc <<EOF
4093 $ cat >> .hg/hgrc <<EOF
4091 > [revsetalias]
4094 > [revsetalias]
4092 > myparents(\$1) = parents(\$1)
4095 > myparents(\$1) = parents(\$1)
4093 > EOF
4096 > EOF
4094 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
4097 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
4095 2 Parents: 1
4098 2 Parents: 1
4096 1 Parents: 0
4099 1 Parents: 0
4097 0 Parents:
4100 0 Parents:
4098
4101
4099 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
4102 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
4100 Rev: 2
4103 Rev: 2
4101 Ancestor: 0
4104 Ancestor: 0
4102 Ancestor: 1
4105 Ancestor: 1
4103 Ancestor: 2
4106 Ancestor: 2
4104
4107
4105 Rev: 1
4108 Rev: 1
4106 Ancestor: 0
4109 Ancestor: 0
4107 Ancestor: 1
4110 Ancestor: 1
4108
4111
4109 Rev: 0
4112 Rev: 0
4110 Ancestor: 0
4113 Ancestor: 0
4111
4114
4112 $ hg log --template '{revset("TIP"|lower)}\n' -l1
4115 $ hg log --template '{revset("TIP"|lower)}\n' -l1
4113 2
4116 2
4114
4117
4115 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1
4118 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1
4116 2
4119 2
4117
4120
4118 a list template is evaluated for each item of revset/parents
4121 a list template is evaluated for each item of revset/parents
4119
4122
4120 $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
4123 $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
4121 2 p: 1:bcc7ff960b8e
4124 2 p: 1:bcc7ff960b8e
4122 1 p: 0:f7769ec2ab97
4125 1 p: 0:f7769ec2ab97
4123 0 p:
4126 0 p:
4124
4127
4125 $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
4128 $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
4126 2 p: 1:bcc7ff960b8e -1:000000000000
4129 2 p: 1:bcc7ff960b8e -1:000000000000
4127 1 p: 0:f7769ec2ab97 -1:000000000000
4130 1 p: 0:f7769ec2ab97 -1:000000000000
4128 0 p: -1:000000000000 -1:000000000000
4131 0 p: -1:000000000000 -1:000000000000
4129
4132
4130 therefore, 'revcache' should be recreated for each rev
4133 therefore, 'revcache' should be recreated for each rev
4131
4134
4132 $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
4135 $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
4133 2 aa b
4136 2 aa b
4134 p
4137 p
4135 1
4138 1
4136 p a
4139 p a
4137 0 a
4140 0 a
4138 p
4141 p
4139
4142
4140 $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
4143 $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
4141 2 aa b
4144 2 aa b
4142 p
4145 p
4143 1
4146 1
4144 p a
4147 p a
4145 0 a
4148 0 a
4146 p
4149 p
4147
4150
4148 a revset item must be evaluated as an integer revision, not an offset from tip
4151 a revset item must be evaluated as an integer revision, not an offset from tip
4149
4152
4150 $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'
4153 $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'
4151 -1:000000000000
4154 -1:000000000000
4152 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n'
4155 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n'
4153 -1:000000000000
4156 -1:000000000000
4154
4157
4155 join() should pick '{rev}' from revset items:
4158 join() should pick '{rev}' from revset items:
4156
4159
4157 $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6
4160 $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6
4158 4, 5
4161 4, 5
4159
4162
4160 on the other hand, parents are formatted as '{rev}:{node|formatnode}' by
4163 on the other hand, parents are formatted as '{rev}:{node|formatnode}' by
4161 default. join() should agree with the default formatting:
4164 default. join() should agree with the default formatting:
4162
4165
4163 $ hg log -R ../a -T '{join(parents, ", ")}\n' -r6
4166 $ hg log -R ../a -T '{join(parents, ", ")}\n' -r6
4164 5:13207e5a10d9, 4:bbe44766e73d
4167 5:13207e5a10d9, 4:bbe44766e73d
4165
4168
4166 $ hg log -R ../a -T '{join(parents, ",\n")}\n' -r6 --debug
4169 $ hg log -R ../a -T '{join(parents, ",\n")}\n' -r6 --debug
4167 5:13207e5a10d9fd28ec424934298e176197f2c67f,
4170 5:13207e5a10d9fd28ec424934298e176197f2c67f,
4168 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
4171 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
4169
4172
4170 Invalid arguments passed to revset()
4173 Invalid arguments passed to revset()
4171
4174
4172 $ hg log -T '{revset("%whatever", 0)}\n'
4175 $ hg log -T '{revset("%whatever", 0)}\n'
4173 hg: parse error: unexpected revspec format character w
4176 hg: parse error: unexpected revspec format character w
4174 [255]
4177 [255]
4175 $ hg log -T '{revset("%lwhatever", files)}\n'
4178 $ hg log -T '{revset("%lwhatever", files)}\n'
4176 hg: parse error: unexpected revspec format character w
4179 hg: parse error: unexpected revspec format character w
4177 [255]
4180 [255]
4178 $ hg log -T '{revset("%s %s", 0)}\n'
4181 $ hg log -T '{revset("%s %s", 0)}\n'
4179 hg: parse error: missing argument for revspec
4182 hg: parse error: missing argument for revspec
4180 [255]
4183 [255]
4181 $ hg log -T '{revset("", 0)}\n'
4184 $ hg log -T '{revset("", 0)}\n'
4182 hg: parse error: too many revspec arguments specified
4185 hg: parse error: too many revspec arguments specified
4183 [255]
4186 [255]
4184 $ hg log -T '{revset("%s", 0, 1)}\n'
4187 $ hg log -T '{revset("%s", 0, 1)}\n'
4185 hg: parse error: too many revspec arguments specified
4188 hg: parse error: too many revspec arguments specified
4186 [255]
4189 [255]
4187 $ hg log -T '{revset("%", 0)}\n'
4190 $ hg log -T '{revset("%", 0)}\n'
4188 hg: parse error: incomplete revspec format character
4191 hg: parse error: incomplete revspec format character
4189 [255]
4192 [255]
4190 $ hg log -T '{revset("%l", 0)}\n'
4193 $ hg log -T '{revset("%l", 0)}\n'
4191 hg: parse error: incomplete revspec format character
4194 hg: parse error: incomplete revspec format character
4192 [255]
4195 [255]
4193 $ hg log -T '{revset("%d", 'foo')}\n'
4196 $ hg log -T '{revset("%d", 'foo')}\n'
4194 hg: parse error: invalid argument for revspec
4197 hg: parse error: invalid argument for revspec
4195 [255]
4198 [255]
4196 $ hg log -T '{revset("%ld", files)}\n'
4199 $ hg log -T '{revset("%ld", files)}\n'
4197 hg: parse error: invalid argument for revspec
4200 hg: parse error: invalid argument for revspec
4198 [255]
4201 [255]
4199 $ hg log -T '{revset("%ls", 0)}\n'
4202 $ hg log -T '{revset("%ls", 0)}\n'
4200 hg: parse error: invalid argument for revspec
4203 hg: parse error: invalid argument for revspec
4201 [255]
4204 [255]
4202 $ hg log -T '{revset("%b", 'foo')}\n'
4205 $ hg log -T '{revset("%b", 'foo')}\n'
4203 hg: parse error: invalid argument for revspec
4206 hg: parse error: invalid argument for revspec
4204 [255]
4207 [255]
4205 $ hg log -T '{revset("%lb", files)}\n'
4208 $ hg log -T '{revset("%lb", files)}\n'
4206 hg: parse error: invalid argument for revspec
4209 hg: parse error: invalid argument for revspec
4207 [255]
4210 [255]
4208 $ hg log -T '{revset("%r", 0)}\n'
4211 $ hg log -T '{revset("%r", 0)}\n'
4209 hg: parse error: invalid argument for revspec
4212 hg: parse error: invalid argument for revspec
4210 [255]
4213 [255]
4211
4214
4212 Test 'originalnode'
4215 Test 'originalnode'
4213
4216
4214 $ hg log -r 1 -T '{revset("null") % "{node|short} {originalnode|short}"}\n'
4217 $ hg log -r 1 -T '{revset("null") % "{node|short} {originalnode|short}"}\n'
4215 000000000000 bcc7ff960b8e
4218 000000000000 bcc7ff960b8e
4216 $ hg log -r 0 -T '{manifest % "{node} {originalnode}"}\n'
4219 $ hg log -r 0 -T '{manifest % "{node} {originalnode}"}\n'
4217 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 f7769ec2ab975ad19684098ad1ffd9b81ecc71a1
4220 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 f7769ec2ab975ad19684098ad1ffd9b81ecc71a1
4218
4221
4219 Test files function
4222 Test files function
4220
4223
4221 $ hg log -T "{rev}\n{join(files('*'), '\n')}\n"
4224 $ hg log -T "{rev}\n{join(files('*'), '\n')}\n"
4222 2
4225 2
4223 a
4226 a
4224 aa
4227 aa
4225 b
4228 b
4226 1
4229 1
4227 a
4230 a
4228 0
4231 0
4229 a
4232 a
4230
4233
4231 $ hg log -T "{rev}\n{join(files('aa'), '\n')}\n"
4234 $ hg log -T "{rev}\n{join(files('aa'), '\n')}\n"
4232 2
4235 2
4233 aa
4236 aa
4234 1
4237 1
4235
4238
4236 0
4239 0
4237
4240
4238
4241
4239 Test relpath function
4242 Test relpath function
4240
4243
4241 $ hg log -r0 -T '{files % "{file|relpath}\n"}'
4244 $ hg log -r0 -T '{files % "{file|relpath}\n"}'
4242 a
4245 a
4243 $ cd ..
4246 $ cd ..
4244 $ hg log -R r -r0 -T '{files % "{file|relpath}\n"}'
4247 $ hg log -R r -r0 -T '{files % "{file|relpath}\n"}'
4245 r/a
4248 r/a
4246 $ cd r
4249 $ cd r
4247
4250
4248 Test active bookmark templating
4251 Test active bookmark templating
4249
4252
4250 $ hg book foo
4253 $ hg book foo
4251 $ hg book bar
4254 $ hg book bar
4252 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
4255 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
4253 2 bar* foo
4256 2 bar* foo
4254 1
4257 1
4255 0
4258 0
4256 $ hg log --template "{rev} {activebookmark}\n"
4259 $ hg log --template "{rev} {activebookmark}\n"
4257 2 bar
4260 2 bar
4258 1
4261 1
4259 0
4262 0
4260 $ hg bookmarks --inactive bar
4263 $ hg bookmarks --inactive bar
4261 $ hg log --template "{rev} {activebookmark}\n"
4264 $ hg log --template "{rev} {activebookmark}\n"
4262 2
4265 2
4263 1
4266 1
4264 0
4267 0
4265 $ hg book -r1 baz
4268 $ hg book -r1 baz
4266 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
4269 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
4267 2 bar foo
4270 2 bar foo
4268 1 baz
4271 1 baz
4269 0
4272 0
4270 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
4273 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
4271 2 t
4274 2 t
4272 1 f
4275 1 f
4273 0 f
4276 0 f
4274
4277
4275 Test namespaces dict
4278 Test namespaces dict
4276
4279
4277 $ hg --config extensions.revnamesext=$TESTDIR/revnamesext.py log -T '{rev}\n{namespaces % " {namespace} color={colorname} builtin={builtin}\n {join(names, ",")}\n"}\n'
4280 $ hg --config extensions.revnamesext=$TESTDIR/revnamesext.py log -T '{rev}\n{namespaces % " {namespace} color={colorname} builtin={builtin}\n {join(names, ",")}\n"}\n'
4278 2
4281 2
4279 bookmarks color=bookmark builtin=True
4282 bookmarks color=bookmark builtin=True
4280 bar,foo
4283 bar,foo
4281 tags color=tag builtin=True
4284 tags color=tag builtin=True
4282 tip
4285 tip
4283 branches color=branch builtin=True
4286 branches color=branch builtin=True
4284 text.{rev}
4287 text.{rev}
4285 revnames color=revname builtin=False
4288 revnames color=revname builtin=False
4286 r2
4289 r2
4287
4290
4288 1
4291 1
4289 bookmarks color=bookmark builtin=True
4292 bookmarks color=bookmark builtin=True
4290 baz
4293 baz
4291 tags color=tag builtin=True
4294 tags color=tag builtin=True
4292
4295
4293 branches color=branch builtin=True
4296 branches color=branch builtin=True
4294 text.{rev}
4297 text.{rev}
4295 revnames color=revname builtin=False
4298 revnames color=revname builtin=False
4296 r1
4299 r1
4297
4300
4298 0
4301 0
4299 bookmarks color=bookmark builtin=True
4302 bookmarks color=bookmark builtin=True
4300
4303
4301 tags color=tag builtin=True
4304 tags color=tag builtin=True
4302
4305
4303 branches color=branch builtin=True
4306 branches color=branch builtin=True
4304 default
4307 default
4305 revnames color=revname builtin=False
4308 revnames color=revname builtin=False
4306 r0
4309 r0
4307
4310
4308 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}'
4311 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}'
4309 bookmarks: bar foo
4312 bookmarks: bar foo
4310 tags: tip
4313 tags: tip
4311 branches: text.{rev}
4314 branches: text.{rev}
4312 $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}'
4315 $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}'
4313 bookmarks:
4316 bookmarks:
4314 bar
4317 bar
4315 foo
4318 foo
4316 tags:
4319 tags:
4317 tip
4320 tip
4318 branches:
4321 branches:
4319 text.{rev}
4322 text.{rev}
4320 $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}'
4323 $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}'
4321 bar
4324 bar
4322 foo
4325 foo
4323 $ hg log -r2 -T '{namespaces.bookmarks % "{bookmark}\n"}'
4326 $ hg log -r2 -T '{namespaces.bookmarks % "{bookmark}\n"}'
4324 bar
4327 bar
4325 foo
4328 foo
4326
4329
4327 Test stringify on sub expressions
4330 Test stringify on sub expressions
4328
4331
4329 $ cd ..
4332 $ cd ..
4330 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
4333 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
4331 fourth, second, third
4334 fourth, second, third
4332 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
4335 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
4333 abc
4336 abc
4334
4337
4335 Test splitlines
4338 Test splitlines
4336
4339
4337 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
4340 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
4338 @ foo Modify, add, remove, rename
4341 @ foo Modify, add, remove, rename
4339 |
4342 |
4340 o foo future
4343 o foo future
4341 |
4344 |
4342 o foo third
4345 o foo third
4343 |
4346 |
4344 o foo second
4347 o foo second
4345
4348
4346 o foo merge
4349 o foo merge
4347 |\
4350 |\
4348 | o foo new head
4351 | o foo new head
4349 | |
4352 | |
4350 o | foo new branch
4353 o | foo new branch
4351 |/
4354 |/
4352 o foo no user, no domain
4355 o foo no user, no domain
4353 |
4356 |
4354 o foo no person
4357 o foo no person
4355 |
4358 |
4356 o foo other 1
4359 o foo other 1
4357 | foo other 2
4360 | foo other 2
4358 | foo
4361 | foo
4359 | foo other 3
4362 | foo other 3
4360 o foo line 1
4363 o foo line 1
4361 foo line 2
4364 foo line 2
4362
4365
4363 $ hg log -R a -r0 -T '{desc|splitlines}\n'
4366 $ hg log -R a -r0 -T '{desc|splitlines}\n'
4364 line 1 line 2
4367 line 1 line 2
4365 $ hg log -R a -r0 -T '{join(desc|splitlines, "|")}\n'
4368 $ hg log -R a -r0 -T '{join(desc|splitlines, "|")}\n'
4366 line 1|line 2
4369 line 1|line 2
4367
4370
4368 Test startswith
4371 Test startswith
4369 $ hg log -Gv -R a --template "{startswith(desc)}"
4372 $ hg log -Gv -R a --template "{startswith(desc)}"
4370 hg: parse error: startswith expects two arguments
4373 hg: parse error: startswith expects two arguments
4371 [255]
4374 [255]
4372
4375
4373 $ hg log -Gv -R a --template "{startswith('line', desc)}"
4376 $ hg log -Gv -R a --template "{startswith('line', desc)}"
4374 @
4377 @
4375 |
4378 |
4376 o
4379 o
4377 |
4380 |
4378 o
4381 o
4379 |
4382 |
4380 o
4383 o
4381
4384
4382 o
4385 o
4383 |\
4386 |\
4384 | o
4387 | o
4385 | |
4388 | |
4386 o |
4389 o |
4387 |/
4390 |/
4388 o
4391 o
4389 |
4392 |
4390 o
4393 o
4391 |
4394 |
4392 o
4395 o
4393 |
4396 |
4394 o line 1
4397 o line 1
4395 line 2
4398 line 2
4396
4399
4397 Test bad template with better error message
4400 Test bad template with better error message
4398
4401
4399 $ hg log -Gv -R a --template '{desc|user()}'
4402 $ hg log -Gv -R a --template '{desc|user()}'
4400 hg: parse error: expected a symbol, got 'func'
4403 hg: parse error: expected a symbol, got 'func'
4401 [255]
4404 [255]
4402
4405
4403 Test word function (including index out of bounds graceful failure)
4406 Test word function (including index out of bounds graceful failure)
4404
4407
4405 $ hg log -Gv -R a --template "{word('1', desc)}"
4408 $ hg log -Gv -R a --template "{word('1', desc)}"
4406 @ add,
4409 @ add,
4407 |
4410 |
4408 o
4411 o
4409 |
4412 |
4410 o
4413 o
4411 |
4414 |
4412 o
4415 o
4413
4416
4414 o
4417 o
4415 |\
4418 |\
4416 | o head
4419 | o head
4417 | |
4420 | |
4418 o | branch
4421 o | branch
4419 |/
4422 |/
4420 o user,
4423 o user,
4421 |
4424 |
4422 o person
4425 o person
4423 |
4426 |
4424 o 1
4427 o 1
4425 |
4428 |
4426 o 1
4429 o 1
4427
4430
4428
4431
4429 Test word third parameter used as splitter
4432 Test word third parameter used as splitter
4430
4433
4431 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
4434 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
4432 @ M
4435 @ M
4433 |
4436 |
4434 o future
4437 o future
4435 |
4438 |
4436 o third
4439 o third
4437 |
4440 |
4438 o sec
4441 o sec
4439
4442
4440 o merge
4443 o merge
4441 |\
4444 |\
4442 | o new head
4445 | o new head
4443 | |
4446 | |
4444 o | new branch
4447 o | new branch
4445 |/
4448 |/
4446 o n
4449 o n
4447 |
4450 |
4448 o n
4451 o n
4449 |
4452 |
4450 o
4453 o
4451 |
4454 |
4452 o line 1
4455 o line 1
4453 line 2
4456 line 2
4454
4457
4455 Test word error messages for not enough and too many arguments
4458 Test word error messages for not enough and too many arguments
4456
4459
4457 $ hg log -Gv -R a --template "{word('0')}"
4460 $ hg log -Gv -R a --template "{word('0')}"
4458 hg: parse error: word expects two or three arguments, got 1
4461 hg: parse error: word expects two or three arguments, got 1
4459 [255]
4462 [255]
4460
4463
4461 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
4464 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
4462 hg: parse error: word expects two or three arguments, got 7
4465 hg: parse error: word expects two or three arguments, got 7
4463 [255]
4466 [255]
4464
4467
4465 Test word for integer literal
4468 Test word for integer literal
4466
4469
4467 $ hg log -R a --template "{word(2, desc)}\n" -r0
4470 $ hg log -R a --template "{word(2, desc)}\n" -r0
4468 line
4471 line
4469
4472
4470 Test word for invalid numbers
4473 Test word for invalid numbers
4471
4474
4472 $ hg log -Gv -R a --template "{word('a', desc)}"
4475 $ hg log -Gv -R a --template "{word('a', desc)}"
4473 hg: parse error: word expects an integer index
4476 hg: parse error: word expects an integer index
4474 [255]
4477 [255]
4475
4478
4476 Test word for out of range
4479 Test word for out of range
4477
4480
4478 $ hg log -R a --template "{word(10000, desc)}"
4481 $ hg log -R a --template "{word(10000, desc)}"
4479 $ hg log -R a --template "{word(-10000, desc)}"
4482 $ hg log -R a --template "{word(-10000, desc)}"
4480
4483
4481 Test indent and not adding to empty lines
4484 Test indent and not adding to empty lines
4482
4485
4483 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
4486 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
4484 -----
4487 -----
4485 > line 1
4488 > line 1
4486 >> line 2
4489 >> line 2
4487 -----
4490 -----
4488 > other 1
4491 > other 1
4489 >> other 2
4492 >> other 2
4490
4493
4491 >> other 3
4494 >> other 3
4492
4495
4493 Test with non-strings like dates
4496 Test with non-strings like dates
4494
4497
4495 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
4498 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
4496 1200000.00
4499 1200000.00
4497 1300000.00
4500 1300000.00
4498
4501
4499 Test broken string escapes:
4502 Test broken string escapes:
4500
4503
4501 $ hg log -T "bogus\\" -R a
4504 $ hg log -T "bogus\\" -R a
4502 hg: parse error: trailing \ in string
4505 hg: parse error: trailing \ in string
4503 [255]
4506 [255]
4504 $ hg log -T "\\xy" -R a
4507 $ hg log -T "\\xy" -R a
4505 hg: parse error: invalid \x escape* (glob)
4508 hg: parse error: invalid \x escape* (glob)
4506 [255]
4509 [255]
4507
4510
4508 json filter should escape HTML tags so that the output can be embedded in hgweb:
4511 json filter should escape HTML tags so that the output can be embedded in hgweb:
4509
4512
4510 $ hg log -T "{'<foo@example.org>'|json}\n" -R a -l1
4513 $ hg log -T "{'<foo@example.org>'|json}\n" -R a -l1
4511 "\u003cfoo@example.org\u003e"
4514 "\u003cfoo@example.org\u003e"
4512
4515
4513 Templater supports aliases of symbol and func() styles:
4516 Templater supports aliases of symbol and func() styles:
4514
4517
4515 $ hg clone -q a aliases
4518 $ hg clone -q a aliases
4516 $ cd aliases
4519 $ cd aliases
4517 $ cat <<EOF >> .hg/hgrc
4520 $ cat <<EOF >> .hg/hgrc
4518 > [templatealias]
4521 > [templatealias]
4519 > r = rev
4522 > r = rev
4520 > rn = "{r}:{node|short}"
4523 > rn = "{r}:{node|short}"
4521 > status(c, files) = files % "{c} {file}\n"
4524 > status(c, files) = files % "{c} {file}\n"
4522 > utcdate(d) = localdate(d, "UTC")
4525 > utcdate(d) = localdate(d, "UTC")
4523 > EOF
4526 > EOF
4524
4527
4525 $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n'
4528 $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n'
4526 (template
4529 (template
4527 (symbol 'rn')
4530 (symbol 'rn')
4528 (string ' ')
4531 (string ' ')
4529 (|
4532 (|
4530 (func
4533 (func
4531 (symbol 'utcdate')
4534 (symbol 'utcdate')
4532 (symbol 'date'))
4535 (symbol 'date'))
4533 (symbol 'isodate'))
4536 (symbol 'isodate'))
4534 (string '\n'))
4537 (string '\n'))
4535 * expanded:
4538 * expanded:
4536 (template
4539 (template
4537 (template
4540 (template
4538 (symbol 'rev')
4541 (symbol 'rev')
4539 (string ':')
4542 (string ':')
4540 (|
4543 (|
4541 (symbol 'node')
4544 (symbol 'node')
4542 (symbol 'short')))
4545 (symbol 'short')))
4543 (string ' ')
4546 (string ' ')
4544 (|
4547 (|
4545 (func
4548 (func
4546 (symbol 'localdate')
4549 (symbol 'localdate')
4547 (list
4550 (list
4548 (symbol 'date')
4551 (symbol 'date')
4549 (string 'UTC')))
4552 (string 'UTC')))
4550 (symbol 'isodate'))
4553 (symbol 'isodate'))
4551 (string '\n'))
4554 (string '\n'))
4552 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4555 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4553
4556
4554 $ hg debugtemplate -vr0 '{status("A", file_adds)}'
4557 $ hg debugtemplate -vr0 '{status("A", file_adds)}'
4555 (template
4558 (template
4556 (func
4559 (func
4557 (symbol 'status')
4560 (symbol 'status')
4558 (list
4561 (list
4559 (string 'A')
4562 (string 'A')
4560 (symbol 'file_adds'))))
4563 (symbol 'file_adds'))))
4561 * expanded:
4564 * expanded:
4562 (template
4565 (template
4563 (%
4566 (%
4564 (symbol 'file_adds')
4567 (symbol 'file_adds')
4565 (template
4568 (template
4566 (string 'A')
4569 (string 'A')
4567 (string ' ')
4570 (string ' ')
4568 (symbol 'file')
4571 (symbol 'file')
4569 (string '\n'))))
4572 (string '\n'))))
4570 A a
4573 A a
4571
4574
4572 A unary function alias can be called as a filter:
4575 A unary function alias can be called as a filter:
4573
4576
4574 $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n'
4577 $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n'
4575 (template
4578 (template
4576 (|
4579 (|
4577 (|
4580 (|
4578 (symbol 'date')
4581 (symbol 'date')
4579 (symbol 'utcdate'))
4582 (symbol 'utcdate'))
4580 (symbol 'isodate'))
4583 (symbol 'isodate'))
4581 (string '\n'))
4584 (string '\n'))
4582 * expanded:
4585 * expanded:
4583 (template
4586 (template
4584 (|
4587 (|
4585 (func
4588 (func
4586 (symbol 'localdate')
4589 (symbol 'localdate')
4587 (list
4590 (list
4588 (symbol 'date')
4591 (symbol 'date')
4589 (string 'UTC')))
4592 (string 'UTC')))
4590 (symbol 'isodate'))
4593 (symbol 'isodate'))
4591 (string '\n'))
4594 (string '\n'))
4592 1970-01-12 13:46 +0000
4595 1970-01-12 13:46 +0000
4593
4596
4594 Aliases should be applied only to command arguments and templates in hgrc.
4597 Aliases should be applied only to command arguments and templates in hgrc.
4595 Otherwise, our stock styles and web templates could be corrupted:
4598 Otherwise, our stock styles and web templates could be corrupted:
4596
4599
4597 $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n'
4600 $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n'
4598 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4601 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4599
4602
4600 $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"'
4603 $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"'
4601 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4604 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4602
4605
4603 $ cat <<EOF > tmpl
4606 $ cat <<EOF > tmpl
4604 > changeset = 'nothing expanded:{rn}\n'
4607 > changeset = 'nothing expanded:{rn}\n'
4605 > EOF
4608 > EOF
4606 $ hg log -r0 --style ./tmpl
4609 $ hg log -r0 --style ./tmpl
4607 nothing expanded:
4610 nothing expanded:
4608
4611
4609 Aliases in formatter:
4612 Aliases in formatter:
4610
4613
4611 $ hg branches -T '{pad(branch, 7)} {rn}\n'
4614 $ hg branches -T '{pad(branch, 7)} {rn}\n'
4612 default 6:d41e714fe50d
4615 default 6:d41e714fe50d
4613 foo 4:bbe44766e73d
4616 foo 4:bbe44766e73d
4614
4617
4615 Aliases should honor HGPLAIN:
4618 Aliases should honor HGPLAIN:
4616
4619
4617 $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n'
4620 $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n'
4618 nothing expanded:
4621 nothing expanded:
4619 $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n'
4622 $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n'
4620 0:1e4e1b8f71e0
4623 0:1e4e1b8f71e0
4621
4624
4622 Unparsable alias:
4625 Unparsable alias:
4623
4626
4624 $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}'
4627 $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}'
4625 (template
4628 (template
4626 (symbol 'bad'))
4629 (symbol 'bad'))
4627 abort: bad definition of template alias "bad": at 2: not a prefix: end
4630 abort: bad definition of template alias "bad": at 2: not a prefix: end
4628 [255]
4631 [255]
4629 $ hg log --config templatealias.bad='x(' -T '{bad}'
4632 $ hg log --config templatealias.bad='x(' -T '{bad}'
4630 abort: bad definition of template alias "bad": at 2: not a prefix: end
4633 abort: bad definition of template alias "bad": at 2: not a prefix: end
4631 [255]
4634 [255]
4632
4635
4633 $ cd ..
4636 $ cd ..
4634
4637
4635 Set up repository for non-ascii encoding tests:
4638 Set up repository for non-ascii encoding tests:
4636
4639
4637 $ hg init nonascii
4640 $ hg init nonascii
4638 $ cd nonascii
4641 $ cd nonascii
4639 $ $PYTHON <<EOF
4642 $ $PYTHON <<EOF
4640 > open('latin1', 'wb').write(b'\xe9')
4643 > open('latin1', 'wb').write(b'\xe9')
4641 > open('utf-8', 'wb').write(b'\xc3\xa9')
4644 > open('utf-8', 'wb').write(b'\xc3\xa9')
4642 > EOF
4645 > EOF
4643 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
4646 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
4644 $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8
4647 $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8
4645
4648
4646 json filter should try round-trip conversion to utf-8:
4649 json filter should try round-trip conversion to utf-8:
4647
4650
4648 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
4651 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
4649 "\u00e9"
4652 "\u00e9"
4650 $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0
4653 $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0
4651 "non-ascii branch: \u00e9"
4654 "non-ascii branch: \u00e9"
4652
4655
4653 json filter takes input as utf-8b:
4656 json filter takes input as utf-8b:
4654
4657
4655 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
4658 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
4656 "\u00e9"
4659 "\u00e9"
4657 $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1
4660 $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1
4658 "\udce9"
4661 "\udce9"
4659
4662
4660 utf8 filter:
4663 utf8 filter:
4661
4664
4662 $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0
4665 $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0
4663 round-trip: c3a9
4666 round-trip: c3a9
4664 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1
4667 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1
4665 decoded: c3a9
4668 decoded: c3a9
4666 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1
4669 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1
4667 abort: decoding near * (glob)
4670 abort: decoding near * (glob)
4668 [255]
4671 [255]
4669 $ hg log -T "coerced to string: {rev|utf8}\n" -r0
4672 $ hg log -T "coerced to string: {rev|utf8}\n" -r0
4670 coerced to string: 0
4673 coerced to string: 0
4671
4674
4672 pad width:
4675 pad width:
4673
4676
4674 $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n"
4677 $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n"
4675 \xc3\xa9- (esc)
4678 \xc3\xa9- (esc)
4676
4679
4677 $ cd ..
4680 $ cd ..
4678
4681
4679 Test that template function in extension is registered as expected
4682 Test that template function in extension is registered as expected
4680
4683
4681 $ cd a
4684 $ cd a
4682
4685
4683 $ cat <<EOF > $TESTTMP/customfunc.py
4686 $ cat <<EOF > $TESTTMP/customfunc.py
4684 > from mercurial import registrar
4687 > from mercurial import registrar
4685 >
4688 >
4686 > templatefunc = registrar.templatefunc()
4689 > templatefunc = registrar.templatefunc()
4687 >
4690 >
4688 > @templatefunc(b'custom()')
4691 > @templatefunc(b'custom()')
4689 > def custom(context, mapping, args):
4692 > def custom(context, mapping, args):
4690 > return b'custom'
4693 > return b'custom'
4691 > EOF
4694 > EOF
4692 $ cat <<EOF > .hg/hgrc
4695 $ cat <<EOF > .hg/hgrc
4693 > [extensions]
4696 > [extensions]
4694 > customfunc = $TESTTMP/customfunc.py
4697 > customfunc = $TESTTMP/customfunc.py
4695 > EOF
4698 > EOF
4696
4699
4697 $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true
4700 $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true
4698 custom
4701 custom
4699
4702
4700 $ cd ..
4703 $ cd ..
4701
4704
4702 Test 'graphwidth' in 'hg log' on various topologies. The key here is that the
4705 Test 'graphwidth' in 'hg log' on various topologies. The key here is that the
4703 printed graphwidths 3, 5, 7, etc. should all line up in their respective
4706 printed graphwidths 3, 5, 7, etc. should all line up in their respective
4704 columns. We don't care about other aspects of the graph rendering here.
4707 columns. We don't care about other aspects of the graph rendering here.
4705
4708
4706 $ hg init graphwidth
4709 $ hg init graphwidth
4707 $ cd graphwidth
4710 $ cd graphwidth
4708
4711
4709 $ wrappabletext="a a a a a a a a a a a a"
4712 $ wrappabletext="a a a a a a a a a a a a"
4710
4713
4711 $ printf "first\n" > file
4714 $ printf "first\n" > file
4712 $ hg add file
4715 $ hg add file
4713 $ hg commit -m "$wrappabletext"
4716 $ hg commit -m "$wrappabletext"
4714
4717
4715 $ printf "first\nsecond\n" > file
4718 $ printf "first\nsecond\n" > file
4716 $ hg commit -m "$wrappabletext"
4719 $ hg commit -m "$wrappabletext"
4717
4720
4718 $ hg checkout 0
4721 $ hg checkout 0
4719 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4722 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4720 $ printf "third\nfirst\n" > file
4723 $ printf "third\nfirst\n" > file
4721 $ hg commit -m "$wrappabletext"
4724 $ hg commit -m "$wrappabletext"
4722 created new head
4725 created new head
4723
4726
4724 $ hg merge
4727 $ hg merge
4725 merging file
4728 merging file
4726 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
4729 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
4727 (branch merge, don't forget to commit)
4730 (branch merge, don't forget to commit)
4728
4731
4729 $ hg log --graph -T "{graphwidth}"
4732 $ hg log --graph -T "{graphwidth}"
4730 @ 3
4733 @ 3
4731 |
4734 |
4732 | @ 5
4735 | @ 5
4733 |/
4736 |/
4734 o 3
4737 o 3
4735
4738
4736 $ hg commit -m "$wrappabletext"
4739 $ hg commit -m "$wrappabletext"
4737
4740
4738 $ hg log --graph -T "{graphwidth}"
4741 $ hg log --graph -T "{graphwidth}"
4739 @ 5
4742 @ 5
4740 |\
4743 |\
4741 | o 5
4744 | o 5
4742 | |
4745 | |
4743 o | 5
4746 o | 5
4744 |/
4747 |/
4745 o 3
4748 o 3
4746
4749
4747
4750
4748 $ hg checkout 0
4751 $ hg checkout 0
4749 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4752 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4750 $ printf "third\nfirst\nsecond\n" > file
4753 $ printf "third\nfirst\nsecond\n" > file
4751 $ hg commit -m "$wrappabletext"
4754 $ hg commit -m "$wrappabletext"
4752 created new head
4755 created new head
4753
4756
4754 $ hg log --graph -T "{graphwidth}"
4757 $ hg log --graph -T "{graphwidth}"
4755 @ 3
4758 @ 3
4756 |
4759 |
4757 | o 7
4760 | o 7
4758 | |\
4761 | |\
4759 +---o 7
4762 +---o 7
4760 | |
4763 | |
4761 | o 5
4764 | o 5
4762 |/
4765 |/
4763 o 3
4766 o 3
4764
4767
4765
4768
4766 $ hg log --graph -T "{graphwidth}" -r 3
4769 $ hg log --graph -T "{graphwidth}" -r 3
4767 o 5
4770 o 5
4768 |\
4771 |\
4769 ~ ~
4772 ~ ~
4770
4773
4771 $ hg log --graph -T "{graphwidth}" -r 1
4774 $ hg log --graph -T "{graphwidth}" -r 1
4772 o 3
4775 o 3
4773 |
4776 |
4774 ~
4777 ~
4775
4778
4776 $ hg merge
4779 $ hg merge
4777 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4780 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4778 (branch merge, don't forget to commit)
4781 (branch merge, don't forget to commit)
4779 $ hg commit -m "$wrappabletext"
4782 $ hg commit -m "$wrappabletext"
4780
4783
4781 $ printf "seventh\n" >> file
4784 $ printf "seventh\n" >> file
4782 $ hg commit -m "$wrappabletext"
4785 $ hg commit -m "$wrappabletext"
4783
4786
4784 $ hg log --graph -T "{graphwidth}"
4787 $ hg log --graph -T "{graphwidth}"
4785 @ 3
4788 @ 3
4786 |
4789 |
4787 o 5
4790 o 5
4788 |\
4791 |\
4789 | o 5
4792 | o 5
4790 | |
4793 | |
4791 o | 7
4794 o | 7
4792 |\ \
4795 |\ \
4793 | o | 7
4796 | o | 7
4794 | |/
4797 | |/
4795 o / 5
4798 o / 5
4796 |/
4799 |/
4797 o 3
4800 o 3
4798
4801
4799
4802
4800 The point of graphwidth is to allow wrapping that accounts for the space taken
4803 The point of graphwidth is to allow wrapping that accounts for the space taken
4801 by the graph.
4804 by the graph.
4802
4805
4803 $ COLUMNS=10 hg log --graph -T "{fill(desc, termwidth - graphwidth)}"
4806 $ COLUMNS=10 hg log --graph -T "{fill(desc, termwidth - graphwidth)}"
4804 @ a a a a
4807 @ a a a a
4805 | a a a a
4808 | a a a a
4806 | a a a a
4809 | a a a a
4807 o a a a
4810 o a a a
4808 |\ a a a
4811 |\ a a a
4809 | | a a a
4812 | | a a a
4810 | | a a a
4813 | | a a a
4811 | o a a a
4814 | o a a a
4812 | | a a a
4815 | | a a a
4813 | | a a a
4816 | | a a a
4814 | | a a a
4817 | | a a a
4815 o | a a
4818 o | a a
4816 |\ \ a a
4819 |\ \ a a
4817 | | | a a
4820 | | | a a
4818 | | | a a
4821 | | | a a
4819 | | | a a
4822 | | | a a
4820 | | | a a
4823 | | | a a
4821 | o | a a
4824 | o | a a
4822 | |/ a a
4825 | |/ a a
4823 | | a a
4826 | | a a
4824 | | a a
4827 | | a a
4825 | | a a
4828 | | a a
4826 | | a a
4829 | | a a
4827 o | a a a
4830 o | a a a
4828 |/ a a a
4831 |/ a a a
4829 | a a a
4832 | a a a
4830 | a a a
4833 | a a a
4831 o a a a a
4834 o a a a a
4832 a a a a
4835 a a a a
4833 a a a a
4836 a a a a
4834
4837
4835 Something tricky happens when there are elided nodes; the next drawn row of
4838 Something tricky happens when there are elided nodes; the next drawn row of
4836 edges can be more than one column wider, but the graph width only increases by
4839 edges can be more than one column wider, but the graph width only increases by
4837 one column. The remaining columns are added in between the nodes.
4840 one column. The remaining columns are added in between the nodes.
4838
4841
4839 $ hg log --graph -T "{graphwidth}" -r "0|2|4|5"
4842 $ hg log --graph -T "{graphwidth}" -r "0|2|4|5"
4840 o 5
4843 o 5
4841 |\
4844 |\
4842 | \
4845 | \
4843 | :\
4846 | :\
4844 o : : 7
4847 o : : 7
4845 :/ /
4848 :/ /
4846 : o 5
4849 : o 5
4847 :/
4850 :/
4848 o 3
4851 o 3
4849
4852
4850
4853
4851 $ cd ..
4854 $ cd ..
4852
4855
General Comments 0
You need to be logged in to leave comments. Login now