##// END OF EJS Templates
parser: shorten prefix of alias parsing errors...
Yuya Nishihara -
r29059:8eba4cdc default
parent child Browse files
Show More
@@ -1,542 +1,540
1 # parser.py - simple top-down operator precedence parser for mercurial
1 # parser.py - simple top-down operator precedence parser for mercurial
2 #
2 #
3 # Copyright 2010 Matt Mackall <mpm@selenic.com>
3 # Copyright 2010 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 # see http://effbot.org/zone/simple-top-down-parsing.htm and
8 # see http://effbot.org/zone/simple-top-down-parsing.htm and
9 # http://eli.thegreenplace.net/2010/01/02/top-down-operator-precedence-parsing/
9 # http://eli.thegreenplace.net/2010/01/02/top-down-operator-precedence-parsing/
10 # for background
10 # for background
11
11
12 # takes a tokenizer and elements
12 # takes a tokenizer and elements
13 # tokenizer is an iterator that returns (type, value, pos) tuples
13 # tokenizer is an iterator that returns (type, value, pos) tuples
14 # elements is a mapping of types to binding strength, primary, prefix, infix
14 # elements is a mapping of types to binding strength, primary, prefix, infix
15 # and suffix actions
15 # and suffix actions
16 # an action is a tree node name, a tree label, and an optional match
16 # an action is a tree node name, a tree label, and an optional match
17 # __call__(program) parses program into a labeled tree
17 # __call__(program) parses program into a labeled tree
18
18
19 from __future__ import absolute_import
19 from __future__ import absolute_import
20
20
21 from .i18n import _
21 from .i18n import _
22 from . import error
22 from . import error
23
23
24 class parser(object):
24 class parser(object):
25 def __init__(self, elements, methods=None):
25 def __init__(self, elements, methods=None):
26 self._elements = elements
26 self._elements = elements
27 self._methods = methods
27 self._methods = methods
28 self.current = None
28 self.current = None
29 def _advance(self):
29 def _advance(self):
30 'advance the tokenizer'
30 'advance the tokenizer'
31 t = self.current
31 t = self.current
32 self.current = next(self._iter, None)
32 self.current = next(self._iter, None)
33 return t
33 return t
34 def _hasnewterm(self):
34 def _hasnewterm(self):
35 'True if next token may start new term'
35 'True if next token may start new term'
36 return any(self._elements[self.current[0]][1:3])
36 return any(self._elements[self.current[0]][1:3])
37 def _match(self, m):
37 def _match(self, m):
38 'make sure the tokenizer matches an end condition'
38 'make sure the tokenizer matches an end condition'
39 if self.current[0] != m:
39 if self.current[0] != m:
40 raise error.ParseError(_("unexpected token: %s") % self.current[0],
40 raise error.ParseError(_("unexpected token: %s") % self.current[0],
41 self.current[2])
41 self.current[2])
42 self._advance()
42 self._advance()
43 def _parseoperand(self, bind, m=None):
43 def _parseoperand(self, bind, m=None):
44 'gather right-hand-side operand until an end condition or binding met'
44 'gather right-hand-side operand until an end condition or binding met'
45 if m and self.current[0] == m:
45 if m and self.current[0] == m:
46 expr = None
46 expr = None
47 else:
47 else:
48 expr = self._parse(bind)
48 expr = self._parse(bind)
49 if m:
49 if m:
50 self._match(m)
50 self._match(m)
51 return expr
51 return expr
52 def _parse(self, bind=0):
52 def _parse(self, bind=0):
53 token, value, pos = self._advance()
53 token, value, pos = self._advance()
54 # handle prefix rules on current token, take as primary if unambiguous
54 # handle prefix rules on current token, take as primary if unambiguous
55 primary, prefix = self._elements[token][1:3]
55 primary, prefix = self._elements[token][1:3]
56 if primary and not (prefix and self._hasnewterm()):
56 if primary and not (prefix and self._hasnewterm()):
57 expr = (primary, value)
57 expr = (primary, value)
58 elif prefix:
58 elif prefix:
59 expr = (prefix[0], self._parseoperand(*prefix[1:]))
59 expr = (prefix[0], self._parseoperand(*prefix[1:]))
60 else:
60 else:
61 raise error.ParseError(_("not a prefix: %s") % token, pos)
61 raise error.ParseError(_("not a prefix: %s") % token, pos)
62 # gather tokens until we meet a lower binding strength
62 # gather tokens until we meet a lower binding strength
63 while bind < self._elements[self.current[0]][0]:
63 while bind < self._elements[self.current[0]][0]:
64 token, value, pos = self._advance()
64 token, value, pos = self._advance()
65 # handle infix rules, take as suffix if unambiguous
65 # handle infix rules, take as suffix if unambiguous
66 infix, suffix = self._elements[token][3:]
66 infix, suffix = self._elements[token][3:]
67 if suffix and not (infix and self._hasnewterm()):
67 if suffix and not (infix and self._hasnewterm()):
68 expr = (suffix[0], expr)
68 expr = (suffix[0], expr)
69 elif infix:
69 elif infix:
70 expr = (infix[0], expr, self._parseoperand(*infix[1:]))
70 expr = (infix[0], expr, self._parseoperand(*infix[1:]))
71 else:
71 else:
72 raise error.ParseError(_("not an infix: %s") % token, pos)
72 raise error.ParseError(_("not an infix: %s") % token, pos)
73 return expr
73 return expr
74 def parse(self, tokeniter):
74 def parse(self, tokeniter):
75 'generate a parse tree from tokens'
75 'generate a parse tree from tokens'
76 self._iter = tokeniter
76 self._iter = tokeniter
77 self._advance()
77 self._advance()
78 res = self._parse()
78 res = self._parse()
79 token, value, pos = self.current
79 token, value, pos = self.current
80 return res, pos
80 return res, pos
81 def eval(self, tree):
81 def eval(self, tree):
82 'recursively evaluate a parse tree using node methods'
82 'recursively evaluate a parse tree using node methods'
83 if not isinstance(tree, tuple):
83 if not isinstance(tree, tuple):
84 return tree
84 return tree
85 return self._methods[tree[0]](*[self.eval(t) for t in tree[1:]])
85 return self._methods[tree[0]](*[self.eval(t) for t in tree[1:]])
86 def __call__(self, tokeniter):
86 def __call__(self, tokeniter):
87 'parse tokens into a parse tree and evaluate if methods given'
87 'parse tokens into a parse tree and evaluate if methods given'
88 t = self.parse(tokeniter)
88 t = self.parse(tokeniter)
89 if self._methods:
89 if self._methods:
90 return self.eval(t)
90 return self.eval(t)
91 return t
91 return t
92
92
93 def buildargsdict(trees, funcname, keys, keyvaluenode, keynode):
93 def buildargsdict(trees, funcname, keys, keyvaluenode, keynode):
94 """Build dict from list containing positional and keyword arguments
94 """Build dict from list containing positional and keyword arguments
95
95
96 Invalid keywords or too many positional arguments are rejected, but
96 Invalid keywords or too many positional arguments are rejected, but
97 missing arguments are just omitted.
97 missing arguments are just omitted.
98 """
98 """
99 if len(trees) > len(keys):
99 if len(trees) > len(keys):
100 raise error.ParseError(_("%(func)s takes at most %(nargs)d arguments")
100 raise error.ParseError(_("%(func)s takes at most %(nargs)d arguments")
101 % {'func': funcname, 'nargs': len(keys)})
101 % {'func': funcname, 'nargs': len(keys)})
102 args = {}
102 args = {}
103 # consume positional arguments
103 # consume positional arguments
104 for k, x in zip(keys, trees):
104 for k, x in zip(keys, trees):
105 if x[0] == keyvaluenode:
105 if x[0] == keyvaluenode:
106 break
106 break
107 args[k] = x
107 args[k] = x
108 # remainder should be keyword arguments
108 # remainder should be keyword arguments
109 for x in trees[len(args):]:
109 for x in trees[len(args):]:
110 if x[0] != keyvaluenode or x[1][0] != keynode:
110 if x[0] != keyvaluenode or x[1][0] != keynode:
111 raise error.ParseError(_("%(func)s got an invalid argument")
111 raise error.ParseError(_("%(func)s got an invalid argument")
112 % {'func': funcname})
112 % {'func': funcname})
113 k = x[1][1]
113 k = x[1][1]
114 if k not in keys:
114 if k not in keys:
115 raise error.ParseError(_("%(func)s got an unexpected keyword "
115 raise error.ParseError(_("%(func)s got an unexpected keyword "
116 "argument '%(key)s'")
116 "argument '%(key)s'")
117 % {'func': funcname, 'key': k})
117 % {'func': funcname, 'key': k})
118 if k in args:
118 if k in args:
119 raise error.ParseError(_("%(func)s got multiple values for keyword "
119 raise error.ParseError(_("%(func)s got multiple values for keyword "
120 "argument '%(key)s'")
120 "argument '%(key)s'")
121 % {'func': funcname, 'key': k})
121 % {'func': funcname, 'key': k})
122 args[k] = x[2]
122 args[k] = x[2]
123 return args
123 return args
124
124
125 def unescapestr(s):
125 def unescapestr(s):
126 try:
126 try:
127 return s.decode("string_escape")
127 return s.decode("string_escape")
128 except ValueError as e:
128 except ValueError as e:
129 # mangle Python's exception into our format
129 # mangle Python's exception into our format
130 raise error.ParseError(str(e).lower())
130 raise error.ParseError(str(e).lower())
131
131
132 def _prettyformat(tree, leafnodes, level, lines):
132 def _prettyformat(tree, leafnodes, level, lines):
133 if not isinstance(tree, tuple) or tree[0] in leafnodes:
133 if not isinstance(tree, tuple) or tree[0] in leafnodes:
134 lines.append((level, str(tree)))
134 lines.append((level, str(tree)))
135 else:
135 else:
136 lines.append((level, '(%s' % tree[0]))
136 lines.append((level, '(%s' % tree[0]))
137 for s in tree[1:]:
137 for s in tree[1:]:
138 _prettyformat(s, leafnodes, level + 1, lines)
138 _prettyformat(s, leafnodes, level + 1, lines)
139 lines[-1:] = [(lines[-1][0], lines[-1][1] + ')')]
139 lines[-1:] = [(lines[-1][0], lines[-1][1] + ')')]
140
140
141 def prettyformat(tree, leafnodes):
141 def prettyformat(tree, leafnodes):
142 lines = []
142 lines = []
143 _prettyformat(tree, leafnodes, 0, lines)
143 _prettyformat(tree, leafnodes, 0, lines)
144 output = '\n'.join((' ' * l + s) for l, s in lines)
144 output = '\n'.join((' ' * l + s) for l, s in lines)
145 return output
145 return output
146
146
147 def simplifyinfixops(tree, targetnodes):
147 def simplifyinfixops(tree, targetnodes):
148 """Flatten chained infix operations to reduce usage of Python stack
148 """Flatten chained infix operations to reduce usage of Python stack
149
149
150 >>> def f(tree):
150 >>> def f(tree):
151 ... print prettyformat(simplifyinfixops(tree, ('or',)), ('symbol',))
151 ... print prettyformat(simplifyinfixops(tree, ('or',)), ('symbol',))
152 >>> f(('or',
152 >>> f(('or',
153 ... ('or',
153 ... ('or',
154 ... ('symbol', '1'),
154 ... ('symbol', '1'),
155 ... ('symbol', '2')),
155 ... ('symbol', '2')),
156 ... ('symbol', '3')))
156 ... ('symbol', '3')))
157 (or
157 (or
158 ('symbol', '1')
158 ('symbol', '1')
159 ('symbol', '2')
159 ('symbol', '2')
160 ('symbol', '3'))
160 ('symbol', '3'))
161 >>> f(('func',
161 >>> f(('func',
162 ... ('symbol', 'p1'),
162 ... ('symbol', 'p1'),
163 ... ('or',
163 ... ('or',
164 ... ('or',
164 ... ('or',
165 ... ('func',
165 ... ('func',
166 ... ('symbol', 'sort'),
166 ... ('symbol', 'sort'),
167 ... ('list',
167 ... ('list',
168 ... ('or',
168 ... ('or',
169 ... ('or',
169 ... ('or',
170 ... ('symbol', '1'),
170 ... ('symbol', '1'),
171 ... ('symbol', '2')),
171 ... ('symbol', '2')),
172 ... ('symbol', '3')),
172 ... ('symbol', '3')),
173 ... ('negate',
173 ... ('negate',
174 ... ('symbol', 'rev')))),
174 ... ('symbol', 'rev')))),
175 ... ('and',
175 ... ('and',
176 ... ('symbol', '4'),
176 ... ('symbol', '4'),
177 ... ('group',
177 ... ('group',
178 ... ('or',
178 ... ('or',
179 ... ('or',
179 ... ('or',
180 ... ('symbol', '5'),
180 ... ('symbol', '5'),
181 ... ('symbol', '6')),
181 ... ('symbol', '6')),
182 ... ('symbol', '7'))))),
182 ... ('symbol', '7'))))),
183 ... ('symbol', '8'))))
183 ... ('symbol', '8'))))
184 (func
184 (func
185 ('symbol', 'p1')
185 ('symbol', 'p1')
186 (or
186 (or
187 (func
187 (func
188 ('symbol', 'sort')
188 ('symbol', 'sort')
189 (list
189 (list
190 (or
190 (or
191 ('symbol', '1')
191 ('symbol', '1')
192 ('symbol', '2')
192 ('symbol', '2')
193 ('symbol', '3'))
193 ('symbol', '3'))
194 (negate
194 (negate
195 ('symbol', 'rev'))))
195 ('symbol', 'rev'))))
196 (and
196 (and
197 ('symbol', '4')
197 ('symbol', '4')
198 (group
198 (group
199 (or
199 (or
200 ('symbol', '5')
200 ('symbol', '5')
201 ('symbol', '6')
201 ('symbol', '6')
202 ('symbol', '7'))))
202 ('symbol', '7'))))
203 ('symbol', '8')))
203 ('symbol', '8')))
204 """
204 """
205 if not isinstance(tree, tuple):
205 if not isinstance(tree, tuple):
206 return tree
206 return tree
207 op = tree[0]
207 op = tree[0]
208 if op not in targetnodes:
208 if op not in targetnodes:
209 return (op,) + tuple(simplifyinfixops(x, targetnodes) for x in tree[1:])
209 return (op,) + tuple(simplifyinfixops(x, targetnodes) for x in tree[1:])
210
210
211 # walk down left nodes taking each right node. no recursion to left nodes
211 # walk down left nodes taking each right node. no recursion to left nodes
212 # because infix operators are left-associative, i.e. left tree is deep.
212 # because infix operators are left-associative, i.e. left tree is deep.
213 # e.g. '1 + 2 + 3' -> (+ (+ 1 2) 3) -> (+ 1 2 3)
213 # e.g. '1 + 2 + 3' -> (+ (+ 1 2) 3) -> (+ 1 2 3)
214 simplified = []
214 simplified = []
215 x = tree
215 x = tree
216 while x[0] == op:
216 while x[0] == op:
217 l, r = x[1:]
217 l, r = x[1:]
218 simplified.append(simplifyinfixops(r, targetnodes))
218 simplified.append(simplifyinfixops(r, targetnodes))
219 x = l
219 x = l
220 simplified.append(simplifyinfixops(x, targetnodes))
220 simplified.append(simplifyinfixops(x, targetnodes))
221 simplified.append(op)
221 simplified.append(op)
222 return tuple(reversed(simplified))
222 return tuple(reversed(simplified))
223
223
224 def parseerrordetail(inst):
224 def parseerrordetail(inst):
225 """Compose error message from specified ParseError object
225 """Compose error message from specified ParseError object
226 """
226 """
227 if len(inst.args) > 1:
227 if len(inst.args) > 1:
228 return _('at %s: %s') % (inst.args[1], inst.args[0])
228 return _('at %s: %s') % (inst.args[1], inst.args[0])
229 else:
229 else:
230 return inst.args[0]
230 return inst.args[0]
231
231
232 class alias(object):
232 class alias(object):
233 """Parsed result of alias"""
233 """Parsed result of alias"""
234
234
235 def __init__(self, name, args, err, replacement):
235 def __init__(self, name, args, err, replacement):
236 self.name = name
236 self.name = name
237 self.args = args
237 self.args = args
238 self.error = err
238 self.error = err
239 self.replacement = replacement
239 self.replacement = replacement
240 # whether own `error` information is already shown or not.
240 # whether own `error` information is already shown or not.
241 # this avoids showing same warning multiple times at each
241 # this avoids showing same warning multiple times at each
242 # `expandaliases`.
242 # `expandaliases`.
243 self.warned = False
243 self.warned = False
244
244
245 class basealiasrules(object):
245 class basealiasrules(object):
246 """Parsing and expansion rule set of aliases
246 """Parsing and expansion rule set of aliases
247
247
248 This is a helper for fileset/revset/template aliases. A concrete rule set
248 This is a helper for fileset/revset/template aliases. A concrete rule set
249 should be made by sub-classing this and implementing class/static methods.
249 should be made by sub-classing this and implementing class/static methods.
250
250
251 It supports alias expansion of symbol and funciton-call styles::
251 It supports alias expansion of symbol and funciton-call styles::
252
252
253 # decl = defn
253 # decl = defn
254 h = heads(default)
254 h = heads(default)
255 b($1) = ancestors($1) - ancestors(default)
255 b($1) = ancestors($1) - ancestors(default)
256 """
256 """
257 # typically a config section, which will be included in error messages
257 # typically a config section, which will be included in error messages
258 _section = None
258 _section = None
259 # tag of symbol node
259 # tag of symbol node
260 _symbolnode = 'symbol'
260 _symbolnode = 'symbol'
261
261
262 def __new__(cls):
262 def __new__(cls):
263 raise TypeError("'%s' is not instantiatable" % cls.__name__)
263 raise TypeError("'%s' is not instantiatable" % cls.__name__)
264
264
265 @staticmethod
265 @staticmethod
266 def _parse(spec):
266 def _parse(spec):
267 """Parse an alias name, arguments and definition"""
267 """Parse an alias name, arguments and definition"""
268 raise NotImplementedError
268 raise NotImplementedError
269
269
270 @staticmethod
270 @staticmethod
271 def _trygetfunc(tree):
271 def _trygetfunc(tree):
272 """Return (name, args) if tree is a function; otherwise None"""
272 """Return (name, args) if tree is a function; otherwise None"""
273 raise NotImplementedError
273 raise NotImplementedError
274
274
275 @classmethod
275 @classmethod
276 def _builddecl(cls, decl):
276 def _builddecl(cls, decl):
277 """Parse an alias declaration into ``(name, args, errorstr)``
277 """Parse an alias declaration into ``(name, args, errorstr)``
278
278
279 This function analyzes the parsed tree. The parsing rule is provided
279 This function analyzes the parsed tree. The parsing rule is provided
280 by ``_parse()``.
280 by ``_parse()``.
281
281
282 - ``name``: of declared alias (may be ``decl`` itself at error)
282 - ``name``: of declared alias (may be ``decl`` itself at error)
283 - ``args``: list of argument names (or None for symbol declaration)
283 - ``args``: list of argument names (or None for symbol declaration)
284 - ``errorstr``: detail about detected error (or None)
284 - ``errorstr``: detail about detected error (or None)
285
285
286 >>> sym = lambda x: ('symbol', x)
286 >>> sym = lambda x: ('symbol', x)
287 >>> symlist = lambda *xs: ('list',) + tuple(sym(x) for x in xs)
287 >>> symlist = lambda *xs: ('list',) + tuple(sym(x) for x in xs)
288 >>> func = lambda n, a: ('func', sym(n), a)
288 >>> func = lambda n, a: ('func', sym(n), a)
289 >>> parsemap = {
289 >>> parsemap = {
290 ... 'foo': sym('foo'),
290 ... 'foo': sym('foo'),
291 ... '$foo': sym('$foo'),
291 ... '$foo': sym('$foo'),
292 ... 'foo::bar': ('dagrange', sym('foo'), sym('bar')),
292 ... 'foo::bar': ('dagrange', sym('foo'), sym('bar')),
293 ... 'foo()': func('foo', None),
293 ... 'foo()': func('foo', None),
294 ... '$foo()': func('$foo', None),
294 ... '$foo()': func('$foo', None),
295 ... 'foo($1, $2)': func('foo', symlist('$1', '$2')),
295 ... 'foo($1, $2)': func('foo', symlist('$1', '$2')),
296 ... 'foo(bar_bar, baz.baz)':
296 ... 'foo(bar_bar, baz.baz)':
297 ... func('foo', symlist('bar_bar', 'baz.baz')),
297 ... func('foo', symlist('bar_bar', 'baz.baz')),
298 ... 'foo(bar($1, $2))':
298 ... 'foo(bar($1, $2))':
299 ... func('foo', func('bar', symlist('$1', '$2'))),
299 ... func('foo', func('bar', symlist('$1', '$2'))),
300 ... 'foo($1, $2, nested($1, $2))':
300 ... 'foo($1, $2, nested($1, $2))':
301 ... func('foo', (symlist('$1', '$2') +
301 ... func('foo', (symlist('$1', '$2') +
302 ... (func('nested', symlist('$1', '$2')),))),
302 ... (func('nested', symlist('$1', '$2')),))),
303 ... 'foo("bar")': func('foo', ('string', 'bar')),
303 ... 'foo("bar")': func('foo', ('string', 'bar')),
304 ... 'foo($1, $2': error.ParseError('unexpected token: end', 10),
304 ... 'foo($1, $2': error.ParseError('unexpected token: end', 10),
305 ... 'foo("bar': error.ParseError('unterminated string', 5),
305 ... 'foo("bar': error.ParseError('unterminated string', 5),
306 ... 'foo($1, $2, $1)': func('foo', symlist('$1', '$2', '$1')),
306 ... 'foo($1, $2, $1)': func('foo', symlist('$1', '$2', '$1')),
307 ... }
307 ... }
308 >>> def parse(expr):
308 >>> def parse(expr):
309 ... x = parsemap[expr]
309 ... x = parsemap[expr]
310 ... if isinstance(x, Exception):
310 ... if isinstance(x, Exception):
311 ... raise x
311 ... raise x
312 ... return x
312 ... return x
313 >>> def trygetfunc(tree):
313 >>> def trygetfunc(tree):
314 ... if not tree or tree[0] != 'func' or tree[1][0] != 'symbol':
314 ... if not tree or tree[0] != 'func' or tree[1][0] != 'symbol':
315 ... return None
315 ... return None
316 ... if not tree[2]:
316 ... if not tree[2]:
317 ... return tree[1][1], []
317 ... return tree[1][1], []
318 ... if tree[2][0] == 'list':
318 ... if tree[2][0] == 'list':
319 ... return tree[1][1], list(tree[2][1:])
319 ... return tree[1][1], list(tree[2][1:])
320 ... return tree[1][1], [tree[2]]
320 ... return tree[1][1], [tree[2]]
321 >>> class aliasrules(basealiasrules):
321 >>> class aliasrules(basealiasrules):
322 ... _parse = staticmethod(parse)
322 ... _parse = staticmethod(parse)
323 ... _trygetfunc = staticmethod(trygetfunc)
323 ... _trygetfunc = staticmethod(trygetfunc)
324 >>> builddecl = aliasrules._builddecl
324 >>> builddecl = aliasrules._builddecl
325 >>> builddecl('foo')
325 >>> builddecl('foo')
326 ('foo', None, None)
326 ('foo', None, None)
327 >>> builddecl('$foo')
327 >>> builddecl('$foo')
328 ('$foo', None, "invalid symbol '$foo'")
328 ('$foo', None, "invalid symbol '$foo'")
329 >>> builddecl('foo::bar')
329 >>> builddecl('foo::bar')
330 ('foo::bar', None, 'invalid format')
330 ('foo::bar', None, 'invalid format')
331 >>> builddecl('foo()')
331 >>> builddecl('foo()')
332 ('foo', [], None)
332 ('foo', [], None)
333 >>> builddecl('$foo()')
333 >>> builddecl('$foo()')
334 ('$foo()', None, "invalid function '$foo'")
334 ('$foo()', None, "invalid function '$foo'")
335 >>> builddecl('foo($1, $2)')
335 >>> builddecl('foo($1, $2)')
336 ('foo', ['$1', '$2'], None)
336 ('foo', ['$1', '$2'], None)
337 >>> builddecl('foo(bar_bar, baz.baz)')
337 >>> builddecl('foo(bar_bar, baz.baz)')
338 ('foo', ['bar_bar', 'baz.baz'], None)
338 ('foo', ['bar_bar', 'baz.baz'], None)
339 >>> builddecl('foo($1, $2, nested($1, $2))')
339 >>> builddecl('foo($1, $2, nested($1, $2))')
340 ('foo($1, $2, nested($1, $2))', None, 'invalid argument list')
340 ('foo($1, $2, nested($1, $2))', None, 'invalid argument list')
341 >>> builddecl('foo(bar($1, $2))')
341 >>> builddecl('foo(bar($1, $2))')
342 ('foo(bar($1, $2))', None, 'invalid argument list')
342 ('foo(bar($1, $2))', None, 'invalid argument list')
343 >>> builddecl('foo("bar")')
343 >>> builddecl('foo("bar")')
344 ('foo("bar")', None, 'invalid argument list')
344 ('foo("bar")', None, 'invalid argument list')
345 >>> builddecl('foo($1, $2')
345 >>> builddecl('foo($1, $2')
346 ('foo($1, $2', None, 'at 10: unexpected token: end')
346 ('foo($1, $2', None, 'at 10: unexpected token: end')
347 >>> builddecl('foo("bar')
347 >>> builddecl('foo("bar')
348 ('foo("bar', None, 'at 5: unterminated string')
348 ('foo("bar', None, 'at 5: unterminated string')
349 >>> builddecl('foo($1, $2, $1)')
349 >>> builddecl('foo($1, $2, $1)')
350 ('foo', None, 'argument names collide with each other')
350 ('foo', None, 'argument names collide with each other')
351 """
351 """
352 try:
352 try:
353 tree = cls._parse(decl)
353 tree = cls._parse(decl)
354 except error.ParseError as inst:
354 except error.ParseError as inst:
355 return (decl, None, parseerrordetail(inst))
355 return (decl, None, parseerrordetail(inst))
356
356
357 if tree[0] == cls._symbolnode:
357 if tree[0] == cls._symbolnode:
358 # "name = ...." style
358 # "name = ...." style
359 name = tree[1]
359 name = tree[1]
360 if name.startswith('$'):
360 if name.startswith('$'):
361 return (decl, None, _("invalid symbol '%s'") % name)
361 return (decl, None, _("invalid symbol '%s'") % name)
362 return (name, None, None)
362 return (name, None, None)
363
363
364 func = cls._trygetfunc(tree)
364 func = cls._trygetfunc(tree)
365 if func:
365 if func:
366 # "name(arg, ....) = ...." style
366 # "name(arg, ....) = ...." style
367 name, args = func
367 name, args = func
368 if name.startswith('$'):
368 if name.startswith('$'):
369 return (decl, None, _("invalid function '%s'") % name)
369 return (decl, None, _("invalid function '%s'") % name)
370 if any(t[0] != cls._symbolnode for t in args):
370 if any(t[0] != cls._symbolnode for t in args):
371 return (decl, None, _("invalid argument list"))
371 return (decl, None, _("invalid argument list"))
372 if len(args) != len(set(args)):
372 if len(args) != len(set(args)):
373 return (name, None, _("argument names collide with each other"))
373 return (name, None, _("argument names collide with each other"))
374 return (name, [t[1] for t in args], None)
374 return (name, [t[1] for t in args], None)
375
375
376 return (decl, None, _("invalid format"))
376 return (decl, None, _("invalid format"))
377
377
378 @classmethod
378 @classmethod
379 def _relabelargs(cls, tree, args):
379 def _relabelargs(cls, tree, args):
380 """Mark alias arguments as ``_aliasarg``"""
380 """Mark alias arguments as ``_aliasarg``"""
381 if not isinstance(tree, tuple):
381 if not isinstance(tree, tuple):
382 return tree
382 return tree
383 op = tree[0]
383 op = tree[0]
384 if op != cls._symbolnode:
384 if op != cls._symbolnode:
385 return (op,) + tuple(cls._relabelargs(x, args) for x in tree[1:])
385 return (op,) + tuple(cls._relabelargs(x, args) for x in tree[1:])
386
386
387 assert len(tree) == 2
387 assert len(tree) == 2
388 sym = tree[1]
388 sym = tree[1]
389 if sym in args:
389 if sym in args:
390 op = '_aliasarg'
390 op = '_aliasarg'
391 elif sym.startswith('$'):
391 elif sym.startswith('$'):
392 raise error.ParseError(_("invalid symbol '%s'") % sym)
392 raise error.ParseError(_("invalid symbol '%s'") % sym)
393 return (op, sym)
393 return (op, sym)
394
394
395 @classmethod
395 @classmethod
396 def _builddefn(cls, defn, args):
396 def _builddefn(cls, defn, args):
397 """Parse an alias definition into a tree and marks substitutions
397 """Parse an alias definition into a tree and marks substitutions
398
398
399 This function marks alias argument references as ``_aliasarg``. The
399 This function marks alias argument references as ``_aliasarg``. The
400 parsing rule is provided by ``_parse()``.
400 parsing rule is provided by ``_parse()``.
401
401
402 ``args`` is a list of alias argument names, or None if the alias
402 ``args`` is a list of alias argument names, or None if the alias
403 is declared as a symbol.
403 is declared as a symbol.
404
404
405 >>> parsemap = {
405 >>> parsemap = {
406 ... '$1 or foo': ('or', ('symbol', '$1'), ('symbol', 'foo')),
406 ... '$1 or foo': ('or', ('symbol', '$1'), ('symbol', 'foo')),
407 ... '$1 or $bar': ('or', ('symbol', '$1'), ('symbol', '$bar')),
407 ... '$1 or $bar': ('or', ('symbol', '$1'), ('symbol', '$bar')),
408 ... '$10 or baz': ('or', ('symbol', '$10'), ('symbol', 'baz')),
408 ... '$10 or baz': ('or', ('symbol', '$10'), ('symbol', 'baz')),
409 ... '"$1" or "foo"': ('or', ('string', '$1'), ('string', 'foo')),
409 ... '"$1" or "foo"': ('or', ('string', '$1'), ('string', 'foo')),
410 ... }
410 ... }
411 >>> class aliasrules(basealiasrules):
411 >>> class aliasrules(basealiasrules):
412 ... _parse = staticmethod(parsemap.__getitem__)
412 ... _parse = staticmethod(parsemap.__getitem__)
413 ... _trygetfunc = staticmethod(lambda x: None)
413 ... _trygetfunc = staticmethod(lambda x: None)
414 >>> builddefn = aliasrules._builddefn
414 >>> builddefn = aliasrules._builddefn
415 >>> def pprint(tree):
415 >>> def pprint(tree):
416 ... print prettyformat(tree, ('_aliasarg', 'string', 'symbol'))
416 ... print prettyformat(tree, ('_aliasarg', 'string', 'symbol'))
417 >>> args = ['$1', '$2', 'foo']
417 >>> args = ['$1', '$2', 'foo']
418 >>> pprint(builddefn('$1 or foo', args))
418 >>> pprint(builddefn('$1 or foo', args))
419 (or
419 (or
420 ('_aliasarg', '$1')
420 ('_aliasarg', '$1')
421 ('_aliasarg', 'foo'))
421 ('_aliasarg', 'foo'))
422 >>> try:
422 >>> try:
423 ... builddefn('$1 or $bar', args)
423 ... builddefn('$1 or $bar', args)
424 ... except error.ParseError as inst:
424 ... except error.ParseError as inst:
425 ... print parseerrordetail(inst)
425 ... print parseerrordetail(inst)
426 invalid symbol '$bar'
426 invalid symbol '$bar'
427 >>> args = ['$1', '$10', 'foo']
427 >>> args = ['$1', '$10', 'foo']
428 >>> pprint(builddefn('$10 or baz', args))
428 >>> pprint(builddefn('$10 or baz', args))
429 (or
429 (or
430 ('_aliasarg', '$10')
430 ('_aliasarg', '$10')
431 ('symbol', 'baz'))
431 ('symbol', 'baz'))
432 >>> pprint(builddefn('"$1" or "foo"', args))
432 >>> pprint(builddefn('"$1" or "foo"', args))
433 (or
433 (or
434 ('string', '$1')
434 ('string', '$1')
435 ('string', 'foo'))
435 ('string', 'foo'))
436 """
436 """
437 tree = cls._parse(defn)
437 tree = cls._parse(defn)
438 if args:
438 if args:
439 args = set(args)
439 args = set(args)
440 else:
440 else:
441 args = set()
441 args = set()
442 return cls._relabelargs(tree, args)
442 return cls._relabelargs(tree, args)
443
443
444 @classmethod
444 @classmethod
445 def build(cls, decl, defn):
445 def build(cls, decl, defn):
446 """Parse an alias declaration and definition into an alias object"""
446 """Parse an alias declaration and definition into an alias object"""
447 repl = efmt = None
447 repl = efmt = None
448 name, args, err = cls._builddecl(decl)
448 name, args, err = cls._builddecl(decl)
449 if err:
449 if err:
450 efmt = _('failed to parse the declaration of %(section)s '
450 efmt = _('bad declaration of %(section)s "%(name)s": %(error)s')
451 '"%(name)s": %(error)s')
452 else:
451 else:
453 try:
452 try:
454 repl = cls._builddefn(defn, args)
453 repl = cls._builddefn(defn, args)
455 except error.ParseError as inst:
454 except error.ParseError as inst:
456 err = parseerrordetail(inst)
455 err = parseerrordetail(inst)
457 efmt = _('failed to parse the definition of %(section)s '
456 efmt = _('bad definition of %(section)s "%(name)s": %(error)s')
458 '"%(name)s": %(error)s')
459 if err:
457 if err:
460 err = efmt % {'section': cls._section, 'name': name, 'error': err}
458 err = efmt % {'section': cls._section, 'name': name, 'error': err}
461 return alias(name, args, err, repl)
459 return alias(name, args, err, repl)
462
460
463 @classmethod
461 @classmethod
464 def buildmap(cls, items):
462 def buildmap(cls, items):
465 """Parse a list of alias (name, replacement) pairs into a dict of
463 """Parse a list of alias (name, replacement) pairs into a dict of
466 alias objects"""
464 alias objects"""
467 aliases = {}
465 aliases = {}
468 for decl, defn in items:
466 for decl, defn in items:
469 a = cls.build(decl, defn)
467 a = cls.build(decl, defn)
470 aliases[a.name] = a
468 aliases[a.name] = a
471 return aliases
469 return aliases
472
470
473 @classmethod
471 @classmethod
474 def _getalias(cls, aliases, tree):
472 def _getalias(cls, aliases, tree):
475 """If tree looks like an unexpanded alias, return (alias, pattern-args)
473 """If tree looks like an unexpanded alias, return (alias, pattern-args)
476 pair. Return None otherwise.
474 pair. Return None otherwise.
477 """
475 """
478 if not isinstance(tree, tuple):
476 if not isinstance(tree, tuple):
479 return None
477 return None
480 if tree[0] == cls._symbolnode:
478 if tree[0] == cls._symbolnode:
481 name = tree[1]
479 name = tree[1]
482 a = aliases.get(name)
480 a = aliases.get(name)
483 if a and a.args is None:
481 if a and a.args is None:
484 return a, None
482 return a, None
485 func = cls._trygetfunc(tree)
483 func = cls._trygetfunc(tree)
486 if func:
484 if func:
487 name, args = func
485 name, args = func
488 a = aliases.get(name)
486 a = aliases.get(name)
489 if a and a.args is not None:
487 if a and a.args is not None:
490 return a, args
488 return a, args
491 return None
489 return None
492
490
493 @classmethod
491 @classmethod
494 def _expandargs(cls, tree, args):
492 def _expandargs(cls, tree, args):
495 """Replace _aliasarg instances with the substitution value of the
493 """Replace _aliasarg instances with the substitution value of the
496 same name in args, recursively.
494 same name in args, recursively.
497 """
495 """
498 if not isinstance(tree, tuple):
496 if not isinstance(tree, tuple):
499 return tree
497 return tree
500 if tree[0] == '_aliasarg':
498 if tree[0] == '_aliasarg':
501 sym = tree[1]
499 sym = tree[1]
502 return args[sym]
500 return args[sym]
503 return tuple(cls._expandargs(t, args) for t in tree)
501 return tuple(cls._expandargs(t, args) for t in tree)
504
502
505 @classmethod
503 @classmethod
506 def _expand(cls, aliases, tree, expanding, cache):
504 def _expand(cls, aliases, tree, expanding, cache):
507 if not isinstance(tree, tuple):
505 if not isinstance(tree, tuple):
508 return tree
506 return tree
509 r = cls._getalias(aliases, tree)
507 r = cls._getalias(aliases, tree)
510 if r is None:
508 if r is None:
511 return tuple(cls._expand(aliases, t, expanding, cache)
509 return tuple(cls._expand(aliases, t, expanding, cache)
512 for t in tree)
510 for t in tree)
513 a, l = r
511 a, l = r
514 if a.error:
512 if a.error:
515 raise error.Abort(a.error)
513 raise error.Abort(a.error)
516 if a in expanding:
514 if a in expanding:
517 raise error.ParseError(_('infinite expansion of %(section)s '
515 raise error.ParseError(_('infinite expansion of %(section)s '
518 '"%(name)s" detected')
516 '"%(name)s" detected')
519 % {'section': cls._section, 'name': a.name})
517 % {'section': cls._section, 'name': a.name})
520 # get cacheable replacement tree by expanding aliases recursively
518 # get cacheable replacement tree by expanding aliases recursively
521 expanding.append(a)
519 expanding.append(a)
522 if a.name not in cache:
520 if a.name not in cache:
523 cache[a.name] = cls._expand(aliases, a.replacement, expanding,
521 cache[a.name] = cls._expand(aliases, a.replacement, expanding,
524 cache)
522 cache)
525 result = cache[a.name]
523 result = cache[a.name]
526 expanding.pop()
524 expanding.pop()
527 if a.args is None:
525 if a.args is None:
528 return result
526 return result
529 # substitute function arguments in replacement tree
527 # substitute function arguments in replacement tree
530 if len(l) != len(a.args):
528 if len(l) != len(a.args):
531 raise error.ParseError(_('invalid number of arguments: %d')
529 raise error.ParseError(_('invalid number of arguments: %d')
532 % len(l))
530 % len(l))
533 l = [cls._expand(aliases, t, [], cache) for t in l]
531 l = [cls._expand(aliases, t, [], cache) for t in l]
534 return cls._expandargs(result, dict(zip(a.args, l)))
532 return cls._expandargs(result, dict(zip(a.args, l)))
535
533
536 @classmethod
534 @classmethod
537 def expand(cls, aliases, tree):
535 def expand(cls, aliases, tree):
538 """Expand aliases in tree, recursively.
536 """Expand aliases in tree, recursively.
539
537
540 'aliases' is a dictionary mapping user defined aliases to alias objects.
538 'aliases' is a dictionary mapping user defined aliases to alias objects.
541 """
539 """
542 return cls._expand(aliases, tree, [], {})
540 return cls._expand(aliases, tree, [], {})
@@ -1,3840 +1,3840
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 Second branch starting at nullrev:
32 Second branch starting at nullrev:
33
33
34 $ hg update null
34 $ hg update null
35 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
35 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
36 $ echo second > second
36 $ echo second > second
37 $ hg add second
37 $ hg add second
38 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
38 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
39 created new head
39 created new head
40
40
41 $ echo third > third
41 $ echo third > third
42 $ hg add third
42 $ hg add third
43 $ hg mv second fourth
43 $ hg mv second fourth
44 $ hg commit -m third -d "2020-01-01 10:01"
44 $ hg commit -m third -d "2020-01-01 10:01"
45
45
46 $ hg log --template '{join(file_copies, ",\n")}\n' -r .
46 $ hg log --template '{join(file_copies, ",\n")}\n' -r .
47 fourth (second)
47 fourth (second)
48 $ hg log -T '{file_copies % "{source} -> {name}\n"}' -r .
48 $ hg log -T '{file_copies % "{source} -> {name}\n"}' -r .
49 second -> fourth
49 second -> fourth
50 $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7
50 $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7
51 8 t
51 8 t
52 7 f
52 7 f
53
53
54 Working-directory revision has special identifiers, though they are still
54 Working-directory revision has special identifiers, though they are still
55 experimental:
55 experimental:
56
56
57 $ hg log -r 'wdir()' -T '{rev}:{node}\n'
57 $ hg log -r 'wdir()' -T '{rev}:{node}\n'
58 2147483647:ffffffffffffffffffffffffffffffffffffffff
58 2147483647:ffffffffffffffffffffffffffffffffffffffff
59
59
60 Some keywords are invalid for working-directory revision, but they should
60 Some keywords are invalid for working-directory revision, but they should
61 never cause crash:
61 never cause crash:
62
62
63 $ hg log -r 'wdir()' -T '{manifest}\n'
63 $ hg log -r 'wdir()' -T '{manifest}\n'
64
64
65
65
66 Quoting for ui.logtemplate
66 Quoting for ui.logtemplate
67
67
68 $ hg tip --config "ui.logtemplate={rev}\n"
68 $ hg tip --config "ui.logtemplate={rev}\n"
69 8
69 8
70 $ hg tip --config "ui.logtemplate='{rev}\n'"
70 $ hg tip --config "ui.logtemplate='{rev}\n'"
71 8
71 8
72 $ hg tip --config 'ui.logtemplate="{rev}\n"'
72 $ hg tip --config 'ui.logtemplate="{rev}\n"'
73 8
73 8
74 $ hg tip --config 'ui.logtemplate=n{rev}\n'
74 $ hg tip --config 'ui.logtemplate=n{rev}\n'
75 n8
75 n8
76
76
77 Make sure user/global hgrc does not affect tests
77 Make sure user/global hgrc does not affect tests
78
78
79 $ echo '[ui]' > .hg/hgrc
79 $ echo '[ui]' > .hg/hgrc
80 $ echo 'logtemplate =' >> .hg/hgrc
80 $ echo 'logtemplate =' >> .hg/hgrc
81 $ echo 'style =' >> .hg/hgrc
81 $ echo 'style =' >> .hg/hgrc
82
82
83 Add some simple styles to settings
83 Add some simple styles to settings
84
84
85 $ echo '[templates]' >> .hg/hgrc
85 $ echo '[templates]' >> .hg/hgrc
86 $ printf 'simple = "{rev}\\n"\n' >> .hg/hgrc
86 $ printf 'simple = "{rev}\\n"\n' >> .hg/hgrc
87 $ printf 'simple2 = {rev}\\n\n' >> .hg/hgrc
87 $ printf 'simple2 = {rev}\\n\n' >> .hg/hgrc
88
88
89 $ hg log -l1 -Tsimple
89 $ hg log -l1 -Tsimple
90 8
90 8
91 $ hg log -l1 -Tsimple2
91 $ hg log -l1 -Tsimple2
92 8
92 8
93
93
94 Test templates and style maps in files:
94 Test templates and style maps in files:
95
95
96 $ echo "{rev}" > tmpl
96 $ echo "{rev}" > tmpl
97 $ hg log -l1 -T./tmpl
97 $ hg log -l1 -T./tmpl
98 8
98 8
99 $ hg log -l1 -Tblah/blah
99 $ hg log -l1 -Tblah/blah
100 blah/blah (no-eol)
100 blah/blah (no-eol)
101
101
102 $ printf 'changeset = "{rev}\\n"\n' > map-simple
102 $ printf 'changeset = "{rev}\\n"\n' > map-simple
103 $ hg log -l1 -T./map-simple
103 $ hg log -l1 -T./map-simple
104 8
104 8
105
105
106 Template should precede style option
106 Template should precede style option
107
107
108 $ hg log -l1 --style default -T '{rev}\n'
108 $ hg log -l1 --style default -T '{rev}\n'
109 8
109 8
110
110
111 Add a commit with empty description, to ensure that the templates
111 Add a commit with empty description, to ensure that the templates
112 below will omit the description line.
112 below will omit the description line.
113
113
114 $ echo c >> c
114 $ echo c >> c
115 $ hg add c
115 $ hg add c
116 $ hg commit -qm ' '
116 $ hg commit -qm ' '
117
117
118 Default style is like normal output. Phases style should be the same
118 Default style is like normal output. Phases style should be the same
119 as default style, except for extra phase lines.
119 as default style, except for extra phase lines.
120
120
121 $ hg log > log.out
121 $ hg log > log.out
122 $ hg log --style default > style.out
122 $ hg log --style default > style.out
123 $ cmp log.out style.out || diff -u log.out style.out
123 $ cmp log.out style.out || diff -u log.out style.out
124 $ hg log -T phases > phases.out
124 $ hg log -T phases > phases.out
125 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
125 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
126 +phase: draft
126 +phase: draft
127 +phase: draft
127 +phase: draft
128 +phase: draft
128 +phase: draft
129 +phase: draft
129 +phase: draft
130 +phase: draft
130 +phase: draft
131 +phase: draft
131 +phase: draft
132 +phase: draft
132 +phase: draft
133 +phase: draft
133 +phase: draft
134 +phase: draft
134 +phase: draft
135 +phase: draft
135 +phase: draft
136
136
137 $ hg log -v > log.out
137 $ hg log -v > log.out
138 $ hg log -v --style default > style.out
138 $ hg log -v --style default > style.out
139 $ cmp log.out style.out || diff -u log.out style.out
139 $ cmp log.out style.out || diff -u log.out style.out
140 $ hg log -v -T phases > phases.out
140 $ hg log -v -T phases > phases.out
141 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
141 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
142 +phase: draft
142 +phase: draft
143 +phase: draft
143 +phase: draft
144 +phase: draft
144 +phase: draft
145 +phase: draft
145 +phase: draft
146 +phase: draft
146 +phase: draft
147 +phase: draft
147 +phase: draft
148 +phase: draft
148 +phase: draft
149 +phase: draft
149 +phase: draft
150 +phase: draft
150 +phase: draft
151 +phase: draft
151 +phase: draft
152
152
153 $ hg log -q > log.out
153 $ hg log -q > log.out
154 $ hg log -q --style default > style.out
154 $ hg log -q --style default > style.out
155 $ cmp log.out style.out || diff -u log.out style.out
155 $ cmp log.out style.out || diff -u log.out style.out
156 $ hg log -q -T phases > phases.out
156 $ hg log -q -T phases > phases.out
157 $ cmp log.out phases.out || diff -u log.out phases.out
157 $ cmp log.out phases.out || diff -u log.out phases.out
158
158
159 $ hg log --debug > log.out
159 $ hg log --debug > log.out
160 $ hg log --debug --style default > style.out
160 $ hg log --debug --style default > style.out
161 $ cmp log.out style.out || diff -u log.out style.out
161 $ cmp log.out style.out || diff -u log.out style.out
162 $ hg log --debug -T phases > phases.out
162 $ hg log --debug -T phases > phases.out
163 $ cmp log.out phases.out || diff -u log.out phases.out
163 $ cmp log.out phases.out || diff -u log.out phases.out
164
164
165 Default style of working-directory revision should also be the same (but
165 Default style of working-directory revision should also be the same (but
166 date may change while running tests):
166 date may change while running tests):
167
167
168 $ hg log -r 'wdir()' | sed 's|^date:.*|date:|' > log.out
168 $ hg log -r 'wdir()' | sed 's|^date:.*|date:|' > log.out
169 $ hg log -r 'wdir()' --style default | sed 's|^date:.*|date:|' > style.out
169 $ hg log -r 'wdir()' --style default | sed 's|^date:.*|date:|' > style.out
170 $ cmp log.out style.out || diff -u log.out style.out
170 $ cmp log.out style.out || diff -u log.out style.out
171
171
172 $ hg log -r 'wdir()' -v | sed 's|^date:.*|date:|' > log.out
172 $ hg log -r 'wdir()' -v | sed 's|^date:.*|date:|' > log.out
173 $ hg log -r 'wdir()' -v --style default | sed 's|^date:.*|date:|' > style.out
173 $ hg log -r 'wdir()' -v --style default | sed 's|^date:.*|date:|' > style.out
174 $ cmp log.out style.out || diff -u log.out style.out
174 $ cmp log.out style.out || diff -u log.out style.out
175
175
176 $ hg log -r 'wdir()' -q > log.out
176 $ hg log -r 'wdir()' -q > log.out
177 $ hg log -r 'wdir()' -q --style default > style.out
177 $ hg log -r 'wdir()' -q --style default > style.out
178 $ cmp log.out style.out || diff -u log.out style.out
178 $ cmp log.out style.out || diff -u log.out style.out
179
179
180 $ hg log -r 'wdir()' --debug | sed 's|^date:.*|date:|' > log.out
180 $ hg log -r 'wdir()' --debug | sed 's|^date:.*|date:|' > log.out
181 $ hg log -r 'wdir()' --debug --style default \
181 $ hg log -r 'wdir()' --debug --style default \
182 > | sed 's|^date:.*|date:|' > style.out
182 > | sed 's|^date:.*|date:|' > style.out
183 $ cmp log.out style.out || diff -u log.out style.out
183 $ cmp log.out style.out || diff -u log.out style.out
184
184
185 Default style should also preserve color information (issue2866):
185 Default style should also preserve color information (issue2866):
186
186
187 $ cp $HGRCPATH $HGRCPATH-bak
187 $ cp $HGRCPATH $HGRCPATH-bak
188 $ cat <<EOF >> $HGRCPATH
188 $ cat <<EOF >> $HGRCPATH
189 > [extensions]
189 > [extensions]
190 > color=
190 > color=
191 > EOF
191 > EOF
192
192
193 $ hg --color=debug log > log.out
193 $ hg --color=debug log > log.out
194 $ hg --color=debug log --style default > style.out
194 $ hg --color=debug log --style default > style.out
195 $ cmp log.out style.out || diff -u log.out style.out
195 $ cmp log.out style.out || diff -u log.out style.out
196 $ hg --color=debug log -T phases > phases.out
196 $ hg --color=debug log -T phases > phases.out
197 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
197 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
198 +[log.phase|phase: draft]
198 +[log.phase|phase: draft]
199 +[log.phase|phase: draft]
199 +[log.phase|phase: draft]
200 +[log.phase|phase: draft]
200 +[log.phase|phase: draft]
201 +[log.phase|phase: draft]
201 +[log.phase|phase: draft]
202 +[log.phase|phase: draft]
202 +[log.phase|phase: draft]
203 +[log.phase|phase: draft]
203 +[log.phase|phase: draft]
204 +[log.phase|phase: draft]
204 +[log.phase|phase: draft]
205 +[log.phase|phase: draft]
205 +[log.phase|phase: draft]
206 +[log.phase|phase: draft]
206 +[log.phase|phase: draft]
207 +[log.phase|phase: draft]
207 +[log.phase|phase: draft]
208
208
209 $ hg --color=debug -v log > log.out
209 $ hg --color=debug -v log > log.out
210 $ hg --color=debug -v log --style default > style.out
210 $ hg --color=debug -v log --style default > style.out
211 $ cmp log.out style.out || diff -u log.out style.out
211 $ cmp log.out style.out || diff -u log.out style.out
212 $ hg --color=debug -v log -T phases > phases.out
212 $ hg --color=debug -v log -T phases > phases.out
213 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
213 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
214 +[log.phase|phase: draft]
214 +[log.phase|phase: draft]
215 +[log.phase|phase: draft]
215 +[log.phase|phase: draft]
216 +[log.phase|phase: draft]
216 +[log.phase|phase: draft]
217 +[log.phase|phase: draft]
217 +[log.phase|phase: draft]
218 +[log.phase|phase: draft]
218 +[log.phase|phase: draft]
219 +[log.phase|phase: draft]
219 +[log.phase|phase: draft]
220 +[log.phase|phase: draft]
220 +[log.phase|phase: draft]
221 +[log.phase|phase: draft]
221 +[log.phase|phase: draft]
222 +[log.phase|phase: draft]
222 +[log.phase|phase: draft]
223 +[log.phase|phase: draft]
223 +[log.phase|phase: draft]
224
224
225 $ hg --color=debug -q log > log.out
225 $ hg --color=debug -q log > log.out
226 $ hg --color=debug -q log --style default > style.out
226 $ hg --color=debug -q log --style default > style.out
227 $ cmp log.out style.out || diff -u log.out style.out
227 $ cmp log.out style.out || diff -u log.out style.out
228 $ hg --color=debug -q log -T phases > phases.out
228 $ hg --color=debug -q log -T phases > phases.out
229 $ cmp log.out phases.out || diff -u log.out phases.out
229 $ cmp log.out phases.out || diff -u log.out phases.out
230
230
231 $ hg --color=debug --debug log > log.out
231 $ hg --color=debug --debug log > log.out
232 $ hg --color=debug --debug log --style default > style.out
232 $ hg --color=debug --debug log --style default > style.out
233 $ cmp log.out style.out || diff -u log.out style.out
233 $ cmp log.out style.out || diff -u log.out style.out
234 $ hg --color=debug --debug log -T phases > phases.out
234 $ hg --color=debug --debug log -T phases > phases.out
235 $ cmp log.out phases.out || diff -u log.out phases.out
235 $ cmp log.out phases.out || diff -u log.out phases.out
236
236
237 $ mv $HGRCPATH-bak $HGRCPATH
237 $ mv $HGRCPATH-bak $HGRCPATH
238
238
239 Remove commit with empty commit message, so as to not pollute further
239 Remove commit with empty commit message, so as to not pollute further
240 tests.
240 tests.
241
241
242 $ hg --config extensions.strip= strip -q .
242 $ hg --config extensions.strip= strip -q .
243
243
244 Revision with no copies (used to print a traceback):
244 Revision with no copies (used to print a traceback):
245
245
246 $ hg tip -v --template '\n'
246 $ hg tip -v --template '\n'
247
247
248
248
249 Compact style works:
249 Compact style works:
250
250
251 $ hg log -Tcompact
251 $ hg log -Tcompact
252 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
252 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
253 third
253 third
254
254
255 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
255 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
256 second
256 second
257
257
258 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
258 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
259 merge
259 merge
260
260
261 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
261 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
262 new head
262 new head
263
263
264 4 bbe44766e73d 1970-01-17 04:53 +0000 person
264 4 bbe44766e73d 1970-01-17 04:53 +0000 person
265 new branch
265 new branch
266
266
267 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
267 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
268 no user, no domain
268 no user, no domain
269
269
270 2 97054abb4ab8 1970-01-14 21:20 +0000 other
270 2 97054abb4ab8 1970-01-14 21:20 +0000 other
271 no person
271 no person
272
272
273 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
273 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
274 other 1
274 other 1
275
275
276 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
276 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
277 line 1
277 line 1
278
278
279
279
280 $ hg log -v --style compact
280 $ hg log -v --style compact
281 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
281 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
282 third
282 third
283
283
284 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
284 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
285 second
285 second
286
286
287 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
287 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
288 merge
288 merge
289
289
290 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
290 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
291 new head
291 new head
292
292
293 4 bbe44766e73d 1970-01-17 04:53 +0000 person
293 4 bbe44766e73d 1970-01-17 04:53 +0000 person
294 new branch
294 new branch
295
295
296 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
296 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
297 no user, no domain
297 no user, no domain
298
298
299 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
299 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
300 no person
300 no person
301
301
302 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
302 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
303 other 1
303 other 1
304 other 2
304 other 2
305
305
306 other 3
306 other 3
307
307
308 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
308 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
309 line 1
309 line 1
310 line 2
310 line 2
311
311
312
312
313 $ hg log --debug --style compact
313 $ hg log --debug --style compact
314 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
314 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
315 third
315 third
316
316
317 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
317 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
318 second
318 second
319
319
320 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
320 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
321 merge
321 merge
322
322
323 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
323 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
324 new head
324 new head
325
325
326 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
326 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
327 new branch
327 new branch
328
328
329 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
329 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
330 no user, no domain
330 no user, no domain
331
331
332 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
332 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
333 no person
333 no person
334
334
335 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
335 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
336 other 1
336 other 1
337 other 2
337 other 2
338
338
339 other 3
339 other 3
340
340
341 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
341 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
342 line 1
342 line 1
343 line 2
343 line 2
344
344
345
345
346 Test xml styles:
346 Test xml styles:
347
347
348 $ hg log --style xml -r 'not all()'
348 $ hg log --style xml -r 'not all()'
349 <?xml version="1.0"?>
349 <?xml version="1.0"?>
350 <log>
350 <log>
351 </log>
351 </log>
352
352
353 $ hg log --style xml
353 $ hg log --style xml
354 <?xml version="1.0"?>
354 <?xml version="1.0"?>
355 <log>
355 <log>
356 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
356 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
357 <tag>tip</tag>
357 <tag>tip</tag>
358 <author email="test">test</author>
358 <author email="test">test</author>
359 <date>2020-01-01T10:01:00+00:00</date>
359 <date>2020-01-01T10:01:00+00:00</date>
360 <msg xml:space="preserve">third</msg>
360 <msg xml:space="preserve">third</msg>
361 </logentry>
361 </logentry>
362 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
362 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
363 <parent revision="-1" node="0000000000000000000000000000000000000000" />
363 <parent revision="-1" node="0000000000000000000000000000000000000000" />
364 <author email="user@hostname">User Name</author>
364 <author email="user@hostname">User Name</author>
365 <date>1970-01-12T13:46:40+00:00</date>
365 <date>1970-01-12T13:46:40+00:00</date>
366 <msg xml:space="preserve">second</msg>
366 <msg xml:space="preserve">second</msg>
367 </logentry>
367 </logentry>
368 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
368 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
369 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
369 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
370 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
370 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
371 <author email="person">person</author>
371 <author email="person">person</author>
372 <date>1970-01-18T08:40:01+00:00</date>
372 <date>1970-01-18T08:40:01+00:00</date>
373 <msg xml:space="preserve">merge</msg>
373 <msg xml:space="preserve">merge</msg>
374 </logentry>
374 </logentry>
375 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
375 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
376 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
376 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
377 <author email="person">person</author>
377 <author email="person">person</author>
378 <date>1970-01-18T08:40:00+00:00</date>
378 <date>1970-01-18T08:40:00+00:00</date>
379 <msg xml:space="preserve">new head</msg>
379 <msg xml:space="preserve">new head</msg>
380 </logentry>
380 </logentry>
381 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
381 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
382 <branch>foo</branch>
382 <branch>foo</branch>
383 <author email="person">person</author>
383 <author email="person">person</author>
384 <date>1970-01-17T04:53:20+00:00</date>
384 <date>1970-01-17T04:53:20+00:00</date>
385 <msg xml:space="preserve">new branch</msg>
385 <msg xml:space="preserve">new branch</msg>
386 </logentry>
386 </logentry>
387 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
387 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
388 <author email="person">person</author>
388 <author email="person">person</author>
389 <date>1970-01-16T01:06:40+00:00</date>
389 <date>1970-01-16T01:06:40+00:00</date>
390 <msg xml:space="preserve">no user, no domain</msg>
390 <msg xml:space="preserve">no user, no domain</msg>
391 </logentry>
391 </logentry>
392 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
392 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
393 <author email="other@place">other</author>
393 <author email="other@place">other</author>
394 <date>1970-01-14T21:20:00+00:00</date>
394 <date>1970-01-14T21:20:00+00:00</date>
395 <msg xml:space="preserve">no person</msg>
395 <msg xml:space="preserve">no person</msg>
396 </logentry>
396 </logentry>
397 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
397 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
398 <author email="other@place">A. N. Other</author>
398 <author email="other@place">A. N. Other</author>
399 <date>1970-01-13T17:33:20+00:00</date>
399 <date>1970-01-13T17:33:20+00:00</date>
400 <msg xml:space="preserve">other 1
400 <msg xml:space="preserve">other 1
401 other 2
401 other 2
402
402
403 other 3</msg>
403 other 3</msg>
404 </logentry>
404 </logentry>
405 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
405 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
406 <author email="user@hostname">User Name</author>
406 <author email="user@hostname">User Name</author>
407 <date>1970-01-12T13:46:40+00:00</date>
407 <date>1970-01-12T13:46:40+00:00</date>
408 <msg xml:space="preserve">line 1
408 <msg xml:space="preserve">line 1
409 line 2</msg>
409 line 2</msg>
410 </logentry>
410 </logentry>
411 </log>
411 </log>
412
412
413 $ hg log -v --style xml
413 $ hg log -v --style xml
414 <?xml version="1.0"?>
414 <?xml version="1.0"?>
415 <log>
415 <log>
416 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
416 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
417 <tag>tip</tag>
417 <tag>tip</tag>
418 <author email="test">test</author>
418 <author email="test">test</author>
419 <date>2020-01-01T10:01:00+00:00</date>
419 <date>2020-01-01T10:01:00+00:00</date>
420 <msg xml:space="preserve">third</msg>
420 <msg xml:space="preserve">third</msg>
421 <paths>
421 <paths>
422 <path action="A">fourth</path>
422 <path action="A">fourth</path>
423 <path action="A">third</path>
423 <path action="A">third</path>
424 <path action="R">second</path>
424 <path action="R">second</path>
425 </paths>
425 </paths>
426 <copies>
426 <copies>
427 <copy source="second">fourth</copy>
427 <copy source="second">fourth</copy>
428 </copies>
428 </copies>
429 </logentry>
429 </logentry>
430 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
430 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
431 <parent revision="-1" node="0000000000000000000000000000000000000000" />
431 <parent revision="-1" node="0000000000000000000000000000000000000000" />
432 <author email="user@hostname">User Name</author>
432 <author email="user@hostname">User Name</author>
433 <date>1970-01-12T13:46:40+00:00</date>
433 <date>1970-01-12T13:46:40+00:00</date>
434 <msg xml:space="preserve">second</msg>
434 <msg xml:space="preserve">second</msg>
435 <paths>
435 <paths>
436 <path action="A">second</path>
436 <path action="A">second</path>
437 </paths>
437 </paths>
438 </logentry>
438 </logentry>
439 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
439 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
440 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
440 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
441 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
441 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
442 <author email="person">person</author>
442 <author email="person">person</author>
443 <date>1970-01-18T08:40:01+00:00</date>
443 <date>1970-01-18T08:40:01+00:00</date>
444 <msg xml:space="preserve">merge</msg>
444 <msg xml:space="preserve">merge</msg>
445 <paths>
445 <paths>
446 </paths>
446 </paths>
447 </logentry>
447 </logentry>
448 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
448 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
449 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
449 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
450 <author email="person">person</author>
450 <author email="person">person</author>
451 <date>1970-01-18T08:40:00+00:00</date>
451 <date>1970-01-18T08:40:00+00:00</date>
452 <msg xml:space="preserve">new head</msg>
452 <msg xml:space="preserve">new head</msg>
453 <paths>
453 <paths>
454 <path action="A">d</path>
454 <path action="A">d</path>
455 </paths>
455 </paths>
456 </logentry>
456 </logentry>
457 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
457 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
458 <branch>foo</branch>
458 <branch>foo</branch>
459 <author email="person">person</author>
459 <author email="person">person</author>
460 <date>1970-01-17T04:53:20+00:00</date>
460 <date>1970-01-17T04:53:20+00:00</date>
461 <msg xml:space="preserve">new branch</msg>
461 <msg xml:space="preserve">new branch</msg>
462 <paths>
462 <paths>
463 </paths>
463 </paths>
464 </logentry>
464 </logentry>
465 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
465 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
466 <author email="person">person</author>
466 <author email="person">person</author>
467 <date>1970-01-16T01:06:40+00:00</date>
467 <date>1970-01-16T01:06:40+00:00</date>
468 <msg xml:space="preserve">no user, no domain</msg>
468 <msg xml:space="preserve">no user, no domain</msg>
469 <paths>
469 <paths>
470 <path action="M">c</path>
470 <path action="M">c</path>
471 </paths>
471 </paths>
472 </logentry>
472 </logentry>
473 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
473 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
474 <author email="other@place">other</author>
474 <author email="other@place">other</author>
475 <date>1970-01-14T21:20:00+00:00</date>
475 <date>1970-01-14T21:20:00+00:00</date>
476 <msg xml:space="preserve">no person</msg>
476 <msg xml:space="preserve">no person</msg>
477 <paths>
477 <paths>
478 <path action="A">c</path>
478 <path action="A">c</path>
479 </paths>
479 </paths>
480 </logentry>
480 </logentry>
481 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
481 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
482 <author email="other@place">A. N. Other</author>
482 <author email="other@place">A. N. Other</author>
483 <date>1970-01-13T17:33:20+00:00</date>
483 <date>1970-01-13T17:33:20+00:00</date>
484 <msg xml:space="preserve">other 1
484 <msg xml:space="preserve">other 1
485 other 2
485 other 2
486
486
487 other 3</msg>
487 other 3</msg>
488 <paths>
488 <paths>
489 <path action="A">b</path>
489 <path action="A">b</path>
490 </paths>
490 </paths>
491 </logentry>
491 </logentry>
492 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
492 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
493 <author email="user@hostname">User Name</author>
493 <author email="user@hostname">User Name</author>
494 <date>1970-01-12T13:46:40+00:00</date>
494 <date>1970-01-12T13:46:40+00:00</date>
495 <msg xml:space="preserve">line 1
495 <msg xml:space="preserve">line 1
496 line 2</msg>
496 line 2</msg>
497 <paths>
497 <paths>
498 <path action="A">a</path>
498 <path action="A">a</path>
499 </paths>
499 </paths>
500 </logentry>
500 </logentry>
501 </log>
501 </log>
502
502
503 $ hg log --debug --style xml
503 $ hg log --debug --style xml
504 <?xml version="1.0"?>
504 <?xml version="1.0"?>
505 <log>
505 <log>
506 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
506 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
507 <tag>tip</tag>
507 <tag>tip</tag>
508 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
508 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
509 <parent revision="-1" node="0000000000000000000000000000000000000000" />
509 <parent revision="-1" node="0000000000000000000000000000000000000000" />
510 <author email="test">test</author>
510 <author email="test">test</author>
511 <date>2020-01-01T10:01:00+00:00</date>
511 <date>2020-01-01T10:01:00+00:00</date>
512 <msg xml:space="preserve">third</msg>
512 <msg xml:space="preserve">third</msg>
513 <paths>
513 <paths>
514 <path action="A">fourth</path>
514 <path action="A">fourth</path>
515 <path action="A">third</path>
515 <path action="A">third</path>
516 <path action="R">second</path>
516 <path action="R">second</path>
517 </paths>
517 </paths>
518 <copies>
518 <copies>
519 <copy source="second">fourth</copy>
519 <copy source="second">fourth</copy>
520 </copies>
520 </copies>
521 <extra key="branch">default</extra>
521 <extra key="branch">default</extra>
522 </logentry>
522 </logentry>
523 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
523 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
524 <parent revision="-1" node="0000000000000000000000000000000000000000" />
524 <parent revision="-1" node="0000000000000000000000000000000000000000" />
525 <parent revision="-1" node="0000000000000000000000000000000000000000" />
525 <parent revision="-1" node="0000000000000000000000000000000000000000" />
526 <author email="user@hostname">User Name</author>
526 <author email="user@hostname">User Name</author>
527 <date>1970-01-12T13:46:40+00:00</date>
527 <date>1970-01-12T13:46:40+00:00</date>
528 <msg xml:space="preserve">second</msg>
528 <msg xml:space="preserve">second</msg>
529 <paths>
529 <paths>
530 <path action="A">second</path>
530 <path action="A">second</path>
531 </paths>
531 </paths>
532 <extra key="branch">default</extra>
532 <extra key="branch">default</extra>
533 </logentry>
533 </logentry>
534 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
534 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
535 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
535 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
536 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
536 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
537 <author email="person">person</author>
537 <author email="person">person</author>
538 <date>1970-01-18T08:40:01+00:00</date>
538 <date>1970-01-18T08:40:01+00:00</date>
539 <msg xml:space="preserve">merge</msg>
539 <msg xml:space="preserve">merge</msg>
540 <paths>
540 <paths>
541 </paths>
541 </paths>
542 <extra key="branch">default</extra>
542 <extra key="branch">default</extra>
543 </logentry>
543 </logentry>
544 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
544 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
545 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
545 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
546 <parent revision="-1" node="0000000000000000000000000000000000000000" />
546 <parent revision="-1" node="0000000000000000000000000000000000000000" />
547 <author email="person">person</author>
547 <author email="person">person</author>
548 <date>1970-01-18T08:40:00+00:00</date>
548 <date>1970-01-18T08:40:00+00:00</date>
549 <msg xml:space="preserve">new head</msg>
549 <msg xml:space="preserve">new head</msg>
550 <paths>
550 <paths>
551 <path action="A">d</path>
551 <path action="A">d</path>
552 </paths>
552 </paths>
553 <extra key="branch">default</extra>
553 <extra key="branch">default</extra>
554 </logentry>
554 </logentry>
555 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
555 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
556 <branch>foo</branch>
556 <branch>foo</branch>
557 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
557 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
558 <parent revision="-1" node="0000000000000000000000000000000000000000" />
558 <parent revision="-1" node="0000000000000000000000000000000000000000" />
559 <author email="person">person</author>
559 <author email="person">person</author>
560 <date>1970-01-17T04:53:20+00:00</date>
560 <date>1970-01-17T04:53:20+00:00</date>
561 <msg xml:space="preserve">new branch</msg>
561 <msg xml:space="preserve">new branch</msg>
562 <paths>
562 <paths>
563 </paths>
563 </paths>
564 <extra key="branch">foo</extra>
564 <extra key="branch">foo</extra>
565 </logentry>
565 </logentry>
566 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
566 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
567 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
567 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
568 <parent revision="-1" node="0000000000000000000000000000000000000000" />
568 <parent revision="-1" node="0000000000000000000000000000000000000000" />
569 <author email="person">person</author>
569 <author email="person">person</author>
570 <date>1970-01-16T01:06:40+00:00</date>
570 <date>1970-01-16T01:06:40+00:00</date>
571 <msg xml:space="preserve">no user, no domain</msg>
571 <msg xml:space="preserve">no user, no domain</msg>
572 <paths>
572 <paths>
573 <path action="M">c</path>
573 <path action="M">c</path>
574 </paths>
574 </paths>
575 <extra key="branch">default</extra>
575 <extra key="branch">default</extra>
576 </logentry>
576 </logentry>
577 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
577 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
578 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
578 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
579 <parent revision="-1" node="0000000000000000000000000000000000000000" />
579 <parent revision="-1" node="0000000000000000000000000000000000000000" />
580 <author email="other@place">other</author>
580 <author email="other@place">other</author>
581 <date>1970-01-14T21:20:00+00:00</date>
581 <date>1970-01-14T21:20:00+00:00</date>
582 <msg xml:space="preserve">no person</msg>
582 <msg xml:space="preserve">no person</msg>
583 <paths>
583 <paths>
584 <path action="A">c</path>
584 <path action="A">c</path>
585 </paths>
585 </paths>
586 <extra key="branch">default</extra>
586 <extra key="branch">default</extra>
587 </logentry>
587 </logentry>
588 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
588 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
589 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
589 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
590 <parent revision="-1" node="0000000000000000000000000000000000000000" />
590 <parent revision="-1" node="0000000000000000000000000000000000000000" />
591 <author email="other@place">A. N. Other</author>
591 <author email="other@place">A. N. Other</author>
592 <date>1970-01-13T17:33:20+00:00</date>
592 <date>1970-01-13T17:33:20+00:00</date>
593 <msg xml:space="preserve">other 1
593 <msg xml:space="preserve">other 1
594 other 2
594 other 2
595
595
596 other 3</msg>
596 other 3</msg>
597 <paths>
597 <paths>
598 <path action="A">b</path>
598 <path action="A">b</path>
599 </paths>
599 </paths>
600 <extra key="branch">default</extra>
600 <extra key="branch">default</extra>
601 </logentry>
601 </logentry>
602 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
602 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
603 <parent revision="-1" node="0000000000000000000000000000000000000000" />
603 <parent revision="-1" node="0000000000000000000000000000000000000000" />
604 <parent revision="-1" node="0000000000000000000000000000000000000000" />
604 <parent revision="-1" node="0000000000000000000000000000000000000000" />
605 <author email="user@hostname">User Name</author>
605 <author email="user@hostname">User Name</author>
606 <date>1970-01-12T13:46:40+00:00</date>
606 <date>1970-01-12T13:46:40+00:00</date>
607 <msg xml:space="preserve">line 1
607 <msg xml:space="preserve">line 1
608 line 2</msg>
608 line 2</msg>
609 <paths>
609 <paths>
610 <path action="A">a</path>
610 <path action="A">a</path>
611 </paths>
611 </paths>
612 <extra key="branch">default</extra>
612 <extra key="branch">default</extra>
613 </logentry>
613 </logentry>
614 </log>
614 </log>
615
615
616
616
617 Test JSON style:
617 Test JSON style:
618
618
619 $ hg log -k nosuch -Tjson
619 $ hg log -k nosuch -Tjson
620 []
620 []
621
621
622 $ hg log -qr . -Tjson
622 $ hg log -qr . -Tjson
623 [
623 [
624 {
624 {
625 "rev": 8,
625 "rev": 8,
626 "node": "95c24699272ef57d062b8bccc32c878bf841784a"
626 "node": "95c24699272ef57d062b8bccc32c878bf841784a"
627 }
627 }
628 ]
628 ]
629
629
630 $ hg log -vpr . -Tjson --stat
630 $ hg log -vpr . -Tjson --stat
631 [
631 [
632 {
632 {
633 "rev": 8,
633 "rev": 8,
634 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
634 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
635 "branch": "default",
635 "branch": "default",
636 "phase": "draft",
636 "phase": "draft",
637 "user": "test",
637 "user": "test",
638 "date": [1577872860, 0],
638 "date": [1577872860, 0],
639 "desc": "third",
639 "desc": "third",
640 "bookmarks": [],
640 "bookmarks": [],
641 "tags": ["tip"],
641 "tags": ["tip"],
642 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
642 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
643 "files": ["fourth", "second", "third"],
643 "files": ["fourth", "second", "third"],
644 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
644 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
645 "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"
645 "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"
646 }
646 }
647 ]
647 ]
648
648
649 honor --git but not format-breaking diffopts
649 honor --git but not format-breaking diffopts
650 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
650 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
651 [
651 [
652 {
652 {
653 "rev": 8,
653 "rev": 8,
654 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
654 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
655 "branch": "default",
655 "branch": "default",
656 "phase": "draft",
656 "phase": "draft",
657 "user": "test",
657 "user": "test",
658 "date": [1577872860, 0],
658 "date": [1577872860, 0],
659 "desc": "third",
659 "desc": "third",
660 "bookmarks": [],
660 "bookmarks": [],
661 "tags": ["tip"],
661 "tags": ["tip"],
662 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
662 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
663 "files": ["fourth", "second", "third"],
663 "files": ["fourth", "second", "third"],
664 "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"
664 "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"
665 }
665 }
666 ]
666 ]
667
667
668 $ hg log -T json
668 $ hg log -T json
669 [
669 [
670 {
670 {
671 "rev": 8,
671 "rev": 8,
672 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
672 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
673 "branch": "default",
673 "branch": "default",
674 "phase": "draft",
674 "phase": "draft",
675 "user": "test",
675 "user": "test",
676 "date": [1577872860, 0],
676 "date": [1577872860, 0],
677 "desc": "third",
677 "desc": "third",
678 "bookmarks": [],
678 "bookmarks": [],
679 "tags": ["tip"],
679 "tags": ["tip"],
680 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"]
680 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"]
681 },
681 },
682 {
682 {
683 "rev": 7,
683 "rev": 7,
684 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
684 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
685 "branch": "default",
685 "branch": "default",
686 "phase": "draft",
686 "phase": "draft",
687 "user": "User Name <user@hostname>",
687 "user": "User Name <user@hostname>",
688 "date": [1000000, 0],
688 "date": [1000000, 0],
689 "desc": "second",
689 "desc": "second",
690 "bookmarks": [],
690 "bookmarks": [],
691 "tags": [],
691 "tags": [],
692 "parents": ["0000000000000000000000000000000000000000"]
692 "parents": ["0000000000000000000000000000000000000000"]
693 },
693 },
694 {
694 {
695 "rev": 6,
695 "rev": 6,
696 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
696 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
697 "branch": "default",
697 "branch": "default",
698 "phase": "draft",
698 "phase": "draft",
699 "user": "person",
699 "user": "person",
700 "date": [1500001, 0],
700 "date": [1500001, 0],
701 "desc": "merge",
701 "desc": "merge",
702 "bookmarks": [],
702 "bookmarks": [],
703 "tags": [],
703 "tags": [],
704 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"]
704 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"]
705 },
705 },
706 {
706 {
707 "rev": 5,
707 "rev": 5,
708 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
708 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
709 "branch": "default",
709 "branch": "default",
710 "phase": "draft",
710 "phase": "draft",
711 "user": "person",
711 "user": "person",
712 "date": [1500000, 0],
712 "date": [1500000, 0],
713 "desc": "new head",
713 "desc": "new head",
714 "bookmarks": [],
714 "bookmarks": [],
715 "tags": [],
715 "tags": [],
716 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
716 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
717 },
717 },
718 {
718 {
719 "rev": 4,
719 "rev": 4,
720 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
720 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
721 "branch": "foo",
721 "branch": "foo",
722 "phase": "draft",
722 "phase": "draft",
723 "user": "person",
723 "user": "person",
724 "date": [1400000, 0],
724 "date": [1400000, 0],
725 "desc": "new branch",
725 "desc": "new branch",
726 "bookmarks": [],
726 "bookmarks": [],
727 "tags": [],
727 "tags": [],
728 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
728 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
729 },
729 },
730 {
730 {
731 "rev": 3,
731 "rev": 3,
732 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
732 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
733 "branch": "default",
733 "branch": "default",
734 "phase": "draft",
734 "phase": "draft",
735 "user": "person",
735 "user": "person",
736 "date": [1300000, 0],
736 "date": [1300000, 0],
737 "desc": "no user, no domain",
737 "desc": "no user, no domain",
738 "bookmarks": [],
738 "bookmarks": [],
739 "tags": [],
739 "tags": [],
740 "parents": ["97054abb4ab824450e9164180baf491ae0078465"]
740 "parents": ["97054abb4ab824450e9164180baf491ae0078465"]
741 },
741 },
742 {
742 {
743 "rev": 2,
743 "rev": 2,
744 "node": "97054abb4ab824450e9164180baf491ae0078465",
744 "node": "97054abb4ab824450e9164180baf491ae0078465",
745 "branch": "default",
745 "branch": "default",
746 "phase": "draft",
746 "phase": "draft",
747 "user": "other@place",
747 "user": "other@place",
748 "date": [1200000, 0],
748 "date": [1200000, 0],
749 "desc": "no person",
749 "desc": "no person",
750 "bookmarks": [],
750 "bookmarks": [],
751 "tags": [],
751 "tags": [],
752 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"]
752 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"]
753 },
753 },
754 {
754 {
755 "rev": 1,
755 "rev": 1,
756 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
756 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
757 "branch": "default",
757 "branch": "default",
758 "phase": "draft",
758 "phase": "draft",
759 "user": "A. N. Other <other@place>",
759 "user": "A. N. Other <other@place>",
760 "date": [1100000, 0],
760 "date": [1100000, 0],
761 "desc": "other 1\nother 2\n\nother 3",
761 "desc": "other 1\nother 2\n\nother 3",
762 "bookmarks": [],
762 "bookmarks": [],
763 "tags": [],
763 "tags": [],
764 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"]
764 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"]
765 },
765 },
766 {
766 {
767 "rev": 0,
767 "rev": 0,
768 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
768 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
769 "branch": "default",
769 "branch": "default",
770 "phase": "draft",
770 "phase": "draft",
771 "user": "User Name <user@hostname>",
771 "user": "User Name <user@hostname>",
772 "date": [1000000, 0],
772 "date": [1000000, 0],
773 "desc": "line 1\nline 2",
773 "desc": "line 1\nline 2",
774 "bookmarks": [],
774 "bookmarks": [],
775 "tags": [],
775 "tags": [],
776 "parents": ["0000000000000000000000000000000000000000"]
776 "parents": ["0000000000000000000000000000000000000000"]
777 }
777 }
778 ]
778 ]
779
779
780 $ hg heads -v -Tjson
780 $ hg heads -v -Tjson
781 [
781 [
782 {
782 {
783 "rev": 8,
783 "rev": 8,
784 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
784 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
785 "branch": "default",
785 "branch": "default",
786 "phase": "draft",
786 "phase": "draft",
787 "user": "test",
787 "user": "test",
788 "date": [1577872860, 0],
788 "date": [1577872860, 0],
789 "desc": "third",
789 "desc": "third",
790 "bookmarks": [],
790 "bookmarks": [],
791 "tags": ["tip"],
791 "tags": ["tip"],
792 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
792 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
793 "files": ["fourth", "second", "third"]
793 "files": ["fourth", "second", "third"]
794 },
794 },
795 {
795 {
796 "rev": 6,
796 "rev": 6,
797 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
797 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
798 "branch": "default",
798 "branch": "default",
799 "phase": "draft",
799 "phase": "draft",
800 "user": "person",
800 "user": "person",
801 "date": [1500001, 0],
801 "date": [1500001, 0],
802 "desc": "merge",
802 "desc": "merge",
803 "bookmarks": [],
803 "bookmarks": [],
804 "tags": [],
804 "tags": [],
805 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
805 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
806 "files": []
806 "files": []
807 },
807 },
808 {
808 {
809 "rev": 4,
809 "rev": 4,
810 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
810 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
811 "branch": "foo",
811 "branch": "foo",
812 "phase": "draft",
812 "phase": "draft",
813 "user": "person",
813 "user": "person",
814 "date": [1400000, 0],
814 "date": [1400000, 0],
815 "desc": "new branch",
815 "desc": "new branch",
816 "bookmarks": [],
816 "bookmarks": [],
817 "tags": [],
817 "tags": [],
818 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
818 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
819 "files": []
819 "files": []
820 }
820 }
821 ]
821 ]
822
822
823 $ hg log --debug -Tjson
823 $ hg log --debug -Tjson
824 [
824 [
825 {
825 {
826 "rev": 8,
826 "rev": 8,
827 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
827 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
828 "branch": "default",
828 "branch": "default",
829 "phase": "draft",
829 "phase": "draft",
830 "user": "test",
830 "user": "test",
831 "date": [1577872860, 0],
831 "date": [1577872860, 0],
832 "desc": "third",
832 "desc": "third",
833 "bookmarks": [],
833 "bookmarks": [],
834 "tags": ["tip"],
834 "tags": ["tip"],
835 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
835 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
836 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
836 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
837 "extra": {"branch": "default"},
837 "extra": {"branch": "default"},
838 "modified": [],
838 "modified": [],
839 "added": ["fourth", "third"],
839 "added": ["fourth", "third"],
840 "removed": ["second"]
840 "removed": ["second"]
841 },
841 },
842 {
842 {
843 "rev": 7,
843 "rev": 7,
844 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
844 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
845 "branch": "default",
845 "branch": "default",
846 "phase": "draft",
846 "phase": "draft",
847 "user": "User Name <user@hostname>",
847 "user": "User Name <user@hostname>",
848 "date": [1000000, 0],
848 "date": [1000000, 0],
849 "desc": "second",
849 "desc": "second",
850 "bookmarks": [],
850 "bookmarks": [],
851 "tags": [],
851 "tags": [],
852 "parents": ["0000000000000000000000000000000000000000"],
852 "parents": ["0000000000000000000000000000000000000000"],
853 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
853 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
854 "extra": {"branch": "default"},
854 "extra": {"branch": "default"},
855 "modified": [],
855 "modified": [],
856 "added": ["second"],
856 "added": ["second"],
857 "removed": []
857 "removed": []
858 },
858 },
859 {
859 {
860 "rev": 6,
860 "rev": 6,
861 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
861 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
862 "branch": "default",
862 "branch": "default",
863 "phase": "draft",
863 "phase": "draft",
864 "user": "person",
864 "user": "person",
865 "date": [1500001, 0],
865 "date": [1500001, 0],
866 "desc": "merge",
866 "desc": "merge",
867 "bookmarks": [],
867 "bookmarks": [],
868 "tags": [],
868 "tags": [],
869 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
869 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
870 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
870 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
871 "extra": {"branch": "default"},
871 "extra": {"branch": "default"},
872 "modified": [],
872 "modified": [],
873 "added": [],
873 "added": [],
874 "removed": []
874 "removed": []
875 },
875 },
876 {
876 {
877 "rev": 5,
877 "rev": 5,
878 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
878 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
879 "branch": "default",
879 "branch": "default",
880 "phase": "draft",
880 "phase": "draft",
881 "user": "person",
881 "user": "person",
882 "date": [1500000, 0],
882 "date": [1500000, 0],
883 "desc": "new head",
883 "desc": "new head",
884 "bookmarks": [],
884 "bookmarks": [],
885 "tags": [],
885 "tags": [],
886 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
886 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
887 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
887 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
888 "extra": {"branch": "default"},
888 "extra": {"branch": "default"},
889 "modified": [],
889 "modified": [],
890 "added": ["d"],
890 "added": ["d"],
891 "removed": []
891 "removed": []
892 },
892 },
893 {
893 {
894 "rev": 4,
894 "rev": 4,
895 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
895 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
896 "branch": "foo",
896 "branch": "foo",
897 "phase": "draft",
897 "phase": "draft",
898 "user": "person",
898 "user": "person",
899 "date": [1400000, 0],
899 "date": [1400000, 0],
900 "desc": "new branch",
900 "desc": "new branch",
901 "bookmarks": [],
901 "bookmarks": [],
902 "tags": [],
902 "tags": [],
903 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
903 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
904 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
904 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
905 "extra": {"branch": "foo"},
905 "extra": {"branch": "foo"},
906 "modified": [],
906 "modified": [],
907 "added": [],
907 "added": [],
908 "removed": []
908 "removed": []
909 },
909 },
910 {
910 {
911 "rev": 3,
911 "rev": 3,
912 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
912 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
913 "branch": "default",
913 "branch": "default",
914 "phase": "draft",
914 "phase": "draft",
915 "user": "person",
915 "user": "person",
916 "date": [1300000, 0],
916 "date": [1300000, 0],
917 "desc": "no user, no domain",
917 "desc": "no user, no domain",
918 "bookmarks": [],
918 "bookmarks": [],
919 "tags": [],
919 "tags": [],
920 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
920 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
921 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
921 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
922 "extra": {"branch": "default"},
922 "extra": {"branch": "default"},
923 "modified": ["c"],
923 "modified": ["c"],
924 "added": [],
924 "added": [],
925 "removed": []
925 "removed": []
926 },
926 },
927 {
927 {
928 "rev": 2,
928 "rev": 2,
929 "node": "97054abb4ab824450e9164180baf491ae0078465",
929 "node": "97054abb4ab824450e9164180baf491ae0078465",
930 "branch": "default",
930 "branch": "default",
931 "phase": "draft",
931 "phase": "draft",
932 "user": "other@place",
932 "user": "other@place",
933 "date": [1200000, 0],
933 "date": [1200000, 0],
934 "desc": "no person",
934 "desc": "no person",
935 "bookmarks": [],
935 "bookmarks": [],
936 "tags": [],
936 "tags": [],
937 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
937 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
938 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
938 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
939 "extra": {"branch": "default"},
939 "extra": {"branch": "default"},
940 "modified": [],
940 "modified": [],
941 "added": ["c"],
941 "added": ["c"],
942 "removed": []
942 "removed": []
943 },
943 },
944 {
944 {
945 "rev": 1,
945 "rev": 1,
946 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
946 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
947 "branch": "default",
947 "branch": "default",
948 "phase": "draft",
948 "phase": "draft",
949 "user": "A. N. Other <other@place>",
949 "user": "A. N. Other <other@place>",
950 "date": [1100000, 0],
950 "date": [1100000, 0],
951 "desc": "other 1\nother 2\n\nother 3",
951 "desc": "other 1\nother 2\n\nother 3",
952 "bookmarks": [],
952 "bookmarks": [],
953 "tags": [],
953 "tags": [],
954 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
954 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
955 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
955 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
956 "extra": {"branch": "default"},
956 "extra": {"branch": "default"},
957 "modified": [],
957 "modified": [],
958 "added": ["b"],
958 "added": ["b"],
959 "removed": []
959 "removed": []
960 },
960 },
961 {
961 {
962 "rev": 0,
962 "rev": 0,
963 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
963 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
964 "branch": "default",
964 "branch": "default",
965 "phase": "draft",
965 "phase": "draft",
966 "user": "User Name <user@hostname>",
966 "user": "User Name <user@hostname>",
967 "date": [1000000, 0],
967 "date": [1000000, 0],
968 "desc": "line 1\nline 2",
968 "desc": "line 1\nline 2",
969 "bookmarks": [],
969 "bookmarks": [],
970 "tags": [],
970 "tags": [],
971 "parents": ["0000000000000000000000000000000000000000"],
971 "parents": ["0000000000000000000000000000000000000000"],
972 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
972 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
973 "extra": {"branch": "default"},
973 "extra": {"branch": "default"},
974 "modified": [],
974 "modified": [],
975 "added": ["a"],
975 "added": ["a"],
976 "removed": []
976 "removed": []
977 }
977 }
978 ]
978 ]
979
979
980 Error if style not readable:
980 Error if style not readable:
981
981
982 #if unix-permissions no-root
982 #if unix-permissions no-root
983 $ touch q
983 $ touch q
984 $ chmod 0 q
984 $ chmod 0 q
985 $ hg log --style ./q
985 $ hg log --style ./q
986 abort: Permission denied: ./q
986 abort: Permission denied: ./q
987 [255]
987 [255]
988 #endif
988 #endif
989
989
990 Error if no style:
990 Error if no style:
991
991
992 $ hg log --style notexist
992 $ hg log --style notexist
993 abort: style 'notexist' not found
993 abort: style 'notexist' not found
994 (available styles: bisect, changelog, compact, default, phases, status, xml)
994 (available styles: bisect, changelog, compact, default, phases, status, xml)
995 [255]
995 [255]
996
996
997 $ hg log -T list
997 $ hg log -T list
998 available styles: bisect, changelog, compact, default, phases, status, xml
998 available styles: bisect, changelog, compact, default, phases, status, xml
999 abort: specify a template
999 abort: specify a template
1000 [255]
1000 [255]
1001
1001
1002 Error if style missing key:
1002 Error if style missing key:
1003
1003
1004 $ echo 'q = q' > t
1004 $ echo 'q = q' > t
1005 $ hg log --style ./t
1005 $ hg log --style ./t
1006 abort: "changeset" not in template map
1006 abort: "changeset" not in template map
1007 [255]
1007 [255]
1008
1008
1009 Error if style missing value:
1009 Error if style missing value:
1010
1010
1011 $ echo 'changeset =' > t
1011 $ echo 'changeset =' > t
1012 $ hg log --style t
1012 $ hg log --style t
1013 hg: parse error at t:1: missing value
1013 hg: parse error at t:1: missing value
1014 [255]
1014 [255]
1015
1015
1016 Error if include fails:
1016 Error if include fails:
1017
1017
1018 $ echo 'changeset = q' >> t
1018 $ echo 'changeset = q' >> t
1019 #if unix-permissions no-root
1019 #if unix-permissions no-root
1020 $ hg log --style ./t
1020 $ hg log --style ./t
1021 abort: template file ./q: Permission denied
1021 abort: template file ./q: Permission denied
1022 [255]
1022 [255]
1023 $ rm -f q
1023 $ rm -f q
1024 #endif
1024 #endif
1025
1025
1026 Include works:
1026 Include works:
1027
1027
1028 $ echo '{rev}' > q
1028 $ echo '{rev}' > q
1029 $ hg log --style ./t
1029 $ hg log --style ./t
1030 8
1030 8
1031 7
1031 7
1032 6
1032 6
1033 5
1033 5
1034 4
1034 4
1035 3
1035 3
1036 2
1036 2
1037 1
1037 1
1038 0
1038 0
1039
1039
1040 Check that recursive reference does not fall into RuntimeError (issue4758):
1040 Check that recursive reference does not fall into RuntimeError (issue4758):
1041
1041
1042 common mistake:
1042 common mistake:
1043
1043
1044 $ hg log -T '{changeset}\n'
1044 $ hg log -T '{changeset}\n'
1045 abort: recursive reference 'changeset' in template
1045 abort: recursive reference 'changeset' in template
1046 [255]
1046 [255]
1047
1047
1048 circular reference:
1048 circular reference:
1049
1049
1050 $ cat << EOF > issue4758
1050 $ cat << EOF > issue4758
1051 > changeset = '{foo}'
1051 > changeset = '{foo}'
1052 > foo = '{changeset}'
1052 > foo = '{changeset}'
1053 > EOF
1053 > EOF
1054 $ hg log --style ./issue4758
1054 $ hg log --style ./issue4758
1055 abort: recursive reference 'foo' in template
1055 abort: recursive reference 'foo' in template
1056 [255]
1056 [255]
1057
1057
1058 buildmap() -> gettemplate(), where no thunk was made:
1058 buildmap() -> gettemplate(), where no thunk was made:
1059
1059
1060 $ hg log -T '{files % changeset}\n'
1060 $ hg log -T '{files % changeset}\n'
1061 abort: recursive reference 'changeset' in template
1061 abort: recursive reference 'changeset' in template
1062 [255]
1062 [255]
1063
1063
1064 not a recursion if a keyword of the same name exists:
1064 not a recursion if a keyword of the same name exists:
1065
1065
1066 $ cat << EOF > issue4758
1066 $ cat << EOF > issue4758
1067 > changeset = '{tags % rev}'
1067 > changeset = '{tags % rev}'
1068 > rev = '{rev} {tag}\n'
1068 > rev = '{rev} {tag}\n'
1069 > EOF
1069 > EOF
1070 $ hg log --style ./issue4758 -r tip
1070 $ hg log --style ./issue4758 -r tip
1071 8 tip
1071 8 tip
1072
1072
1073 Check that {phase} works correctly on parents:
1073 Check that {phase} works correctly on parents:
1074
1074
1075 $ cat << EOF > parentphase
1075 $ cat << EOF > parentphase
1076 > changeset_debug = '{rev} ({phase}):{parents}\n'
1076 > changeset_debug = '{rev} ({phase}):{parents}\n'
1077 > parent = ' {rev} ({phase})'
1077 > parent = ' {rev} ({phase})'
1078 > EOF
1078 > EOF
1079 $ hg phase -r 5 --public
1079 $ hg phase -r 5 --public
1080 $ hg phase -r 7 --secret --force
1080 $ hg phase -r 7 --secret --force
1081 $ hg log --debug -G --style ./parentphase
1081 $ hg log --debug -G --style ./parentphase
1082 @ 8 (secret): 7 (secret) -1 (public)
1082 @ 8 (secret): 7 (secret) -1 (public)
1083 |
1083 |
1084 o 7 (secret): -1 (public) -1 (public)
1084 o 7 (secret): -1 (public) -1 (public)
1085
1085
1086 o 6 (draft): 5 (public) 4 (draft)
1086 o 6 (draft): 5 (public) 4 (draft)
1087 |\
1087 |\
1088 | o 5 (public): 3 (public) -1 (public)
1088 | o 5 (public): 3 (public) -1 (public)
1089 | |
1089 | |
1090 o | 4 (draft): 3 (public) -1 (public)
1090 o | 4 (draft): 3 (public) -1 (public)
1091 |/
1091 |/
1092 o 3 (public): 2 (public) -1 (public)
1092 o 3 (public): 2 (public) -1 (public)
1093 |
1093 |
1094 o 2 (public): 1 (public) -1 (public)
1094 o 2 (public): 1 (public) -1 (public)
1095 |
1095 |
1096 o 1 (public): 0 (public) -1 (public)
1096 o 1 (public): 0 (public) -1 (public)
1097 |
1097 |
1098 o 0 (public): -1 (public) -1 (public)
1098 o 0 (public): -1 (public) -1 (public)
1099
1099
1100
1100
1101 Missing non-standard names give no error (backward compatibility):
1101 Missing non-standard names give no error (backward compatibility):
1102
1102
1103 $ echo "changeset = '{c}'" > t
1103 $ echo "changeset = '{c}'" > t
1104 $ hg log --style ./t
1104 $ hg log --style ./t
1105
1105
1106 Defining non-standard name works:
1106 Defining non-standard name works:
1107
1107
1108 $ cat <<EOF > t
1108 $ cat <<EOF > t
1109 > changeset = '{c}'
1109 > changeset = '{c}'
1110 > c = q
1110 > c = q
1111 > EOF
1111 > EOF
1112 $ hg log --style ./t
1112 $ hg log --style ./t
1113 8
1113 8
1114 7
1114 7
1115 6
1115 6
1116 5
1116 5
1117 4
1117 4
1118 3
1118 3
1119 2
1119 2
1120 1
1120 1
1121 0
1121 0
1122
1122
1123 ui.style works:
1123 ui.style works:
1124
1124
1125 $ echo '[ui]' > .hg/hgrc
1125 $ echo '[ui]' > .hg/hgrc
1126 $ echo 'style = t' >> .hg/hgrc
1126 $ echo 'style = t' >> .hg/hgrc
1127 $ hg log
1127 $ hg log
1128 8
1128 8
1129 7
1129 7
1130 6
1130 6
1131 5
1131 5
1132 4
1132 4
1133 3
1133 3
1134 2
1134 2
1135 1
1135 1
1136 0
1136 0
1137
1137
1138
1138
1139 Issue338:
1139 Issue338:
1140
1140
1141 $ hg log --style=changelog > changelog
1141 $ hg log --style=changelog > changelog
1142
1142
1143 $ cat changelog
1143 $ cat changelog
1144 2020-01-01 test <test>
1144 2020-01-01 test <test>
1145
1145
1146 * fourth, second, third:
1146 * fourth, second, third:
1147 third
1147 third
1148 [95c24699272e] [tip]
1148 [95c24699272e] [tip]
1149
1149
1150 1970-01-12 User Name <user@hostname>
1150 1970-01-12 User Name <user@hostname>
1151
1151
1152 * second:
1152 * second:
1153 second
1153 second
1154 [29114dbae42b]
1154 [29114dbae42b]
1155
1155
1156 1970-01-18 person <person>
1156 1970-01-18 person <person>
1157
1157
1158 * merge
1158 * merge
1159 [d41e714fe50d]
1159 [d41e714fe50d]
1160
1160
1161 * d:
1161 * d:
1162 new head
1162 new head
1163 [13207e5a10d9]
1163 [13207e5a10d9]
1164
1164
1165 1970-01-17 person <person>
1165 1970-01-17 person <person>
1166
1166
1167 * new branch
1167 * new branch
1168 [bbe44766e73d] <foo>
1168 [bbe44766e73d] <foo>
1169
1169
1170 1970-01-16 person <person>
1170 1970-01-16 person <person>
1171
1171
1172 * c:
1172 * c:
1173 no user, no domain
1173 no user, no domain
1174 [10e46f2dcbf4]
1174 [10e46f2dcbf4]
1175
1175
1176 1970-01-14 other <other@place>
1176 1970-01-14 other <other@place>
1177
1177
1178 * c:
1178 * c:
1179 no person
1179 no person
1180 [97054abb4ab8]
1180 [97054abb4ab8]
1181
1181
1182 1970-01-13 A. N. Other <other@place>
1182 1970-01-13 A. N. Other <other@place>
1183
1183
1184 * b:
1184 * b:
1185 other 1 other 2
1185 other 1 other 2
1186
1186
1187 other 3
1187 other 3
1188 [b608e9d1a3f0]
1188 [b608e9d1a3f0]
1189
1189
1190 1970-01-12 User Name <user@hostname>
1190 1970-01-12 User Name <user@hostname>
1191
1191
1192 * a:
1192 * a:
1193 line 1 line 2
1193 line 1 line 2
1194 [1e4e1b8f71e0]
1194 [1e4e1b8f71e0]
1195
1195
1196
1196
1197 Issue2130: xml output for 'hg heads' is malformed
1197 Issue2130: xml output for 'hg heads' is malformed
1198
1198
1199 $ hg heads --style changelog
1199 $ hg heads --style changelog
1200 2020-01-01 test <test>
1200 2020-01-01 test <test>
1201
1201
1202 * fourth, second, third:
1202 * fourth, second, third:
1203 third
1203 third
1204 [95c24699272e] [tip]
1204 [95c24699272e] [tip]
1205
1205
1206 1970-01-18 person <person>
1206 1970-01-18 person <person>
1207
1207
1208 * merge
1208 * merge
1209 [d41e714fe50d]
1209 [d41e714fe50d]
1210
1210
1211 1970-01-17 person <person>
1211 1970-01-17 person <person>
1212
1212
1213 * new branch
1213 * new branch
1214 [bbe44766e73d] <foo>
1214 [bbe44766e73d] <foo>
1215
1215
1216
1216
1217 Keys work:
1217 Keys work:
1218
1218
1219 $ for key in author branch branches date desc file_adds file_dels file_mods \
1219 $ for key in author branch branches date desc file_adds file_dels file_mods \
1220 > file_copies file_copies_switch files \
1220 > file_copies file_copies_switch files \
1221 > manifest node parents rev tags diffstat extras \
1221 > manifest node parents rev tags diffstat extras \
1222 > p1rev p2rev p1node p2node; do
1222 > p1rev p2rev p1node p2node; do
1223 > for mode in '' --verbose --debug; do
1223 > for mode in '' --verbose --debug; do
1224 > hg log $mode --template "$key$mode: {$key}\n"
1224 > hg log $mode --template "$key$mode: {$key}\n"
1225 > done
1225 > done
1226 > done
1226 > done
1227 author: test
1227 author: test
1228 author: User Name <user@hostname>
1228 author: User Name <user@hostname>
1229 author: person
1229 author: person
1230 author: person
1230 author: person
1231 author: person
1231 author: person
1232 author: person
1232 author: person
1233 author: other@place
1233 author: other@place
1234 author: A. N. Other <other@place>
1234 author: A. N. Other <other@place>
1235 author: User Name <user@hostname>
1235 author: User Name <user@hostname>
1236 author--verbose: test
1236 author--verbose: test
1237 author--verbose: User Name <user@hostname>
1237 author--verbose: User Name <user@hostname>
1238 author--verbose: person
1238 author--verbose: person
1239 author--verbose: person
1239 author--verbose: person
1240 author--verbose: person
1240 author--verbose: person
1241 author--verbose: person
1241 author--verbose: person
1242 author--verbose: other@place
1242 author--verbose: other@place
1243 author--verbose: A. N. Other <other@place>
1243 author--verbose: A. N. Other <other@place>
1244 author--verbose: User Name <user@hostname>
1244 author--verbose: User Name <user@hostname>
1245 author--debug: test
1245 author--debug: test
1246 author--debug: User Name <user@hostname>
1246 author--debug: User Name <user@hostname>
1247 author--debug: person
1247 author--debug: person
1248 author--debug: person
1248 author--debug: person
1249 author--debug: person
1249 author--debug: person
1250 author--debug: person
1250 author--debug: person
1251 author--debug: other@place
1251 author--debug: other@place
1252 author--debug: A. N. Other <other@place>
1252 author--debug: A. N. Other <other@place>
1253 author--debug: User Name <user@hostname>
1253 author--debug: User Name <user@hostname>
1254 branch: default
1254 branch: default
1255 branch: default
1255 branch: default
1256 branch: default
1256 branch: default
1257 branch: default
1257 branch: default
1258 branch: foo
1258 branch: foo
1259 branch: default
1259 branch: default
1260 branch: default
1260 branch: default
1261 branch: default
1261 branch: default
1262 branch: default
1262 branch: default
1263 branch--verbose: default
1263 branch--verbose: default
1264 branch--verbose: default
1264 branch--verbose: default
1265 branch--verbose: default
1265 branch--verbose: default
1266 branch--verbose: default
1266 branch--verbose: default
1267 branch--verbose: foo
1267 branch--verbose: foo
1268 branch--verbose: default
1268 branch--verbose: default
1269 branch--verbose: default
1269 branch--verbose: default
1270 branch--verbose: default
1270 branch--verbose: default
1271 branch--verbose: default
1271 branch--verbose: default
1272 branch--debug: default
1272 branch--debug: default
1273 branch--debug: default
1273 branch--debug: default
1274 branch--debug: default
1274 branch--debug: default
1275 branch--debug: default
1275 branch--debug: default
1276 branch--debug: foo
1276 branch--debug: foo
1277 branch--debug: default
1277 branch--debug: default
1278 branch--debug: default
1278 branch--debug: default
1279 branch--debug: default
1279 branch--debug: default
1280 branch--debug: default
1280 branch--debug: default
1281 branches:
1281 branches:
1282 branches:
1282 branches:
1283 branches:
1283 branches:
1284 branches:
1284 branches:
1285 branches: foo
1285 branches: foo
1286 branches:
1286 branches:
1287 branches:
1287 branches:
1288 branches:
1288 branches:
1289 branches:
1289 branches:
1290 branches--verbose:
1290 branches--verbose:
1291 branches--verbose:
1291 branches--verbose:
1292 branches--verbose:
1292 branches--verbose:
1293 branches--verbose:
1293 branches--verbose:
1294 branches--verbose: foo
1294 branches--verbose: foo
1295 branches--verbose:
1295 branches--verbose:
1296 branches--verbose:
1296 branches--verbose:
1297 branches--verbose:
1297 branches--verbose:
1298 branches--verbose:
1298 branches--verbose:
1299 branches--debug:
1299 branches--debug:
1300 branches--debug:
1300 branches--debug:
1301 branches--debug:
1301 branches--debug:
1302 branches--debug:
1302 branches--debug:
1303 branches--debug: foo
1303 branches--debug: foo
1304 branches--debug:
1304 branches--debug:
1305 branches--debug:
1305 branches--debug:
1306 branches--debug:
1306 branches--debug:
1307 branches--debug:
1307 branches--debug:
1308 date: 1577872860.00
1308 date: 1577872860.00
1309 date: 1000000.00
1309 date: 1000000.00
1310 date: 1500001.00
1310 date: 1500001.00
1311 date: 1500000.00
1311 date: 1500000.00
1312 date: 1400000.00
1312 date: 1400000.00
1313 date: 1300000.00
1313 date: 1300000.00
1314 date: 1200000.00
1314 date: 1200000.00
1315 date: 1100000.00
1315 date: 1100000.00
1316 date: 1000000.00
1316 date: 1000000.00
1317 date--verbose: 1577872860.00
1317 date--verbose: 1577872860.00
1318 date--verbose: 1000000.00
1318 date--verbose: 1000000.00
1319 date--verbose: 1500001.00
1319 date--verbose: 1500001.00
1320 date--verbose: 1500000.00
1320 date--verbose: 1500000.00
1321 date--verbose: 1400000.00
1321 date--verbose: 1400000.00
1322 date--verbose: 1300000.00
1322 date--verbose: 1300000.00
1323 date--verbose: 1200000.00
1323 date--verbose: 1200000.00
1324 date--verbose: 1100000.00
1324 date--verbose: 1100000.00
1325 date--verbose: 1000000.00
1325 date--verbose: 1000000.00
1326 date--debug: 1577872860.00
1326 date--debug: 1577872860.00
1327 date--debug: 1000000.00
1327 date--debug: 1000000.00
1328 date--debug: 1500001.00
1328 date--debug: 1500001.00
1329 date--debug: 1500000.00
1329 date--debug: 1500000.00
1330 date--debug: 1400000.00
1330 date--debug: 1400000.00
1331 date--debug: 1300000.00
1331 date--debug: 1300000.00
1332 date--debug: 1200000.00
1332 date--debug: 1200000.00
1333 date--debug: 1100000.00
1333 date--debug: 1100000.00
1334 date--debug: 1000000.00
1334 date--debug: 1000000.00
1335 desc: third
1335 desc: third
1336 desc: second
1336 desc: second
1337 desc: merge
1337 desc: merge
1338 desc: new head
1338 desc: new head
1339 desc: new branch
1339 desc: new branch
1340 desc: no user, no domain
1340 desc: no user, no domain
1341 desc: no person
1341 desc: no person
1342 desc: other 1
1342 desc: other 1
1343 other 2
1343 other 2
1344
1344
1345 other 3
1345 other 3
1346 desc: line 1
1346 desc: line 1
1347 line 2
1347 line 2
1348 desc--verbose: third
1348 desc--verbose: third
1349 desc--verbose: second
1349 desc--verbose: second
1350 desc--verbose: merge
1350 desc--verbose: merge
1351 desc--verbose: new head
1351 desc--verbose: new head
1352 desc--verbose: new branch
1352 desc--verbose: new branch
1353 desc--verbose: no user, no domain
1353 desc--verbose: no user, no domain
1354 desc--verbose: no person
1354 desc--verbose: no person
1355 desc--verbose: other 1
1355 desc--verbose: other 1
1356 other 2
1356 other 2
1357
1357
1358 other 3
1358 other 3
1359 desc--verbose: line 1
1359 desc--verbose: line 1
1360 line 2
1360 line 2
1361 desc--debug: third
1361 desc--debug: third
1362 desc--debug: second
1362 desc--debug: second
1363 desc--debug: merge
1363 desc--debug: merge
1364 desc--debug: new head
1364 desc--debug: new head
1365 desc--debug: new branch
1365 desc--debug: new branch
1366 desc--debug: no user, no domain
1366 desc--debug: no user, no domain
1367 desc--debug: no person
1367 desc--debug: no person
1368 desc--debug: other 1
1368 desc--debug: other 1
1369 other 2
1369 other 2
1370
1370
1371 other 3
1371 other 3
1372 desc--debug: line 1
1372 desc--debug: line 1
1373 line 2
1373 line 2
1374 file_adds: fourth third
1374 file_adds: fourth third
1375 file_adds: second
1375 file_adds: second
1376 file_adds:
1376 file_adds:
1377 file_adds: d
1377 file_adds: d
1378 file_adds:
1378 file_adds:
1379 file_adds:
1379 file_adds:
1380 file_adds: c
1380 file_adds: c
1381 file_adds: b
1381 file_adds: b
1382 file_adds: a
1382 file_adds: a
1383 file_adds--verbose: fourth third
1383 file_adds--verbose: fourth third
1384 file_adds--verbose: second
1384 file_adds--verbose: second
1385 file_adds--verbose:
1385 file_adds--verbose:
1386 file_adds--verbose: d
1386 file_adds--verbose: d
1387 file_adds--verbose:
1387 file_adds--verbose:
1388 file_adds--verbose:
1388 file_adds--verbose:
1389 file_adds--verbose: c
1389 file_adds--verbose: c
1390 file_adds--verbose: b
1390 file_adds--verbose: b
1391 file_adds--verbose: a
1391 file_adds--verbose: a
1392 file_adds--debug: fourth third
1392 file_adds--debug: fourth third
1393 file_adds--debug: second
1393 file_adds--debug: second
1394 file_adds--debug:
1394 file_adds--debug:
1395 file_adds--debug: d
1395 file_adds--debug: d
1396 file_adds--debug:
1396 file_adds--debug:
1397 file_adds--debug:
1397 file_adds--debug:
1398 file_adds--debug: c
1398 file_adds--debug: c
1399 file_adds--debug: b
1399 file_adds--debug: b
1400 file_adds--debug: a
1400 file_adds--debug: a
1401 file_dels: second
1401 file_dels: second
1402 file_dels:
1402 file_dels:
1403 file_dels:
1403 file_dels:
1404 file_dels:
1404 file_dels:
1405 file_dels:
1405 file_dels:
1406 file_dels:
1406 file_dels:
1407 file_dels:
1407 file_dels:
1408 file_dels:
1408 file_dels:
1409 file_dels:
1409 file_dels:
1410 file_dels--verbose: second
1410 file_dels--verbose: second
1411 file_dels--verbose:
1411 file_dels--verbose:
1412 file_dels--verbose:
1412 file_dels--verbose:
1413 file_dels--verbose:
1413 file_dels--verbose:
1414 file_dels--verbose:
1414 file_dels--verbose:
1415 file_dels--verbose:
1415 file_dels--verbose:
1416 file_dels--verbose:
1416 file_dels--verbose:
1417 file_dels--verbose:
1417 file_dels--verbose:
1418 file_dels--verbose:
1418 file_dels--verbose:
1419 file_dels--debug: second
1419 file_dels--debug: second
1420 file_dels--debug:
1420 file_dels--debug:
1421 file_dels--debug:
1421 file_dels--debug:
1422 file_dels--debug:
1422 file_dels--debug:
1423 file_dels--debug:
1423 file_dels--debug:
1424 file_dels--debug:
1424 file_dels--debug:
1425 file_dels--debug:
1425 file_dels--debug:
1426 file_dels--debug:
1426 file_dels--debug:
1427 file_dels--debug:
1427 file_dels--debug:
1428 file_mods:
1428 file_mods:
1429 file_mods:
1429 file_mods:
1430 file_mods:
1430 file_mods:
1431 file_mods:
1431 file_mods:
1432 file_mods:
1432 file_mods:
1433 file_mods: c
1433 file_mods: c
1434 file_mods:
1434 file_mods:
1435 file_mods:
1435 file_mods:
1436 file_mods:
1436 file_mods:
1437 file_mods--verbose:
1437 file_mods--verbose:
1438 file_mods--verbose:
1438 file_mods--verbose:
1439 file_mods--verbose:
1439 file_mods--verbose:
1440 file_mods--verbose:
1440 file_mods--verbose:
1441 file_mods--verbose:
1441 file_mods--verbose:
1442 file_mods--verbose: c
1442 file_mods--verbose: c
1443 file_mods--verbose:
1443 file_mods--verbose:
1444 file_mods--verbose:
1444 file_mods--verbose:
1445 file_mods--verbose:
1445 file_mods--verbose:
1446 file_mods--debug:
1446 file_mods--debug:
1447 file_mods--debug:
1447 file_mods--debug:
1448 file_mods--debug:
1448 file_mods--debug:
1449 file_mods--debug:
1449 file_mods--debug:
1450 file_mods--debug:
1450 file_mods--debug:
1451 file_mods--debug: c
1451 file_mods--debug: c
1452 file_mods--debug:
1452 file_mods--debug:
1453 file_mods--debug:
1453 file_mods--debug:
1454 file_mods--debug:
1454 file_mods--debug:
1455 file_copies: fourth (second)
1455 file_copies: fourth (second)
1456 file_copies:
1456 file_copies:
1457 file_copies:
1457 file_copies:
1458 file_copies:
1458 file_copies:
1459 file_copies:
1459 file_copies:
1460 file_copies:
1460 file_copies:
1461 file_copies:
1461 file_copies:
1462 file_copies:
1462 file_copies:
1463 file_copies:
1463 file_copies:
1464 file_copies--verbose: fourth (second)
1464 file_copies--verbose: fourth (second)
1465 file_copies--verbose:
1465 file_copies--verbose:
1466 file_copies--verbose:
1466 file_copies--verbose:
1467 file_copies--verbose:
1467 file_copies--verbose:
1468 file_copies--verbose:
1468 file_copies--verbose:
1469 file_copies--verbose:
1469 file_copies--verbose:
1470 file_copies--verbose:
1470 file_copies--verbose:
1471 file_copies--verbose:
1471 file_copies--verbose:
1472 file_copies--verbose:
1472 file_copies--verbose:
1473 file_copies--debug: fourth (second)
1473 file_copies--debug: fourth (second)
1474 file_copies--debug:
1474 file_copies--debug:
1475 file_copies--debug:
1475 file_copies--debug:
1476 file_copies--debug:
1476 file_copies--debug:
1477 file_copies--debug:
1477 file_copies--debug:
1478 file_copies--debug:
1478 file_copies--debug:
1479 file_copies--debug:
1479 file_copies--debug:
1480 file_copies--debug:
1480 file_copies--debug:
1481 file_copies--debug:
1481 file_copies--debug:
1482 file_copies_switch:
1482 file_copies_switch:
1483 file_copies_switch:
1483 file_copies_switch:
1484 file_copies_switch:
1484 file_copies_switch:
1485 file_copies_switch:
1485 file_copies_switch:
1486 file_copies_switch:
1486 file_copies_switch:
1487 file_copies_switch:
1487 file_copies_switch:
1488 file_copies_switch:
1488 file_copies_switch:
1489 file_copies_switch:
1489 file_copies_switch:
1490 file_copies_switch:
1490 file_copies_switch:
1491 file_copies_switch--verbose:
1491 file_copies_switch--verbose:
1492 file_copies_switch--verbose:
1492 file_copies_switch--verbose:
1493 file_copies_switch--verbose:
1493 file_copies_switch--verbose:
1494 file_copies_switch--verbose:
1494 file_copies_switch--verbose:
1495 file_copies_switch--verbose:
1495 file_copies_switch--verbose:
1496 file_copies_switch--verbose:
1496 file_copies_switch--verbose:
1497 file_copies_switch--verbose:
1497 file_copies_switch--verbose:
1498 file_copies_switch--verbose:
1498 file_copies_switch--verbose:
1499 file_copies_switch--verbose:
1499 file_copies_switch--verbose:
1500 file_copies_switch--debug:
1500 file_copies_switch--debug:
1501 file_copies_switch--debug:
1501 file_copies_switch--debug:
1502 file_copies_switch--debug:
1502 file_copies_switch--debug:
1503 file_copies_switch--debug:
1503 file_copies_switch--debug:
1504 file_copies_switch--debug:
1504 file_copies_switch--debug:
1505 file_copies_switch--debug:
1505 file_copies_switch--debug:
1506 file_copies_switch--debug:
1506 file_copies_switch--debug:
1507 file_copies_switch--debug:
1507 file_copies_switch--debug:
1508 file_copies_switch--debug:
1508 file_copies_switch--debug:
1509 files: fourth second third
1509 files: fourth second third
1510 files: second
1510 files: second
1511 files:
1511 files:
1512 files: d
1512 files: d
1513 files:
1513 files:
1514 files: c
1514 files: c
1515 files: c
1515 files: c
1516 files: b
1516 files: b
1517 files: a
1517 files: a
1518 files--verbose: fourth second third
1518 files--verbose: fourth second third
1519 files--verbose: second
1519 files--verbose: second
1520 files--verbose:
1520 files--verbose:
1521 files--verbose: d
1521 files--verbose: d
1522 files--verbose:
1522 files--verbose:
1523 files--verbose: c
1523 files--verbose: c
1524 files--verbose: c
1524 files--verbose: c
1525 files--verbose: b
1525 files--verbose: b
1526 files--verbose: a
1526 files--verbose: a
1527 files--debug: fourth second third
1527 files--debug: fourth second third
1528 files--debug: second
1528 files--debug: second
1529 files--debug:
1529 files--debug:
1530 files--debug: d
1530 files--debug: d
1531 files--debug:
1531 files--debug:
1532 files--debug: c
1532 files--debug: c
1533 files--debug: c
1533 files--debug: c
1534 files--debug: b
1534 files--debug: b
1535 files--debug: a
1535 files--debug: a
1536 manifest: 6:94961b75a2da
1536 manifest: 6:94961b75a2da
1537 manifest: 5:f2dbc354b94e
1537 manifest: 5:f2dbc354b94e
1538 manifest: 4:4dc3def4f9b4
1538 manifest: 4:4dc3def4f9b4
1539 manifest: 4:4dc3def4f9b4
1539 manifest: 4:4dc3def4f9b4
1540 manifest: 3:cb5a1327723b
1540 manifest: 3:cb5a1327723b
1541 manifest: 3:cb5a1327723b
1541 manifest: 3:cb5a1327723b
1542 manifest: 2:6e0e82995c35
1542 manifest: 2:6e0e82995c35
1543 manifest: 1:4e8d705b1e53
1543 manifest: 1:4e8d705b1e53
1544 manifest: 0:a0c8bcbbb45c
1544 manifest: 0:a0c8bcbbb45c
1545 manifest--verbose: 6:94961b75a2da
1545 manifest--verbose: 6:94961b75a2da
1546 manifest--verbose: 5:f2dbc354b94e
1546 manifest--verbose: 5:f2dbc354b94e
1547 manifest--verbose: 4:4dc3def4f9b4
1547 manifest--verbose: 4:4dc3def4f9b4
1548 manifest--verbose: 4:4dc3def4f9b4
1548 manifest--verbose: 4:4dc3def4f9b4
1549 manifest--verbose: 3:cb5a1327723b
1549 manifest--verbose: 3:cb5a1327723b
1550 manifest--verbose: 3:cb5a1327723b
1550 manifest--verbose: 3:cb5a1327723b
1551 manifest--verbose: 2:6e0e82995c35
1551 manifest--verbose: 2:6e0e82995c35
1552 manifest--verbose: 1:4e8d705b1e53
1552 manifest--verbose: 1:4e8d705b1e53
1553 manifest--verbose: 0:a0c8bcbbb45c
1553 manifest--verbose: 0:a0c8bcbbb45c
1554 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
1554 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
1555 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
1555 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
1556 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1556 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1557 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1557 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1558 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1558 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1559 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1559 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1560 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1560 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1561 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1561 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1562 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1562 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1563 node: 95c24699272ef57d062b8bccc32c878bf841784a
1563 node: 95c24699272ef57d062b8bccc32c878bf841784a
1564 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1564 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1565 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1565 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1566 node: 13207e5a10d9fd28ec424934298e176197f2c67f
1566 node: 13207e5a10d9fd28ec424934298e176197f2c67f
1567 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1567 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1568 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1568 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1569 node: 97054abb4ab824450e9164180baf491ae0078465
1569 node: 97054abb4ab824450e9164180baf491ae0078465
1570 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1570 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1571 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1571 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1572 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
1572 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
1573 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1573 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1574 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1574 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1575 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1575 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1576 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1576 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1577 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1577 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1578 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1578 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1579 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1579 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1580 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1580 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1581 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
1581 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
1582 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1582 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1583 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1583 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1584 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1584 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1585 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1585 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1586 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1586 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1587 node--debug: 97054abb4ab824450e9164180baf491ae0078465
1587 node--debug: 97054abb4ab824450e9164180baf491ae0078465
1588 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1588 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1589 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1589 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1590 parents:
1590 parents:
1591 parents: -1:000000000000
1591 parents: -1:000000000000
1592 parents: 5:13207e5a10d9 4:bbe44766e73d
1592 parents: 5:13207e5a10d9 4:bbe44766e73d
1593 parents: 3:10e46f2dcbf4
1593 parents: 3:10e46f2dcbf4
1594 parents:
1594 parents:
1595 parents:
1595 parents:
1596 parents:
1596 parents:
1597 parents:
1597 parents:
1598 parents:
1598 parents:
1599 parents--verbose:
1599 parents--verbose:
1600 parents--verbose: -1:000000000000
1600 parents--verbose: -1:000000000000
1601 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
1601 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
1602 parents--verbose: 3:10e46f2dcbf4
1602 parents--verbose: 3:10e46f2dcbf4
1603 parents--verbose:
1603 parents--verbose:
1604 parents--verbose:
1604 parents--verbose:
1605 parents--verbose:
1605 parents--verbose:
1606 parents--verbose:
1606 parents--verbose:
1607 parents--verbose:
1607 parents--verbose:
1608 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
1608 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
1609 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1609 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1610 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1610 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1611 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1611 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1612 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1612 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1613 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
1613 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
1614 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
1614 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
1615 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
1615 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
1616 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1616 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1617 rev: 8
1617 rev: 8
1618 rev: 7
1618 rev: 7
1619 rev: 6
1619 rev: 6
1620 rev: 5
1620 rev: 5
1621 rev: 4
1621 rev: 4
1622 rev: 3
1622 rev: 3
1623 rev: 2
1623 rev: 2
1624 rev: 1
1624 rev: 1
1625 rev: 0
1625 rev: 0
1626 rev--verbose: 8
1626 rev--verbose: 8
1627 rev--verbose: 7
1627 rev--verbose: 7
1628 rev--verbose: 6
1628 rev--verbose: 6
1629 rev--verbose: 5
1629 rev--verbose: 5
1630 rev--verbose: 4
1630 rev--verbose: 4
1631 rev--verbose: 3
1631 rev--verbose: 3
1632 rev--verbose: 2
1632 rev--verbose: 2
1633 rev--verbose: 1
1633 rev--verbose: 1
1634 rev--verbose: 0
1634 rev--verbose: 0
1635 rev--debug: 8
1635 rev--debug: 8
1636 rev--debug: 7
1636 rev--debug: 7
1637 rev--debug: 6
1637 rev--debug: 6
1638 rev--debug: 5
1638 rev--debug: 5
1639 rev--debug: 4
1639 rev--debug: 4
1640 rev--debug: 3
1640 rev--debug: 3
1641 rev--debug: 2
1641 rev--debug: 2
1642 rev--debug: 1
1642 rev--debug: 1
1643 rev--debug: 0
1643 rev--debug: 0
1644 tags: tip
1644 tags: tip
1645 tags:
1645 tags:
1646 tags:
1646 tags:
1647 tags:
1647 tags:
1648 tags:
1648 tags:
1649 tags:
1649 tags:
1650 tags:
1650 tags:
1651 tags:
1651 tags:
1652 tags:
1652 tags:
1653 tags--verbose: tip
1653 tags--verbose: tip
1654 tags--verbose:
1654 tags--verbose:
1655 tags--verbose:
1655 tags--verbose:
1656 tags--verbose:
1656 tags--verbose:
1657 tags--verbose:
1657 tags--verbose:
1658 tags--verbose:
1658 tags--verbose:
1659 tags--verbose:
1659 tags--verbose:
1660 tags--verbose:
1660 tags--verbose:
1661 tags--verbose:
1661 tags--verbose:
1662 tags--debug: tip
1662 tags--debug: tip
1663 tags--debug:
1663 tags--debug:
1664 tags--debug:
1664 tags--debug:
1665 tags--debug:
1665 tags--debug:
1666 tags--debug:
1666 tags--debug:
1667 tags--debug:
1667 tags--debug:
1668 tags--debug:
1668 tags--debug:
1669 tags--debug:
1669 tags--debug:
1670 tags--debug:
1670 tags--debug:
1671 diffstat: 3: +2/-1
1671 diffstat: 3: +2/-1
1672 diffstat: 1: +1/-0
1672 diffstat: 1: +1/-0
1673 diffstat: 0: +0/-0
1673 diffstat: 0: +0/-0
1674 diffstat: 1: +1/-0
1674 diffstat: 1: +1/-0
1675 diffstat: 0: +0/-0
1675 diffstat: 0: +0/-0
1676 diffstat: 1: +1/-0
1676 diffstat: 1: +1/-0
1677 diffstat: 1: +4/-0
1677 diffstat: 1: +4/-0
1678 diffstat: 1: +2/-0
1678 diffstat: 1: +2/-0
1679 diffstat: 1: +1/-0
1679 diffstat: 1: +1/-0
1680 diffstat--verbose: 3: +2/-1
1680 diffstat--verbose: 3: +2/-1
1681 diffstat--verbose: 1: +1/-0
1681 diffstat--verbose: 1: +1/-0
1682 diffstat--verbose: 0: +0/-0
1682 diffstat--verbose: 0: +0/-0
1683 diffstat--verbose: 1: +1/-0
1683 diffstat--verbose: 1: +1/-0
1684 diffstat--verbose: 0: +0/-0
1684 diffstat--verbose: 0: +0/-0
1685 diffstat--verbose: 1: +1/-0
1685 diffstat--verbose: 1: +1/-0
1686 diffstat--verbose: 1: +4/-0
1686 diffstat--verbose: 1: +4/-0
1687 diffstat--verbose: 1: +2/-0
1687 diffstat--verbose: 1: +2/-0
1688 diffstat--verbose: 1: +1/-0
1688 diffstat--verbose: 1: +1/-0
1689 diffstat--debug: 3: +2/-1
1689 diffstat--debug: 3: +2/-1
1690 diffstat--debug: 1: +1/-0
1690 diffstat--debug: 1: +1/-0
1691 diffstat--debug: 0: +0/-0
1691 diffstat--debug: 0: +0/-0
1692 diffstat--debug: 1: +1/-0
1692 diffstat--debug: 1: +1/-0
1693 diffstat--debug: 0: +0/-0
1693 diffstat--debug: 0: +0/-0
1694 diffstat--debug: 1: +1/-0
1694 diffstat--debug: 1: +1/-0
1695 diffstat--debug: 1: +4/-0
1695 diffstat--debug: 1: +4/-0
1696 diffstat--debug: 1: +2/-0
1696 diffstat--debug: 1: +2/-0
1697 diffstat--debug: 1: +1/-0
1697 diffstat--debug: 1: +1/-0
1698 extras: branch=default
1698 extras: branch=default
1699 extras: branch=default
1699 extras: branch=default
1700 extras: branch=default
1700 extras: branch=default
1701 extras: branch=default
1701 extras: branch=default
1702 extras: branch=foo
1702 extras: branch=foo
1703 extras: branch=default
1703 extras: branch=default
1704 extras: branch=default
1704 extras: branch=default
1705 extras: branch=default
1705 extras: branch=default
1706 extras: branch=default
1706 extras: branch=default
1707 extras--verbose: branch=default
1707 extras--verbose: branch=default
1708 extras--verbose: branch=default
1708 extras--verbose: branch=default
1709 extras--verbose: branch=default
1709 extras--verbose: branch=default
1710 extras--verbose: branch=default
1710 extras--verbose: branch=default
1711 extras--verbose: branch=foo
1711 extras--verbose: branch=foo
1712 extras--verbose: branch=default
1712 extras--verbose: branch=default
1713 extras--verbose: branch=default
1713 extras--verbose: branch=default
1714 extras--verbose: branch=default
1714 extras--verbose: branch=default
1715 extras--verbose: branch=default
1715 extras--verbose: branch=default
1716 extras--debug: branch=default
1716 extras--debug: branch=default
1717 extras--debug: branch=default
1717 extras--debug: branch=default
1718 extras--debug: branch=default
1718 extras--debug: branch=default
1719 extras--debug: branch=default
1719 extras--debug: branch=default
1720 extras--debug: branch=foo
1720 extras--debug: branch=foo
1721 extras--debug: branch=default
1721 extras--debug: branch=default
1722 extras--debug: branch=default
1722 extras--debug: branch=default
1723 extras--debug: branch=default
1723 extras--debug: branch=default
1724 extras--debug: branch=default
1724 extras--debug: branch=default
1725 p1rev: 7
1725 p1rev: 7
1726 p1rev: -1
1726 p1rev: -1
1727 p1rev: 5
1727 p1rev: 5
1728 p1rev: 3
1728 p1rev: 3
1729 p1rev: 3
1729 p1rev: 3
1730 p1rev: 2
1730 p1rev: 2
1731 p1rev: 1
1731 p1rev: 1
1732 p1rev: 0
1732 p1rev: 0
1733 p1rev: -1
1733 p1rev: -1
1734 p1rev--verbose: 7
1734 p1rev--verbose: 7
1735 p1rev--verbose: -1
1735 p1rev--verbose: -1
1736 p1rev--verbose: 5
1736 p1rev--verbose: 5
1737 p1rev--verbose: 3
1737 p1rev--verbose: 3
1738 p1rev--verbose: 3
1738 p1rev--verbose: 3
1739 p1rev--verbose: 2
1739 p1rev--verbose: 2
1740 p1rev--verbose: 1
1740 p1rev--verbose: 1
1741 p1rev--verbose: 0
1741 p1rev--verbose: 0
1742 p1rev--verbose: -1
1742 p1rev--verbose: -1
1743 p1rev--debug: 7
1743 p1rev--debug: 7
1744 p1rev--debug: -1
1744 p1rev--debug: -1
1745 p1rev--debug: 5
1745 p1rev--debug: 5
1746 p1rev--debug: 3
1746 p1rev--debug: 3
1747 p1rev--debug: 3
1747 p1rev--debug: 3
1748 p1rev--debug: 2
1748 p1rev--debug: 2
1749 p1rev--debug: 1
1749 p1rev--debug: 1
1750 p1rev--debug: 0
1750 p1rev--debug: 0
1751 p1rev--debug: -1
1751 p1rev--debug: -1
1752 p2rev: -1
1752 p2rev: -1
1753 p2rev: -1
1753 p2rev: -1
1754 p2rev: 4
1754 p2rev: 4
1755 p2rev: -1
1755 p2rev: -1
1756 p2rev: -1
1756 p2rev: -1
1757 p2rev: -1
1757 p2rev: -1
1758 p2rev: -1
1758 p2rev: -1
1759 p2rev: -1
1759 p2rev: -1
1760 p2rev: -1
1760 p2rev: -1
1761 p2rev--verbose: -1
1761 p2rev--verbose: -1
1762 p2rev--verbose: -1
1762 p2rev--verbose: -1
1763 p2rev--verbose: 4
1763 p2rev--verbose: 4
1764 p2rev--verbose: -1
1764 p2rev--verbose: -1
1765 p2rev--verbose: -1
1765 p2rev--verbose: -1
1766 p2rev--verbose: -1
1766 p2rev--verbose: -1
1767 p2rev--verbose: -1
1767 p2rev--verbose: -1
1768 p2rev--verbose: -1
1768 p2rev--verbose: -1
1769 p2rev--verbose: -1
1769 p2rev--verbose: -1
1770 p2rev--debug: -1
1770 p2rev--debug: -1
1771 p2rev--debug: -1
1771 p2rev--debug: -1
1772 p2rev--debug: 4
1772 p2rev--debug: 4
1773 p2rev--debug: -1
1773 p2rev--debug: -1
1774 p2rev--debug: -1
1774 p2rev--debug: -1
1775 p2rev--debug: -1
1775 p2rev--debug: -1
1776 p2rev--debug: -1
1776 p2rev--debug: -1
1777 p2rev--debug: -1
1777 p2rev--debug: -1
1778 p2rev--debug: -1
1778 p2rev--debug: -1
1779 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1779 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1780 p1node: 0000000000000000000000000000000000000000
1780 p1node: 0000000000000000000000000000000000000000
1781 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
1781 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
1782 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1782 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1783 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1783 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1784 p1node: 97054abb4ab824450e9164180baf491ae0078465
1784 p1node: 97054abb4ab824450e9164180baf491ae0078465
1785 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1785 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1786 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1786 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1787 p1node: 0000000000000000000000000000000000000000
1787 p1node: 0000000000000000000000000000000000000000
1788 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1788 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1789 p1node--verbose: 0000000000000000000000000000000000000000
1789 p1node--verbose: 0000000000000000000000000000000000000000
1790 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1790 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1791 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1791 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1792 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1792 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1793 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1793 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1794 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1794 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1795 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1795 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1796 p1node--verbose: 0000000000000000000000000000000000000000
1796 p1node--verbose: 0000000000000000000000000000000000000000
1797 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1797 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1798 p1node--debug: 0000000000000000000000000000000000000000
1798 p1node--debug: 0000000000000000000000000000000000000000
1799 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1799 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1800 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1800 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1801 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1801 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1802 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
1802 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
1803 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1803 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1804 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1804 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1805 p1node--debug: 0000000000000000000000000000000000000000
1805 p1node--debug: 0000000000000000000000000000000000000000
1806 p2node: 0000000000000000000000000000000000000000
1806 p2node: 0000000000000000000000000000000000000000
1807 p2node: 0000000000000000000000000000000000000000
1807 p2node: 0000000000000000000000000000000000000000
1808 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1808 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1809 p2node: 0000000000000000000000000000000000000000
1809 p2node: 0000000000000000000000000000000000000000
1810 p2node: 0000000000000000000000000000000000000000
1810 p2node: 0000000000000000000000000000000000000000
1811 p2node: 0000000000000000000000000000000000000000
1811 p2node: 0000000000000000000000000000000000000000
1812 p2node: 0000000000000000000000000000000000000000
1812 p2node: 0000000000000000000000000000000000000000
1813 p2node: 0000000000000000000000000000000000000000
1813 p2node: 0000000000000000000000000000000000000000
1814 p2node: 0000000000000000000000000000000000000000
1814 p2node: 0000000000000000000000000000000000000000
1815 p2node--verbose: 0000000000000000000000000000000000000000
1815 p2node--verbose: 0000000000000000000000000000000000000000
1816 p2node--verbose: 0000000000000000000000000000000000000000
1816 p2node--verbose: 0000000000000000000000000000000000000000
1817 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1817 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1818 p2node--verbose: 0000000000000000000000000000000000000000
1818 p2node--verbose: 0000000000000000000000000000000000000000
1819 p2node--verbose: 0000000000000000000000000000000000000000
1819 p2node--verbose: 0000000000000000000000000000000000000000
1820 p2node--verbose: 0000000000000000000000000000000000000000
1820 p2node--verbose: 0000000000000000000000000000000000000000
1821 p2node--verbose: 0000000000000000000000000000000000000000
1821 p2node--verbose: 0000000000000000000000000000000000000000
1822 p2node--verbose: 0000000000000000000000000000000000000000
1822 p2node--verbose: 0000000000000000000000000000000000000000
1823 p2node--verbose: 0000000000000000000000000000000000000000
1823 p2node--verbose: 0000000000000000000000000000000000000000
1824 p2node--debug: 0000000000000000000000000000000000000000
1824 p2node--debug: 0000000000000000000000000000000000000000
1825 p2node--debug: 0000000000000000000000000000000000000000
1825 p2node--debug: 0000000000000000000000000000000000000000
1826 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1826 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1827 p2node--debug: 0000000000000000000000000000000000000000
1827 p2node--debug: 0000000000000000000000000000000000000000
1828 p2node--debug: 0000000000000000000000000000000000000000
1828 p2node--debug: 0000000000000000000000000000000000000000
1829 p2node--debug: 0000000000000000000000000000000000000000
1829 p2node--debug: 0000000000000000000000000000000000000000
1830 p2node--debug: 0000000000000000000000000000000000000000
1830 p2node--debug: 0000000000000000000000000000000000000000
1831 p2node--debug: 0000000000000000000000000000000000000000
1831 p2node--debug: 0000000000000000000000000000000000000000
1832 p2node--debug: 0000000000000000000000000000000000000000
1832 p2node--debug: 0000000000000000000000000000000000000000
1833
1833
1834 Filters work:
1834 Filters work:
1835
1835
1836 $ hg log --template '{author|domain}\n'
1836 $ hg log --template '{author|domain}\n'
1837
1837
1838 hostname
1838 hostname
1839
1839
1840
1840
1841
1841
1842
1842
1843 place
1843 place
1844 place
1844 place
1845 hostname
1845 hostname
1846
1846
1847 $ hg log --template '{author|person}\n'
1847 $ hg log --template '{author|person}\n'
1848 test
1848 test
1849 User Name
1849 User Name
1850 person
1850 person
1851 person
1851 person
1852 person
1852 person
1853 person
1853 person
1854 other
1854 other
1855 A. N. Other
1855 A. N. Other
1856 User Name
1856 User Name
1857
1857
1858 $ hg log --template '{author|user}\n'
1858 $ hg log --template '{author|user}\n'
1859 test
1859 test
1860 user
1860 user
1861 person
1861 person
1862 person
1862 person
1863 person
1863 person
1864 person
1864 person
1865 other
1865 other
1866 other
1866 other
1867 user
1867 user
1868
1868
1869 $ hg log --template '{date|date}\n'
1869 $ hg log --template '{date|date}\n'
1870 Wed Jan 01 10:01:00 2020 +0000
1870 Wed Jan 01 10:01:00 2020 +0000
1871 Mon Jan 12 13:46:40 1970 +0000
1871 Mon Jan 12 13:46:40 1970 +0000
1872 Sun Jan 18 08:40:01 1970 +0000
1872 Sun Jan 18 08:40:01 1970 +0000
1873 Sun Jan 18 08:40:00 1970 +0000
1873 Sun Jan 18 08:40:00 1970 +0000
1874 Sat Jan 17 04:53:20 1970 +0000
1874 Sat Jan 17 04:53:20 1970 +0000
1875 Fri Jan 16 01:06:40 1970 +0000
1875 Fri Jan 16 01:06:40 1970 +0000
1876 Wed Jan 14 21:20:00 1970 +0000
1876 Wed Jan 14 21:20:00 1970 +0000
1877 Tue Jan 13 17:33:20 1970 +0000
1877 Tue Jan 13 17:33:20 1970 +0000
1878 Mon Jan 12 13:46:40 1970 +0000
1878 Mon Jan 12 13:46:40 1970 +0000
1879
1879
1880 $ hg log --template '{date|isodate}\n'
1880 $ hg log --template '{date|isodate}\n'
1881 2020-01-01 10:01 +0000
1881 2020-01-01 10:01 +0000
1882 1970-01-12 13:46 +0000
1882 1970-01-12 13:46 +0000
1883 1970-01-18 08:40 +0000
1883 1970-01-18 08:40 +0000
1884 1970-01-18 08:40 +0000
1884 1970-01-18 08:40 +0000
1885 1970-01-17 04:53 +0000
1885 1970-01-17 04:53 +0000
1886 1970-01-16 01:06 +0000
1886 1970-01-16 01:06 +0000
1887 1970-01-14 21:20 +0000
1887 1970-01-14 21:20 +0000
1888 1970-01-13 17:33 +0000
1888 1970-01-13 17:33 +0000
1889 1970-01-12 13:46 +0000
1889 1970-01-12 13:46 +0000
1890
1890
1891 $ hg log --template '{date|isodatesec}\n'
1891 $ hg log --template '{date|isodatesec}\n'
1892 2020-01-01 10:01:00 +0000
1892 2020-01-01 10:01:00 +0000
1893 1970-01-12 13:46:40 +0000
1893 1970-01-12 13:46:40 +0000
1894 1970-01-18 08:40:01 +0000
1894 1970-01-18 08:40:01 +0000
1895 1970-01-18 08:40:00 +0000
1895 1970-01-18 08:40:00 +0000
1896 1970-01-17 04:53:20 +0000
1896 1970-01-17 04:53:20 +0000
1897 1970-01-16 01:06:40 +0000
1897 1970-01-16 01:06:40 +0000
1898 1970-01-14 21:20:00 +0000
1898 1970-01-14 21:20:00 +0000
1899 1970-01-13 17:33:20 +0000
1899 1970-01-13 17:33:20 +0000
1900 1970-01-12 13:46:40 +0000
1900 1970-01-12 13:46:40 +0000
1901
1901
1902 $ hg log --template '{date|rfc822date}\n'
1902 $ hg log --template '{date|rfc822date}\n'
1903 Wed, 01 Jan 2020 10:01:00 +0000
1903 Wed, 01 Jan 2020 10:01:00 +0000
1904 Mon, 12 Jan 1970 13:46:40 +0000
1904 Mon, 12 Jan 1970 13:46:40 +0000
1905 Sun, 18 Jan 1970 08:40:01 +0000
1905 Sun, 18 Jan 1970 08:40:01 +0000
1906 Sun, 18 Jan 1970 08:40:00 +0000
1906 Sun, 18 Jan 1970 08:40:00 +0000
1907 Sat, 17 Jan 1970 04:53:20 +0000
1907 Sat, 17 Jan 1970 04:53:20 +0000
1908 Fri, 16 Jan 1970 01:06:40 +0000
1908 Fri, 16 Jan 1970 01:06:40 +0000
1909 Wed, 14 Jan 1970 21:20:00 +0000
1909 Wed, 14 Jan 1970 21:20:00 +0000
1910 Tue, 13 Jan 1970 17:33:20 +0000
1910 Tue, 13 Jan 1970 17:33:20 +0000
1911 Mon, 12 Jan 1970 13:46:40 +0000
1911 Mon, 12 Jan 1970 13:46:40 +0000
1912
1912
1913 $ hg log --template '{desc|firstline}\n'
1913 $ hg log --template '{desc|firstline}\n'
1914 third
1914 third
1915 second
1915 second
1916 merge
1916 merge
1917 new head
1917 new head
1918 new branch
1918 new branch
1919 no user, no domain
1919 no user, no domain
1920 no person
1920 no person
1921 other 1
1921 other 1
1922 line 1
1922 line 1
1923
1923
1924 $ hg log --template '{node|short}\n'
1924 $ hg log --template '{node|short}\n'
1925 95c24699272e
1925 95c24699272e
1926 29114dbae42b
1926 29114dbae42b
1927 d41e714fe50d
1927 d41e714fe50d
1928 13207e5a10d9
1928 13207e5a10d9
1929 bbe44766e73d
1929 bbe44766e73d
1930 10e46f2dcbf4
1930 10e46f2dcbf4
1931 97054abb4ab8
1931 97054abb4ab8
1932 b608e9d1a3f0
1932 b608e9d1a3f0
1933 1e4e1b8f71e0
1933 1e4e1b8f71e0
1934
1934
1935 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
1935 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
1936 <changeset author="test"/>
1936 <changeset author="test"/>
1937 <changeset author="User Name &lt;user@hostname&gt;"/>
1937 <changeset author="User Name &lt;user@hostname&gt;"/>
1938 <changeset author="person"/>
1938 <changeset author="person"/>
1939 <changeset author="person"/>
1939 <changeset author="person"/>
1940 <changeset author="person"/>
1940 <changeset author="person"/>
1941 <changeset author="person"/>
1941 <changeset author="person"/>
1942 <changeset author="other@place"/>
1942 <changeset author="other@place"/>
1943 <changeset author="A. N. Other &lt;other@place&gt;"/>
1943 <changeset author="A. N. Other &lt;other@place&gt;"/>
1944 <changeset author="User Name &lt;user@hostname&gt;"/>
1944 <changeset author="User Name &lt;user@hostname&gt;"/>
1945
1945
1946 $ hg log --template '{rev}: {children}\n'
1946 $ hg log --template '{rev}: {children}\n'
1947 8:
1947 8:
1948 7: 8:95c24699272e
1948 7: 8:95c24699272e
1949 6:
1949 6:
1950 5: 6:d41e714fe50d
1950 5: 6:d41e714fe50d
1951 4: 6:d41e714fe50d
1951 4: 6:d41e714fe50d
1952 3: 4:bbe44766e73d 5:13207e5a10d9
1952 3: 4:bbe44766e73d 5:13207e5a10d9
1953 2: 3:10e46f2dcbf4
1953 2: 3:10e46f2dcbf4
1954 1: 2:97054abb4ab8
1954 1: 2:97054abb4ab8
1955 0: 1:b608e9d1a3f0
1955 0: 1:b608e9d1a3f0
1956
1956
1957 Formatnode filter works:
1957 Formatnode filter works:
1958
1958
1959 $ hg -q log -r 0 --template '{node|formatnode}\n'
1959 $ hg -q log -r 0 --template '{node|formatnode}\n'
1960 1e4e1b8f71e0
1960 1e4e1b8f71e0
1961
1961
1962 $ hg log -r 0 --template '{node|formatnode}\n'
1962 $ hg log -r 0 --template '{node|formatnode}\n'
1963 1e4e1b8f71e0
1963 1e4e1b8f71e0
1964
1964
1965 $ hg -v log -r 0 --template '{node|formatnode}\n'
1965 $ hg -v log -r 0 --template '{node|formatnode}\n'
1966 1e4e1b8f71e0
1966 1e4e1b8f71e0
1967
1967
1968 $ hg --debug log -r 0 --template '{node|formatnode}\n'
1968 $ hg --debug log -r 0 --template '{node|formatnode}\n'
1969 1e4e1b8f71e05681d422154f5421e385fec3454f
1969 1e4e1b8f71e05681d422154f5421e385fec3454f
1970
1970
1971 Age filter:
1971 Age filter:
1972
1972
1973 $ hg init unstable-hash
1973 $ hg init unstable-hash
1974 $ cd unstable-hash
1974 $ cd unstable-hash
1975 $ hg log --template '{date|age}\n' > /dev/null || exit 1
1975 $ hg log --template '{date|age}\n' > /dev/null || exit 1
1976
1976
1977 >>> from datetime import datetime, timedelta
1977 >>> from datetime import datetime, timedelta
1978 >>> fp = open('a', 'w')
1978 >>> fp = open('a', 'w')
1979 >>> n = datetime.now() + timedelta(366 * 7)
1979 >>> n = datetime.now() + timedelta(366 * 7)
1980 >>> fp.write('%d-%d-%d 00:00' % (n.year, n.month, n.day))
1980 >>> fp.write('%d-%d-%d 00:00' % (n.year, n.month, n.day))
1981 >>> fp.close()
1981 >>> fp.close()
1982 $ hg add a
1982 $ hg add a
1983 $ hg commit -m future -d "`cat a`"
1983 $ hg commit -m future -d "`cat a`"
1984
1984
1985 $ hg log -l1 --template '{date|age}\n'
1985 $ hg log -l1 --template '{date|age}\n'
1986 7 years from now
1986 7 years from now
1987
1987
1988 $ cd ..
1988 $ cd ..
1989 $ rm -rf unstable-hash
1989 $ rm -rf unstable-hash
1990
1990
1991 Add a dummy commit to make up for the instability of the above:
1991 Add a dummy commit to make up for the instability of the above:
1992
1992
1993 $ echo a > a
1993 $ echo a > a
1994 $ hg add a
1994 $ hg add a
1995 $ hg ci -m future
1995 $ hg ci -m future
1996
1996
1997 Count filter:
1997 Count filter:
1998
1998
1999 $ hg log -l1 --template '{node|count} {node|short|count}\n'
1999 $ hg log -l1 --template '{node|count} {node|short|count}\n'
2000 40 12
2000 40 12
2001
2001
2002 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n'
2002 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n'
2003 0 1 4
2003 0 1 4
2004
2004
2005 $ hg log -G --template '{rev}: children: {children|count}, \
2005 $ hg log -G --template '{rev}: children: {children|count}, \
2006 > tags: {tags|count}, file_adds: {file_adds|count}, \
2006 > tags: {tags|count}, file_adds: {file_adds|count}, \
2007 > ancestors: {revset("ancestors(%s)", rev)|count}'
2007 > ancestors: {revset("ancestors(%s)", rev)|count}'
2008 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
2008 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
2009 |
2009 |
2010 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
2010 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
2011 |
2011 |
2012 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
2012 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
2013
2013
2014 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
2014 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
2015 |\
2015 |\
2016 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
2016 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
2017 | |
2017 | |
2018 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
2018 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
2019 |/
2019 |/
2020 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
2020 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
2021 |
2021 |
2022 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
2022 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
2023 |
2023 |
2024 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
2024 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
2025 |
2025 |
2026 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
2026 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
2027
2027
2028
2028
2029 Upper/lower filters:
2029 Upper/lower filters:
2030
2030
2031 $ hg log -r0 --template '{branch|upper}\n'
2031 $ hg log -r0 --template '{branch|upper}\n'
2032 DEFAULT
2032 DEFAULT
2033 $ hg log -r0 --template '{author|lower}\n'
2033 $ hg log -r0 --template '{author|lower}\n'
2034 user name <user@hostname>
2034 user name <user@hostname>
2035 $ hg log -r0 --template '{date|upper}\n'
2035 $ hg log -r0 --template '{date|upper}\n'
2036 abort: template filter 'upper' is not compatible with keyword 'date'
2036 abort: template filter 'upper' is not compatible with keyword 'date'
2037 [255]
2037 [255]
2038
2038
2039 Add a commit that does all possible modifications at once
2039 Add a commit that does all possible modifications at once
2040
2040
2041 $ echo modify >> third
2041 $ echo modify >> third
2042 $ touch b
2042 $ touch b
2043 $ hg add b
2043 $ hg add b
2044 $ hg mv fourth fifth
2044 $ hg mv fourth fifth
2045 $ hg rm a
2045 $ hg rm a
2046 $ hg ci -m "Modify, add, remove, rename"
2046 $ hg ci -m "Modify, add, remove, rename"
2047
2047
2048 Check the status template
2048 Check the status template
2049
2049
2050 $ cat <<EOF >> $HGRCPATH
2050 $ cat <<EOF >> $HGRCPATH
2051 > [extensions]
2051 > [extensions]
2052 > color=
2052 > color=
2053 > EOF
2053 > EOF
2054
2054
2055 $ hg log -T status -r 10
2055 $ hg log -T status -r 10
2056 changeset: 10:0f9759ec227a
2056 changeset: 10:0f9759ec227a
2057 tag: tip
2057 tag: tip
2058 user: test
2058 user: test
2059 date: Thu Jan 01 00:00:00 1970 +0000
2059 date: Thu Jan 01 00:00:00 1970 +0000
2060 summary: Modify, add, remove, rename
2060 summary: Modify, add, remove, rename
2061 files:
2061 files:
2062 M third
2062 M third
2063 A b
2063 A b
2064 A fifth
2064 A fifth
2065 R a
2065 R a
2066 R fourth
2066 R fourth
2067
2067
2068 $ hg log -T status -C -r 10
2068 $ hg log -T status -C -r 10
2069 changeset: 10:0f9759ec227a
2069 changeset: 10:0f9759ec227a
2070 tag: tip
2070 tag: tip
2071 user: test
2071 user: test
2072 date: Thu Jan 01 00:00:00 1970 +0000
2072 date: Thu Jan 01 00:00:00 1970 +0000
2073 summary: Modify, add, remove, rename
2073 summary: Modify, add, remove, rename
2074 files:
2074 files:
2075 M third
2075 M third
2076 A b
2076 A b
2077 A fifth
2077 A fifth
2078 fourth
2078 fourth
2079 R a
2079 R a
2080 R fourth
2080 R fourth
2081
2081
2082 $ hg log -T status -C -r 10 -v
2082 $ hg log -T status -C -r 10 -v
2083 changeset: 10:0f9759ec227a
2083 changeset: 10:0f9759ec227a
2084 tag: tip
2084 tag: tip
2085 user: test
2085 user: test
2086 date: Thu Jan 01 00:00:00 1970 +0000
2086 date: Thu Jan 01 00:00:00 1970 +0000
2087 description:
2087 description:
2088 Modify, add, remove, rename
2088 Modify, add, remove, rename
2089
2089
2090 files:
2090 files:
2091 M third
2091 M third
2092 A b
2092 A b
2093 A fifth
2093 A fifth
2094 fourth
2094 fourth
2095 R a
2095 R a
2096 R fourth
2096 R fourth
2097
2097
2098 $ hg log -T status -C -r 10 --debug
2098 $ hg log -T status -C -r 10 --debug
2099 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2099 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2100 tag: tip
2100 tag: tip
2101 phase: secret
2101 phase: secret
2102 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2102 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2103 parent: -1:0000000000000000000000000000000000000000
2103 parent: -1:0000000000000000000000000000000000000000
2104 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2104 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2105 user: test
2105 user: test
2106 date: Thu Jan 01 00:00:00 1970 +0000
2106 date: Thu Jan 01 00:00:00 1970 +0000
2107 extra: branch=default
2107 extra: branch=default
2108 description:
2108 description:
2109 Modify, add, remove, rename
2109 Modify, add, remove, rename
2110
2110
2111 files:
2111 files:
2112 M third
2112 M third
2113 A b
2113 A b
2114 A fifth
2114 A fifth
2115 fourth
2115 fourth
2116 R a
2116 R a
2117 R fourth
2117 R fourth
2118
2118
2119 $ hg log -T status -C -r 10 --quiet
2119 $ hg log -T status -C -r 10 --quiet
2120 10:0f9759ec227a
2120 10:0f9759ec227a
2121 $ hg --color=debug log -T status -r 10
2121 $ hg --color=debug log -T status -r 10
2122 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2122 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2123 [log.tag|tag: tip]
2123 [log.tag|tag: tip]
2124 [log.user|user: test]
2124 [log.user|user: test]
2125 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2125 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2126 [log.summary|summary: Modify, add, remove, rename]
2126 [log.summary|summary: Modify, add, remove, rename]
2127 [ui.note log.files|files:]
2127 [ui.note log.files|files:]
2128 [status.modified|M third]
2128 [status.modified|M third]
2129 [status.added|A b]
2129 [status.added|A b]
2130 [status.added|A fifth]
2130 [status.added|A fifth]
2131 [status.removed|R a]
2131 [status.removed|R a]
2132 [status.removed|R fourth]
2132 [status.removed|R fourth]
2133
2133
2134 $ hg --color=debug log -T status -C -r 10
2134 $ hg --color=debug log -T status -C -r 10
2135 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2135 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2136 [log.tag|tag: tip]
2136 [log.tag|tag: tip]
2137 [log.user|user: test]
2137 [log.user|user: test]
2138 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2138 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2139 [log.summary|summary: Modify, add, remove, rename]
2139 [log.summary|summary: Modify, add, remove, rename]
2140 [ui.note log.files|files:]
2140 [ui.note log.files|files:]
2141 [status.modified|M third]
2141 [status.modified|M third]
2142 [status.added|A b]
2142 [status.added|A b]
2143 [status.added|A fifth]
2143 [status.added|A fifth]
2144 [status.copied| fourth]
2144 [status.copied| fourth]
2145 [status.removed|R a]
2145 [status.removed|R a]
2146 [status.removed|R fourth]
2146 [status.removed|R fourth]
2147
2147
2148 $ hg --color=debug log -T status -C -r 10 -v
2148 $ hg --color=debug log -T status -C -r 10 -v
2149 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2149 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2150 [log.tag|tag: tip]
2150 [log.tag|tag: tip]
2151 [log.user|user: test]
2151 [log.user|user: test]
2152 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2152 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2153 [ui.note log.description|description:]
2153 [ui.note log.description|description:]
2154 [ui.note log.description|Modify, add, remove, rename]
2154 [ui.note log.description|Modify, add, remove, rename]
2155
2155
2156 [ui.note log.files|files:]
2156 [ui.note log.files|files:]
2157 [status.modified|M third]
2157 [status.modified|M third]
2158 [status.added|A b]
2158 [status.added|A b]
2159 [status.added|A fifth]
2159 [status.added|A fifth]
2160 [status.copied| fourth]
2160 [status.copied| fourth]
2161 [status.removed|R a]
2161 [status.removed|R a]
2162 [status.removed|R fourth]
2162 [status.removed|R fourth]
2163
2163
2164 $ hg --color=debug log -T status -C -r 10 --debug
2164 $ hg --color=debug log -T status -C -r 10 --debug
2165 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2165 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2166 [log.tag|tag: tip]
2166 [log.tag|tag: tip]
2167 [log.phase|phase: secret]
2167 [log.phase|phase: secret]
2168 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2168 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2169 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2169 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2170 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2170 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2171 [log.user|user: test]
2171 [log.user|user: test]
2172 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2172 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2173 [ui.debug log.extra|extra: branch=default]
2173 [ui.debug log.extra|extra: branch=default]
2174 [ui.note log.description|description:]
2174 [ui.note log.description|description:]
2175 [ui.note log.description|Modify, add, remove, rename]
2175 [ui.note log.description|Modify, add, remove, rename]
2176
2176
2177 [ui.note log.files|files:]
2177 [ui.note log.files|files:]
2178 [status.modified|M third]
2178 [status.modified|M third]
2179 [status.added|A b]
2179 [status.added|A b]
2180 [status.added|A fifth]
2180 [status.added|A fifth]
2181 [status.copied| fourth]
2181 [status.copied| fourth]
2182 [status.removed|R a]
2182 [status.removed|R a]
2183 [status.removed|R fourth]
2183 [status.removed|R fourth]
2184
2184
2185 $ hg --color=debug log -T status -C -r 10 --quiet
2185 $ hg --color=debug log -T status -C -r 10 --quiet
2186 [log.node|10:0f9759ec227a]
2186 [log.node|10:0f9759ec227a]
2187
2187
2188 Check the bisect template
2188 Check the bisect template
2189
2189
2190 $ hg bisect -g 1
2190 $ hg bisect -g 1
2191 $ hg bisect -b 3 --noupdate
2191 $ hg bisect -b 3 --noupdate
2192 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2192 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2193 $ hg log -T bisect -r 0:4
2193 $ hg log -T bisect -r 0:4
2194 changeset: 0:1e4e1b8f71e0
2194 changeset: 0:1e4e1b8f71e0
2195 bisect: good (implicit)
2195 bisect: good (implicit)
2196 user: User Name <user@hostname>
2196 user: User Name <user@hostname>
2197 date: Mon Jan 12 13:46:40 1970 +0000
2197 date: Mon Jan 12 13:46:40 1970 +0000
2198 summary: line 1
2198 summary: line 1
2199
2199
2200 changeset: 1:b608e9d1a3f0
2200 changeset: 1:b608e9d1a3f0
2201 bisect: good
2201 bisect: good
2202 user: A. N. Other <other@place>
2202 user: A. N. Other <other@place>
2203 date: Tue Jan 13 17:33:20 1970 +0000
2203 date: Tue Jan 13 17:33:20 1970 +0000
2204 summary: other 1
2204 summary: other 1
2205
2205
2206 changeset: 2:97054abb4ab8
2206 changeset: 2:97054abb4ab8
2207 bisect: untested
2207 bisect: untested
2208 user: other@place
2208 user: other@place
2209 date: Wed Jan 14 21:20:00 1970 +0000
2209 date: Wed Jan 14 21:20:00 1970 +0000
2210 summary: no person
2210 summary: no person
2211
2211
2212 changeset: 3:10e46f2dcbf4
2212 changeset: 3:10e46f2dcbf4
2213 bisect: bad
2213 bisect: bad
2214 user: person
2214 user: person
2215 date: Fri Jan 16 01:06:40 1970 +0000
2215 date: Fri Jan 16 01:06:40 1970 +0000
2216 summary: no user, no domain
2216 summary: no user, no domain
2217
2217
2218 changeset: 4:bbe44766e73d
2218 changeset: 4:bbe44766e73d
2219 bisect: bad (implicit)
2219 bisect: bad (implicit)
2220 branch: foo
2220 branch: foo
2221 user: person
2221 user: person
2222 date: Sat Jan 17 04:53:20 1970 +0000
2222 date: Sat Jan 17 04:53:20 1970 +0000
2223 summary: new branch
2223 summary: new branch
2224
2224
2225 $ hg log --debug -T bisect -r 0:4
2225 $ hg log --debug -T bisect -r 0:4
2226 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2226 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2227 bisect: good (implicit)
2227 bisect: good (implicit)
2228 phase: public
2228 phase: public
2229 parent: -1:0000000000000000000000000000000000000000
2229 parent: -1:0000000000000000000000000000000000000000
2230 parent: -1:0000000000000000000000000000000000000000
2230 parent: -1:0000000000000000000000000000000000000000
2231 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2231 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2232 user: User Name <user@hostname>
2232 user: User Name <user@hostname>
2233 date: Mon Jan 12 13:46:40 1970 +0000
2233 date: Mon Jan 12 13:46:40 1970 +0000
2234 files+: a
2234 files+: a
2235 extra: branch=default
2235 extra: branch=default
2236 description:
2236 description:
2237 line 1
2237 line 1
2238 line 2
2238 line 2
2239
2239
2240
2240
2241 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2241 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2242 bisect: good
2242 bisect: good
2243 phase: public
2243 phase: public
2244 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2244 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2245 parent: -1:0000000000000000000000000000000000000000
2245 parent: -1:0000000000000000000000000000000000000000
2246 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2246 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2247 user: A. N. Other <other@place>
2247 user: A. N. Other <other@place>
2248 date: Tue Jan 13 17:33:20 1970 +0000
2248 date: Tue Jan 13 17:33:20 1970 +0000
2249 files+: b
2249 files+: b
2250 extra: branch=default
2250 extra: branch=default
2251 description:
2251 description:
2252 other 1
2252 other 1
2253 other 2
2253 other 2
2254
2254
2255 other 3
2255 other 3
2256
2256
2257
2257
2258 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2258 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2259 bisect: untested
2259 bisect: untested
2260 phase: public
2260 phase: public
2261 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2261 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2262 parent: -1:0000000000000000000000000000000000000000
2262 parent: -1:0000000000000000000000000000000000000000
2263 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2263 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2264 user: other@place
2264 user: other@place
2265 date: Wed Jan 14 21:20:00 1970 +0000
2265 date: Wed Jan 14 21:20:00 1970 +0000
2266 files+: c
2266 files+: c
2267 extra: branch=default
2267 extra: branch=default
2268 description:
2268 description:
2269 no person
2269 no person
2270
2270
2271
2271
2272 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2272 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2273 bisect: bad
2273 bisect: bad
2274 phase: public
2274 phase: public
2275 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2275 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2276 parent: -1:0000000000000000000000000000000000000000
2276 parent: -1:0000000000000000000000000000000000000000
2277 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2277 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2278 user: person
2278 user: person
2279 date: Fri Jan 16 01:06:40 1970 +0000
2279 date: Fri Jan 16 01:06:40 1970 +0000
2280 files: c
2280 files: c
2281 extra: branch=default
2281 extra: branch=default
2282 description:
2282 description:
2283 no user, no domain
2283 no user, no domain
2284
2284
2285
2285
2286 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2286 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2287 bisect: bad (implicit)
2287 bisect: bad (implicit)
2288 branch: foo
2288 branch: foo
2289 phase: draft
2289 phase: draft
2290 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2290 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2291 parent: -1:0000000000000000000000000000000000000000
2291 parent: -1:0000000000000000000000000000000000000000
2292 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2292 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2293 user: person
2293 user: person
2294 date: Sat Jan 17 04:53:20 1970 +0000
2294 date: Sat Jan 17 04:53:20 1970 +0000
2295 extra: branch=foo
2295 extra: branch=foo
2296 description:
2296 description:
2297 new branch
2297 new branch
2298
2298
2299
2299
2300 $ hg log -v -T bisect -r 0:4
2300 $ hg log -v -T bisect -r 0:4
2301 changeset: 0:1e4e1b8f71e0
2301 changeset: 0:1e4e1b8f71e0
2302 bisect: good (implicit)
2302 bisect: good (implicit)
2303 user: User Name <user@hostname>
2303 user: User Name <user@hostname>
2304 date: Mon Jan 12 13:46:40 1970 +0000
2304 date: Mon Jan 12 13:46:40 1970 +0000
2305 files: a
2305 files: a
2306 description:
2306 description:
2307 line 1
2307 line 1
2308 line 2
2308 line 2
2309
2309
2310
2310
2311 changeset: 1:b608e9d1a3f0
2311 changeset: 1:b608e9d1a3f0
2312 bisect: good
2312 bisect: good
2313 user: A. N. Other <other@place>
2313 user: A. N. Other <other@place>
2314 date: Tue Jan 13 17:33:20 1970 +0000
2314 date: Tue Jan 13 17:33:20 1970 +0000
2315 files: b
2315 files: b
2316 description:
2316 description:
2317 other 1
2317 other 1
2318 other 2
2318 other 2
2319
2319
2320 other 3
2320 other 3
2321
2321
2322
2322
2323 changeset: 2:97054abb4ab8
2323 changeset: 2:97054abb4ab8
2324 bisect: untested
2324 bisect: untested
2325 user: other@place
2325 user: other@place
2326 date: Wed Jan 14 21:20:00 1970 +0000
2326 date: Wed Jan 14 21:20:00 1970 +0000
2327 files: c
2327 files: c
2328 description:
2328 description:
2329 no person
2329 no person
2330
2330
2331
2331
2332 changeset: 3:10e46f2dcbf4
2332 changeset: 3:10e46f2dcbf4
2333 bisect: bad
2333 bisect: bad
2334 user: person
2334 user: person
2335 date: Fri Jan 16 01:06:40 1970 +0000
2335 date: Fri Jan 16 01:06:40 1970 +0000
2336 files: c
2336 files: c
2337 description:
2337 description:
2338 no user, no domain
2338 no user, no domain
2339
2339
2340
2340
2341 changeset: 4:bbe44766e73d
2341 changeset: 4:bbe44766e73d
2342 bisect: bad (implicit)
2342 bisect: bad (implicit)
2343 branch: foo
2343 branch: foo
2344 user: person
2344 user: person
2345 date: Sat Jan 17 04:53:20 1970 +0000
2345 date: Sat Jan 17 04:53:20 1970 +0000
2346 description:
2346 description:
2347 new branch
2347 new branch
2348
2348
2349
2349
2350 $ hg --color=debug log -T bisect -r 0:4
2350 $ hg --color=debug log -T bisect -r 0:4
2351 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2351 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2352 [log.bisect bisect.good|bisect: good (implicit)]
2352 [log.bisect bisect.good|bisect: good (implicit)]
2353 [log.user|user: User Name <user@hostname>]
2353 [log.user|user: User Name <user@hostname>]
2354 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2354 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2355 [log.summary|summary: line 1]
2355 [log.summary|summary: line 1]
2356
2356
2357 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2357 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2358 [log.bisect bisect.good|bisect: good]
2358 [log.bisect bisect.good|bisect: good]
2359 [log.user|user: A. N. Other <other@place>]
2359 [log.user|user: A. N. Other <other@place>]
2360 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2360 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2361 [log.summary|summary: other 1]
2361 [log.summary|summary: other 1]
2362
2362
2363 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2363 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2364 [log.bisect bisect.untested|bisect: untested]
2364 [log.bisect bisect.untested|bisect: untested]
2365 [log.user|user: other@place]
2365 [log.user|user: other@place]
2366 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2366 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2367 [log.summary|summary: no person]
2367 [log.summary|summary: no person]
2368
2368
2369 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2369 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2370 [log.bisect bisect.bad|bisect: bad]
2370 [log.bisect bisect.bad|bisect: bad]
2371 [log.user|user: person]
2371 [log.user|user: person]
2372 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2372 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2373 [log.summary|summary: no user, no domain]
2373 [log.summary|summary: no user, no domain]
2374
2374
2375 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2375 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2376 [log.bisect bisect.bad|bisect: bad (implicit)]
2376 [log.bisect bisect.bad|bisect: bad (implicit)]
2377 [log.branch|branch: foo]
2377 [log.branch|branch: foo]
2378 [log.user|user: person]
2378 [log.user|user: person]
2379 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2379 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2380 [log.summary|summary: new branch]
2380 [log.summary|summary: new branch]
2381
2381
2382 $ hg --color=debug log --debug -T bisect -r 0:4
2382 $ hg --color=debug log --debug -T bisect -r 0:4
2383 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2383 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2384 [log.bisect bisect.good|bisect: good (implicit)]
2384 [log.bisect bisect.good|bisect: good (implicit)]
2385 [log.phase|phase: public]
2385 [log.phase|phase: public]
2386 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2386 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2387 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2387 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2388 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2388 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2389 [log.user|user: User Name <user@hostname>]
2389 [log.user|user: User Name <user@hostname>]
2390 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2390 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2391 [ui.debug log.files|files+: a]
2391 [ui.debug log.files|files+: a]
2392 [ui.debug log.extra|extra: branch=default]
2392 [ui.debug log.extra|extra: branch=default]
2393 [ui.note log.description|description:]
2393 [ui.note log.description|description:]
2394 [ui.note log.description|line 1
2394 [ui.note log.description|line 1
2395 line 2]
2395 line 2]
2396
2396
2397
2397
2398 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2398 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2399 [log.bisect bisect.good|bisect: good]
2399 [log.bisect bisect.good|bisect: good]
2400 [log.phase|phase: public]
2400 [log.phase|phase: public]
2401 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2401 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2402 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2402 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2403 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2403 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2404 [log.user|user: A. N. Other <other@place>]
2404 [log.user|user: A. N. Other <other@place>]
2405 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2405 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2406 [ui.debug log.files|files+: b]
2406 [ui.debug log.files|files+: b]
2407 [ui.debug log.extra|extra: branch=default]
2407 [ui.debug log.extra|extra: branch=default]
2408 [ui.note log.description|description:]
2408 [ui.note log.description|description:]
2409 [ui.note log.description|other 1
2409 [ui.note log.description|other 1
2410 other 2
2410 other 2
2411
2411
2412 other 3]
2412 other 3]
2413
2413
2414
2414
2415 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2415 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2416 [log.bisect bisect.untested|bisect: untested]
2416 [log.bisect bisect.untested|bisect: untested]
2417 [log.phase|phase: public]
2417 [log.phase|phase: public]
2418 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2418 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2419 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2419 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2420 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2420 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2421 [log.user|user: other@place]
2421 [log.user|user: other@place]
2422 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2422 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2423 [ui.debug log.files|files+: c]
2423 [ui.debug log.files|files+: c]
2424 [ui.debug log.extra|extra: branch=default]
2424 [ui.debug log.extra|extra: branch=default]
2425 [ui.note log.description|description:]
2425 [ui.note log.description|description:]
2426 [ui.note log.description|no person]
2426 [ui.note log.description|no person]
2427
2427
2428
2428
2429 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2429 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2430 [log.bisect bisect.bad|bisect: bad]
2430 [log.bisect bisect.bad|bisect: bad]
2431 [log.phase|phase: public]
2431 [log.phase|phase: public]
2432 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2432 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2433 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2433 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2434 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2434 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2435 [log.user|user: person]
2435 [log.user|user: person]
2436 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2436 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2437 [ui.debug log.files|files: c]
2437 [ui.debug log.files|files: c]
2438 [ui.debug log.extra|extra: branch=default]
2438 [ui.debug log.extra|extra: branch=default]
2439 [ui.note log.description|description:]
2439 [ui.note log.description|description:]
2440 [ui.note log.description|no user, no domain]
2440 [ui.note log.description|no user, no domain]
2441
2441
2442
2442
2443 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2443 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2444 [log.bisect bisect.bad|bisect: bad (implicit)]
2444 [log.bisect bisect.bad|bisect: bad (implicit)]
2445 [log.branch|branch: foo]
2445 [log.branch|branch: foo]
2446 [log.phase|phase: draft]
2446 [log.phase|phase: draft]
2447 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2447 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2448 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2448 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2449 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2449 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2450 [log.user|user: person]
2450 [log.user|user: person]
2451 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2451 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2452 [ui.debug log.extra|extra: branch=foo]
2452 [ui.debug log.extra|extra: branch=foo]
2453 [ui.note log.description|description:]
2453 [ui.note log.description|description:]
2454 [ui.note log.description|new branch]
2454 [ui.note log.description|new branch]
2455
2455
2456
2456
2457 $ hg --color=debug log -v -T bisect -r 0:4
2457 $ hg --color=debug log -v -T bisect -r 0:4
2458 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2458 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2459 [log.bisect bisect.good|bisect: good (implicit)]
2459 [log.bisect bisect.good|bisect: good (implicit)]
2460 [log.user|user: User Name <user@hostname>]
2460 [log.user|user: User Name <user@hostname>]
2461 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2461 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2462 [ui.note log.files|files: a]
2462 [ui.note log.files|files: a]
2463 [ui.note log.description|description:]
2463 [ui.note log.description|description:]
2464 [ui.note log.description|line 1
2464 [ui.note log.description|line 1
2465 line 2]
2465 line 2]
2466
2466
2467
2467
2468 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2468 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2469 [log.bisect bisect.good|bisect: good]
2469 [log.bisect bisect.good|bisect: good]
2470 [log.user|user: A. N. Other <other@place>]
2470 [log.user|user: A. N. Other <other@place>]
2471 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2471 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2472 [ui.note log.files|files: b]
2472 [ui.note log.files|files: b]
2473 [ui.note log.description|description:]
2473 [ui.note log.description|description:]
2474 [ui.note log.description|other 1
2474 [ui.note log.description|other 1
2475 other 2
2475 other 2
2476
2476
2477 other 3]
2477 other 3]
2478
2478
2479
2479
2480 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2480 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2481 [log.bisect bisect.untested|bisect: untested]
2481 [log.bisect bisect.untested|bisect: untested]
2482 [log.user|user: other@place]
2482 [log.user|user: other@place]
2483 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2483 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2484 [ui.note log.files|files: c]
2484 [ui.note log.files|files: c]
2485 [ui.note log.description|description:]
2485 [ui.note log.description|description:]
2486 [ui.note log.description|no person]
2486 [ui.note log.description|no person]
2487
2487
2488
2488
2489 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2489 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2490 [log.bisect bisect.bad|bisect: bad]
2490 [log.bisect bisect.bad|bisect: bad]
2491 [log.user|user: person]
2491 [log.user|user: person]
2492 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2492 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2493 [ui.note log.files|files: c]
2493 [ui.note log.files|files: c]
2494 [ui.note log.description|description:]
2494 [ui.note log.description|description:]
2495 [ui.note log.description|no user, no domain]
2495 [ui.note log.description|no user, no domain]
2496
2496
2497
2497
2498 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2498 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2499 [log.bisect bisect.bad|bisect: bad (implicit)]
2499 [log.bisect bisect.bad|bisect: bad (implicit)]
2500 [log.branch|branch: foo]
2500 [log.branch|branch: foo]
2501 [log.user|user: person]
2501 [log.user|user: person]
2502 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2502 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2503 [ui.note log.description|description:]
2503 [ui.note log.description|description:]
2504 [ui.note log.description|new branch]
2504 [ui.note log.description|new branch]
2505
2505
2506
2506
2507 $ hg bisect --reset
2507 $ hg bisect --reset
2508
2508
2509 Error on syntax:
2509 Error on syntax:
2510
2510
2511 $ echo 'x = "f' >> t
2511 $ echo 'x = "f' >> t
2512 $ hg log
2512 $ hg log
2513 hg: parse error at t:3: unmatched quotes
2513 hg: parse error at t:3: unmatched quotes
2514 [255]
2514 [255]
2515
2515
2516 $ hg log -T '{date'
2516 $ hg log -T '{date'
2517 hg: parse error at 1: unterminated template expansion
2517 hg: parse error at 1: unterminated template expansion
2518 [255]
2518 [255]
2519
2519
2520 Behind the scenes, this will throw TypeError
2520 Behind the scenes, this will throw TypeError
2521
2521
2522 $ hg log -l 3 --template '{date|obfuscate}\n'
2522 $ hg log -l 3 --template '{date|obfuscate}\n'
2523 abort: template filter 'obfuscate' is not compatible with keyword 'date'
2523 abort: template filter 'obfuscate' is not compatible with keyword 'date'
2524 [255]
2524 [255]
2525
2525
2526 Behind the scenes, this will throw a ValueError
2526 Behind the scenes, this will throw a ValueError
2527
2527
2528 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
2528 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
2529 abort: template filter 'shortdate' is not compatible with keyword 'desc'
2529 abort: template filter 'shortdate' is not compatible with keyword 'desc'
2530 [255]
2530 [255]
2531
2531
2532 Behind the scenes, this will throw AttributeError
2532 Behind the scenes, this will throw AttributeError
2533
2533
2534 $ hg log -l 3 --template 'line: {date|escape}\n'
2534 $ hg log -l 3 --template 'line: {date|escape}\n'
2535 abort: template filter 'escape' is not compatible with keyword 'date'
2535 abort: template filter 'escape' is not compatible with keyword 'date'
2536 [255]
2536 [255]
2537
2537
2538 $ hg log -l 3 --template 'line: {extras|localdate}\n'
2538 $ hg log -l 3 --template 'line: {extras|localdate}\n'
2539 hg: parse error: localdate expects a date information
2539 hg: parse error: localdate expects a date information
2540 [255]
2540 [255]
2541
2541
2542 Behind the scenes, this will throw ValueError
2542 Behind the scenes, this will throw ValueError
2543
2543
2544 $ hg tip --template '{author|email|date}\n'
2544 $ hg tip --template '{author|email|date}\n'
2545 hg: parse error: date expects a date information
2545 hg: parse error: date expects a date information
2546 [255]
2546 [255]
2547
2547
2548 Error in nested template:
2548 Error in nested template:
2549
2549
2550 $ hg log -T '{"date'
2550 $ hg log -T '{"date'
2551 hg: parse error at 2: unterminated string
2551 hg: parse error at 2: unterminated string
2552 [255]
2552 [255]
2553
2553
2554 $ hg log -T '{"foo{date|=}"}'
2554 $ hg log -T '{"foo{date|=}"}'
2555 hg: parse error at 11: syntax error
2555 hg: parse error at 11: syntax error
2556 [255]
2556 [255]
2557
2557
2558 Thrown an error if a template function doesn't exist
2558 Thrown an error if a template function doesn't exist
2559
2559
2560 $ hg tip --template '{foo()}\n'
2560 $ hg tip --template '{foo()}\n'
2561 hg: parse error: unknown function 'foo'
2561 hg: parse error: unknown function 'foo'
2562 [255]
2562 [255]
2563
2563
2564 Pass generator object created by template function to filter
2564 Pass generator object created by template function to filter
2565
2565
2566 $ hg log -l 1 --template '{if(author, author)|user}\n'
2566 $ hg log -l 1 --template '{if(author, author)|user}\n'
2567 test
2567 test
2568
2568
2569 Test diff function:
2569 Test diff function:
2570
2570
2571 $ hg diff -c 8
2571 $ hg diff -c 8
2572 diff -r 29114dbae42b -r 95c24699272e fourth
2572 diff -r 29114dbae42b -r 95c24699272e fourth
2573 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2573 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2574 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2574 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2575 @@ -0,0 +1,1 @@
2575 @@ -0,0 +1,1 @@
2576 +second
2576 +second
2577 diff -r 29114dbae42b -r 95c24699272e second
2577 diff -r 29114dbae42b -r 95c24699272e second
2578 --- a/second Mon Jan 12 13:46:40 1970 +0000
2578 --- a/second Mon Jan 12 13:46:40 1970 +0000
2579 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2579 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2580 @@ -1,1 +0,0 @@
2580 @@ -1,1 +0,0 @@
2581 -second
2581 -second
2582 diff -r 29114dbae42b -r 95c24699272e third
2582 diff -r 29114dbae42b -r 95c24699272e third
2583 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2583 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2584 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2584 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2585 @@ -0,0 +1,1 @@
2585 @@ -0,0 +1,1 @@
2586 +third
2586 +third
2587
2587
2588 $ hg log -r 8 -T "{diff()}"
2588 $ hg log -r 8 -T "{diff()}"
2589 diff -r 29114dbae42b -r 95c24699272e fourth
2589 diff -r 29114dbae42b -r 95c24699272e fourth
2590 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2590 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2591 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2591 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2592 @@ -0,0 +1,1 @@
2592 @@ -0,0 +1,1 @@
2593 +second
2593 +second
2594 diff -r 29114dbae42b -r 95c24699272e second
2594 diff -r 29114dbae42b -r 95c24699272e second
2595 --- a/second Mon Jan 12 13:46:40 1970 +0000
2595 --- a/second Mon Jan 12 13:46:40 1970 +0000
2596 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2596 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2597 @@ -1,1 +0,0 @@
2597 @@ -1,1 +0,0 @@
2598 -second
2598 -second
2599 diff -r 29114dbae42b -r 95c24699272e third
2599 diff -r 29114dbae42b -r 95c24699272e third
2600 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2600 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2601 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2601 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2602 @@ -0,0 +1,1 @@
2602 @@ -0,0 +1,1 @@
2603 +third
2603 +third
2604
2604
2605 $ hg log -r 8 -T "{diff('glob:f*')}"
2605 $ hg log -r 8 -T "{diff('glob:f*')}"
2606 diff -r 29114dbae42b -r 95c24699272e fourth
2606 diff -r 29114dbae42b -r 95c24699272e fourth
2607 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2607 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2608 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2608 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2609 @@ -0,0 +1,1 @@
2609 @@ -0,0 +1,1 @@
2610 +second
2610 +second
2611
2611
2612 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
2612 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
2613 diff -r 29114dbae42b -r 95c24699272e second
2613 diff -r 29114dbae42b -r 95c24699272e second
2614 --- a/second Mon Jan 12 13:46:40 1970 +0000
2614 --- a/second Mon Jan 12 13:46:40 1970 +0000
2615 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2615 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2616 @@ -1,1 +0,0 @@
2616 @@ -1,1 +0,0 @@
2617 -second
2617 -second
2618 diff -r 29114dbae42b -r 95c24699272e third
2618 diff -r 29114dbae42b -r 95c24699272e third
2619 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2619 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2620 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2620 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2621 @@ -0,0 +1,1 @@
2621 @@ -0,0 +1,1 @@
2622 +third
2622 +third
2623
2623
2624 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2624 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2625 diff -r 29114dbae42b -r 95c24699272e fourth
2625 diff -r 29114dbae42b -r 95c24699272e fourth
2626 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2626 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2627 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2627 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2628 @@ -0,0 +1,1 @@
2628 @@ -0,0 +1,1 @@
2629 +second
2629 +second
2630
2630
2631 $ cd ..
2631 $ cd ..
2632
2632
2633
2633
2634 latesttag:
2634 latesttag:
2635
2635
2636 $ hg init latesttag
2636 $ hg init latesttag
2637 $ cd latesttag
2637 $ cd latesttag
2638
2638
2639 $ echo a > file
2639 $ echo a > file
2640 $ hg ci -Am a -d '0 0'
2640 $ hg ci -Am a -d '0 0'
2641 adding file
2641 adding file
2642
2642
2643 $ echo b >> file
2643 $ echo b >> file
2644 $ hg ci -m b -d '1 0'
2644 $ hg ci -m b -d '1 0'
2645
2645
2646 $ echo c >> head1
2646 $ echo c >> head1
2647 $ hg ci -Am h1c -d '2 0'
2647 $ hg ci -Am h1c -d '2 0'
2648 adding head1
2648 adding head1
2649
2649
2650 $ hg update -q 1
2650 $ hg update -q 1
2651 $ echo d >> head2
2651 $ echo d >> head2
2652 $ hg ci -Am h2d -d '3 0'
2652 $ hg ci -Am h2d -d '3 0'
2653 adding head2
2653 adding head2
2654 created new head
2654 created new head
2655
2655
2656 $ echo e >> head2
2656 $ echo e >> head2
2657 $ hg ci -m h2e -d '4 0'
2657 $ hg ci -m h2e -d '4 0'
2658
2658
2659 $ hg merge -q
2659 $ hg merge -q
2660 $ hg ci -m merge -d '5 -3600'
2660 $ hg ci -m merge -d '5 -3600'
2661
2661
2662 No tag set:
2662 No tag set:
2663
2663
2664 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2664 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2665 5: null+5
2665 5: null+5
2666 4: null+4
2666 4: null+4
2667 3: null+3
2667 3: null+3
2668 2: null+3
2668 2: null+3
2669 1: null+2
2669 1: null+2
2670 0: null+1
2670 0: null+1
2671
2671
2672 One common tag: longest path wins:
2672 One common tag: longest path wins:
2673
2673
2674 $ hg tag -r 1 -m t1 -d '6 0' t1
2674 $ hg tag -r 1 -m t1 -d '6 0' t1
2675 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2675 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2676 6: t1+4
2676 6: t1+4
2677 5: t1+3
2677 5: t1+3
2678 4: t1+2
2678 4: t1+2
2679 3: t1+1
2679 3: t1+1
2680 2: t1+1
2680 2: t1+1
2681 1: t1+0
2681 1: t1+0
2682 0: null+1
2682 0: null+1
2683
2683
2684 One ancestor tag: more recent wins:
2684 One ancestor tag: more recent wins:
2685
2685
2686 $ hg tag -r 2 -m t2 -d '7 0' t2
2686 $ hg tag -r 2 -m t2 -d '7 0' t2
2687 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2687 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2688 7: t2+3
2688 7: t2+3
2689 6: t2+2
2689 6: t2+2
2690 5: t2+1
2690 5: t2+1
2691 4: t1+2
2691 4: t1+2
2692 3: t1+1
2692 3: t1+1
2693 2: t2+0
2693 2: t2+0
2694 1: t1+0
2694 1: t1+0
2695 0: null+1
2695 0: null+1
2696
2696
2697 Two branch tags: more recent wins:
2697 Two branch tags: more recent wins:
2698
2698
2699 $ hg tag -r 3 -m t3 -d '8 0' t3
2699 $ hg tag -r 3 -m t3 -d '8 0' t3
2700 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2700 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2701 8: t3+5
2701 8: t3+5
2702 7: t3+4
2702 7: t3+4
2703 6: t3+3
2703 6: t3+3
2704 5: t3+2
2704 5: t3+2
2705 4: t3+1
2705 4: t3+1
2706 3: t3+0
2706 3: t3+0
2707 2: t2+0
2707 2: t2+0
2708 1: t1+0
2708 1: t1+0
2709 0: null+1
2709 0: null+1
2710
2710
2711 Merged tag overrides:
2711 Merged tag overrides:
2712
2712
2713 $ hg tag -r 5 -m t5 -d '9 0' t5
2713 $ hg tag -r 5 -m t5 -d '9 0' t5
2714 $ hg tag -r 3 -m at3 -d '10 0' at3
2714 $ hg tag -r 3 -m at3 -d '10 0' at3
2715 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2715 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2716 10: t5+5
2716 10: t5+5
2717 9: t5+4
2717 9: t5+4
2718 8: t5+3
2718 8: t5+3
2719 7: t5+2
2719 7: t5+2
2720 6: t5+1
2720 6: t5+1
2721 5: t5+0
2721 5: t5+0
2722 4: at3:t3+1
2722 4: at3:t3+1
2723 3: at3:t3+0
2723 3: at3:t3+0
2724 2: t2+0
2724 2: t2+0
2725 1: t1+0
2725 1: t1+0
2726 0: null+1
2726 0: null+1
2727
2727
2728 $ hg log --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
2728 $ hg log --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
2729 10: t5+5,5
2729 10: t5+5,5
2730 9: t5+4,4
2730 9: t5+4,4
2731 8: t5+3,3
2731 8: t5+3,3
2732 7: t5+2,2
2732 7: t5+2,2
2733 6: t5+1,1
2733 6: t5+1,1
2734 5: t5+0,0
2734 5: t5+0,0
2735 4: at3+1,1 t3+1,1
2735 4: at3+1,1 t3+1,1
2736 3: at3+0,0 t3+0,0
2736 3: at3+0,0 t3+0,0
2737 2: t2+0,0
2737 2: t2+0,0
2738 1: t1+0,0
2738 1: t1+0,0
2739 0: null+1,1
2739 0: null+1,1
2740
2740
2741 $ hg log --template "{rev}: {latesttag('re:^t[13]$') % '{tag}, C: {changes}, D: {distance}'}\n"
2741 $ hg log --template "{rev}: {latesttag('re:^t[13]$') % '{tag}, C: {changes}, D: {distance}'}\n"
2742 10: t3, C: 8, D: 7
2742 10: t3, C: 8, D: 7
2743 9: t3, C: 7, D: 6
2743 9: t3, C: 7, D: 6
2744 8: t3, C: 6, D: 5
2744 8: t3, C: 6, D: 5
2745 7: t3, C: 5, D: 4
2745 7: t3, C: 5, D: 4
2746 6: t3, C: 4, D: 3
2746 6: t3, C: 4, D: 3
2747 5: t3, C: 3, D: 2
2747 5: t3, C: 3, D: 2
2748 4: t3, C: 1, D: 1
2748 4: t3, C: 1, D: 1
2749 3: t3, C: 0, D: 0
2749 3: t3, C: 0, D: 0
2750 2: t1, C: 1, D: 1
2750 2: t1, C: 1, D: 1
2751 1: t1, C: 0, D: 0
2751 1: t1, C: 0, D: 0
2752 0: null, C: 1, D: 1
2752 0: null, C: 1, D: 1
2753
2753
2754 $ cd ..
2754 $ cd ..
2755
2755
2756
2756
2757 Style path expansion: issue1948 - ui.style option doesn't work on OSX
2757 Style path expansion: issue1948 - ui.style option doesn't work on OSX
2758 if it is a relative path
2758 if it is a relative path
2759
2759
2760 $ mkdir -p home/styles
2760 $ mkdir -p home/styles
2761
2761
2762 $ cat > home/styles/teststyle <<EOF
2762 $ cat > home/styles/teststyle <<EOF
2763 > changeset = 'test {rev}:{node|short}\n'
2763 > changeset = 'test {rev}:{node|short}\n'
2764 > EOF
2764 > EOF
2765
2765
2766 $ HOME=`pwd`/home; export HOME
2766 $ HOME=`pwd`/home; export HOME
2767
2767
2768 $ cat > latesttag/.hg/hgrc <<EOF
2768 $ cat > latesttag/.hg/hgrc <<EOF
2769 > [ui]
2769 > [ui]
2770 > style = ~/styles/teststyle
2770 > style = ~/styles/teststyle
2771 > EOF
2771 > EOF
2772
2772
2773 $ hg -R latesttag tip
2773 $ hg -R latesttag tip
2774 test 10:9b4a630e5f5f
2774 test 10:9b4a630e5f5f
2775
2775
2776 Test recursive showlist template (issue1989):
2776 Test recursive showlist template (issue1989):
2777
2777
2778 $ cat > style1989 <<EOF
2778 $ cat > style1989 <<EOF
2779 > changeset = '{file_mods}{manifest}{extras}'
2779 > changeset = '{file_mods}{manifest}{extras}'
2780 > file_mod = 'M|{author|person}\n'
2780 > file_mod = 'M|{author|person}\n'
2781 > manifest = '{rev},{author}\n'
2781 > manifest = '{rev},{author}\n'
2782 > extra = '{key}: {author}\n'
2782 > extra = '{key}: {author}\n'
2783 > EOF
2783 > EOF
2784
2784
2785 $ hg -R latesttag log -r tip --style=style1989
2785 $ hg -R latesttag log -r tip --style=style1989
2786 M|test
2786 M|test
2787 10,test
2787 10,test
2788 branch: test
2788 branch: test
2789
2789
2790 Test new-style inline templating:
2790 Test new-style inline templating:
2791
2791
2792 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
2792 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
2793 modified files: .hgtags
2793 modified files: .hgtags
2794
2794
2795
2795
2796 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
2796 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
2797 hg: parse error: keyword 'rev' is not iterable
2797 hg: parse error: keyword 'rev' is not iterable
2798 [255]
2798 [255]
2799 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
2799 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
2800 hg: parse error: None is not iterable
2800 hg: parse error: None is not iterable
2801 [255]
2801 [255]
2802
2802
2803 Test the sub function of templating for expansion:
2803 Test the sub function of templating for expansion:
2804
2804
2805 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
2805 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
2806 xx
2806 xx
2807
2807
2808 $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n'
2808 $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n'
2809 hg: parse error: sub got an invalid pattern: [
2809 hg: parse error: sub got an invalid pattern: [
2810 [255]
2810 [255]
2811 $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n'
2811 $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n'
2812 hg: parse error: sub got an invalid replacement: \1
2812 hg: parse error: sub got an invalid replacement: \1
2813 [255]
2813 [255]
2814
2814
2815 Test the strip function with chars specified:
2815 Test the strip function with chars specified:
2816
2816
2817 $ hg log -R latesttag --template '{desc}\n'
2817 $ hg log -R latesttag --template '{desc}\n'
2818 at3
2818 at3
2819 t5
2819 t5
2820 t3
2820 t3
2821 t2
2821 t2
2822 t1
2822 t1
2823 merge
2823 merge
2824 h2e
2824 h2e
2825 h2d
2825 h2d
2826 h1c
2826 h1c
2827 b
2827 b
2828 a
2828 a
2829
2829
2830 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
2830 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
2831 at3
2831 at3
2832 5
2832 5
2833 3
2833 3
2834 2
2834 2
2835 1
2835 1
2836 merg
2836 merg
2837 h2
2837 h2
2838 h2d
2838 h2d
2839 h1c
2839 h1c
2840 b
2840 b
2841 a
2841 a
2842
2842
2843 Test date format:
2843 Test date format:
2844
2844
2845 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
2845 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
2846 date: 70 01 01 10 +0000
2846 date: 70 01 01 10 +0000
2847 date: 70 01 01 09 +0000
2847 date: 70 01 01 09 +0000
2848 date: 70 01 01 08 +0000
2848 date: 70 01 01 08 +0000
2849 date: 70 01 01 07 +0000
2849 date: 70 01 01 07 +0000
2850 date: 70 01 01 06 +0000
2850 date: 70 01 01 06 +0000
2851 date: 70 01 01 05 +0100
2851 date: 70 01 01 05 +0100
2852 date: 70 01 01 04 +0000
2852 date: 70 01 01 04 +0000
2853 date: 70 01 01 03 +0000
2853 date: 70 01 01 03 +0000
2854 date: 70 01 01 02 +0000
2854 date: 70 01 01 02 +0000
2855 date: 70 01 01 01 +0000
2855 date: 70 01 01 01 +0000
2856 date: 70 01 01 00 +0000
2856 date: 70 01 01 00 +0000
2857
2857
2858 Test invalid date:
2858 Test invalid date:
2859
2859
2860 $ hg log -R latesttag -T '{date(rev)}\n'
2860 $ hg log -R latesttag -T '{date(rev)}\n'
2861 hg: parse error: date expects a date information
2861 hg: parse error: date expects a date information
2862 [255]
2862 [255]
2863
2863
2864 Test integer literal:
2864 Test integer literal:
2865
2865
2866 $ hg debugtemplate -v '{(0)}\n'
2866 $ hg debugtemplate -v '{(0)}\n'
2867 (template
2867 (template
2868 (group
2868 (group
2869 ('integer', '0'))
2869 ('integer', '0'))
2870 ('string', '\n'))
2870 ('string', '\n'))
2871 0
2871 0
2872 $ hg debugtemplate -v '{(123)}\n'
2872 $ hg debugtemplate -v '{(123)}\n'
2873 (template
2873 (template
2874 (group
2874 (group
2875 ('integer', '123'))
2875 ('integer', '123'))
2876 ('string', '\n'))
2876 ('string', '\n'))
2877 123
2877 123
2878 $ hg debugtemplate -v '{(-4)}\n'
2878 $ hg debugtemplate -v '{(-4)}\n'
2879 (template
2879 (template
2880 (group
2880 (group
2881 ('integer', '-4'))
2881 ('integer', '-4'))
2882 ('string', '\n'))
2882 ('string', '\n'))
2883 -4
2883 -4
2884 $ hg debugtemplate '{(-)}\n'
2884 $ hg debugtemplate '{(-)}\n'
2885 hg: parse error at 2: integer literal without digits
2885 hg: parse error at 2: integer literal without digits
2886 [255]
2886 [255]
2887 $ hg debugtemplate '{(-a)}\n'
2887 $ hg debugtemplate '{(-a)}\n'
2888 hg: parse error at 2: integer literal without digits
2888 hg: parse error at 2: integer literal without digits
2889 [255]
2889 [255]
2890
2890
2891 top-level integer literal is interpreted as symbol (i.e. variable name):
2891 top-level integer literal is interpreted as symbol (i.e. variable name):
2892
2892
2893 $ hg debugtemplate -D 1=one -v '{1}\n'
2893 $ hg debugtemplate -D 1=one -v '{1}\n'
2894 (template
2894 (template
2895 ('integer', '1')
2895 ('integer', '1')
2896 ('string', '\n'))
2896 ('string', '\n'))
2897 one
2897 one
2898 $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n'
2898 $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n'
2899 (template
2899 (template
2900 (func
2900 (func
2901 ('symbol', 'if')
2901 ('symbol', 'if')
2902 (list
2902 (list
2903 ('string', 't')
2903 ('string', 't')
2904 (template
2904 (template
2905 ('integer', '1'))))
2905 ('integer', '1'))))
2906 ('string', '\n'))
2906 ('string', '\n'))
2907 one
2907 one
2908 $ hg debugtemplate -D 1=one -v '{1|stringify}\n'
2908 $ hg debugtemplate -D 1=one -v '{1|stringify}\n'
2909 (template
2909 (template
2910 (|
2910 (|
2911 ('integer', '1')
2911 ('integer', '1')
2912 ('symbol', 'stringify'))
2912 ('symbol', 'stringify'))
2913 ('string', '\n'))
2913 ('string', '\n'))
2914 one
2914 one
2915
2915
2916 unless explicit symbol is expected:
2916 unless explicit symbol is expected:
2917
2917
2918 $ hg log -Ra -r0 -T '{desc|1}\n'
2918 $ hg log -Ra -r0 -T '{desc|1}\n'
2919 hg: parse error: expected a symbol, got 'integer'
2919 hg: parse error: expected a symbol, got 'integer'
2920 [255]
2920 [255]
2921 $ hg log -Ra -r0 -T '{1()}\n'
2921 $ hg log -Ra -r0 -T '{1()}\n'
2922 hg: parse error: expected a symbol, got 'integer'
2922 hg: parse error: expected a symbol, got 'integer'
2923 [255]
2923 [255]
2924
2924
2925 Test string literal:
2925 Test string literal:
2926
2926
2927 $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n'
2927 $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n'
2928 (template
2928 (template
2929 ('string', 'string with no template fragment')
2929 ('string', 'string with no template fragment')
2930 ('string', '\n'))
2930 ('string', '\n'))
2931 string with no template fragment
2931 string with no template fragment
2932 $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n'
2932 $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n'
2933 (template
2933 (template
2934 (template
2934 (template
2935 ('string', 'template: ')
2935 ('string', 'template: ')
2936 ('symbol', 'rev'))
2936 ('symbol', 'rev'))
2937 ('string', '\n'))
2937 ('string', '\n'))
2938 template: 0
2938 template: 0
2939 $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n'
2939 $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n'
2940 (template
2940 (template
2941 ('string', 'rawstring: {rev}')
2941 ('string', 'rawstring: {rev}')
2942 ('string', '\n'))
2942 ('string', '\n'))
2943 rawstring: {rev}
2943 rawstring: {rev}
2944 $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n'
2944 $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n'
2945 (template
2945 (template
2946 (%
2946 (%
2947 ('symbol', 'files')
2947 ('symbol', 'files')
2948 ('string', 'rawstring: {file}'))
2948 ('string', 'rawstring: {file}'))
2949 ('string', '\n'))
2949 ('string', '\n'))
2950 rawstring: {file}
2950 rawstring: {file}
2951
2951
2952 Test string escaping:
2952 Test string escaping:
2953
2953
2954 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2954 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2955 >
2955 >
2956 <>\n<[>
2956 <>\n<[>
2957 <>\n<]>
2957 <>\n<]>
2958 <>\n<
2958 <>\n<
2959
2959
2960 $ hg log -R latesttag -r 0 \
2960 $ hg log -R latesttag -r 0 \
2961 > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2961 > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2962 >
2962 >
2963 <>\n<[>
2963 <>\n<[>
2964 <>\n<]>
2964 <>\n<]>
2965 <>\n<
2965 <>\n<
2966
2966
2967 $ hg log -R latesttag -r 0 -T esc \
2967 $ hg log -R latesttag -r 0 -T esc \
2968 > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2968 > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2969 >
2969 >
2970 <>\n<[>
2970 <>\n<[>
2971 <>\n<]>
2971 <>\n<]>
2972 <>\n<
2972 <>\n<
2973
2973
2974 $ cat <<'EOF' > esctmpl
2974 $ cat <<'EOF' > esctmpl
2975 > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2975 > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2976 > EOF
2976 > EOF
2977 $ hg log -R latesttag -r 0 --style ./esctmpl
2977 $ hg log -R latesttag -r 0 --style ./esctmpl
2978 >
2978 >
2979 <>\n<[>
2979 <>\n<[>
2980 <>\n<]>
2980 <>\n<]>
2981 <>\n<
2981 <>\n<
2982
2982
2983 Test string escaping of quotes:
2983 Test string escaping of quotes:
2984
2984
2985 $ hg log -Ra -r0 -T '{"\""}\n'
2985 $ hg log -Ra -r0 -T '{"\""}\n'
2986 "
2986 "
2987 $ hg log -Ra -r0 -T '{"\\\""}\n'
2987 $ hg log -Ra -r0 -T '{"\\\""}\n'
2988 \"
2988 \"
2989 $ hg log -Ra -r0 -T '{r"\""}\n'
2989 $ hg log -Ra -r0 -T '{r"\""}\n'
2990 \"
2990 \"
2991 $ hg log -Ra -r0 -T '{r"\\\""}\n'
2991 $ hg log -Ra -r0 -T '{r"\\\""}\n'
2992 \\\"
2992 \\\"
2993
2993
2994
2994
2995 $ hg log -Ra -r0 -T '{"\""}\n'
2995 $ hg log -Ra -r0 -T '{"\""}\n'
2996 "
2996 "
2997 $ hg log -Ra -r0 -T '{"\\\""}\n'
2997 $ hg log -Ra -r0 -T '{"\\\""}\n'
2998 \"
2998 \"
2999 $ hg log -Ra -r0 -T '{r"\""}\n'
2999 $ hg log -Ra -r0 -T '{r"\""}\n'
3000 \"
3000 \"
3001 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3001 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3002 \\\"
3002 \\\"
3003
3003
3004 Test exception in quoted template. single backslash before quotation mark is
3004 Test exception in quoted template. single backslash before quotation mark is
3005 stripped before parsing:
3005 stripped before parsing:
3006
3006
3007 $ cat <<'EOF' > escquotetmpl
3007 $ cat <<'EOF' > escquotetmpl
3008 > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n"
3008 > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n"
3009 > EOF
3009 > EOF
3010 $ cd latesttag
3010 $ cd latesttag
3011 $ hg log -r 2 --style ../escquotetmpl
3011 $ hg log -r 2 --style ../escquotetmpl
3012 " \" \" \\" head1
3012 " \" \" \\" head1
3013
3013
3014 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"'
3014 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"'
3015 valid
3015 valid
3016 $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'"
3016 $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'"
3017 valid
3017 valid
3018
3018
3019 Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested
3019 Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested
3020 _evalifliteral() templates (issue4733):
3020 _evalifliteral() templates (issue4733):
3021
3021
3022 $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n'
3022 $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n'
3023 "2
3023 "2
3024 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n'
3024 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n'
3025 "2
3025 "2
3026 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n'
3026 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n'
3027 "2
3027 "2
3028
3028
3029 $ hg log -r 2 -T '{if(rev, "\\\"")}\n'
3029 $ hg log -r 2 -T '{if(rev, "\\\"")}\n'
3030 \"
3030 \"
3031 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n'
3031 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n'
3032 \"
3032 \"
3033 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3033 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3034 \"
3034 \"
3035
3035
3036 $ hg log -r 2 -T '{if(rev, r"\\\"")}\n'
3036 $ hg log -r 2 -T '{if(rev, r"\\\"")}\n'
3037 \\\"
3037 \\\"
3038 $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n'
3038 $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n'
3039 \\\"
3039 \\\"
3040 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3040 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3041 \\\"
3041 \\\"
3042
3042
3043 escaped single quotes and errors:
3043 escaped single quotes and errors:
3044
3044
3045 $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n'
3045 $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n'
3046 foo
3046 foo
3047 $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n'
3047 $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n'
3048 foo
3048 foo
3049 $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n'
3049 $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n'
3050 hg: parse error at 21: unterminated string
3050 hg: parse error at 21: unterminated string
3051 [255]
3051 [255]
3052 $ hg log -r 2 -T '{if(rev, \"\\"")}\n'
3052 $ hg log -r 2 -T '{if(rev, \"\\"")}\n'
3053 hg: parse error: trailing \ in string
3053 hg: parse error: trailing \ in string
3054 [255]
3054 [255]
3055 $ hg log -r 2 -T '{if(rev, r\"\\"")}\n'
3055 $ hg log -r 2 -T '{if(rev, r\"\\"")}\n'
3056 hg: parse error: trailing \ in string
3056 hg: parse error: trailing \ in string
3057 [255]
3057 [255]
3058
3058
3059 $ cd ..
3059 $ cd ..
3060
3060
3061 Test leading backslashes:
3061 Test leading backslashes:
3062
3062
3063 $ cd latesttag
3063 $ cd latesttag
3064 $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n'
3064 $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n'
3065 {rev} {file}
3065 {rev} {file}
3066 $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n'
3066 $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n'
3067 \2 \head1
3067 \2 \head1
3068 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n'
3068 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n'
3069 \{rev} \{file}
3069 \{rev} \{file}
3070 $ cd ..
3070 $ cd ..
3071
3071
3072 Test leading backslashes in "if" expression (issue4714):
3072 Test leading backslashes in "if" expression (issue4714):
3073
3073
3074 $ cd latesttag
3074 $ cd latesttag
3075 $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n'
3075 $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n'
3076 {rev} \{rev}
3076 {rev} \{rev}
3077 $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n'
3077 $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n'
3078 \2 \\{rev}
3078 \2 \\{rev}
3079 $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n'
3079 $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n'
3080 \{rev} \\\{rev}
3080 \{rev} \\\{rev}
3081 $ cd ..
3081 $ cd ..
3082
3082
3083 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
3083 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
3084
3084
3085 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
3085 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
3086 \x6e
3086 \x6e
3087 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
3087 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
3088 \x5c\x786e
3088 \x5c\x786e
3089 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
3089 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
3090 \x6e
3090 \x6e
3091 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
3091 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
3092 \x5c\x786e
3092 \x5c\x786e
3093
3093
3094 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
3094 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
3095 \x6e
3095 \x6e
3096 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
3096 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
3097 \x5c\x786e
3097 \x5c\x786e
3098 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
3098 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
3099 \x6e
3099 \x6e
3100 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
3100 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
3101 \x5c\x786e
3101 \x5c\x786e
3102
3102
3103 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
3103 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
3104 fourth
3104 fourth
3105 second
3105 second
3106 third
3106 third
3107 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
3107 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
3108 fourth\nsecond\nthird
3108 fourth\nsecond\nthird
3109
3109
3110 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
3110 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
3111 <p>
3111 <p>
3112 1st
3112 1st
3113 </p>
3113 </p>
3114 <p>
3114 <p>
3115 2nd
3115 2nd
3116 </p>
3116 </p>
3117 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
3117 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
3118 <p>
3118 <p>
3119 1st\n\n2nd
3119 1st\n\n2nd
3120 </p>
3120 </p>
3121 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
3121 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
3122 1st
3122 1st
3123
3123
3124 2nd
3124 2nd
3125
3125
3126 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
3126 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
3127 o perso
3127 o perso
3128 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
3128 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
3129 no person
3129 no person
3130 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
3130 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
3131 o perso
3131 o perso
3132 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
3132 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
3133 no perso
3133 no perso
3134
3134
3135 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
3135 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
3136 -o perso-
3136 -o perso-
3137 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
3137 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
3138 no person
3138 no person
3139 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
3139 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
3140 \x2do perso\x2d
3140 \x2do perso\x2d
3141 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
3141 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
3142 -o perso-
3142 -o perso-
3143 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
3143 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
3144 \x2do perso\x6e
3144 \x2do perso\x6e
3145
3145
3146 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
3146 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
3147 fourth
3147 fourth
3148 second
3148 second
3149 third
3149 third
3150
3150
3151 Test string escaping in nested expression:
3151 Test string escaping in nested expression:
3152
3152
3153 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
3153 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
3154 fourth\x6esecond\x6ethird
3154 fourth\x6esecond\x6ethird
3155 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
3155 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
3156 fourth\x6esecond\x6ethird
3156 fourth\x6esecond\x6ethird
3157
3157
3158 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
3158 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
3159 fourth\x6esecond\x6ethird
3159 fourth\x6esecond\x6ethird
3160 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
3160 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
3161 fourth\x5c\x786esecond\x5c\x786ethird
3161 fourth\x5c\x786esecond\x5c\x786ethird
3162
3162
3163 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
3163 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
3164 3:\x6eo user, \x6eo domai\x6e
3164 3:\x6eo user, \x6eo domai\x6e
3165 4:\x5c\x786eew bra\x5c\x786ech
3165 4:\x5c\x786eew bra\x5c\x786ech
3166
3166
3167 Test quotes in nested expression are evaluated just like a $(command)
3167 Test quotes in nested expression are evaluated just like a $(command)
3168 substitution in POSIX shells:
3168 substitution in POSIX shells:
3169
3169
3170 $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n'
3170 $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n'
3171 8:95c24699272e
3171 8:95c24699272e
3172 $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n'
3172 $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n'
3173 {8} "95c24699272e"
3173 {8} "95c24699272e"
3174
3174
3175 Test recursive evaluation:
3175 Test recursive evaluation:
3176
3176
3177 $ hg init r
3177 $ hg init r
3178 $ cd r
3178 $ cd r
3179 $ echo a > a
3179 $ echo a > a
3180 $ hg ci -Am '{rev}'
3180 $ hg ci -Am '{rev}'
3181 adding a
3181 adding a
3182 $ hg log -r 0 --template '{if(rev, desc)}\n'
3182 $ hg log -r 0 --template '{if(rev, desc)}\n'
3183 {rev}
3183 {rev}
3184 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
3184 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
3185 test 0
3185 test 0
3186
3186
3187 $ hg branch -q 'text.{rev}'
3187 $ hg branch -q 'text.{rev}'
3188 $ echo aa >> aa
3188 $ echo aa >> aa
3189 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
3189 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
3190
3190
3191 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
3191 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
3192 {node|short}desc to
3192 {node|short}desc to
3193 text.{rev}be wrapped
3193 text.{rev}be wrapped
3194 text.{rev}desc to be
3194 text.{rev}desc to be
3195 text.{rev}wrapped (no-eol)
3195 text.{rev}wrapped (no-eol)
3196 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
3196 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
3197 bcc7ff960b8e:desc to
3197 bcc7ff960b8e:desc to
3198 text.1:be wrapped
3198 text.1:be wrapped
3199 text.1:desc to be
3199 text.1:desc to be
3200 text.1:wrapped (no-eol)
3200 text.1:wrapped (no-eol)
3201 $ hg log -l1 -T '{fill(desc, date, "", "")}\n'
3201 $ hg log -l1 -T '{fill(desc, date, "", "")}\n'
3202 hg: parse error: fill expects an integer width
3202 hg: parse error: fill expects an integer width
3203 [255]
3203 [255]
3204
3204
3205 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3205 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3206 {node|short} (no-eol)
3206 {node|short} (no-eol)
3207 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
3207 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
3208 bcc-ff---b-e (no-eol)
3208 bcc-ff---b-e (no-eol)
3209
3209
3210 $ cat >> .hg/hgrc <<EOF
3210 $ cat >> .hg/hgrc <<EOF
3211 > [extensions]
3211 > [extensions]
3212 > color=
3212 > color=
3213 > [color]
3213 > [color]
3214 > mode=ansi
3214 > mode=ansi
3215 > text.{rev} = red
3215 > text.{rev} = red
3216 > text.1 = green
3216 > text.1 = green
3217 > EOF
3217 > EOF
3218 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
3218 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
3219 \x1b[0;31mtext\x1b[0m (esc)
3219 \x1b[0;31mtext\x1b[0m (esc)
3220 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
3220 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
3221 \x1b[0;32mtext\x1b[0m (esc)
3221 \x1b[0;32mtext\x1b[0m (esc)
3222
3222
3223 color effect can be specified without quoting:
3223 color effect can be specified without quoting:
3224
3224
3225 $ hg log --color=always -l 1 --template '{label(red, "text\n")}'
3225 $ hg log --color=always -l 1 --template '{label(red, "text\n")}'
3226 \x1b[0;31mtext\x1b[0m (esc)
3226 \x1b[0;31mtext\x1b[0m (esc)
3227
3227
3228 label should be no-op if color is disabled:
3228 label should be no-op if color is disabled:
3229
3229
3230 $ hg log --color=never -l 1 --template '{label(red, "text\n")}'
3230 $ hg log --color=never -l 1 --template '{label(red, "text\n")}'
3231 text
3231 text
3232 $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}'
3232 $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}'
3233 text
3233 text
3234
3234
3235 Test branches inside if statement:
3235 Test branches inside if statement:
3236
3236
3237 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
3237 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
3238 no
3238 no
3239
3239
3240 Test get function:
3240 Test get function:
3241
3241
3242 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3242 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3243 default
3243 default
3244 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
3244 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
3245 default
3245 default
3246 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3246 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3247 hg: parse error: get() expects a dict as first argument
3247 hg: parse error: get() expects a dict as first argument
3248 [255]
3248 [255]
3249
3249
3250 Test localdate(date, tz) function:
3250 Test localdate(date, tz) function:
3251
3251
3252 $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
3252 $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
3253 1970-01-01 09:00 +0900
3253 1970-01-01 09:00 +0900
3254 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n'
3254 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n'
3255 1970-01-01 00:00 +0000
3255 1970-01-01 00:00 +0000
3256 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n'
3256 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n'
3257 1970-01-01 02:00 +0200
3257 1970-01-01 02:00 +0200
3258 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n'
3258 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n'
3259 1970-01-01 00:00 +0000
3259 1970-01-01 00:00 +0000
3260 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n'
3260 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n'
3261 1970-01-01 00:00 +0000
3261 1970-01-01 00:00 +0000
3262 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n'
3262 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n'
3263 hg: parse error: localdate expects a timezone
3263 hg: parse error: localdate expects a timezone
3264 [255]
3264 [255]
3265 $ hg log -r0 -T '{localdate(date, date)|isodate}\n'
3265 $ hg log -r0 -T '{localdate(date, date)|isodate}\n'
3266 hg: parse error: localdate expects a timezone
3266 hg: parse error: localdate expects a timezone
3267 [255]
3267 [255]
3268
3268
3269 Test shortest(node) function:
3269 Test shortest(node) function:
3270
3270
3271 $ echo b > b
3271 $ echo b > b
3272 $ hg ci -qAm b
3272 $ hg ci -qAm b
3273 $ hg log --template '{shortest(node)}\n'
3273 $ hg log --template '{shortest(node)}\n'
3274 e777
3274 e777
3275 bcc7
3275 bcc7
3276 f776
3276 f776
3277 $ hg log --template '{shortest(node, 10)}\n'
3277 $ hg log --template '{shortest(node, 10)}\n'
3278 e777603221
3278 e777603221
3279 bcc7ff960b
3279 bcc7ff960b
3280 f7769ec2ab
3280 f7769ec2ab
3281 $ hg log --template '{node|shortest}\n' -l1
3281 $ hg log --template '{node|shortest}\n' -l1
3282 e777
3282 e777
3283
3283
3284 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
3284 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
3285 f7769ec2ab
3285 f7769ec2ab
3286 $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
3286 $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
3287 hg: parse error: shortest() expects an integer minlength
3287 hg: parse error: shortest() expects an integer minlength
3288 [255]
3288 [255]
3289
3289
3290 Test pad function
3290 Test pad function
3291
3291
3292 $ hg log --template '{pad(rev, 20)} {author|user}\n'
3292 $ hg log --template '{pad(rev, 20)} {author|user}\n'
3293 2 test
3293 2 test
3294 1 {node|short}
3294 1 {node|short}
3295 0 test
3295 0 test
3296
3296
3297 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
3297 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
3298 2 test
3298 2 test
3299 1 {node|short}
3299 1 {node|short}
3300 0 test
3300 0 test
3301
3301
3302 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
3302 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
3303 2------------------- test
3303 2------------------- test
3304 1------------------- {node|short}
3304 1------------------- {node|short}
3305 0------------------- test
3305 0------------------- test
3306
3306
3307 Test template string in pad function
3307 Test template string in pad function
3308
3308
3309 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
3309 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
3310 {0} test
3310 {0} test
3311
3311
3312 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
3312 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
3313 \{rev} test
3313 \{rev} test
3314
3314
3315 Test width argument passed to pad function
3315 Test width argument passed to pad function
3316
3316
3317 $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n'
3317 $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n'
3318 0 test
3318 0 test
3319 $ hg log -r 0 -T '{pad(rev, "not an int")}\n'
3319 $ hg log -r 0 -T '{pad(rev, "not an int")}\n'
3320 hg: parse error: pad() expects an integer width
3320 hg: parse error: pad() expects an integer width
3321 [255]
3321 [255]
3322
3322
3323 Test ifcontains function
3323 Test ifcontains function
3324
3324
3325 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
3325 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
3326 2 is in the string
3326 2 is in the string
3327 1 is not
3327 1 is not
3328 0 is in the string
3328 0 is in the string
3329
3329
3330 $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n'
3330 $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n'
3331 2 is in the string
3331 2 is in the string
3332 1 is not
3332 1 is not
3333 0 is in the string
3333 0 is in the string
3334
3334
3335 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
3335 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
3336 2 did not add a
3336 2 did not add a
3337 1 did not add a
3337 1 did not add a
3338 0 added a
3338 0 added a
3339
3339
3340 $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
3340 $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
3341 2 is parent of 1
3341 2 is parent of 1
3342 1
3342 1
3343 0
3343 0
3344
3344
3345 Test revset function
3345 Test revset function
3346
3346
3347 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
3347 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
3348 2 current rev
3348 2 current rev
3349 1 not current rev
3349 1 not current rev
3350 0 not current rev
3350 0 not current rev
3351
3351
3352 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
3352 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
3353 2 match rev
3353 2 match rev
3354 1 match rev
3354 1 match rev
3355 0 not match rev
3355 0 not match rev
3356
3356
3357 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
3357 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
3358 2 Parents: 1
3358 2 Parents: 1
3359 1 Parents: 0
3359 1 Parents: 0
3360 0 Parents:
3360 0 Parents:
3361
3361
3362 $ cat >> .hg/hgrc <<EOF
3362 $ cat >> .hg/hgrc <<EOF
3363 > [revsetalias]
3363 > [revsetalias]
3364 > myparents(\$1) = parents(\$1)
3364 > myparents(\$1) = parents(\$1)
3365 > EOF
3365 > EOF
3366 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
3366 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
3367 2 Parents: 1
3367 2 Parents: 1
3368 1 Parents: 0
3368 1 Parents: 0
3369 0 Parents:
3369 0 Parents:
3370
3370
3371 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
3371 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
3372 Rev: 2
3372 Rev: 2
3373 Ancestor: 0
3373 Ancestor: 0
3374 Ancestor: 1
3374 Ancestor: 1
3375 Ancestor: 2
3375 Ancestor: 2
3376
3376
3377 Rev: 1
3377 Rev: 1
3378 Ancestor: 0
3378 Ancestor: 0
3379 Ancestor: 1
3379 Ancestor: 1
3380
3380
3381 Rev: 0
3381 Rev: 0
3382 Ancestor: 0
3382 Ancestor: 0
3383
3383
3384 $ hg log --template '{revset("TIP"|lower)}\n' -l1
3384 $ hg log --template '{revset("TIP"|lower)}\n' -l1
3385 2
3385 2
3386
3386
3387 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1
3387 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1
3388 2
3388 2
3389
3389
3390 a list template is evaluated for each item of revset/parents
3390 a list template is evaluated for each item of revset/parents
3391
3391
3392 $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
3392 $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
3393 2 p: 1:bcc7ff960b8e
3393 2 p: 1:bcc7ff960b8e
3394 1 p: 0:f7769ec2ab97
3394 1 p: 0:f7769ec2ab97
3395 0 p:
3395 0 p:
3396
3396
3397 $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
3397 $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
3398 2 p: 1:bcc7ff960b8e -1:000000000000
3398 2 p: 1:bcc7ff960b8e -1:000000000000
3399 1 p: 0:f7769ec2ab97 -1:000000000000
3399 1 p: 0:f7769ec2ab97 -1:000000000000
3400 0 p: -1:000000000000 -1:000000000000
3400 0 p: -1:000000000000 -1:000000000000
3401
3401
3402 therefore, 'revcache' should be recreated for each rev
3402 therefore, 'revcache' should be recreated for each rev
3403
3403
3404 $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
3404 $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
3405 2 aa b
3405 2 aa b
3406 p
3406 p
3407 1
3407 1
3408 p a
3408 p a
3409 0 a
3409 0 a
3410 p
3410 p
3411
3411
3412 $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
3412 $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
3413 2 aa b
3413 2 aa b
3414 p
3414 p
3415 1
3415 1
3416 p a
3416 p a
3417 0 a
3417 0 a
3418 p
3418 p
3419
3419
3420 a revset item must be evaluated as an integer revision, not an offset from tip
3420 a revset item must be evaluated as an integer revision, not an offset from tip
3421
3421
3422 $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'
3422 $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'
3423 -1:000000000000
3423 -1:000000000000
3424 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n'
3424 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n'
3425 -1:000000000000
3425 -1:000000000000
3426
3426
3427 Test active bookmark templating
3427 Test active bookmark templating
3428
3428
3429 $ hg book foo
3429 $ hg book foo
3430 $ hg book bar
3430 $ hg book bar
3431 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
3431 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
3432 2 bar* foo
3432 2 bar* foo
3433 1
3433 1
3434 0
3434 0
3435 $ hg log --template "{rev} {activebookmark}\n"
3435 $ hg log --template "{rev} {activebookmark}\n"
3436 2 bar
3436 2 bar
3437 1
3437 1
3438 0
3438 0
3439 $ hg bookmarks --inactive bar
3439 $ hg bookmarks --inactive bar
3440 $ hg log --template "{rev} {activebookmark}\n"
3440 $ hg log --template "{rev} {activebookmark}\n"
3441 2
3441 2
3442 1
3442 1
3443 0
3443 0
3444 $ hg book -r1 baz
3444 $ hg book -r1 baz
3445 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
3445 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
3446 2 bar foo
3446 2 bar foo
3447 1 baz
3447 1 baz
3448 0
3448 0
3449 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
3449 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
3450 2 t
3450 2 t
3451 1 f
3451 1 f
3452 0 f
3452 0 f
3453
3453
3454 Test namespaces dict
3454 Test namespaces dict
3455
3455
3456 $ hg log -T '{rev}{namespaces % " {namespace}={join(names, ",")}"}\n'
3456 $ hg log -T '{rev}{namespaces % " {namespace}={join(names, ",")}"}\n'
3457 2 bookmarks=bar,foo tags=tip branches=text.{rev}
3457 2 bookmarks=bar,foo tags=tip branches=text.{rev}
3458 1 bookmarks=baz tags= branches=text.{rev}
3458 1 bookmarks=baz tags= branches=text.{rev}
3459 0 bookmarks= tags= branches=default
3459 0 bookmarks= tags= branches=default
3460 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}'
3460 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}'
3461 bookmarks: bar foo
3461 bookmarks: bar foo
3462 tags: tip
3462 tags: tip
3463 branches: text.{rev}
3463 branches: text.{rev}
3464 $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}'
3464 $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}'
3465 bookmarks:
3465 bookmarks:
3466 bar
3466 bar
3467 foo
3467 foo
3468 tags:
3468 tags:
3469 tip
3469 tip
3470 branches:
3470 branches:
3471 text.{rev}
3471 text.{rev}
3472 $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}'
3472 $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}'
3473 bar
3473 bar
3474 foo
3474 foo
3475
3475
3476 Test stringify on sub expressions
3476 Test stringify on sub expressions
3477
3477
3478 $ cd ..
3478 $ cd ..
3479 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
3479 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
3480 fourth, second, third
3480 fourth, second, third
3481 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
3481 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
3482 abc
3482 abc
3483
3483
3484 Test splitlines
3484 Test splitlines
3485
3485
3486 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
3486 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
3487 @ foo Modify, add, remove, rename
3487 @ foo Modify, add, remove, rename
3488 |
3488 |
3489 o foo future
3489 o foo future
3490 |
3490 |
3491 o foo third
3491 o foo third
3492 |
3492 |
3493 o foo second
3493 o foo second
3494
3494
3495 o foo merge
3495 o foo merge
3496 |\
3496 |\
3497 | o foo new head
3497 | o foo new head
3498 | |
3498 | |
3499 o | foo new branch
3499 o | foo new branch
3500 |/
3500 |/
3501 o foo no user, no domain
3501 o foo no user, no domain
3502 |
3502 |
3503 o foo no person
3503 o foo no person
3504 |
3504 |
3505 o foo other 1
3505 o foo other 1
3506 | foo other 2
3506 | foo other 2
3507 | foo
3507 | foo
3508 | foo other 3
3508 | foo other 3
3509 o foo line 1
3509 o foo line 1
3510 foo line 2
3510 foo line 2
3511
3511
3512 Test startswith
3512 Test startswith
3513 $ hg log -Gv -R a --template "{startswith(desc)}"
3513 $ hg log -Gv -R a --template "{startswith(desc)}"
3514 hg: parse error: startswith expects two arguments
3514 hg: parse error: startswith expects two arguments
3515 [255]
3515 [255]
3516
3516
3517 $ hg log -Gv -R a --template "{startswith('line', desc)}"
3517 $ hg log -Gv -R a --template "{startswith('line', desc)}"
3518 @
3518 @
3519 |
3519 |
3520 o
3520 o
3521 |
3521 |
3522 o
3522 o
3523 |
3523 |
3524 o
3524 o
3525
3525
3526 o
3526 o
3527 |\
3527 |\
3528 | o
3528 | o
3529 | |
3529 | |
3530 o |
3530 o |
3531 |/
3531 |/
3532 o
3532 o
3533 |
3533 |
3534 o
3534 o
3535 |
3535 |
3536 o
3536 o
3537 |
3537 |
3538 o line 1
3538 o line 1
3539 line 2
3539 line 2
3540
3540
3541 Test bad template with better error message
3541 Test bad template with better error message
3542
3542
3543 $ hg log -Gv -R a --template '{desc|user()}'
3543 $ hg log -Gv -R a --template '{desc|user()}'
3544 hg: parse error: expected a symbol, got 'func'
3544 hg: parse error: expected a symbol, got 'func'
3545 [255]
3545 [255]
3546
3546
3547 Test word function (including index out of bounds graceful failure)
3547 Test word function (including index out of bounds graceful failure)
3548
3548
3549 $ hg log -Gv -R a --template "{word('1', desc)}"
3549 $ hg log -Gv -R a --template "{word('1', desc)}"
3550 @ add,
3550 @ add,
3551 |
3551 |
3552 o
3552 o
3553 |
3553 |
3554 o
3554 o
3555 |
3555 |
3556 o
3556 o
3557
3557
3558 o
3558 o
3559 |\
3559 |\
3560 | o head
3560 | o head
3561 | |
3561 | |
3562 o | branch
3562 o | branch
3563 |/
3563 |/
3564 o user,
3564 o user,
3565 |
3565 |
3566 o person
3566 o person
3567 |
3567 |
3568 o 1
3568 o 1
3569 |
3569 |
3570 o 1
3570 o 1
3571
3571
3572
3572
3573 Test word third parameter used as splitter
3573 Test word third parameter used as splitter
3574
3574
3575 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
3575 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
3576 @ M
3576 @ M
3577 |
3577 |
3578 o future
3578 o future
3579 |
3579 |
3580 o third
3580 o third
3581 |
3581 |
3582 o sec
3582 o sec
3583
3583
3584 o merge
3584 o merge
3585 |\
3585 |\
3586 | o new head
3586 | o new head
3587 | |
3587 | |
3588 o | new branch
3588 o | new branch
3589 |/
3589 |/
3590 o n
3590 o n
3591 |
3591 |
3592 o n
3592 o n
3593 |
3593 |
3594 o
3594 o
3595 |
3595 |
3596 o line 1
3596 o line 1
3597 line 2
3597 line 2
3598
3598
3599 Test word error messages for not enough and too many arguments
3599 Test word error messages for not enough and too many arguments
3600
3600
3601 $ hg log -Gv -R a --template "{word('0')}"
3601 $ hg log -Gv -R a --template "{word('0')}"
3602 hg: parse error: word expects two or three arguments, got 1
3602 hg: parse error: word expects two or three arguments, got 1
3603 [255]
3603 [255]
3604
3604
3605 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
3605 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
3606 hg: parse error: word expects two or three arguments, got 7
3606 hg: parse error: word expects two or three arguments, got 7
3607 [255]
3607 [255]
3608
3608
3609 Test word for integer literal
3609 Test word for integer literal
3610
3610
3611 $ hg log -R a --template "{word(2, desc)}\n" -r0
3611 $ hg log -R a --template "{word(2, desc)}\n" -r0
3612 line
3612 line
3613
3613
3614 Test word for invalid numbers
3614 Test word for invalid numbers
3615
3615
3616 $ hg log -Gv -R a --template "{word('a', desc)}"
3616 $ hg log -Gv -R a --template "{word('a', desc)}"
3617 hg: parse error: word expects an integer index
3617 hg: parse error: word expects an integer index
3618 [255]
3618 [255]
3619
3619
3620 Test word for out of range
3620 Test word for out of range
3621
3621
3622 $ hg log -R a --template "{word(10000, desc)}"
3622 $ hg log -R a --template "{word(10000, desc)}"
3623 $ hg log -R a --template "{word(-10000, desc)}"
3623 $ hg log -R a --template "{word(-10000, desc)}"
3624
3624
3625 Test indent and not adding to empty lines
3625 Test indent and not adding to empty lines
3626
3626
3627 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
3627 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
3628 -----
3628 -----
3629 > line 1
3629 > line 1
3630 >> line 2
3630 >> line 2
3631 -----
3631 -----
3632 > other 1
3632 > other 1
3633 >> other 2
3633 >> other 2
3634
3634
3635 >> other 3
3635 >> other 3
3636
3636
3637 Test with non-strings like dates
3637 Test with non-strings like dates
3638
3638
3639 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
3639 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
3640 1200000.00
3640 1200000.00
3641 1300000.00
3641 1300000.00
3642
3642
3643 Test broken string escapes:
3643 Test broken string escapes:
3644
3644
3645 $ hg log -T "bogus\\" -R a
3645 $ hg log -T "bogus\\" -R a
3646 hg: parse error: trailing \ in string
3646 hg: parse error: trailing \ in string
3647 [255]
3647 [255]
3648 $ hg log -T "\\xy" -R a
3648 $ hg log -T "\\xy" -R a
3649 hg: parse error: invalid \x escape
3649 hg: parse error: invalid \x escape
3650 [255]
3650 [255]
3651
3651
3652 json filter should escape HTML tags so that the output can be embedded in hgweb:
3652 json filter should escape HTML tags so that the output can be embedded in hgweb:
3653
3653
3654 $ hg log -T "{'<foo@example.org>'|json}\n" -R a -l1
3654 $ hg log -T "{'<foo@example.org>'|json}\n" -R a -l1
3655 "\u003cfoo@example.org\u003e"
3655 "\u003cfoo@example.org\u003e"
3656
3656
3657 Templater supports aliases of symbol and func() styles:
3657 Templater supports aliases of symbol and func() styles:
3658
3658
3659 $ hg clone -q a aliases
3659 $ hg clone -q a aliases
3660 $ cd aliases
3660 $ cd aliases
3661 $ cat <<EOF >> .hg/hgrc
3661 $ cat <<EOF >> .hg/hgrc
3662 > [templatealias]
3662 > [templatealias]
3663 > r = rev
3663 > r = rev
3664 > rn = "{r}:{node|short}"
3664 > rn = "{r}:{node|short}"
3665 > status(c, files) = files % "{c} {file}\n"
3665 > status(c, files) = files % "{c} {file}\n"
3666 > utcdate(d) = localdate(d, "UTC")
3666 > utcdate(d) = localdate(d, "UTC")
3667 > EOF
3667 > EOF
3668
3668
3669 $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n'
3669 $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n'
3670 (template
3670 (template
3671 ('symbol', 'rn')
3671 ('symbol', 'rn')
3672 ('string', ' ')
3672 ('string', ' ')
3673 (|
3673 (|
3674 (func
3674 (func
3675 ('symbol', 'utcdate')
3675 ('symbol', 'utcdate')
3676 ('symbol', 'date'))
3676 ('symbol', 'date'))
3677 ('symbol', 'isodate'))
3677 ('symbol', 'isodate'))
3678 ('string', '\n'))
3678 ('string', '\n'))
3679 * expanded:
3679 * expanded:
3680 (template
3680 (template
3681 (template
3681 (template
3682 ('symbol', 'rev')
3682 ('symbol', 'rev')
3683 ('string', ':')
3683 ('string', ':')
3684 (|
3684 (|
3685 ('symbol', 'node')
3685 ('symbol', 'node')
3686 ('symbol', 'short')))
3686 ('symbol', 'short')))
3687 ('string', ' ')
3687 ('string', ' ')
3688 (|
3688 (|
3689 (func
3689 (func
3690 ('symbol', 'localdate')
3690 ('symbol', 'localdate')
3691 (list
3691 (list
3692 ('symbol', 'date')
3692 ('symbol', 'date')
3693 ('string', 'UTC')))
3693 ('string', 'UTC')))
3694 ('symbol', 'isodate'))
3694 ('symbol', 'isodate'))
3695 ('string', '\n'))
3695 ('string', '\n'))
3696 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
3696 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
3697
3697
3698 $ hg debugtemplate -vr0 '{status("A", file_adds)}'
3698 $ hg debugtemplate -vr0 '{status("A", file_adds)}'
3699 (template
3699 (template
3700 (func
3700 (func
3701 ('symbol', 'status')
3701 ('symbol', 'status')
3702 (list
3702 (list
3703 ('string', 'A')
3703 ('string', 'A')
3704 ('symbol', 'file_adds'))))
3704 ('symbol', 'file_adds'))))
3705 * expanded:
3705 * expanded:
3706 (template
3706 (template
3707 (%
3707 (%
3708 ('symbol', 'file_adds')
3708 ('symbol', 'file_adds')
3709 (template
3709 (template
3710 ('string', 'A')
3710 ('string', 'A')
3711 ('string', ' ')
3711 ('string', ' ')
3712 ('symbol', 'file')
3712 ('symbol', 'file')
3713 ('string', '\n'))))
3713 ('string', '\n'))))
3714 A a
3714 A a
3715
3715
3716 A unary function alias can be called as a filter:
3716 A unary function alias can be called as a filter:
3717
3717
3718 $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n'
3718 $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n'
3719 (template
3719 (template
3720 (|
3720 (|
3721 (|
3721 (|
3722 ('symbol', 'date')
3722 ('symbol', 'date')
3723 ('symbol', 'utcdate'))
3723 ('symbol', 'utcdate'))
3724 ('symbol', 'isodate'))
3724 ('symbol', 'isodate'))
3725 ('string', '\n'))
3725 ('string', '\n'))
3726 * expanded:
3726 * expanded:
3727 (template
3727 (template
3728 (|
3728 (|
3729 (func
3729 (func
3730 ('symbol', 'localdate')
3730 ('symbol', 'localdate')
3731 (list
3731 (list
3732 ('symbol', 'date')
3732 ('symbol', 'date')
3733 ('string', 'UTC')))
3733 ('string', 'UTC')))
3734 ('symbol', 'isodate'))
3734 ('symbol', 'isodate'))
3735 ('string', '\n'))
3735 ('string', '\n'))
3736 1970-01-12 13:46 +0000
3736 1970-01-12 13:46 +0000
3737
3737
3738 Aliases should be applied only to command arguments and templates in hgrc.
3738 Aliases should be applied only to command arguments and templates in hgrc.
3739 Otherwise, our stock styles and web templates could be corrupted:
3739 Otherwise, our stock styles and web templates could be corrupted:
3740
3740
3741 $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n'
3741 $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n'
3742 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
3742 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
3743
3743
3744 $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"'
3744 $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"'
3745 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
3745 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
3746
3746
3747 $ cat <<EOF > tmpl
3747 $ cat <<EOF > tmpl
3748 > changeset = 'nothing expanded:{rn}\n'
3748 > changeset = 'nothing expanded:{rn}\n'
3749 > EOF
3749 > EOF
3750 $ hg log -r0 --style ./tmpl
3750 $ hg log -r0 --style ./tmpl
3751 nothing expanded:
3751 nothing expanded:
3752
3752
3753 Aliases in formatter:
3753 Aliases in formatter:
3754
3754
3755 $ hg branches -T '{pad(branch, 7)} {rn}\n'
3755 $ hg branches -T '{pad(branch, 7)} {rn}\n'
3756 default 6:d41e714fe50d
3756 default 6:d41e714fe50d
3757 foo 4:bbe44766e73d
3757 foo 4:bbe44766e73d
3758
3758
3759 Aliases should honor HGPLAIN:
3759 Aliases should honor HGPLAIN:
3760
3760
3761 $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n'
3761 $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n'
3762 nothing expanded:
3762 nothing expanded:
3763 $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n'
3763 $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n'
3764 0:1e4e1b8f71e0
3764 0:1e4e1b8f71e0
3765
3765
3766 Unparsable alias:
3766 Unparsable alias:
3767
3767
3768 $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}'
3768 $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}'
3769 (template
3769 (template
3770 ('symbol', 'bad'))
3770 ('symbol', 'bad'))
3771 abort: failed to parse the definition of template alias "bad": at 2: not a prefix: end
3771 abort: bad definition of template alias "bad": at 2: not a prefix: end
3772 [255]
3772 [255]
3773 $ hg log --config templatealias.bad='x(' -T '{bad}'
3773 $ hg log --config templatealias.bad='x(' -T '{bad}'
3774 abort: failed to parse the definition of template alias "bad": at 2: not a prefix: end
3774 abort: bad definition of template alias "bad": at 2: not a prefix: end
3775 [255]
3775 [255]
3776
3776
3777 $ cd ..
3777 $ cd ..
3778
3778
3779 Set up repository for non-ascii encoding tests:
3779 Set up repository for non-ascii encoding tests:
3780
3780
3781 $ hg init nonascii
3781 $ hg init nonascii
3782 $ cd nonascii
3782 $ cd nonascii
3783 $ python <<EOF
3783 $ python <<EOF
3784 > open('latin1', 'w').write('\xe9')
3784 > open('latin1', 'w').write('\xe9')
3785 > open('utf-8', 'w').write('\xc3\xa9')
3785 > open('utf-8', 'w').write('\xc3\xa9')
3786 > EOF
3786 > EOF
3787 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
3787 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
3788 $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8
3788 $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8
3789
3789
3790 json filter should try round-trip conversion to utf-8:
3790 json filter should try round-trip conversion to utf-8:
3791
3791
3792 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
3792 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
3793 "\u00e9"
3793 "\u00e9"
3794 $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0
3794 $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0
3795 "non-ascii branch: \u00e9"
3795 "non-ascii branch: \u00e9"
3796
3796
3797 json filter takes input as utf-8b:
3797 json filter takes input as utf-8b:
3798
3798
3799 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
3799 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
3800 "\u00e9"
3800 "\u00e9"
3801 $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1
3801 $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1
3802 "\udce9"
3802 "\udce9"
3803
3803
3804 utf8 filter:
3804 utf8 filter:
3805
3805
3806 $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0
3806 $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0
3807 round-trip: c3a9
3807 round-trip: c3a9
3808 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1
3808 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1
3809 decoded: c3a9
3809 decoded: c3a9
3810 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1
3810 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1
3811 abort: decoding near * (glob)
3811 abort: decoding near * (glob)
3812 [255]
3812 [255]
3813 $ hg log -T "invalid type: {rev|utf8}\n" -r0
3813 $ hg log -T "invalid type: {rev|utf8}\n" -r0
3814 abort: template filter 'utf8' is not compatible with keyword 'rev'
3814 abort: template filter 'utf8' is not compatible with keyword 'rev'
3815 [255]
3815 [255]
3816
3816
3817 $ cd ..
3817 $ cd ..
3818
3818
3819 Test that template function in extension is registered as expected
3819 Test that template function in extension is registered as expected
3820
3820
3821 $ cd a
3821 $ cd a
3822
3822
3823 $ cat <<EOF > $TESTTMP/customfunc.py
3823 $ cat <<EOF > $TESTTMP/customfunc.py
3824 > from mercurial import registrar
3824 > from mercurial import registrar
3825 >
3825 >
3826 > templatefunc = registrar.templatefunc()
3826 > templatefunc = registrar.templatefunc()
3827 >
3827 >
3828 > @templatefunc('custom()')
3828 > @templatefunc('custom()')
3829 > def custom(context, mapping, args):
3829 > def custom(context, mapping, args):
3830 > return 'custom'
3830 > return 'custom'
3831 > EOF
3831 > EOF
3832 $ cat <<EOF > .hg/hgrc
3832 $ cat <<EOF > .hg/hgrc
3833 > [extensions]
3833 > [extensions]
3834 > customfunc = $TESTTMP/customfunc.py
3834 > customfunc = $TESTTMP/customfunc.py
3835 > EOF
3835 > EOF
3836
3836
3837 $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true
3837 $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true
3838 custom
3838 custom
3839
3839
3840 $ cd ..
3840 $ cd ..
@@ -1,2480 +1,2480
1 $ HGENCODING=utf-8
1 $ HGENCODING=utf-8
2 $ export HGENCODING
2 $ export HGENCODING
3 $ cat > testrevset.py << EOF
3 $ cat > testrevset.py << EOF
4 > import mercurial.revset
4 > import mercurial.revset
5 >
5 >
6 > baseset = mercurial.revset.baseset
6 > baseset = mercurial.revset.baseset
7 >
7 >
8 > def r3232(repo, subset, x):
8 > def r3232(repo, subset, x):
9 > """"simple revset that return [3,2,3,2]
9 > """"simple revset that return [3,2,3,2]
10 >
10 >
11 > revisions duplicated on purpose.
11 > revisions duplicated on purpose.
12 > """
12 > """
13 > if 3 not in subset:
13 > if 3 not in subset:
14 > if 2 in subset:
14 > if 2 in subset:
15 > return baseset([2,2])
15 > return baseset([2,2])
16 > return baseset()
16 > return baseset()
17 > return baseset([3,3,2,2])
17 > return baseset([3,3,2,2])
18 >
18 >
19 > mercurial.revset.symbols['r3232'] = r3232
19 > mercurial.revset.symbols['r3232'] = r3232
20 > EOF
20 > EOF
21 $ cat >> $HGRCPATH << EOF
21 $ cat >> $HGRCPATH << EOF
22 > [extensions]
22 > [extensions]
23 > testrevset=$TESTTMP/testrevset.py
23 > testrevset=$TESTTMP/testrevset.py
24 > EOF
24 > EOF
25
25
26 $ try() {
26 $ try() {
27 > hg debugrevspec --debug "$@"
27 > hg debugrevspec --debug "$@"
28 > }
28 > }
29
29
30 $ log() {
30 $ log() {
31 > hg log --template '{rev}\n' -r "$1"
31 > hg log --template '{rev}\n' -r "$1"
32 > }
32 > }
33
33
34 $ hg init repo
34 $ hg init repo
35 $ cd repo
35 $ cd repo
36
36
37 $ echo a > a
37 $ echo a > a
38 $ hg branch a
38 $ hg branch a
39 marked working directory as branch a
39 marked working directory as branch a
40 (branches are permanent and global, did you want a bookmark?)
40 (branches are permanent and global, did you want a bookmark?)
41 $ hg ci -Aqm0
41 $ hg ci -Aqm0
42
42
43 $ echo b > b
43 $ echo b > b
44 $ hg branch b
44 $ hg branch b
45 marked working directory as branch b
45 marked working directory as branch b
46 $ hg ci -Aqm1
46 $ hg ci -Aqm1
47
47
48 $ rm a
48 $ rm a
49 $ hg branch a-b-c-
49 $ hg branch a-b-c-
50 marked working directory as branch a-b-c-
50 marked working directory as branch a-b-c-
51 $ hg ci -Aqm2 -u Bob
51 $ hg ci -Aqm2 -u Bob
52
52
53 $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n'
53 $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n'
54 2
54 2
55 $ hg log -r "extra('branch')" --template '{rev}\n'
55 $ hg log -r "extra('branch')" --template '{rev}\n'
56 0
56 0
57 1
57 1
58 2
58 2
59 $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n'
59 $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n'
60 0 a
60 0 a
61 2 a-b-c-
61 2 a-b-c-
62
62
63 $ hg co 1
63 $ hg co 1
64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 $ hg branch +a+b+c+
65 $ hg branch +a+b+c+
66 marked working directory as branch +a+b+c+
66 marked working directory as branch +a+b+c+
67 $ hg ci -Aqm3
67 $ hg ci -Aqm3
68
68
69 $ hg co 2 # interleave
69 $ hg co 2 # interleave
70 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
70 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
71 $ echo bb > b
71 $ echo bb > b
72 $ hg branch -- -a-b-c-
72 $ hg branch -- -a-b-c-
73 marked working directory as branch -a-b-c-
73 marked working directory as branch -a-b-c-
74 $ hg ci -Aqm4 -d "May 12 2005"
74 $ hg ci -Aqm4 -d "May 12 2005"
75
75
76 $ hg co 3
76 $ hg co 3
77 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 $ hg branch !a/b/c/
78 $ hg branch !a/b/c/
79 marked working directory as branch !a/b/c/
79 marked working directory as branch !a/b/c/
80 $ hg ci -Aqm"5 bug"
80 $ hg ci -Aqm"5 bug"
81
81
82 $ hg merge 4
82 $ hg merge 4
83 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
83 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
84 (branch merge, don't forget to commit)
84 (branch merge, don't forget to commit)
85 $ hg branch _a_b_c_
85 $ hg branch _a_b_c_
86 marked working directory as branch _a_b_c_
86 marked working directory as branch _a_b_c_
87 $ hg ci -Aqm"6 issue619"
87 $ hg ci -Aqm"6 issue619"
88
88
89 $ hg branch .a.b.c.
89 $ hg branch .a.b.c.
90 marked working directory as branch .a.b.c.
90 marked working directory as branch .a.b.c.
91 $ hg ci -Aqm7
91 $ hg ci -Aqm7
92
92
93 $ hg branch all
93 $ hg branch all
94 marked working directory as branch all
94 marked working directory as branch all
95
95
96 $ hg co 4
96 $ hg co 4
97 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 $ hg branch Γ©
98 $ hg branch Γ©
99 marked working directory as branch \xc3\xa9 (esc)
99 marked working directory as branch \xc3\xa9 (esc)
100 $ hg ci -Aqm9
100 $ hg ci -Aqm9
101
101
102 $ hg tag -r6 1.0
102 $ hg tag -r6 1.0
103 $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
103 $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
104
104
105 $ hg clone --quiet -U -r 7 . ../remote1
105 $ hg clone --quiet -U -r 7 . ../remote1
106 $ hg clone --quiet -U -r 8 . ../remote2
106 $ hg clone --quiet -U -r 8 . ../remote2
107 $ echo "[paths]" >> .hg/hgrc
107 $ echo "[paths]" >> .hg/hgrc
108 $ echo "default = ../remote1" >> .hg/hgrc
108 $ echo "default = ../remote1" >> .hg/hgrc
109
109
110 trivial
110 trivial
111
111
112 $ try 0:1
112 $ try 0:1
113 (range
113 (range
114 ('symbol', '0')
114 ('symbol', '0')
115 ('symbol', '1'))
115 ('symbol', '1'))
116 * set:
116 * set:
117 <spanset+ 0:1>
117 <spanset+ 0:1>
118 0
118 0
119 1
119 1
120 $ try --optimize :
120 $ try --optimize :
121 (rangeall
121 (rangeall
122 None)
122 None)
123 * optimized:
123 * optimized:
124 (range
124 (range
125 ('string', '0')
125 ('string', '0')
126 ('string', 'tip'))
126 ('string', 'tip'))
127 * set:
127 * set:
128 <spanset+ 0:9>
128 <spanset+ 0:9>
129 0
129 0
130 1
130 1
131 2
131 2
132 3
132 3
133 4
133 4
134 5
134 5
135 6
135 6
136 7
136 7
137 8
137 8
138 9
138 9
139 $ try 3::6
139 $ try 3::6
140 (dagrange
140 (dagrange
141 ('symbol', '3')
141 ('symbol', '3')
142 ('symbol', '6'))
142 ('symbol', '6'))
143 * set:
143 * set:
144 <baseset+ [3, 5, 6]>
144 <baseset+ [3, 5, 6]>
145 3
145 3
146 5
146 5
147 6
147 6
148 $ try '0|1|2'
148 $ try '0|1|2'
149 (or
149 (or
150 ('symbol', '0')
150 ('symbol', '0')
151 ('symbol', '1')
151 ('symbol', '1')
152 ('symbol', '2'))
152 ('symbol', '2'))
153 * set:
153 * set:
154 <baseset [0, 1, 2]>
154 <baseset [0, 1, 2]>
155 0
155 0
156 1
156 1
157 2
157 2
158
158
159 names that should work without quoting
159 names that should work without quoting
160
160
161 $ try a
161 $ try a
162 ('symbol', 'a')
162 ('symbol', 'a')
163 * set:
163 * set:
164 <baseset [0]>
164 <baseset [0]>
165 0
165 0
166 $ try b-a
166 $ try b-a
167 (minus
167 (minus
168 ('symbol', 'b')
168 ('symbol', 'b')
169 ('symbol', 'a'))
169 ('symbol', 'a'))
170 * set:
170 * set:
171 <filteredset
171 <filteredset
172 <baseset [1]>,
172 <baseset [1]>,
173 <not
173 <not
174 <baseset [0]>>>
174 <baseset [0]>>>
175 1
175 1
176 $ try _a_b_c_
176 $ try _a_b_c_
177 ('symbol', '_a_b_c_')
177 ('symbol', '_a_b_c_')
178 * set:
178 * set:
179 <baseset [6]>
179 <baseset [6]>
180 6
180 6
181 $ try _a_b_c_-a
181 $ try _a_b_c_-a
182 (minus
182 (minus
183 ('symbol', '_a_b_c_')
183 ('symbol', '_a_b_c_')
184 ('symbol', 'a'))
184 ('symbol', 'a'))
185 * set:
185 * set:
186 <filteredset
186 <filteredset
187 <baseset [6]>,
187 <baseset [6]>,
188 <not
188 <not
189 <baseset [0]>>>
189 <baseset [0]>>>
190 6
190 6
191 $ try .a.b.c.
191 $ try .a.b.c.
192 ('symbol', '.a.b.c.')
192 ('symbol', '.a.b.c.')
193 * set:
193 * set:
194 <baseset [7]>
194 <baseset [7]>
195 7
195 7
196 $ try .a.b.c.-a
196 $ try .a.b.c.-a
197 (minus
197 (minus
198 ('symbol', '.a.b.c.')
198 ('symbol', '.a.b.c.')
199 ('symbol', 'a'))
199 ('symbol', 'a'))
200 * set:
200 * set:
201 <filteredset
201 <filteredset
202 <baseset [7]>,
202 <baseset [7]>,
203 <not
203 <not
204 <baseset [0]>>>
204 <baseset [0]>>>
205 7
205 7
206
206
207 names that should be caught by fallback mechanism
207 names that should be caught by fallback mechanism
208
208
209 $ try -- '-a-b-c-'
209 $ try -- '-a-b-c-'
210 ('symbol', '-a-b-c-')
210 ('symbol', '-a-b-c-')
211 * set:
211 * set:
212 <baseset [4]>
212 <baseset [4]>
213 4
213 4
214 $ log -a-b-c-
214 $ log -a-b-c-
215 4
215 4
216 $ try '+a+b+c+'
216 $ try '+a+b+c+'
217 ('symbol', '+a+b+c+')
217 ('symbol', '+a+b+c+')
218 * set:
218 * set:
219 <baseset [3]>
219 <baseset [3]>
220 3
220 3
221 $ try '+a+b+c+:'
221 $ try '+a+b+c+:'
222 (rangepost
222 (rangepost
223 ('symbol', '+a+b+c+'))
223 ('symbol', '+a+b+c+'))
224 * set:
224 * set:
225 <spanset+ 3:9>
225 <spanset+ 3:9>
226 3
226 3
227 4
227 4
228 5
228 5
229 6
229 6
230 7
230 7
231 8
231 8
232 9
232 9
233 $ try ':+a+b+c+'
233 $ try ':+a+b+c+'
234 (rangepre
234 (rangepre
235 ('symbol', '+a+b+c+'))
235 ('symbol', '+a+b+c+'))
236 * set:
236 * set:
237 <spanset+ 0:3>
237 <spanset+ 0:3>
238 0
238 0
239 1
239 1
240 2
240 2
241 3
241 3
242 $ try -- '-a-b-c-:+a+b+c+'
242 $ try -- '-a-b-c-:+a+b+c+'
243 (range
243 (range
244 ('symbol', '-a-b-c-')
244 ('symbol', '-a-b-c-')
245 ('symbol', '+a+b+c+'))
245 ('symbol', '+a+b+c+'))
246 * set:
246 * set:
247 <spanset- 3:4>
247 <spanset- 3:4>
248 4
248 4
249 3
249 3
250 $ log '-a-b-c-:+a+b+c+'
250 $ log '-a-b-c-:+a+b+c+'
251 4
251 4
252 3
252 3
253
253
254 $ try -- -a-b-c--a # complains
254 $ try -- -a-b-c--a # complains
255 (minus
255 (minus
256 (minus
256 (minus
257 (minus
257 (minus
258 (negate
258 (negate
259 ('symbol', 'a'))
259 ('symbol', 'a'))
260 ('symbol', 'b'))
260 ('symbol', 'b'))
261 ('symbol', 'c'))
261 ('symbol', 'c'))
262 (negate
262 (negate
263 ('symbol', 'a')))
263 ('symbol', 'a')))
264 abort: unknown revision '-a'!
264 abort: unknown revision '-a'!
265 [255]
265 [255]
266 $ try Γ©
266 $ try Γ©
267 ('symbol', '\xc3\xa9')
267 ('symbol', '\xc3\xa9')
268 * set:
268 * set:
269 <baseset [9]>
269 <baseset [9]>
270 9
270 9
271
271
272 no quoting needed
272 no quoting needed
273
273
274 $ log ::a-b-c-
274 $ log ::a-b-c-
275 0
275 0
276 1
276 1
277 2
277 2
278
278
279 quoting needed
279 quoting needed
280
280
281 $ try '"-a-b-c-"-a'
281 $ try '"-a-b-c-"-a'
282 (minus
282 (minus
283 ('string', '-a-b-c-')
283 ('string', '-a-b-c-')
284 ('symbol', 'a'))
284 ('symbol', 'a'))
285 * set:
285 * set:
286 <filteredset
286 <filteredset
287 <baseset [4]>,
287 <baseset [4]>,
288 <not
288 <not
289 <baseset [0]>>>
289 <baseset [0]>>>
290 4
290 4
291
291
292 $ log '1 or 2'
292 $ log '1 or 2'
293 1
293 1
294 2
294 2
295 $ log '1|2'
295 $ log '1|2'
296 1
296 1
297 2
297 2
298 $ log '1 and 2'
298 $ log '1 and 2'
299 $ log '1&2'
299 $ log '1&2'
300 $ try '1&2|3' # precedence - and is higher
300 $ try '1&2|3' # precedence - and is higher
301 (or
301 (or
302 (and
302 (and
303 ('symbol', '1')
303 ('symbol', '1')
304 ('symbol', '2'))
304 ('symbol', '2'))
305 ('symbol', '3'))
305 ('symbol', '3'))
306 * set:
306 * set:
307 <addset
307 <addset
308 <baseset []>,
308 <baseset []>,
309 <baseset [3]>>
309 <baseset [3]>>
310 3
310 3
311 $ try '1|2&3'
311 $ try '1|2&3'
312 (or
312 (or
313 ('symbol', '1')
313 ('symbol', '1')
314 (and
314 (and
315 ('symbol', '2')
315 ('symbol', '2')
316 ('symbol', '3')))
316 ('symbol', '3')))
317 * set:
317 * set:
318 <addset
318 <addset
319 <baseset [1]>,
319 <baseset [1]>,
320 <baseset []>>
320 <baseset []>>
321 1
321 1
322 $ try '1&2&3' # associativity
322 $ try '1&2&3' # associativity
323 (and
323 (and
324 (and
324 (and
325 ('symbol', '1')
325 ('symbol', '1')
326 ('symbol', '2'))
326 ('symbol', '2'))
327 ('symbol', '3'))
327 ('symbol', '3'))
328 * set:
328 * set:
329 <baseset []>
329 <baseset []>
330 $ try '1|(2|3)'
330 $ try '1|(2|3)'
331 (or
331 (or
332 ('symbol', '1')
332 ('symbol', '1')
333 (group
333 (group
334 (or
334 (or
335 ('symbol', '2')
335 ('symbol', '2')
336 ('symbol', '3'))))
336 ('symbol', '3'))))
337 * set:
337 * set:
338 <addset
338 <addset
339 <baseset [1]>,
339 <baseset [1]>,
340 <baseset [2, 3]>>
340 <baseset [2, 3]>>
341 1
341 1
342 2
342 2
343 3
343 3
344 $ log '1.0' # tag
344 $ log '1.0' # tag
345 6
345 6
346 $ log 'a' # branch
346 $ log 'a' # branch
347 0
347 0
348 $ log '2785f51ee'
348 $ log '2785f51ee'
349 0
349 0
350 $ log 'date(2005)'
350 $ log 'date(2005)'
351 4
351 4
352 $ log 'date(this is a test)'
352 $ log 'date(this is a test)'
353 hg: parse error at 10: unexpected token: symbol
353 hg: parse error at 10: unexpected token: symbol
354 [255]
354 [255]
355 $ log 'date()'
355 $ log 'date()'
356 hg: parse error: date requires a string
356 hg: parse error: date requires a string
357 [255]
357 [255]
358 $ log 'date'
358 $ log 'date'
359 abort: unknown revision 'date'!
359 abort: unknown revision 'date'!
360 [255]
360 [255]
361 $ log 'date('
361 $ log 'date('
362 hg: parse error at 5: not a prefix: end
362 hg: parse error at 5: not a prefix: end
363 [255]
363 [255]
364 $ log 'date("\xy")'
364 $ log 'date("\xy")'
365 hg: parse error: invalid \x escape
365 hg: parse error: invalid \x escape
366 [255]
366 [255]
367 $ log 'date(tip)'
367 $ log 'date(tip)'
368 abort: invalid date: 'tip'
368 abort: invalid date: 'tip'
369 [255]
369 [255]
370 $ log '0:date'
370 $ log '0:date'
371 abort: unknown revision 'date'!
371 abort: unknown revision 'date'!
372 [255]
372 [255]
373 $ log '::"date"'
373 $ log '::"date"'
374 abort: unknown revision 'date'!
374 abort: unknown revision 'date'!
375 [255]
375 [255]
376 $ hg book date -r 4
376 $ hg book date -r 4
377 $ log '0:date'
377 $ log '0:date'
378 0
378 0
379 1
379 1
380 2
380 2
381 3
381 3
382 4
382 4
383 $ log '::date'
383 $ log '::date'
384 0
384 0
385 1
385 1
386 2
386 2
387 4
387 4
388 $ log '::"date"'
388 $ log '::"date"'
389 0
389 0
390 1
390 1
391 2
391 2
392 4
392 4
393 $ log 'date(2005) and 1::'
393 $ log 'date(2005) and 1::'
394 4
394 4
395 $ hg book -d date
395 $ hg book -d date
396
396
397 keyword arguments
397 keyword arguments
398
398
399 $ log 'extra(branch, value=a)'
399 $ log 'extra(branch, value=a)'
400 0
400 0
401
401
402 $ log 'extra(branch, a, b)'
402 $ log 'extra(branch, a, b)'
403 hg: parse error: extra takes at most 2 arguments
403 hg: parse error: extra takes at most 2 arguments
404 [255]
404 [255]
405 $ log 'extra(a, label=b)'
405 $ log 'extra(a, label=b)'
406 hg: parse error: extra got multiple values for keyword argument 'label'
406 hg: parse error: extra got multiple values for keyword argument 'label'
407 [255]
407 [255]
408 $ log 'extra(label=branch, default)'
408 $ log 'extra(label=branch, default)'
409 hg: parse error: extra got an invalid argument
409 hg: parse error: extra got an invalid argument
410 [255]
410 [255]
411 $ log 'extra(branch, foo+bar=baz)'
411 $ log 'extra(branch, foo+bar=baz)'
412 hg: parse error: extra got an invalid argument
412 hg: parse error: extra got an invalid argument
413 [255]
413 [255]
414 $ log 'extra(unknown=branch)'
414 $ log 'extra(unknown=branch)'
415 hg: parse error: extra got an unexpected keyword argument 'unknown'
415 hg: parse error: extra got an unexpected keyword argument 'unknown'
416 [255]
416 [255]
417
417
418 $ try 'foo=bar|baz'
418 $ try 'foo=bar|baz'
419 (keyvalue
419 (keyvalue
420 ('symbol', 'foo')
420 ('symbol', 'foo')
421 (or
421 (or
422 ('symbol', 'bar')
422 ('symbol', 'bar')
423 ('symbol', 'baz')))
423 ('symbol', 'baz')))
424 hg: parse error: can't use a key-value pair in this context
424 hg: parse error: can't use a key-value pair in this context
425 [255]
425 [255]
426
426
427 Test that symbols only get parsed as functions if there's an opening
427 Test that symbols only get parsed as functions if there's an opening
428 parenthesis.
428 parenthesis.
429
429
430 $ hg book only -r 9
430 $ hg book only -r 9
431 $ log 'only(only)' # Outer "only" is a function, inner "only" is the bookmark
431 $ log 'only(only)' # Outer "only" is a function, inner "only" is the bookmark
432 8
432 8
433 9
433 9
434
434
435 ancestor can accept 0 or more arguments
435 ancestor can accept 0 or more arguments
436
436
437 $ log 'ancestor()'
437 $ log 'ancestor()'
438 $ log 'ancestor(1)'
438 $ log 'ancestor(1)'
439 1
439 1
440 $ log 'ancestor(4,5)'
440 $ log 'ancestor(4,5)'
441 1
441 1
442 $ log 'ancestor(4,5) and 4'
442 $ log 'ancestor(4,5) and 4'
443 $ log 'ancestor(0,0,1,3)'
443 $ log 'ancestor(0,0,1,3)'
444 0
444 0
445 $ log 'ancestor(3,1,5,3,5,1)'
445 $ log 'ancestor(3,1,5,3,5,1)'
446 1
446 1
447 $ log 'ancestor(0,1,3,5)'
447 $ log 'ancestor(0,1,3,5)'
448 0
448 0
449 $ log 'ancestor(1,2,3,4,5)'
449 $ log 'ancestor(1,2,3,4,5)'
450 1
450 1
451
451
452 test ancestors
452 test ancestors
453
453
454 $ log 'ancestors(5)'
454 $ log 'ancestors(5)'
455 0
455 0
456 1
456 1
457 3
457 3
458 5
458 5
459 $ log 'ancestor(ancestors(5))'
459 $ log 'ancestor(ancestors(5))'
460 0
460 0
461 $ log '::r3232()'
461 $ log '::r3232()'
462 0
462 0
463 1
463 1
464 2
464 2
465 3
465 3
466
466
467 $ log 'author(bob)'
467 $ log 'author(bob)'
468 2
468 2
469 $ log 'author("re:bob|test")'
469 $ log 'author("re:bob|test")'
470 0
470 0
471 1
471 1
472 2
472 2
473 3
473 3
474 4
474 4
475 5
475 5
476 6
476 6
477 7
477 7
478 8
478 8
479 9
479 9
480 $ log 'branch(Γ©)'
480 $ log 'branch(Γ©)'
481 8
481 8
482 9
482 9
483 $ log 'branch(a)'
483 $ log 'branch(a)'
484 0
484 0
485 $ hg log -r 'branch("re:a")' --template '{rev} {branch}\n'
485 $ hg log -r 'branch("re:a")' --template '{rev} {branch}\n'
486 0 a
486 0 a
487 2 a-b-c-
487 2 a-b-c-
488 3 +a+b+c+
488 3 +a+b+c+
489 4 -a-b-c-
489 4 -a-b-c-
490 5 !a/b/c/
490 5 !a/b/c/
491 6 _a_b_c_
491 6 _a_b_c_
492 7 .a.b.c.
492 7 .a.b.c.
493 $ log 'children(ancestor(4,5))'
493 $ log 'children(ancestor(4,5))'
494 2
494 2
495 3
495 3
496 $ log 'closed()'
496 $ log 'closed()'
497 $ log 'contains(a)'
497 $ log 'contains(a)'
498 0
498 0
499 1
499 1
500 3
500 3
501 5
501 5
502 $ log 'contains("../repo/a")'
502 $ log 'contains("../repo/a")'
503 0
503 0
504 1
504 1
505 3
505 3
506 5
506 5
507 $ log 'desc(B)'
507 $ log 'desc(B)'
508 5
508 5
509 $ log 'descendants(2 or 3)'
509 $ log 'descendants(2 or 3)'
510 2
510 2
511 3
511 3
512 4
512 4
513 5
513 5
514 6
514 6
515 7
515 7
516 8
516 8
517 9
517 9
518 $ log 'file("b*")'
518 $ log 'file("b*")'
519 1
519 1
520 4
520 4
521 $ log 'filelog("b")'
521 $ log 'filelog("b")'
522 1
522 1
523 4
523 4
524 $ log 'filelog("../repo/b")'
524 $ log 'filelog("../repo/b")'
525 1
525 1
526 4
526 4
527 $ log 'follow()'
527 $ log 'follow()'
528 0
528 0
529 1
529 1
530 2
530 2
531 4
531 4
532 8
532 8
533 9
533 9
534 $ log 'grep("issue\d+")'
534 $ log 'grep("issue\d+")'
535 6
535 6
536 $ try 'grep("(")' # invalid regular expression
536 $ try 'grep("(")' # invalid regular expression
537 (func
537 (func
538 ('symbol', 'grep')
538 ('symbol', 'grep')
539 ('string', '('))
539 ('string', '('))
540 hg: parse error: invalid match pattern: unbalanced parenthesis
540 hg: parse error: invalid match pattern: unbalanced parenthesis
541 [255]
541 [255]
542 $ try 'grep("\bissue\d+")'
542 $ try 'grep("\bissue\d+")'
543 (func
543 (func
544 ('symbol', 'grep')
544 ('symbol', 'grep')
545 ('string', '\x08issue\\d+'))
545 ('string', '\x08issue\\d+'))
546 * set:
546 * set:
547 <filteredset
547 <filteredset
548 <fullreposet+ 0:9>,
548 <fullreposet+ 0:9>,
549 <grep '\x08issue\\d+'>>
549 <grep '\x08issue\\d+'>>
550 $ try 'grep(r"\bissue\d+")'
550 $ try 'grep(r"\bissue\d+")'
551 (func
551 (func
552 ('symbol', 'grep')
552 ('symbol', 'grep')
553 ('string', '\\bissue\\d+'))
553 ('string', '\\bissue\\d+'))
554 * set:
554 * set:
555 <filteredset
555 <filteredset
556 <fullreposet+ 0:9>,
556 <fullreposet+ 0:9>,
557 <grep '\\bissue\\d+'>>
557 <grep '\\bissue\\d+'>>
558 6
558 6
559 $ try 'grep(r"\")'
559 $ try 'grep(r"\")'
560 hg: parse error at 7: unterminated string
560 hg: parse error at 7: unterminated string
561 [255]
561 [255]
562 $ log 'head()'
562 $ log 'head()'
563 0
563 0
564 1
564 1
565 2
565 2
566 3
566 3
567 4
567 4
568 5
568 5
569 6
569 6
570 7
570 7
571 9
571 9
572 $ log 'heads(6::)'
572 $ log 'heads(6::)'
573 7
573 7
574 $ log 'keyword(issue)'
574 $ log 'keyword(issue)'
575 6
575 6
576 $ log 'keyword("test a")'
576 $ log 'keyword("test a")'
577 $ log 'limit(head(), 1)'
577 $ log 'limit(head(), 1)'
578 0
578 0
579 $ log 'limit(author("re:bob|test"), 3, 5)'
579 $ log 'limit(author("re:bob|test"), 3, 5)'
580 5
580 5
581 6
581 6
582 7
582 7
583 $ log 'limit(author("re:bob|test"), offset=6)'
583 $ log 'limit(author("re:bob|test"), offset=6)'
584 6
584 6
585 $ log 'limit(author("re:bob|test"), offset=10)'
585 $ log 'limit(author("re:bob|test"), offset=10)'
586 $ log 'limit(all(), 1, -1)'
586 $ log 'limit(all(), 1, -1)'
587 hg: parse error: negative offset
587 hg: parse error: negative offset
588 [255]
588 [255]
589 $ log 'matching(6)'
589 $ log 'matching(6)'
590 6
590 6
591 $ log 'matching(6:7, "phase parents user date branch summary files description substate")'
591 $ log 'matching(6:7, "phase parents user date branch summary files description substate")'
592 6
592 6
593 7
593 7
594
594
595 Testing min and max
595 Testing min and max
596
596
597 max: simple
597 max: simple
598
598
599 $ log 'max(contains(a))'
599 $ log 'max(contains(a))'
600 5
600 5
601
601
602 max: simple on unordered set)
602 max: simple on unordered set)
603
603
604 $ log 'max((4+0+2+5+7) and contains(a))'
604 $ log 'max((4+0+2+5+7) and contains(a))'
605 5
605 5
606
606
607 max: no result
607 max: no result
608
608
609 $ log 'max(contains(stringthatdoesnotappearanywhere))'
609 $ log 'max(contains(stringthatdoesnotappearanywhere))'
610
610
611 max: no result on unordered set
611 max: no result on unordered set
612
612
613 $ log 'max((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))'
613 $ log 'max((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))'
614
614
615 min: simple
615 min: simple
616
616
617 $ log 'min(contains(a))'
617 $ log 'min(contains(a))'
618 0
618 0
619
619
620 min: simple on unordered set
620 min: simple on unordered set
621
621
622 $ log 'min((4+0+2+5+7) and contains(a))'
622 $ log 'min((4+0+2+5+7) and contains(a))'
623 0
623 0
624
624
625 min: empty
625 min: empty
626
626
627 $ log 'min(contains(stringthatdoesnotappearanywhere))'
627 $ log 'min(contains(stringthatdoesnotappearanywhere))'
628
628
629 min: empty on unordered set
629 min: empty on unordered set
630
630
631 $ log 'min((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))'
631 $ log 'min((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))'
632
632
633
633
634 $ log 'merge()'
634 $ log 'merge()'
635 6
635 6
636 $ log 'branchpoint()'
636 $ log 'branchpoint()'
637 1
637 1
638 4
638 4
639 $ log 'modifies(b)'
639 $ log 'modifies(b)'
640 4
640 4
641 $ log 'modifies("path:b")'
641 $ log 'modifies("path:b")'
642 4
642 4
643 $ log 'modifies("*")'
643 $ log 'modifies("*")'
644 4
644 4
645 6
645 6
646 $ log 'modifies("set:modified()")'
646 $ log 'modifies("set:modified()")'
647 4
647 4
648 $ log 'id(5)'
648 $ log 'id(5)'
649 2
649 2
650 $ log 'only(9)'
650 $ log 'only(9)'
651 8
651 8
652 9
652 9
653 $ log 'only(8)'
653 $ log 'only(8)'
654 8
654 8
655 $ log 'only(9, 5)'
655 $ log 'only(9, 5)'
656 2
656 2
657 4
657 4
658 8
658 8
659 9
659 9
660 $ log 'only(7 + 9, 5 + 2)'
660 $ log 'only(7 + 9, 5 + 2)'
661 4
661 4
662 6
662 6
663 7
663 7
664 8
664 8
665 9
665 9
666
666
667 Test empty set input
667 Test empty set input
668 $ log 'only(p2())'
668 $ log 'only(p2())'
669 $ log 'only(p1(), p2())'
669 $ log 'only(p1(), p2())'
670 0
670 0
671 1
671 1
672 2
672 2
673 4
673 4
674 8
674 8
675 9
675 9
676
676
677 Test '%' operator
677 Test '%' operator
678
678
679 $ log '9%'
679 $ log '9%'
680 8
680 8
681 9
681 9
682 $ log '9%5'
682 $ log '9%5'
683 2
683 2
684 4
684 4
685 8
685 8
686 9
686 9
687 $ log '(7 + 9)%(5 + 2)'
687 $ log '(7 + 9)%(5 + 2)'
688 4
688 4
689 6
689 6
690 7
690 7
691 8
691 8
692 9
692 9
693
693
694 Test opreand of '%' is optimized recursively (issue4670)
694 Test opreand of '%' is optimized recursively (issue4670)
695
695
696 $ try --optimize '8:9-8%'
696 $ try --optimize '8:9-8%'
697 (onlypost
697 (onlypost
698 (minus
698 (minus
699 (range
699 (range
700 ('symbol', '8')
700 ('symbol', '8')
701 ('symbol', '9'))
701 ('symbol', '9'))
702 ('symbol', '8')))
702 ('symbol', '8')))
703 * optimized:
703 * optimized:
704 (func
704 (func
705 ('symbol', 'only')
705 ('symbol', 'only')
706 (difference
706 (difference
707 (range
707 (range
708 ('symbol', '8')
708 ('symbol', '8')
709 ('symbol', '9'))
709 ('symbol', '9'))
710 ('symbol', '8')))
710 ('symbol', '8')))
711 * set:
711 * set:
712 <baseset+ [8, 9]>
712 <baseset+ [8, 9]>
713 8
713 8
714 9
714 9
715 $ try --optimize '(9)%(5)'
715 $ try --optimize '(9)%(5)'
716 (only
716 (only
717 (group
717 (group
718 ('symbol', '9'))
718 ('symbol', '9'))
719 (group
719 (group
720 ('symbol', '5')))
720 ('symbol', '5')))
721 * optimized:
721 * optimized:
722 (func
722 (func
723 ('symbol', 'only')
723 ('symbol', 'only')
724 (list
724 (list
725 ('symbol', '9')
725 ('symbol', '9')
726 ('symbol', '5')))
726 ('symbol', '5')))
727 * set:
727 * set:
728 <baseset+ [2, 4, 8, 9]>
728 <baseset+ [2, 4, 8, 9]>
729 2
729 2
730 4
730 4
731 8
731 8
732 9
732 9
733
733
734 Test the order of operations
734 Test the order of operations
735
735
736 $ log '7 + 9%5 + 2'
736 $ log '7 + 9%5 + 2'
737 7
737 7
738 2
738 2
739 4
739 4
740 8
740 8
741 9
741 9
742
742
743 Test explicit numeric revision
743 Test explicit numeric revision
744 $ log 'rev(-2)'
744 $ log 'rev(-2)'
745 $ log 'rev(-1)'
745 $ log 'rev(-1)'
746 -1
746 -1
747 $ log 'rev(0)'
747 $ log 'rev(0)'
748 0
748 0
749 $ log 'rev(9)'
749 $ log 'rev(9)'
750 9
750 9
751 $ log 'rev(10)'
751 $ log 'rev(10)'
752 $ log 'rev(tip)'
752 $ log 'rev(tip)'
753 hg: parse error: rev expects a number
753 hg: parse error: rev expects a number
754 [255]
754 [255]
755
755
756 Test hexadecimal revision
756 Test hexadecimal revision
757 $ log 'id(2)'
757 $ log 'id(2)'
758 abort: 00changelog.i@2: ambiguous identifier!
758 abort: 00changelog.i@2: ambiguous identifier!
759 [255]
759 [255]
760 $ log 'id(23268)'
760 $ log 'id(23268)'
761 4
761 4
762 $ log 'id(2785f51eece)'
762 $ log 'id(2785f51eece)'
763 0
763 0
764 $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532c)'
764 $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532c)'
765 8
765 8
766 $ log 'id(d5d0dcbdc4a)'
766 $ log 'id(d5d0dcbdc4a)'
767 $ log 'id(d5d0dcbdc4w)'
767 $ log 'id(d5d0dcbdc4w)'
768 $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532d)'
768 $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532d)'
769 $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532q)'
769 $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532q)'
770 $ log 'id(1.0)'
770 $ log 'id(1.0)'
771 $ log 'id(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)'
771 $ log 'id(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)'
772
772
773 Test null revision
773 Test null revision
774 $ log '(null)'
774 $ log '(null)'
775 -1
775 -1
776 $ log '(null:0)'
776 $ log '(null:0)'
777 -1
777 -1
778 0
778 0
779 $ log '(0:null)'
779 $ log '(0:null)'
780 0
780 0
781 -1
781 -1
782 $ log 'null::0'
782 $ log 'null::0'
783 -1
783 -1
784 0
784 0
785 $ log 'null:tip - 0:'
785 $ log 'null:tip - 0:'
786 -1
786 -1
787 $ log 'null: and null::' | head -1
787 $ log 'null: and null::' | head -1
788 -1
788 -1
789 $ log 'null: or 0:' | head -2
789 $ log 'null: or 0:' | head -2
790 -1
790 -1
791 0
791 0
792 $ log 'ancestors(null)'
792 $ log 'ancestors(null)'
793 -1
793 -1
794 $ log 'reverse(null:)' | tail -2
794 $ log 'reverse(null:)' | tail -2
795 0
795 0
796 -1
796 -1
797 BROKEN: should be '-1'
797 BROKEN: should be '-1'
798 $ log 'first(null:)'
798 $ log 'first(null:)'
799 BROKEN: should be '-1'
799 BROKEN: should be '-1'
800 $ log 'min(null:)'
800 $ log 'min(null:)'
801 $ log 'tip:null and all()' | tail -2
801 $ log 'tip:null and all()' | tail -2
802 1
802 1
803 0
803 0
804
804
805 Test working-directory revision
805 Test working-directory revision
806 $ hg debugrevspec 'wdir()'
806 $ hg debugrevspec 'wdir()'
807 2147483647
807 2147483647
808 $ hg debugrevspec 'tip or wdir()'
808 $ hg debugrevspec 'tip or wdir()'
809 9
809 9
810 2147483647
810 2147483647
811 $ hg debugrevspec '0:tip and wdir()'
811 $ hg debugrevspec '0:tip and wdir()'
812 $ log '0:wdir()' | tail -3
812 $ log '0:wdir()' | tail -3
813 8
813 8
814 9
814 9
815 2147483647
815 2147483647
816 $ log 'wdir():0' | head -3
816 $ log 'wdir():0' | head -3
817 2147483647
817 2147483647
818 9
818 9
819 8
819 8
820 $ log 'wdir():wdir()'
820 $ log 'wdir():wdir()'
821 2147483647
821 2147483647
822 $ log '(all() + wdir()) & min(. + wdir())'
822 $ log '(all() + wdir()) & min(. + wdir())'
823 9
823 9
824 $ log '(all() + wdir()) & max(. + wdir())'
824 $ log '(all() + wdir()) & max(. + wdir())'
825 2147483647
825 2147483647
826 $ log '(all() + wdir()) & first(wdir() + .)'
826 $ log '(all() + wdir()) & first(wdir() + .)'
827 2147483647
827 2147483647
828 $ log '(all() + wdir()) & last(. + wdir())'
828 $ log '(all() + wdir()) & last(. + wdir())'
829 2147483647
829 2147483647
830
830
831 $ log 'outgoing()'
831 $ log 'outgoing()'
832 8
832 8
833 9
833 9
834 $ log 'outgoing("../remote1")'
834 $ log 'outgoing("../remote1")'
835 8
835 8
836 9
836 9
837 $ log 'outgoing("../remote2")'
837 $ log 'outgoing("../remote2")'
838 3
838 3
839 5
839 5
840 6
840 6
841 7
841 7
842 9
842 9
843 $ log 'p1(merge())'
843 $ log 'p1(merge())'
844 5
844 5
845 $ log 'p2(merge())'
845 $ log 'p2(merge())'
846 4
846 4
847 $ log 'parents(merge())'
847 $ log 'parents(merge())'
848 4
848 4
849 5
849 5
850 $ log 'p1(branchpoint())'
850 $ log 'p1(branchpoint())'
851 0
851 0
852 2
852 2
853 $ log 'p2(branchpoint())'
853 $ log 'p2(branchpoint())'
854 $ log 'parents(branchpoint())'
854 $ log 'parents(branchpoint())'
855 0
855 0
856 2
856 2
857 $ log 'removes(a)'
857 $ log 'removes(a)'
858 2
858 2
859 6
859 6
860 $ log 'roots(all())'
860 $ log 'roots(all())'
861 0
861 0
862 $ log 'reverse(2 or 3 or 4 or 5)'
862 $ log 'reverse(2 or 3 or 4 or 5)'
863 5
863 5
864 4
864 4
865 3
865 3
866 2
866 2
867 $ log 'reverse(all())'
867 $ log 'reverse(all())'
868 9
868 9
869 8
869 8
870 7
870 7
871 6
871 6
872 5
872 5
873 4
873 4
874 3
874 3
875 2
875 2
876 1
876 1
877 0
877 0
878 $ log 'reverse(all()) & filelog(b)'
878 $ log 'reverse(all()) & filelog(b)'
879 4
879 4
880 1
880 1
881 $ log 'rev(5)'
881 $ log 'rev(5)'
882 5
882 5
883 $ log 'sort(limit(reverse(all()), 3))'
883 $ log 'sort(limit(reverse(all()), 3))'
884 7
884 7
885 8
885 8
886 9
886 9
887 $ log 'sort(2 or 3 or 4 or 5, date)'
887 $ log 'sort(2 or 3 or 4 or 5, date)'
888 2
888 2
889 3
889 3
890 5
890 5
891 4
891 4
892 $ log 'tagged()'
892 $ log 'tagged()'
893 6
893 6
894 $ log 'tag()'
894 $ log 'tag()'
895 6
895 6
896 $ log 'tag(1.0)'
896 $ log 'tag(1.0)'
897 6
897 6
898 $ log 'tag(tip)'
898 $ log 'tag(tip)'
899 9
899 9
900
900
901 test sort revset
901 test sort revset
902 --------------------------------------------
902 --------------------------------------------
903
903
904 test when adding two unordered revsets
904 test when adding two unordered revsets
905
905
906 $ log 'sort(keyword(issue) or modifies(b))'
906 $ log 'sort(keyword(issue) or modifies(b))'
907 4
907 4
908 6
908 6
909
909
910 test when sorting a reversed collection in the same way it is
910 test when sorting a reversed collection in the same way it is
911
911
912 $ log 'sort(reverse(all()), -rev)'
912 $ log 'sort(reverse(all()), -rev)'
913 9
913 9
914 8
914 8
915 7
915 7
916 6
916 6
917 5
917 5
918 4
918 4
919 3
919 3
920 2
920 2
921 1
921 1
922 0
922 0
923
923
924 test when sorting a reversed collection
924 test when sorting a reversed collection
925
925
926 $ log 'sort(reverse(all()), rev)'
926 $ log 'sort(reverse(all()), rev)'
927 0
927 0
928 1
928 1
929 2
929 2
930 3
930 3
931 4
931 4
932 5
932 5
933 6
933 6
934 7
934 7
935 8
935 8
936 9
936 9
937
937
938
938
939 test sorting two sorted collections in different orders
939 test sorting two sorted collections in different orders
940
940
941 $ log 'sort(outgoing() or reverse(removes(a)), rev)'
941 $ log 'sort(outgoing() or reverse(removes(a)), rev)'
942 2
942 2
943 6
943 6
944 8
944 8
945 9
945 9
946
946
947 test sorting two sorted collections in different orders backwards
947 test sorting two sorted collections in different orders backwards
948
948
949 $ log 'sort(outgoing() or reverse(removes(a)), -rev)'
949 $ log 'sort(outgoing() or reverse(removes(a)), -rev)'
950 9
950 9
951 8
951 8
952 6
952 6
953 2
953 2
954
954
955 $ cd ..
955 $ cd ..
956
956
957 test sorting by multiple keys including variable-length strings
957 test sorting by multiple keys including variable-length strings
958
958
959 $ hg init sorting
959 $ hg init sorting
960 $ cd sorting
960 $ cd sorting
961 $ cat <<EOF >> .hg/hgrc
961 $ cat <<EOF >> .hg/hgrc
962 > [ui]
962 > [ui]
963 > logtemplate = '{rev} {branch|p5}{desc|p5}{author|p5}{date|hgdate}\n'
963 > logtemplate = '{rev} {branch|p5}{desc|p5}{author|p5}{date|hgdate}\n'
964 > [templatealias]
964 > [templatealias]
965 > p5(s) = pad(s, 5)
965 > p5(s) = pad(s, 5)
966 > EOF
966 > EOF
967 $ hg branch -qf b12
967 $ hg branch -qf b12
968 $ hg ci -m m111 -u u112 -d '111 10800'
968 $ hg ci -m m111 -u u112 -d '111 10800'
969 $ hg branch -qf b11
969 $ hg branch -qf b11
970 $ hg ci -m m12 -u u111 -d '112 7200'
970 $ hg ci -m m12 -u u111 -d '112 7200'
971 $ hg branch -qf b111
971 $ hg branch -qf b111
972 $ hg ci -m m11 -u u12 -d '111 3600'
972 $ hg ci -m m11 -u u12 -d '111 3600'
973 $ hg branch -qf b112
973 $ hg branch -qf b112
974 $ hg ci -m m111 -u u11 -d '120 0'
974 $ hg ci -m m111 -u u11 -d '120 0'
975 $ hg branch -qf b111
975 $ hg branch -qf b111
976 $ hg ci -m m112 -u u111 -d '110 14400'
976 $ hg ci -m m112 -u u111 -d '110 14400'
977 created new head
977 created new head
978
978
979 compare revisions (has fast path):
979 compare revisions (has fast path):
980
980
981 $ hg log -r 'sort(all(), rev)'
981 $ hg log -r 'sort(all(), rev)'
982 0 b12 m111 u112 111 10800
982 0 b12 m111 u112 111 10800
983 1 b11 m12 u111 112 7200
983 1 b11 m12 u111 112 7200
984 2 b111 m11 u12 111 3600
984 2 b111 m11 u12 111 3600
985 3 b112 m111 u11 120 0
985 3 b112 m111 u11 120 0
986 4 b111 m112 u111 110 14400
986 4 b111 m112 u111 110 14400
987
987
988 $ hg log -r 'sort(all(), -rev)'
988 $ hg log -r 'sort(all(), -rev)'
989 4 b111 m112 u111 110 14400
989 4 b111 m112 u111 110 14400
990 3 b112 m111 u11 120 0
990 3 b112 m111 u11 120 0
991 2 b111 m11 u12 111 3600
991 2 b111 m11 u12 111 3600
992 1 b11 m12 u111 112 7200
992 1 b11 m12 u111 112 7200
993 0 b12 m111 u112 111 10800
993 0 b12 m111 u112 111 10800
994
994
995 compare variable-length strings (issue5218):
995 compare variable-length strings (issue5218):
996
996
997 $ hg log -r 'sort(all(), branch)'
997 $ hg log -r 'sort(all(), branch)'
998 1 b11 m12 u111 112 7200
998 1 b11 m12 u111 112 7200
999 2 b111 m11 u12 111 3600
999 2 b111 m11 u12 111 3600
1000 4 b111 m112 u111 110 14400
1000 4 b111 m112 u111 110 14400
1001 3 b112 m111 u11 120 0
1001 3 b112 m111 u11 120 0
1002 0 b12 m111 u112 111 10800
1002 0 b12 m111 u112 111 10800
1003
1003
1004 $ hg log -r 'sort(all(), -branch)'
1004 $ hg log -r 'sort(all(), -branch)'
1005 0 b12 m111 u112 111 10800
1005 0 b12 m111 u112 111 10800
1006 3 b112 m111 u11 120 0
1006 3 b112 m111 u11 120 0
1007 2 b111 m11 u12 111 3600
1007 2 b111 m11 u12 111 3600
1008 4 b111 m112 u111 110 14400
1008 4 b111 m112 u111 110 14400
1009 1 b11 m12 u111 112 7200
1009 1 b11 m12 u111 112 7200
1010
1010
1011 $ hg log -r 'sort(all(), desc)'
1011 $ hg log -r 'sort(all(), desc)'
1012 2 b111 m11 u12 111 3600
1012 2 b111 m11 u12 111 3600
1013 0 b12 m111 u112 111 10800
1013 0 b12 m111 u112 111 10800
1014 3 b112 m111 u11 120 0
1014 3 b112 m111 u11 120 0
1015 4 b111 m112 u111 110 14400
1015 4 b111 m112 u111 110 14400
1016 1 b11 m12 u111 112 7200
1016 1 b11 m12 u111 112 7200
1017
1017
1018 $ hg log -r 'sort(all(), -desc)'
1018 $ hg log -r 'sort(all(), -desc)'
1019 1 b11 m12 u111 112 7200
1019 1 b11 m12 u111 112 7200
1020 4 b111 m112 u111 110 14400
1020 4 b111 m112 u111 110 14400
1021 0 b12 m111 u112 111 10800
1021 0 b12 m111 u112 111 10800
1022 3 b112 m111 u11 120 0
1022 3 b112 m111 u11 120 0
1023 2 b111 m11 u12 111 3600
1023 2 b111 m11 u12 111 3600
1024
1024
1025 $ hg log -r 'sort(all(), user)'
1025 $ hg log -r 'sort(all(), user)'
1026 3 b112 m111 u11 120 0
1026 3 b112 m111 u11 120 0
1027 1 b11 m12 u111 112 7200
1027 1 b11 m12 u111 112 7200
1028 4 b111 m112 u111 110 14400
1028 4 b111 m112 u111 110 14400
1029 0 b12 m111 u112 111 10800
1029 0 b12 m111 u112 111 10800
1030 2 b111 m11 u12 111 3600
1030 2 b111 m11 u12 111 3600
1031
1031
1032 $ hg log -r 'sort(all(), -user)'
1032 $ hg log -r 'sort(all(), -user)'
1033 2 b111 m11 u12 111 3600
1033 2 b111 m11 u12 111 3600
1034 0 b12 m111 u112 111 10800
1034 0 b12 m111 u112 111 10800
1035 1 b11 m12 u111 112 7200
1035 1 b11 m12 u111 112 7200
1036 4 b111 m112 u111 110 14400
1036 4 b111 m112 u111 110 14400
1037 3 b112 m111 u11 120 0
1037 3 b112 m111 u11 120 0
1038
1038
1039 compare dates (tz offset should have no effect):
1039 compare dates (tz offset should have no effect):
1040
1040
1041 $ hg log -r 'sort(all(), date)'
1041 $ hg log -r 'sort(all(), date)'
1042 4 b111 m112 u111 110 14400
1042 4 b111 m112 u111 110 14400
1043 0 b12 m111 u112 111 10800
1043 0 b12 m111 u112 111 10800
1044 2 b111 m11 u12 111 3600
1044 2 b111 m11 u12 111 3600
1045 1 b11 m12 u111 112 7200
1045 1 b11 m12 u111 112 7200
1046 3 b112 m111 u11 120 0
1046 3 b112 m111 u11 120 0
1047
1047
1048 $ hg log -r 'sort(all(), -date)'
1048 $ hg log -r 'sort(all(), -date)'
1049 3 b112 m111 u11 120 0
1049 3 b112 m111 u11 120 0
1050 1 b11 m12 u111 112 7200
1050 1 b11 m12 u111 112 7200
1051 0 b12 m111 u112 111 10800
1051 0 b12 m111 u112 111 10800
1052 2 b111 m11 u12 111 3600
1052 2 b111 m11 u12 111 3600
1053 4 b111 m112 u111 110 14400
1053 4 b111 m112 u111 110 14400
1054
1054
1055 be aware that 'sort(x, -k)' is not exactly the same as 'reverse(sort(x, k))'
1055 be aware that 'sort(x, -k)' is not exactly the same as 'reverse(sort(x, k))'
1056 because '-k' reverses the comparison, not the list itself:
1056 because '-k' reverses the comparison, not the list itself:
1057
1057
1058 $ hg log -r 'sort(0 + 2, date)'
1058 $ hg log -r 'sort(0 + 2, date)'
1059 0 b12 m111 u112 111 10800
1059 0 b12 m111 u112 111 10800
1060 2 b111 m11 u12 111 3600
1060 2 b111 m11 u12 111 3600
1061
1061
1062 $ hg log -r 'sort(0 + 2, -date)'
1062 $ hg log -r 'sort(0 + 2, -date)'
1063 0 b12 m111 u112 111 10800
1063 0 b12 m111 u112 111 10800
1064 2 b111 m11 u12 111 3600
1064 2 b111 m11 u12 111 3600
1065
1065
1066 $ hg log -r 'reverse(sort(0 + 2, date))'
1066 $ hg log -r 'reverse(sort(0 + 2, date))'
1067 2 b111 m11 u12 111 3600
1067 2 b111 m11 u12 111 3600
1068 0 b12 m111 u112 111 10800
1068 0 b12 m111 u112 111 10800
1069
1069
1070 sort by multiple keys:
1070 sort by multiple keys:
1071
1071
1072 $ hg log -r 'sort(all(), "branch -rev")'
1072 $ hg log -r 'sort(all(), "branch -rev")'
1073 1 b11 m12 u111 112 7200
1073 1 b11 m12 u111 112 7200
1074 4 b111 m112 u111 110 14400
1074 4 b111 m112 u111 110 14400
1075 2 b111 m11 u12 111 3600
1075 2 b111 m11 u12 111 3600
1076 3 b112 m111 u11 120 0
1076 3 b112 m111 u11 120 0
1077 0 b12 m111 u112 111 10800
1077 0 b12 m111 u112 111 10800
1078
1078
1079 $ hg log -r 'sort(all(), "-desc -date")'
1079 $ hg log -r 'sort(all(), "-desc -date")'
1080 1 b11 m12 u111 112 7200
1080 1 b11 m12 u111 112 7200
1081 4 b111 m112 u111 110 14400
1081 4 b111 m112 u111 110 14400
1082 3 b112 m111 u11 120 0
1082 3 b112 m111 u11 120 0
1083 0 b12 m111 u112 111 10800
1083 0 b12 m111 u112 111 10800
1084 2 b111 m11 u12 111 3600
1084 2 b111 m11 u12 111 3600
1085
1085
1086 $ hg log -r 'sort(all(), "user -branch date rev")'
1086 $ hg log -r 'sort(all(), "user -branch date rev")'
1087 3 b112 m111 u11 120 0
1087 3 b112 m111 u11 120 0
1088 4 b111 m112 u111 110 14400
1088 4 b111 m112 u111 110 14400
1089 1 b11 m12 u111 112 7200
1089 1 b11 m12 u111 112 7200
1090 0 b12 m111 u112 111 10800
1090 0 b12 m111 u112 111 10800
1091 2 b111 m11 u12 111 3600
1091 2 b111 m11 u12 111 3600
1092
1092
1093 $ cd ..
1093 $ cd ..
1094 $ cd repo
1094 $ cd repo
1095
1095
1096 test subtracting something from an addset
1096 test subtracting something from an addset
1097
1097
1098 $ log '(outgoing() or removes(a)) - removes(a)'
1098 $ log '(outgoing() or removes(a)) - removes(a)'
1099 8
1099 8
1100 9
1100 9
1101
1101
1102 test intersecting something with an addset
1102 test intersecting something with an addset
1103
1103
1104 $ log 'parents(outgoing() or removes(a))'
1104 $ log 'parents(outgoing() or removes(a))'
1105 1
1105 1
1106 4
1106 4
1107 5
1107 5
1108 8
1108 8
1109
1109
1110 test that `or` operation combines elements in the right order:
1110 test that `or` operation combines elements in the right order:
1111
1111
1112 $ log '3:4 or 2:5'
1112 $ log '3:4 or 2:5'
1113 3
1113 3
1114 4
1114 4
1115 2
1115 2
1116 5
1116 5
1117 $ log '3:4 or 5:2'
1117 $ log '3:4 or 5:2'
1118 3
1118 3
1119 4
1119 4
1120 5
1120 5
1121 2
1121 2
1122 $ log 'sort(3:4 or 2:5)'
1122 $ log 'sort(3:4 or 2:5)'
1123 2
1123 2
1124 3
1124 3
1125 4
1125 4
1126 5
1126 5
1127 $ log 'sort(3:4 or 5:2)'
1127 $ log 'sort(3:4 or 5:2)'
1128 2
1128 2
1129 3
1129 3
1130 4
1130 4
1131 5
1131 5
1132
1132
1133 test that more than one `-r`s are combined in the right order and deduplicated:
1133 test that more than one `-r`s are combined in the right order and deduplicated:
1134
1134
1135 $ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)'
1135 $ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)'
1136 3
1136 3
1137 4
1137 4
1138 5
1138 5
1139 2
1139 2
1140 0
1140 0
1141 1
1141 1
1142
1142
1143 test that `or` operation skips duplicated revisions from right-hand side
1143 test that `or` operation skips duplicated revisions from right-hand side
1144
1144
1145 $ try 'reverse(1::5) or ancestors(4)'
1145 $ try 'reverse(1::5) or ancestors(4)'
1146 (or
1146 (or
1147 (func
1147 (func
1148 ('symbol', 'reverse')
1148 ('symbol', 'reverse')
1149 (dagrange
1149 (dagrange
1150 ('symbol', '1')
1150 ('symbol', '1')
1151 ('symbol', '5')))
1151 ('symbol', '5')))
1152 (func
1152 (func
1153 ('symbol', 'ancestors')
1153 ('symbol', 'ancestors')
1154 ('symbol', '4')))
1154 ('symbol', '4')))
1155 * set:
1155 * set:
1156 <addset
1156 <addset
1157 <baseset- [1, 3, 5]>,
1157 <baseset- [1, 3, 5]>,
1158 <generatorset+>>
1158 <generatorset+>>
1159 5
1159 5
1160 3
1160 3
1161 1
1161 1
1162 0
1162 0
1163 2
1163 2
1164 4
1164 4
1165 $ try 'sort(ancestors(4) or reverse(1::5))'
1165 $ try 'sort(ancestors(4) or reverse(1::5))'
1166 (func
1166 (func
1167 ('symbol', 'sort')
1167 ('symbol', 'sort')
1168 (or
1168 (or
1169 (func
1169 (func
1170 ('symbol', 'ancestors')
1170 ('symbol', 'ancestors')
1171 ('symbol', '4'))
1171 ('symbol', '4'))
1172 (func
1172 (func
1173 ('symbol', 'reverse')
1173 ('symbol', 'reverse')
1174 (dagrange
1174 (dagrange
1175 ('symbol', '1')
1175 ('symbol', '1')
1176 ('symbol', '5')))))
1176 ('symbol', '5')))))
1177 * set:
1177 * set:
1178 <addset+
1178 <addset+
1179 <generatorset+>,
1179 <generatorset+>,
1180 <baseset- [1, 3, 5]>>
1180 <baseset- [1, 3, 5]>>
1181 0
1181 0
1182 1
1182 1
1183 2
1183 2
1184 3
1184 3
1185 4
1185 4
1186 5
1186 5
1187
1187
1188 test optimization of trivial `or` operation
1188 test optimization of trivial `or` operation
1189
1189
1190 $ try --optimize '0|(1)|"2"|-2|tip|null'
1190 $ try --optimize '0|(1)|"2"|-2|tip|null'
1191 (or
1191 (or
1192 ('symbol', '0')
1192 ('symbol', '0')
1193 (group
1193 (group
1194 ('symbol', '1'))
1194 ('symbol', '1'))
1195 ('string', '2')
1195 ('string', '2')
1196 (negate
1196 (negate
1197 ('symbol', '2'))
1197 ('symbol', '2'))
1198 ('symbol', 'tip')
1198 ('symbol', 'tip')
1199 ('symbol', 'null'))
1199 ('symbol', 'null'))
1200 * optimized:
1200 * optimized:
1201 (func
1201 (func
1202 ('symbol', '_list')
1202 ('symbol', '_list')
1203 ('string', '0\x001\x002\x00-2\x00tip\x00null'))
1203 ('string', '0\x001\x002\x00-2\x00tip\x00null'))
1204 * set:
1204 * set:
1205 <baseset [0, 1, 2, 8, 9, -1]>
1205 <baseset [0, 1, 2, 8, 9, -1]>
1206 0
1206 0
1207 1
1207 1
1208 2
1208 2
1209 8
1209 8
1210 9
1210 9
1211 -1
1211 -1
1212
1212
1213 $ try --optimize '0|1|2:3'
1213 $ try --optimize '0|1|2:3'
1214 (or
1214 (or
1215 ('symbol', '0')
1215 ('symbol', '0')
1216 ('symbol', '1')
1216 ('symbol', '1')
1217 (range
1217 (range
1218 ('symbol', '2')
1218 ('symbol', '2')
1219 ('symbol', '3')))
1219 ('symbol', '3')))
1220 * optimized:
1220 * optimized:
1221 (or
1221 (or
1222 (func
1222 (func
1223 ('symbol', '_list')
1223 ('symbol', '_list')
1224 ('string', '0\x001'))
1224 ('string', '0\x001'))
1225 (range
1225 (range
1226 ('symbol', '2')
1226 ('symbol', '2')
1227 ('symbol', '3')))
1227 ('symbol', '3')))
1228 * set:
1228 * set:
1229 <addset
1229 <addset
1230 <baseset [0, 1]>,
1230 <baseset [0, 1]>,
1231 <spanset+ 2:3>>
1231 <spanset+ 2:3>>
1232 0
1232 0
1233 1
1233 1
1234 2
1234 2
1235 3
1235 3
1236
1236
1237 $ try --optimize '0:1|2|3:4|5|6'
1237 $ try --optimize '0:1|2|3:4|5|6'
1238 (or
1238 (or
1239 (range
1239 (range
1240 ('symbol', '0')
1240 ('symbol', '0')
1241 ('symbol', '1'))
1241 ('symbol', '1'))
1242 ('symbol', '2')
1242 ('symbol', '2')
1243 (range
1243 (range
1244 ('symbol', '3')
1244 ('symbol', '3')
1245 ('symbol', '4'))
1245 ('symbol', '4'))
1246 ('symbol', '5')
1246 ('symbol', '5')
1247 ('symbol', '6'))
1247 ('symbol', '6'))
1248 * optimized:
1248 * optimized:
1249 (or
1249 (or
1250 (range
1250 (range
1251 ('symbol', '0')
1251 ('symbol', '0')
1252 ('symbol', '1'))
1252 ('symbol', '1'))
1253 ('symbol', '2')
1253 ('symbol', '2')
1254 (range
1254 (range
1255 ('symbol', '3')
1255 ('symbol', '3')
1256 ('symbol', '4'))
1256 ('symbol', '4'))
1257 (func
1257 (func
1258 ('symbol', '_list')
1258 ('symbol', '_list')
1259 ('string', '5\x006')))
1259 ('string', '5\x006')))
1260 * set:
1260 * set:
1261 <addset
1261 <addset
1262 <addset
1262 <addset
1263 <spanset+ 0:1>,
1263 <spanset+ 0:1>,
1264 <baseset [2]>>,
1264 <baseset [2]>>,
1265 <addset
1265 <addset
1266 <spanset+ 3:4>,
1266 <spanset+ 3:4>,
1267 <baseset [5, 6]>>>
1267 <baseset [5, 6]>>>
1268 0
1268 0
1269 1
1269 1
1270 2
1270 2
1271 3
1271 3
1272 4
1272 4
1273 5
1273 5
1274 6
1274 6
1275
1275
1276 test that `_list` should be narrowed by provided `subset`
1276 test that `_list` should be narrowed by provided `subset`
1277
1277
1278 $ log '0:2 and (null|1|2|3)'
1278 $ log '0:2 and (null|1|2|3)'
1279 1
1279 1
1280 2
1280 2
1281
1281
1282 test that `_list` should remove duplicates
1282 test that `_list` should remove duplicates
1283
1283
1284 $ log '0|1|2|1|2|-1|tip'
1284 $ log '0|1|2|1|2|-1|tip'
1285 0
1285 0
1286 1
1286 1
1287 2
1287 2
1288 9
1288 9
1289
1289
1290 test unknown revision in `_list`
1290 test unknown revision in `_list`
1291
1291
1292 $ log '0|unknown'
1292 $ log '0|unknown'
1293 abort: unknown revision 'unknown'!
1293 abort: unknown revision 'unknown'!
1294 [255]
1294 [255]
1295
1295
1296 test integer range in `_list`
1296 test integer range in `_list`
1297
1297
1298 $ log '-1|-10'
1298 $ log '-1|-10'
1299 9
1299 9
1300 0
1300 0
1301
1301
1302 $ log '-10|-11'
1302 $ log '-10|-11'
1303 abort: unknown revision '-11'!
1303 abort: unknown revision '-11'!
1304 [255]
1304 [255]
1305
1305
1306 $ log '9|10'
1306 $ log '9|10'
1307 abort: unknown revision '10'!
1307 abort: unknown revision '10'!
1308 [255]
1308 [255]
1309
1309
1310 test '0000' != '0' in `_list`
1310 test '0000' != '0' in `_list`
1311
1311
1312 $ log '0|0000'
1312 $ log '0|0000'
1313 0
1313 0
1314 -1
1314 -1
1315
1315
1316 test ',' in `_list`
1316 test ',' in `_list`
1317 $ log '0,1'
1317 $ log '0,1'
1318 hg: parse error: can't use a list in this context
1318 hg: parse error: can't use a list in this context
1319 (see hg help "revsets.x or y")
1319 (see hg help "revsets.x or y")
1320 [255]
1320 [255]
1321 $ try '0,1,2'
1321 $ try '0,1,2'
1322 (list
1322 (list
1323 ('symbol', '0')
1323 ('symbol', '0')
1324 ('symbol', '1')
1324 ('symbol', '1')
1325 ('symbol', '2'))
1325 ('symbol', '2'))
1326 hg: parse error: can't use a list in this context
1326 hg: parse error: can't use a list in this context
1327 (see hg help "revsets.x or y")
1327 (see hg help "revsets.x or y")
1328 [255]
1328 [255]
1329
1329
1330 test that chained `or` operations make balanced addsets
1330 test that chained `or` operations make balanced addsets
1331
1331
1332 $ try '0:1|1:2|2:3|3:4|4:5'
1332 $ try '0:1|1:2|2:3|3:4|4:5'
1333 (or
1333 (or
1334 (range
1334 (range
1335 ('symbol', '0')
1335 ('symbol', '0')
1336 ('symbol', '1'))
1336 ('symbol', '1'))
1337 (range
1337 (range
1338 ('symbol', '1')
1338 ('symbol', '1')
1339 ('symbol', '2'))
1339 ('symbol', '2'))
1340 (range
1340 (range
1341 ('symbol', '2')
1341 ('symbol', '2')
1342 ('symbol', '3'))
1342 ('symbol', '3'))
1343 (range
1343 (range
1344 ('symbol', '3')
1344 ('symbol', '3')
1345 ('symbol', '4'))
1345 ('symbol', '4'))
1346 (range
1346 (range
1347 ('symbol', '4')
1347 ('symbol', '4')
1348 ('symbol', '5')))
1348 ('symbol', '5')))
1349 * set:
1349 * set:
1350 <addset
1350 <addset
1351 <addset
1351 <addset
1352 <spanset+ 0:1>,
1352 <spanset+ 0:1>,
1353 <spanset+ 1:2>>,
1353 <spanset+ 1:2>>,
1354 <addset
1354 <addset
1355 <spanset+ 2:3>,
1355 <spanset+ 2:3>,
1356 <addset
1356 <addset
1357 <spanset+ 3:4>,
1357 <spanset+ 3:4>,
1358 <spanset+ 4:5>>>>
1358 <spanset+ 4:5>>>>
1359 0
1359 0
1360 1
1360 1
1361 2
1361 2
1362 3
1362 3
1363 4
1363 4
1364 5
1364 5
1365
1365
1366 no crash by empty group "()" while optimizing `or` operations
1366 no crash by empty group "()" while optimizing `or` operations
1367
1367
1368 $ try --optimize '0|()'
1368 $ try --optimize '0|()'
1369 (or
1369 (or
1370 ('symbol', '0')
1370 ('symbol', '0')
1371 (group
1371 (group
1372 None))
1372 None))
1373 * optimized:
1373 * optimized:
1374 (or
1374 (or
1375 ('symbol', '0')
1375 ('symbol', '0')
1376 None)
1376 None)
1377 hg: parse error: missing argument
1377 hg: parse error: missing argument
1378 [255]
1378 [255]
1379
1379
1380 test that chained `or` operations never eat up stack (issue4624)
1380 test that chained `or` operations never eat up stack (issue4624)
1381 (uses `0:1` instead of `0` to avoid future optimization of trivial revisions)
1381 (uses `0:1` instead of `0` to avoid future optimization of trivial revisions)
1382
1382
1383 $ hg log -T '{rev}\n' -r `python -c "print '+'.join(['0:1'] * 500)"`
1383 $ hg log -T '{rev}\n' -r `python -c "print '+'.join(['0:1'] * 500)"`
1384 0
1384 0
1385 1
1385 1
1386
1386
1387 test that repeated `-r` options never eat up stack (issue4565)
1387 test that repeated `-r` options never eat up stack (issue4565)
1388 (uses `-r 0::1` to avoid possible optimization at old-style parser)
1388 (uses `-r 0::1` to avoid possible optimization at old-style parser)
1389
1389
1390 $ hg log -T '{rev}\n' `python -c "for i in xrange(500): print '-r 0::1 ',"`
1390 $ hg log -T '{rev}\n' `python -c "for i in xrange(500): print '-r 0::1 ',"`
1391 0
1391 0
1392 1
1392 1
1393
1393
1394 check that conversion to only works
1394 check that conversion to only works
1395 $ try --optimize '::3 - ::1'
1395 $ try --optimize '::3 - ::1'
1396 (minus
1396 (minus
1397 (dagrangepre
1397 (dagrangepre
1398 ('symbol', '3'))
1398 ('symbol', '3'))
1399 (dagrangepre
1399 (dagrangepre
1400 ('symbol', '1')))
1400 ('symbol', '1')))
1401 * optimized:
1401 * optimized:
1402 (func
1402 (func
1403 ('symbol', 'only')
1403 ('symbol', 'only')
1404 (list
1404 (list
1405 ('symbol', '3')
1405 ('symbol', '3')
1406 ('symbol', '1')))
1406 ('symbol', '1')))
1407 * set:
1407 * set:
1408 <baseset+ [3]>
1408 <baseset+ [3]>
1409 3
1409 3
1410 $ try --optimize 'ancestors(1) - ancestors(3)'
1410 $ try --optimize 'ancestors(1) - ancestors(3)'
1411 (minus
1411 (minus
1412 (func
1412 (func
1413 ('symbol', 'ancestors')
1413 ('symbol', 'ancestors')
1414 ('symbol', '1'))
1414 ('symbol', '1'))
1415 (func
1415 (func
1416 ('symbol', 'ancestors')
1416 ('symbol', 'ancestors')
1417 ('symbol', '3')))
1417 ('symbol', '3')))
1418 * optimized:
1418 * optimized:
1419 (func
1419 (func
1420 ('symbol', 'only')
1420 ('symbol', 'only')
1421 (list
1421 (list
1422 ('symbol', '1')
1422 ('symbol', '1')
1423 ('symbol', '3')))
1423 ('symbol', '3')))
1424 * set:
1424 * set:
1425 <baseset+ []>
1425 <baseset+ []>
1426 $ try --optimize 'not ::2 and ::6'
1426 $ try --optimize 'not ::2 and ::6'
1427 (and
1427 (and
1428 (not
1428 (not
1429 (dagrangepre
1429 (dagrangepre
1430 ('symbol', '2')))
1430 ('symbol', '2')))
1431 (dagrangepre
1431 (dagrangepre
1432 ('symbol', '6')))
1432 ('symbol', '6')))
1433 * optimized:
1433 * optimized:
1434 (func
1434 (func
1435 ('symbol', 'only')
1435 ('symbol', 'only')
1436 (list
1436 (list
1437 ('symbol', '6')
1437 ('symbol', '6')
1438 ('symbol', '2')))
1438 ('symbol', '2')))
1439 * set:
1439 * set:
1440 <baseset+ [3, 4, 5, 6]>
1440 <baseset+ [3, 4, 5, 6]>
1441 3
1441 3
1442 4
1442 4
1443 5
1443 5
1444 6
1444 6
1445 $ try --optimize 'ancestors(6) and not ancestors(4)'
1445 $ try --optimize 'ancestors(6) and not ancestors(4)'
1446 (and
1446 (and
1447 (func
1447 (func
1448 ('symbol', 'ancestors')
1448 ('symbol', 'ancestors')
1449 ('symbol', '6'))
1449 ('symbol', '6'))
1450 (not
1450 (not
1451 (func
1451 (func
1452 ('symbol', 'ancestors')
1452 ('symbol', 'ancestors')
1453 ('symbol', '4'))))
1453 ('symbol', '4'))))
1454 * optimized:
1454 * optimized:
1455 (func
1455 (func
1456 ('symbol', 'only')
1456 ('symbol', 'only')
1457 (list
1457 (list
1458 ('symbol', '6')
1458 ('symbol', '6')
1459 ('symbol', '4')))
1459 ('symbol', '4')))
1460 * set:
1460 * set:
1461 <baseset+ [3, 5, 6]>
1461 <baseset+ [3, 5, 6]>
1462 3
1462 3
1463 5
1463 5
1464 6
1464 6
1465
1465
1466 no crash by empty group "()" while optimizing to "only()"
1466 no crash by empty group "()" while optimizing to "only()"
1467
1467
1468 $ try --optimize '::1 and ()'
1468 $ try --optimize '::1 and ()'
1469 (and
1469 (and
1470 (dagrangepre
1470 (dagrangepre
1471 ('symbol', '1'))
1471 ('symbol', '1'))
1472 (group
1472 (group
1473 None))
1473 None))
1474 * optimized:
1474 * optimized:
1475 (and
1475 (and
1476 None
1476 None
1477 (func
1477 (func
1478 ('symbol', 'ancestors')
1478 ('symbol', 'ancestors')
1479 ('symbol', '1')))
1479 ('symbol', '1')))
1480 hg: parse error: missing argument
1480 hg: parse error: missing argument
1481 [255]
1481 [255]
1482
1482
1483 we can use patterns when searching for tags
1483 we can use patterns when searching for tags
1484
1484
1485 $ log 'tag("1..*")'
1485 $ log 'tag("1..*")'
1486 abort: tag '1..*' does not exist!
1486 abort: tag '1..*' does not exist!
1487 [255]
1487 [255]
1488 $ log 'tag("re:1..*")'
1488 $ log 'tag("re:1..*")'
1489 6
1489 6
1490 $ log 'tag("re:[0-9].[0-9]")'
1490 $ log 'tag("re:[0-9].[0-9]")'
1491 6
1491 6
1492 $ log 'tag("literal:1.0")'
1492 $ log 'tag("literal:1.0")'
1493 6
1493 6
1494 $ log 'tag("re:0..*")'
1494 $ log 'tag("re:0..*")'
1495
1495
1496 $ log 'tag(unknown)'
1496 $ log 'tag(unknown)'
1497 abort: tag 'unknown' does not exist!
1497 abort: tag 'unknown' does not exist!
1498 [255]
1498 [255]
1499 $ log 'tag("re:unknown")'
1499 $ log 'tag("re:unknown")'
1500 $ log 'present(tag("unknown"))'
1500 $ log 'present(tag("unknown"))'
1501 $ log 'present(tag("re:unknown"))'
1501 $ log 'present(tag("re:unknown"))'
1502 $ log 'branch(unknown)'
1502 $ log 'branch(unknown)'
1503 abort: unknown revision 'unknown'!
1503 abort: unknown revision 'unknown'!
1504 [255]
1504 [255]
1505 $ log 'branch("literal:unknown")'
1505 $ log 'branch("literal:unknown")'
1506 abort: branch 'unknown' does not exist!
1506 abort: branch 'unknown' does not exist!
1507 [255]
1507 [255]
1508 $ log 'branch("re:unknown")'
1508 $ log 'branch("re:unknown")'
1509 $ log 'present(branch("unknown"))'
1509 $ log 'present(branch("unknown"))'
1510 $ log 'present(branch("re:unknown"))'
1510 $ log 'present(branch("re:unknown"))'
1511 $ log 'user(bob)'
1511 $ log 'user(bob)'
1512 2
1512 2
1513
1513
1514 $ log '4::8'
1514 $ log '4::8'
1515 4
1515 4
1516 8
1516 8
1517 $ log '4:8'
1517 $ log '4:8'
1518 4
1518 4
1519 5
1519 5
1520 6
1520 6
1521 7
1521 7
1522 8
1522 8
1523
1523
1524 $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
1524 $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
1525 4
1525 4
1526 2
1526 2
1527 5
1527 5
1528
1528
1529 $ log 'not 0 and 0:2'
1529 $ log 'not 0 and 0:2'
1530 1
1530 1
1531 2
1531 2
1532 $ log 'not 1 and 0:2'
1532 $ log 'not 1 and 0:2'
1533 0
1533 0
1534 2
1534 2
1535 $ log 'not 2 and 0:2'
1535 $ log 'not 2 and 0:2'
1536 0
1536 0
1537 1
1537 1
1538 $ log '(1 and 2)::'
1538 $ log '(1 and 2)::'
1539 $ log '(1 and 2):'
1539 $ log '(1 and 2):'
1540 $ log '(1 and 2):3'
1540 $ log '(1 and 2):3'
1541 $ log 'sort(head(), -rev)'
1541 $ log 'sort(head(), -rev)'
1542 9
1542 9
1543 7
1543 7
1544 6
1544 6
1545 5
1545 5
1546 4
1546 4
1547 3
1547 3
1548 2
1548 2
1549 1
1549 1
1550 0
1550 0
1551 $ log '4::8 - 8'
1551 $ log '4::8 - 8'
1552 4
1552 4
1553 $ log 'matching(1 or 2 or 3) and (2 or 3 or 1)'
1553 $ log 'matching(1 or 2 or 3) and (2 or 3 or 1)'
1554 2
1554 2
1555 3
1555 3
1556 1
1556 1
1557
1557
1558 $ log 'named("unknown")'
1558 $ log 'named("unknown")'
1559 abort: namespace 'unknown' does not exist!
1559 abort: namespace 'unknown' does not exist!
1560 [255]
1560 [255]
1561 $ log 'named("re:unknown")'
1561 $ log 'named("re:unknown")'
1562 abort: no namespace exists that match 'unknown'!
1562 abort: no namespace exists that match 'unknown'!
1563 [255]
1563 [255]
1564 $ log 'present(named("unknown"))'
1564 $ log 'present(named("unknown"))'
1565 $ log 'present(named("re:unknown"))'
1565 $ log 'present(named("re:unknown"))'
1566
1566
1567 $ log 'tag()'
1567 $ log 'tag()'
1568 6
1568 6
1569 $ log 'named("tags")'
1569 $ log 'named("tags")'
1570 6
1570 6
1571
1571
1572 issue2437
1572 issue2437
1573
1573
1574 $ log '3 and p1(5)'
1574 $ log '3 and p1(5)'
1575 3
1575 3
1576 $ log '4 and p2(6)'
1576 $ log '4 and p2(6)'
1577 4
1577 4
1578 $ log '1 and parents(:2)'
1578 $ log '1 and parents(:2)'
1579 1
1579 1
1580 $ log '2 and children(1:)'
1580 $ log '2 and children(1:)'
1581 2
1581 2
1582 $ log 'roots(all()) or roots(all())'
1582 $ log 'roots(all()) or roots(all())'
1583 0
1583 0
1584 $ hg debugrevspec 'roots(all()) or roots(all())'
1584 $ hg debugrevspec 'roots(all()) or roots(all())'
1585 0
1585 0
1586 $ log 'heads(branch(Γ©)) or heads(branch(Γ©))'
1586 $ log 'heads(branch(Γ©)) or heads(branch(Γ©))'
1587 9
1587 9
1588 $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))'
1588 $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))'
1589 4
1589 4
1590
1590
1591 issue2654: report a parse error if the revset was not completely parsed
1591 issue2654: report a parse error if the revset was not completely parsed
1592
1592
1593 $ log '1 OR 2'
1593 $ log '1 OR 2'
1594 hg: parse error at 2: invalid token
1594 hg: parse error at 2: invalid token
1595 [255]
1595 [255]
1596
1596
1597 or operator should preserve ordering:
1597 or operator should preserve ordering:
1598 $ log 'reverse(2::4) or tip'
1598 $ log 'reverse(2::4) or tip'
1599 4
1599 4
1600 2
1600 2
1601 9
1601 9
1602
1602
1603 parentrevspec
1603 parentrevspec
1604
1604
1605 $ log 'merge()^0'
1605 $ log 'merge()^0'
1606 6
1606 6
1607 $ log 'merge()^'
1607 $ log 'merge()^'
1608 5
1608 5
1609 $ log 'merge()^1'
1609 $ log 'merge()^1'
1610 5
1610 5
1611 $ log 'merge()^2'
1611 $ log 'merge()^2'
1612 4
1612 4
1613 $ log 'merge()^^'
1613 $ log 'merge()^^'
1614 3
1614 3
1615 $ log 'merge()^1^'
1615 $ log 'merge()^1^'
1616 3
1616 3
1617 $ log 'merge()^^^'
1617 $ log 'merge()^^^'
1618 1
1618 1
1619
1619
1620 $ log 'merge()~0'
1620 $ log 'merge()~0'
1621 6
1621 6
1622 $ log 'merge()~1'
1622 $ log 'merge()~1'
1623 5
1623 5
1624 $ log 'merge()~2'
1624 $ log 'merge()~2'
1625 3
1625 3
1626 $ log 'merge()~2^1'
1626 $ log 'merge()~2^1'
1627 1
1627 1
1628 $ log 'merge()~3'
1628 $ log 'merge()~3'
1629 1
1629 1
1630
1630
1631 $ log '(-3:tip)^'
1631 $ log '(-3:tip)^'
1632 4
1632 4
1633 6
1633 6
1634 8
1634 8
1635
1635
1636 $ log 'tip^foo'
1636 $ log 'tip^foo'
1637 hg: parse error: ^ expects a number 0, 1, or 2
1637 hg: parse error: ^ expects a number 0, 1, or 2
1638 [255]
1638 [255]
1639
1639
1640 Bogus function gets suggestions
1640 Bogus function gets suggestions
1641 $ log 'add()'
1641 $ log 'add()'
1642 hg: parse error: unknown identifier: add
1642 hg: parse error: unknown identifier: add
1643 (did you mean adds?)
1643 (did you mean adds?)
1644 [255]
1644 [255]
1645 $ log 'added()'
1645 $ log 'added()'
1646 hg: parse error: unknown identifier: added
1646 hg: parse error: unknown identifier: added
1647 (did you mean adds?)
1647 (did you mean adds?)
1648 [255]
1648 [255]
1649 $ log 'remo()'
1649 $ log 'remo()'
1650 hg: parse error: unknown identifier: remo
1650 hg: parse error: unknown identifier: remo
1651 (did you mean one of remote, removes?)
1651 (did you mean one of remote, removes?)
1652 [255]
1652 [255]
1653 $ log 'babar()'
1653 $ log 'babar()'
1654 hg: parse error: unknown identifier: babar
1654 hg: parse error: unknown identifier: babar
1655 [255]
1655 [255]
1656
1656
1657 Bogus function with a similar internal name doesn't suggest the internal name
1657 Bogus function with a similar internal name doesn't suggest the internal name
1658 $ log 'matches()'
1658 $ log 'matches()'
1659 hg: parse error: unknown identifier: matches
1659 hg: parse error: unknown identifier: matches
1660 (did you mean matching?)
1660 (did you mean matching?)
1661 [255]
1661 [255]
1662
1662
1663 Undocumented functions aren't suggested as similar either
1663 Undocumented functions aren't suggested as similar either
1664 $ log 'wdir2()'
1664 $ log 'wdir2()'
1665 hg: parse error: unknown identifier: wdir2
1665 hg: parse error: unknown identifier: wdir2
1666 [255]
1666 [255]
1667
1667
1668 multiple revspecs
1668 multiple revspecs
1669
1669
1670 $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n'
1670 $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n'
1671 8
1671 8
1672 9
1672 9
1673 4
1673 4
1674 5
1674 5
1675 6
1675 6
1676 7
1676 7
1677
1677
1678 test usage in revpair (with "+")
1678 test usage in revpair (with "+")
1679
1679
1680 (real pair)
1680 (real pair)
1681
1681
1682 $ hg diff -r 'tip^^' -r 'tip'
1682 $ hg diff -r 'tip^^' -r 'tip'
1683 diff -r 2326846efdab -r 24286f4ae135 .hgtags
1683 diff -r 2326846efdab -r 24286f4ae135 .hgtags
1684 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1684 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1685 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
1685 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
1686 @@ -0,0 +1,1 @@
1686 @@ -0,0 +1,1 @@
1687 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1687 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1688 $ hg diff -r 'tip^^::tip'
1688 $ hg diff -r 'tip^^::tip'
1689 diff -r 2326846efdab -r 24286f4ae135 .hgtags
1689 diff -r 2326846efdab -r 24286f4ae135 .hgtags
1690 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1690 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1691 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
1691 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
1692 @@ -0,0 +1,1 @@
1692 @@ -0,0 +1,1 @@
1693 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1693 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1694
1694
1695 (single rev)
1695 (single rev)
1696
1696
1697 $ hg diff -r 'tip^' -r 'tip^'
1697 $ hg diff -r 'tip^' -r 'tip^'
1698 $ hg diff -r 'tip^:tip^'
1698 $ hg diff -r 'tip^:tip^'
1699
1699
1700 (single rev that does not looks like a range)
1700 (single rev that does not looks like a range)
1701
1701
1702 $ hg diff -r 'tip^::tip^ or tip^'
1702 $ hg diff -r 'tip^::tip^ or tip^'
1703 diff -r d5d0dcbdc4d9 .hgtags
1703 diff -r d5d0dcbdc4d9 .hgtags
1704 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1704 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1705 +++ b/.hgtags * (glob)
1705 +++ b/.hgtags * (glob)
1706 @@ -0,0 +1,1 @@
1706 @@ -0,0 +1,1 @@
1707 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1707 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1708 $ hg diff -r 'tip^ or tip^'
1708 $ hg diff -r 'tip^ or tip^'
1709 diff -r d5d0dcbdc4d9 .hgtags
1709 diff -r d5d0dcbdc4d9 .hgtags
1710 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1710 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1711 +++ b/.hgtags * (glob)
1711 +++ b/.hgtags * (glob)
1712 @@ -0,0 +1,1 @@
1712 @@ -0,0 +1,1 @@
1713 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1713 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1714
1714
1715 (no rev)
1715 (no rev)
1716
1716
1717 $ hg diff -r 'author("babar") or author("celeste")'
1717 $ hg diff -r 'author("babar") or author("celeste")'
1718 abort: empty revision range
1718 abort: empty revision range
1719 [255]
1719 [255]
1720
1720
1721 aliases:
1721 aliases:
1722
1722
1723 $ echo '[revsetalias]' >> .hg/hgrc
1723 $ echo '[revsetalias]' >> .hg/hgrc
1724 $ echo 'm = merge()' >> .hg/hgrc
1724 $ echo 'm = merge()' >> .hg/hgrc
1725 (revset aliases can override builtin revsets)
1725 (revset aliases can override builtin revsets)
1726 $ echo 'p2($1) = p1($1)' >> .hg/hgrc
1726 $ echo 'p2($1) = p1($1)' >> .hg/hgrc
1727 $ echo 'sincem = descendants(m)' >> .hg/hgrc
1727 $ echo 'sincem = descendants(m)' >> .hg/hgrc
1728 $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc
1728 $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc
1729 $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
1729 $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
1730 $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
1730 $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
1731
1731
1732 $ try m
1732 $ try m
1733 ('symbol', 'm')
1733 ('symbol', 'm')
1734 * expanded:
1734 * expanded:
1735 (func
1735 (func
1736 ('symbol', 'merge')
1736 ('symbol', 'merge')
1737 None)
1737 None)
1738 * set:
1738 * set:
1739 <filteredset
1739 <filteredset
1740 <fullreposet+ 0:9>,
1740 <fullreposet+ 0:9>,
1741 <merge>>
1741 <merge>>
1742 6
1742 6
1743
1743
1744 $ HGPLAIN=1
1744 $ HGPLAIN=1
1745 $ export HGPLAIN
1745 $ export HGPLAIN
1746 $ try m
1746 $ try m
1747 ('symbol', 'm')
1747 ('symbol', 'm')
1748 abort: unknown revision 'm'!
1748 abort: unknown revision 'm'!
1749 [255]
1749 [255]
1750
1750
1751 $ HGPLAINEXCEPT=revsetalias
1751 $ HGPLAINEXCEPT=revsetalias
1752 $ export HGPLAINEXCEPT
1752 $ export HGPLAINEXCEPT
1753 $ try m
1753 $ try m
1754 ('symbol', 'm')
1754 ('symbol', 'm')
1755 * expanded:
1755 * expanded:
1756 (func
1756 (func
1757 ('symbol', 'merge')
1757 ('symbol', 'merge')
1758 None)
1758 None)
1759 * set:
1759 * set:
1760 <filteredset
1760 <filteredset
1761 <fullreposet+ 0:9>,
1761 <fullreposet+ 0:9>,
1762 <merge>>
1762 <merge>>
1763 6
1763 6
1764
1764
1765 $ unset HGPLAIN
1765 $ unset HGPLAIN
1766 $ unset HGPLAINEXCEPT
1766 $ unset HGPLAINEXCEPT
1767
1767
1768 $ try 'p2(.)'
1768 $ try 'p2(.)'
1769 (func
1769 (func
1770 ('symbol', 'p2')
1770 ('symbol', 'p2')
1771 ('symbol', '.'))
1771 ('symbol', '.'))
1772 * expanded:
1772 * expanded:
1773 (func
1773 (func
1774 ('symbol', 'p1')
1774 ('symbol', 'p1')
1775 ('symbol', '.'))
1775 ('symbol', '.'))
1776 * set:
1776 * set:
1777 <baseset+ [8]>
1777 <baseset+ [8]>
1778 8
1778 8
1779
1779
1780 $ HGPLAIN=1
1780 $ HGPLAIN=1
1781 $ export HGPLAIN
1781 $ export HGPLAIN
1782 $ try 'p2(.)'
1782 $ try 'p2(.)'
1783 (func
1783 (func
1784 ('symbol', 'p2')
1784 ('symbol', 'p2')
1785 ('symbol', '.'))
1785 ('symbol', '.'))
1786 * set:
1786 * set:
1787 <baseset+ []>
1787 <baseset+ []>
1788
1788
1789 $ HGPLAINEXCEPT=revsetalias
1789 $ HGPLAINEXCEPT=revsetalias
1790 $ export HGPLAINEXCEPT
1790 $ export HGPLAINEXCEPT
1791 $ try 'p2(.)'
1791 $ try 'p2(.)'
1792 (func
1792 (func
1793 ('symbol', 'p2')
1793 ('symbol', 'p2')
1794 ('symbol', '.'))
1794 ('symbol', '.'))
1795 * expanded:
1795 * expanded:
1796 (func
1796 (func
1797 ('symbol', 'p1')
1797 ('symbol', 'p1')
1798 ('symbol', '.'))
1798 ('symbol', '.'))
1799 * set:
1799 * set:
1800 <baseset+ [8]>
1800 <baseset+ [8]>
1801 8
1801 8
1802
1802
1803 $ unset HGPLAIN
1803 $ unset HGPLAIN
1804 $ unset HGPLAINEXCEPT
1804 $ unset HGPLAINEXCEPT
1805
1805
1806 test alias recursion
1806 test alias recursion
1807
1807
1808 $ try sincem
1808 $ try sincem
1809 ('symbol', 'sincem')
1809 ('symbol', 'sincem')
1810 * expanded:
1810 * expanded:
1811 (func
1811 (func
1812 ('symbol', 'descendants')
1812 ('symbol', 'descendants')
1813 (func
1813 (func
1814 ('symbol', 'merge')
1814 ('symbol', 'merge')
1815 None))
1815 None))
1816 * set:
1816 * set:
1817 <addset+
1817 <addset+
1818 <filteredset
1818 <filteredset
1819 <fullreposet+ 0:9>,
1819 <fullreposet+ 0:9>,
1820 <merge>>,
1820 <merge>>,
1821 <generatorset+>>
1821 <generatorset+>>
1822 6
1822 6
1823 7
1823 7
1824
1824
1825 test infinite recursion
1825 test infinite recursion
1826
1826
1827 $ echo 'recurse1 = recurse2' >> .hg/hgrc
1827 $ echo 'recurse1 = recurse2' >> .hg/hgrc
1828 $ echo 'recurse2 = recurse1' >> .hg/hgrc
1828 $ echo 'recurse2 = recurse1' >> .hg/hgrc
1829 $ try recurse1
1829 $ try recurse1
1830 ('symbol', 'recurse1')
1830 ('symbol', 'recurse1')
1831 hg: parse error: infinite expansion of revset alias "recurse1" detected
1831 hg: parse error: infinite expansion of revset alias "recurse1" detected
1832 [255]
1832 [255]
1833
1833
1834 $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc
1834 $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc
1835 $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc
1835 $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc
1836 $ try "level2(level1(1, 2), 3)"
1836 $ try "level2(level1(1, 2), 3)"
1837 (func
1837 (func
1838 ('symbol', 'level2')
1838 ('symbol', 'level2')
1839 (list
1839 (list
1840 (func
1840 (func
1841 ('symbol', 'level1')
1841 ('symbol', 'level1')
1842 (list
1842 (list
1843 ('symbol', '1')
1843 ('symbol', '1')
1844 ('symbol', '2')))
1844 ('symbol', '2')))
1845 ('symbol', '3')))
1845 ('symbol', '3')))
1846 * expanded:
1846 * expanded:
1847 (or
1847 (or
1848 ('symbol', '3')
1848 ('symbol', '3')
1849 (or
1849 (or
1850 ('symbol', '1')
1850 ('symbol', '1')
1851 ('symbol', '2')))
1851 ('symbol', '2')))
1852 * set:
1852 * set:
1853 <addset
1853 <addset
1854 <baseset [3]>,
1854 <baseset [3]>,
1855 <baseset [1, 2]>>
1855 <baseset [1, 2]>>
1856 3
1856 3
1857 1
1857 1
1858 2
1858 2
1859
1859
1860 test nesting and variable passing
1860 test nesting and variable passing
1861
1861
1862 $ echo 'nested($1) = nested2($1)' >> .hg/hgrc
1862 $ echo 'nested($1) = nested2($1)' >> .hg/hgrc
1863 $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc
1863 $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc
1864 $ echo 'nested3($1) = max($1)' >> .hg/hgrc
1864 $ echo 'nested3($1) = max($1)' >> .hg/hgrc
1865 $ try 'nested(2:5)'
1865 $ try 'nested(2:5)'
1866 (func
1866 (func
1867 ('symbol', 'nested')
1867 ('symbol', 'nested')
1868 (range
1868 (range
1869 ('symbol', '2')
1869 ('symbol', '2')
1870 ('symbol', '5')))
1870 ('symbol', '5')))
1871 * expanded:
1871 * expanded:
1872 (func
1872 (func
1873 ('symbol', 'max')
1873 ('symbol', 'max')
1874 (range
1874 (range
1875 ('symbol', '2')
1875 ('symbol', '2')
1876 ('symbol', '5')))
1876 ('symbol', '5')))
1877 * set:
1877 * set:
1878 <baseset
1878 <baseset
1879 <max
1879 <max
1880 <fullreposet+ 0:9>,
1880 <fullreposet+ 0:9>,
1881 <spanset+ 2:5>>>
1881 <spanset+ 2:5>>>
1882 5
1882 5
1883
1883
1884 test chained `or` operations are flattened at parsing phase
1884 test chained `or` operations are flattened at parsing phase
1885
1885
1886 $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc
1886 $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc
1887 $ try 'chainedorops(0:1, 1:2, 2:3)'
1887 $ try 'chainedorops(0:1, 1:2, 2:3)'
1888 (func
1888 (func
1889 ('symbol', 'chainedorops')
1889 ('symbol', 'chainedorops')
1890 (list
1890 (list
1891 (range
1891 (range
1892 ('symbol', '0')
1892 ('symbol', '0')
1893 ('symbol', '1'))
1893 ('symbol', '1'))
1894 (range
1894 (range
1895 ('symbol', '1')
1895 ('symbol', '1')
1896 ('symbol', '2'))
1896 ('symbol', '2'))
1897 (range
1897 (range
1898 ('symbol', '2')
1898 ('symbol', '2')
1899 ('symbol', '3'))))
1899 ('symbol', '3'))))
1900 * expanded:
1900 * expanded:
1901 (or
1901 (or
1902 (range
1902 (range
1903 ('symbol', '0')
1903 ('symbol', '0')
1904 ('symbol', '1'))
1904 ('symbol', '1'))
1905 (range
1905 (range
1906 ('symbol', '1')
1906 ('symbol', '1')
1907 ('symbol', '2'))
1907 ('symbol', '2'))
1908 (range
1908 (range
1909 ('symbol', '2')
1909 ('symbol', '2')
1910 ('symbol', '3')))
1910 ('symbol', '3')))
1911 * set:
1911 * set:
1912 <addset
1912 <addset
1913 <spanset+ 0:1>,
1913 <spanset+ 0:1>,
1914 <addset
1914 <addset
1915 <spanset+ 1:2>,
1915 <spanset+ 1:2>,
1916 <spanset+ 2:3>>>
1916 <spanset+ 2:3>>>
1917 0
1917 0
1918 1
1918 1
1919 2
1919 2
1920 3
1920 3
1921
1921
1922 test variable isolation, variable placeholders are rewritten as string
1922 test variable isolation, variable placeholders are rewritten as string
1923 then parsed and matched again as string. Check they do not leak too
1923 then parsed and matched again as string. Check they do not leak too
1924 far away.
1924 far away.
1925
1925
1926 $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc
1926 $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc
1927 $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc
1927 $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc
1928 $ try 'callinjection(2:5)'
1928 $ try 'callinjection(2:5)'
1929 (func
1929 (func
1930 ('symbol', 'callinjection')
1930 ('symbol', 'callinjection')
1931 (range
1931 (range
1932 ('symbol', '2')
1932 ('symbol', '2')
1933 ('symbol', '5')))
1933 ('symbol', '5')))
1934 * expanded:
1934 * expanded:
1935 (func
1935 (func
1936 ('symbol', 'descendants')
1936 ('symbol', 'descendants')
1937 (func
1937 (func
1938 ('symbol', 'max')
1938 ('symbol', 'max')
1939 ('string', '$1')))
1939 ('string', '$1')))
1940 abort: unknown revision '$1'!
1940 abort: unknown revision '$1'!
1941 [255]
1941 [255]
1942
1942
1943 test scope of alias expansion: 'universe' is expanded prior to 'shadowall(0)',
1943 test scope of alias expansion: 'universe' is expanded prior to 'shadowall(0)',
1944 but 'all()' should never be substituded to '0()'.
1944 but 'all()' should never be substituded to '0()'.
1945
1945
1946 $ echo 'universe = all()' >> .hg/hgrc
1946 $ echo 'universe = all()' >> .hg/hgrc
1947 $ echo 'shadowall(all) = all and universe' >> .hg/hgrc
1947 $ echo 'shadowall(all) = all and universe' >> .hg/hgrc
1948 $ try 'shadowall(0)'
1948 $ try 'shadowall(0)'
1949 (func
1949 (func
1950 ('symbol', 'shadowall')
1950 ('symbol', 'shadowall')
1951 ('symbol', '0'))
1951 ('symbol', '0'))
1952 * expanded:
1952 * expanded:
1953 (and
1953 (and
1954 ('symbol', '0')
1954 ('symbol', '0')
1955 (func
1955 (func
1956 ('symbol', 'all')
1956 ('symbol', 'all')
1957 None))
1957 None))
1958 * set:
1958 * set:
1959 <filteredset
1959 <filteredset
1960 <baseset [0]>,
1960 <baseset [0]>,
1961 <spanset+ 0:9>>
1961 <spanset+ 0:9>>
1962 0
1962 0
1963
1963
1964 test unknown reference:
1964 test unknown reference:
1965
1965
1966 $ try "unknownref(0)" --config 'revsetalias.unknownref($1)=$1:$2'
1966 $ try "unknownref(0)" --config 'revsetalias.unknownref($1)=$1:$2'
1967 (func
1967 (func
1968 ('symbol', 'unknownref')
1968 ('symbol', 'unknownref')
1969 ('symbol', '0'))
1969 ('symbol', '0'))
1970 abort: failed to parse the definition of revset alias "unknownref": invalid symbol '$2'
1970 abort: bad definition of revset alias "unknownref": invalid symbol '$2'
1971 [255]
1971 [255]
1972
1972
1973 $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip"
1973 $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip"
1974 ('symbol', 'tip')
1974 ('symbol', 'tip')
1975 warning: failed to parse the definition of revset alias "anotherbadone": at 7: not a prefix: end
1975 warning: bad definition of revset alias "anotherbadone": at 7: not a prefix: end
1976 * set:
1976 * set:
1977 <baseset [9]>
1977 <baseset [9]>
1978 9
1978 9
1979
1979
1980 $ try 'tip'
1980 $ try 'tip'
1981 ('symbol', 'tip')
1981 ('symbol', 'tip')
1982 * set:
1982 * set:
1983 <baseset [9]>
1983 <baseset [9]>
1984 9
1984 9
1985
1985
1986 $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip"
1986 $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip"
1987 ('symbol', 'tip')
1987 ('symbol', 'tip')
1988 warning: failed to parse the declaration of revset alias "bad name": at 4: invalid token
1988 warning: bad declaration of revset alias "bad name": at 4: invalid token
1989 * set:
1989 * set:
1990 <baseset [9]>
1990 <baseset [9]>
1991 9
1991 9
1992 $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc
1992 $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc
1993 $ try 'strictreplacing("foo", tip)'
1993 $ try 'strictreplacing("foo", tip)'
1994 (func
1994 (func
1995 ('symbol', 'strictreplacing')
1995 ('symbol', 'strictreplacing')
1996 (list
1996 (list
1997 ('string', 'foo')
1997 ('string', 'foo')
1998 ('symbol', 'tip')))
1998 ('symbol', 'tip')))
1999 * expanded:
1999 * expanded:
2000 (or
2000 (or
2001 ('symbol', 'tip')
2001 ('symbol', 'tip')
2002 (func
2002 (func
2003 ('symbol', 'desc')
2003 ('symbol', 'desc')
2004 ('string', '$1')))
2004 ('string', '$1')))
2005 * set:
2005 * set:
2006 <addset
2006 <addset
2007 <baseset [9]>,
2007 <baseset [9]>,
2008 <filteredset
2008 <filteredset
2009 <fullreposet+ 0:9>,
2009 <fullreposet+ 0:9>,
2010 <desc '$1'>>>
2010 <desc '$1'>>>
2011 9
2011 9
2012
2012
2013 $ try 'd(2:5)'
2013 $ try 'd(2:5)'
2014 (func
2014 (func
2015 ('symbol', 'd')
2015 ('symbol', 'd')
2016 (range
2016 (range
2017 ('symbol', '2')
2017 ('symbol', '2')
2018 ('symbol', '5')))
2018 ('symbol', '5')))
2019 * expanded:
2019 * expanded:
2020 (func
2020 (func
2021 ('symbol', 'reverse')
2021 ('symbol', 'reverse')
2022 (func
2022 (func
2023 ('symbol', 'sort')
2023 ('symbol', 'sort')
2024 (list
2024 (list
2025 (range
2025 (range
2026 ('symbol', '2')
2026 ('symbol', '2')
2027 ('symbol', '5'))
2027 ('symbol', '5'))
2028 ('symbol', 'date'))))
2028 ('symbol', 'date'))))
2029 * set:
2029 * set:
2030 <baseset [4, 5, 3, 2]>
2030 <baseset [4, 5, 3, 2]>
2031 4
2031 4
2032 5
2032 5
2033 3
2033 3
2034 2
2034 2
2035 $ try 'rs(2 or 3, date)'
2035 $ try 'rs(2 or 3, date)'
2036 (func
2036 (func
2037 ('symbol', 'rs')
2037 ('symbol', 'rs')
2038 (list
2038 (list
2039 (or
2039 (or
2040 ('symbol', '2')
2040 ('symbol', '2')
2041 ('symbol', '3'))
2041 ('symbol', '3'))
2042 ('symbol', 'date')))
2042 ('symbol', 'date')))
2043 * expanded:
2043 * expanded:
2044 (func
2044 (func
2045 ('symbol', 'reverse')
2045 ('symbol', 'reverse')
2046 (func
2046 (func
2047 ('symbol', 'sort')
2047 ('symbol', 'sort')
2048 (list
2048 (list
2049 (or
2049 (or
2050 ('symbol', '2')
2050 ('symbol', '2')
2051 ('symbol', '3'))
2051 ('symbol', '3'))
2052 ('symbol', 'date'))))
2052 ('symbol', 'date'))))
2053 * set:
2053 * set:
2054 <baseset [3, 2]>
2054 <baseset [3, 2]>
2055 3
2055 3
2056 2
2056 2
2057 $ try 'rs()'
2057 $ try 'rs()'
2058 (func
2058 (func
2059 ('symbol', 'rs')
2059 ('symbol', 'rs')
2060 None)
2060 None)
2061 hg: parse error: invalid number of arguments: 0
2061 hg: parse error: invalid number of arguments: 0
2062 [255]
2062 [255]
2063 $ try 'rs(2)'
2063 $ try 'rs(2)'
2064 (func
2064 (func
2065 ('symbol', 'rs')
2065 ('symbol', 'rs')
2066 ('symbol', '2'))
2066 ('symbol', '2'))
2067 hg: parse error: invalid number of arguments: 1
2067 hg: parse error: invalid number of arguments: 1
2068 [255]
2068 [255]
2069 $ try 'rs(2, data, 7)'
2069 $ try 'rs(2, data, 7)'
2070 (func
2070 (func
2071 ('symbol', 'rs')
2071 ('symbol', 'rs')
2072 (list
2072 (list
2073 ('symbol', '2')
2073 ('symbol', '2')
2074 ('symbol', 'data')
2074 ('symbol', 'data')
2075 ('symbol', '7')))
2075 ('symbol', '7')))
2076 hg: parse error: invalid number of arguments: 3
2076 hg: parse error: invalid number of arguments: 3
2077 [255]
2077 [255]
2078 $ try 'rs4(2 or 3, x, x, date)'
2078 $ try 'rs4(2 or 3, x, x, date)'
2079 (func
2079 (func
2080 ('symbol', 'rs4')
2080 ('symbol', 'rs4')
2081 (list
2081 (list
2082 (or
2082 (or
2083 ('symbol', '2')
2083 ('symbol', '2')
2084 ('symbol', '3'))
2084 ('symbol', '3'))
2085 ('symbol', 'x')
2085 ('symbol', 'x')
2086 ('symbol', 'x')
2086 ('symbol', 'x')
2087 ('symbol', 'date')))
2087 ('symbol', 'date')))
2088 * expanded:
2088 * expanded:
2089 (func
2089 (func
2090 ('symbol', 'reverse')
2090 ('symbol', 'reverse')
2091 (func
2091 (func
2092 ('symbol', 'sort')
2092 ('symbol', 'sort')
2093 (list
2093 (list
2094 (or
2094 (or
2095 ('symbol', '2')
2095 ('symbol', '2')
2096 ('symbol', '3'))
2096 ('symbol', '3'))
2097 ('symbol', 'date'))))
2097 ('symbol', 'date'))))
2098 * set:
2098 * set:
2099 <baseset [3, 2]>
2099 <baseset [3, 2]>
2100 3
2100 3
2101 2
2101 2
2102
2102
2103 issue4553: check that revset aliases override existing hash prefix
2103 issue4553: check that revset aliases override existing hash prefix
2104
2104
2105 $ hg log -qr e
2105 $ hg log -qr e
2106 6:e0cc66ef77e8
2106 6:e0cc66ef77e8
2107
2107
2108 $ hg log -qr e --config revsetalias.e="all()"
2108 $ hg log -qr e --config revsetalias.e="all()"
2109 0:2785f51eece5
2109 0:2785f51eece5
2110 1:d75937da8da0
2110 1:d75937da8da0
2111 2:5ed5505e9f1c
2111 2:5ed5505e9f1c
2112 3:8528aa5637f2
2112 3:8528aa5637f2
2113 4:2326846efdab
2113 4:2326846efdab
2114 5:904fa392b941
2114 5:904fa392b941
2115 6:e0cc66ef77e8
2115 6:e0cc66ef77e8
2116 7:013af1973af4
2116 7:013af1973af4
2117 8:d5d0dcbdc4d9
2117 8:d5d0dcbdc4d9
2118 9:24286f4ae135
2118 9:24286f4ae135
2119
2119
2120 $ hg log -qr e: --config revsetalias.e="0"
2120 $ hg log -qr e: --config revsetalias.e="0"
2121 0:2785f51eece5
2121 0:2785f51eece5
2122 1:d75937da8da0
2122 1:d75937da8da0
2123 2:5ed5505e9f1c
2123 2:5ed5505e9f1c
2124 3:8528aa5637f2
2124 3:8528aa5637f2
2125 4:2326846efdab
2125 4:2326846efdab
2126 5:904fa392b941
2126 5:904fa392b941
2127 6:e0cc66ef77e8
2127 6:e0cc66ef77e8
2128 7:013af1973af4
2128 7:013af1973af4
2129 8:d5d0dcbdc4d9
2129 8:d5d0dcbdc4d9
2130 9:24286f4ae135
2130 9:24286f4ae135
2131
2131
2132 $ hg log -qr :e --config revsetalias.e="9"
2132 $ hg log -qr :e --config revsetalias.e="9"
2133 0:2785f51eece5
2133 0:2785f51eece5
2134 1:d75937da8da0
2134 1:d75937da8da0
2135 2:5ed5505e9f1c
2135 2:5ed5505e9f1c
2136 3:8528aa5637f2
2136 3:8528aa5637f2
2137 4:2326846efdab
2137 4:2326846efdab
2138 5:904fa392b941
2138 5:904fa392b941
2139 6:e0cc66ef77e8
2139 6:e0cc66ef77e8
2140 7:013af1973af4
2140 7:013af1973af4
2141 8:d5d0dcbdc4d9
2141 8:d5d0dcbdc4d9
2142 9:24286f4ae135
2142 9:24286f4ae135
2143
2143
2144 $ hg log -qr e:
2144 $ hg log -qr e:
2145 6:e0cc66ef77e8
2145 6:e0cc66ef77e8
2146 7:013af1973af4
2146 7:013af1973af4
2147 8:d5d0dcbdc4d9
2147 8:d5d0dcbdc4d9
2148 9:24286f4ae135
2148 9:24286f4ae135
2149
2149
2150 $ hg log -qr :e
2150 $ hg log -qr :e
2151 0:2785f51eece5
2151 0:2785f51eece5
2152 1:d75937da8da0
2152 1:d75937da8da0
2153 2:5ed5505e9f1c
2153 2:5ed5505e9f1c
2154 3:8528aa5637f2
2154 3:8528aa5637f2
2155 4:2326846efdab
2155 4:2326846efdab
2156 5:904fa392b941
2156 5:904fa392b941
2157 6:e0cc66ef77e8
2157 6:e0cc66ef77e8
2158
2158
2159 issue2549 - correct optimizations
2159 issue2549 - correct optimizations
2160
2160
2161 $ try 'limit(1 or 2 or 3, 2) and not 2'
2161 $ try 'limit(1 or 2 or 3, 2) and not 2'
2162 (and
2162 (and
2163 (func
2163 (func
2164 ('symbol', 'limit')
2164 ('symbol', 'limit')
2165 (list
2165 (list
2166 (or
2166 (or
2167 ('symbol', '1')
2167 ('symbol', '1')
2168 ('symbol', '2')
2168 ('symbol', '2')
2169 ('symbol', '3'))
2169 ('symbol', '3'))
2170 ('symbol', '2')))
2170 ('symbol', '2')))
2171 (not
2171 (not
2172 ('symbol', '2')))
2172 ('symbol', '2')))
2173 * set:
2173 * set:
2174 <filteredset
2174 <filteredset
2175 <baseset
2175 <baseset
2176 <limit n=2, offset=0,
2176 <limit n=2, offset=0,
2177 <fullreposet+ 0:9>,
2177 <fullreposet+ 0:9>,
2178 <baseset [1, 2, 3]>>>,
2178 <baseset [1, 2, 3]>>>,
2179 <not
2179 <not
2180 <baseset [2]>>>
2180 <baseset [2]>>>
2181 1
2181 1
2182 $ try 'max(1 or 2) and not 2'
2182 $ try 'max(1 or 2) and not 2'
2183 (and
2183 (and
2184 (func
2184 (func
2185 ('symbol', 'max')
2185 ('symbol', 'max')
2186 (or
2186 (or
2187 ('symbol', '1')
2187 ('symbol', '1')
2188 ('symbol', '2')))
2188 ('symbol', '2')))
2189 (not
2189 (not
2190 ('symbol', '2')))
2190 ('symbol', '2')))
2191 * set:
2191 * set:
2192 <filteredset
2192 <filteredset
2193 <baseset
2193 <baseset
2194 <max
2194 <max
2195 <fullreposet+ 0:9>,
2195 <fullreposet+ 0:9>,
2196 <baseset [1, 2]>>>,
2196 <baseset [1, 2]>>>,
2197 <not
2197 <not
2198 <baseset [2]>>>
2198 <baseset [2]>>>
2199 $ try 'min(1 or 2) and not 1'
2199 $ try 'min(1 or 2) and not 1'
2200 (and
2200 (and
2201 (func
2201 (func
2202 ('symbol', 'min')
2202 ('symbol', 'min')
2203 (or
2203 (or
2204 ('symbol', '1')
2204 ('symbol', '1')
2205 ('symbol', '2')))
2205 ('symbol', '2')))
2206 (not
2206 (not
2207 ('symbol', '1')))
2207 ('symbol', '1')))
2208 * set:
2208 * set:
2209 <filteredset
2209 <filteredset
2210 <baseset
2210 <baseset
2211 <min
2211 <min
2212 <fullreposet+ 0:9>,
2212 <fullreposet+ 0:9>,
2213 <baseset [1, 2]>>>,
2213 <baseset [1, 2]>>>,
2214 <not
2214 <not
2215 <baseset [1]>>>
2215 <baseset [1]>>>
2216 $ try 'last(1 or 2, 1) and not 2'
2216 $ try 'last(1 or 2, 1) and not 2'
2217 (and
2217 (and
2218 (func
2218 (func
2219 ('symbol', 'last')
2219 ('symbol', 'last')
2220 (list
2220 (list
2221 (or
2221 (or
2222 ('symbol', '1')
2222 ('symbol', '1')
2223 ('symbol', '2'))
2223 ('symbol', '2'))
2224 ('symbol', '1')))
2224 ('symbol', '1')))
2225 (not
2225 (not
2226 ('symbol', '2')))
2226 ('symbol', '2')))
2227 * set:
2227 * set:
2228 <filteredset
2228 <filteredset
2229 <baseset
2229 <baseset
2230 <last n=1,
2230 <last n=1,
2231 <fullreposet+ 0:9>,
2231 <fullreposet+ 0:9>,
2232 <baseset [2, 1]>>>,
2232 <baseset [2, 1]>>>,
2233 <not
2233 <not
2234 <baseset [2]>>>
2234 <baseset [2]>>>
2235
2235
2236 issue4289 - ordering of built-ins
2236 issue4289 - ordering of built-ins
2237 $ hg log -M -q -r 3:2
2237 $ hg log -M -q -r 3:2
2238 3:8528aa5637f2
2238 3:8528aa5637f2
2239 2:5ed5505e9f1c
2239 2:5ed5505e9f1c
2240
2240
2241 test revsets started with 40-chars hash (issue3669)
2241 test revsets started with 40-chars hash (issue3669)
2242
2242
2243 $ ISSUE3669_TIP=`hg tip --template '{node}'`
2243 $ ISSUE3669_TIP=`hg tip --template '{node}'`
2244 $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n'
2244 $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n'
2245 9
2245 9
2246 $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n'
2246 $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n'
2247 8
2247 8
2248
2248
2249 test or-ed indirect predicates (issue3775)
2249 test or-ed indirect predicates (issue3775)
2250
2250
2251 $ log '6 or 6^1' | sort
2251 $ log '6 or 6^1' | sort
2252 5
2252 5
2253 6
2253 6
2254 $ log '6^1 or 6' | sort
2254 $ log '6^1 or 6' | sort
2255 5
2255 5
2256 6
2256 6
2257 $ log '4 or 4~1' | sort
2257 $ log '4 or 4~1' | sort
2258 2
2258 2
2259 4
2259 4
2260 $ log '4~1 or 4' | sort
2260 $ log '4~1 or 4' | sort
2261 2
2261 2
2262 4
2262 4
2263 $ log '(0 or 2):(4 or 6) or 0 or 6' | sort
2263 $ log '(0 or 2):(4 or 6) or 0 or 6' | sort
2264 0
2264 0
2265 1
2265 1
2266 2
2266 2
2267 3
2267 3
2268 4
2268 4
2269 5
2269 5
2270 6
2270 6
2271 $ log '0 or 6 or (0 or 2):(4 or 6)' | sort
2271 $ log '0 or 6 or (0 or 2):(4 or 6)' | sort
2272 0
2272 0
2273 1
2273 1
2274 2
2274 2
2275 3
2275 3
2276 4
2276 4
2277 5
2277 5
2278 6
2278 6
2279
2279
2280 tests for 'remote()' predicate:
2280 tests for 'remote()' predicate:
2281 #. (csets in remote) (id) (remote)
2281 #. (csets in remote) (id) (remote)
2282 1. less than local current branch "default"
2282 1. less than local current branch "default"
2283 2. same with local specified "default"
2283 2. same with local specified "default"
2284 3. more than local specified specified
2284 3. more than local specified specified
2285
2285
2286 $ hg clone --quiet -U . ../remote3
2286 $ hg clone --quiet -U . ../remote3
2287 $ cd ../remote3
2287 $ cd ../remote3
2288 $ hg update -q 7
2288 $ hg update -q 7
2289 $ echo r > r
2289 $ echo r > r
2290 $ hg ci -Aqm 10
2290 $ hg ci -Aqm 10
2291 $ log 'remote()'
2291 $ log 'remote()'
2292 7
2292 7
2293 $ log 'remote("a-b-c-")'
2293 $ log 'remote("a-b-c-")'
2294 2
2294 2
2295 $ cd ../repo
2295 $ cd ../repo
2296 $ log 'remote(".a.b.c.", "../remote3")'
2296 $ log 'remote(".a.b.c.", "../remote3")'
2297
2297
2298 tests for concatenation of strings/symbols by "##"
2298 tests for concatenation of strings/symbols by "##"
2299
2299
2300 $ try "278 ## '5f5' ## 1ee ## 'ce5'"
2300 $ try "278 ## '5f5' ## 1ee ## 'ce5'"
2301 (_concat
2301 (_concat
2302 (_concat
2302 (_concat
2303 (_concat
2303 (_concat
2304 ('symbol', '278')
2304 ('symbol', '278')
2305 ('string', '5f5'))
2305 ('string', '5f5'))
2306 ('symbol', '1ee'))
2306 ('symbol', '1ee'))
2307 ('string', 'ce5'))
2307 ('string', 'ce5'))
2308 * concatenated:
2308 * concatenated:
2309 ('string', '2785f51eece5')
2309 ('string', '2785f51eece5')
2310 * set:
2310 * set:
2311 <baseset [0]>
2311 <baseset [0]>
2312 0
2312 0
2313
2313
2314 $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc
2314 $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc
2315 $ try "cat4(278, '5f5', 1ee, 'ce5')"
2315 $ try "cat4(278, '5f5', 1ee, 'ce5')"
2316 (func
2316 (func
2317 ('symbol', 'cat4')
2317 ('symbol', 'cat4')
2318 (list
2318 (list
2319 ('symbol', '278')
2319 ('symbol', '278')
2320 ('string', '5f5')
2320 ('string', '5f5')
2321 ('symbol', '1ee')
2321 ('symbol', '1ee')
2322 ('string', 'ce5')))
2322 ('string', 'ce5')))
2323 * expanded:
2323 * expanded:
2324 (_concat
2324 (_concat
2325 (_concat
2325 (_concat
2326 (_concat
2326 (_concat
2327 ('symbol', '278')
2327 ('symbol', '278')
2328 ('string', '5f5'))
2328 ('string', '5f5'))
2329 ('symbol', '1ee'))
2329 ('symbol', '1ee'))
2330 ('string', 'ce5'))
2330 ('string', 'ce5'))
2331 * concatenated:
2331 * concatenated:
2332 ('string', '2785f51eece5')
2332 ('string', '2785f51eece5')
2333 * set:
2333 * set:
2334 <baseset [0]>
2334 <baseset [0]>
2335 0
2335 0
2336
2336
2337 (check concatenation in alias nesting)
2337 (check concatenation in alias nesting)
2338
2338
2339 $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc
2339 $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc
2340 $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc
2340 $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc
2341 $ log "cat2x2(278, '5f5', 1ee, 'ce5')"
2341 $ log "cat2x2(278, '5f5', 1ee, 'ce5')"
2342 0
2342 0
2343
2343
2344 (check operator priority)
2344 (check operator priority)
2345
2345
2346 $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc
2346 $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc
2347 $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)"
2347 $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)"
2348 0
2348 0
2349 4
2349 4
2350
2350
2351 $ cd ..
2351 $ cd ..
2352
2352
2353 prepare repository that has "default" branches of multiple roots
2353 prepare repository that has "default" branches of multiple roots
2354
2354
2355 $ hg init namedbranch
2355 $ hg init namedbranch
2356 $ cd namedbranch
2356 $ cd namedbranch
2357
2357
2358 $ echo default0 >> a
2358 $ echo default0 >> a
2359 $ hg ci -Aqm0
2359 $ hg ci -Aqm0
2360 $ echo default1 >> a
2360 $ echo default1 >> a
2361 $ hg ci -m1
2361 $ hg ci -m1
2362
2362
2363 $ hg branch -q stable
2363 $ hg branch -q stable
2364 $ echo stable2 >> a
2364 $ echo stable2 >> a
2365 $ hg ci -m2
2365 $ hg ci -m2
2366 $ echo stable3 >> a
2366 $ echo stable3 >> a
2367 $ hg ci -m3
2367 $ hg ci -m3
2368
2368
2369 $ hg update -q null
2369 $ hg update -q null
2370 $ echo default4 >> a
2370 $ echo default4 >> a
2371 $ hg ci -Aqm4
2371 $ hg ci -Aqm4
2372 $ echo default5 >> a
2372 $ echo default5 >> a
2373 $ hg ci -m5
2373 $ hg ci -m5
2374
2374
2375 "null" revision belongs to "default" branch (issue4683)
2375 "null" revision belongs to "default" branch (issue4683)
2376
2376
2377 $ log 'branch(null)'
2377 $ log 'branch(null)'
2378 0
2378 0
2379 1
2379 1
2380 4
2380 4
2381 5
2381 5
2382
2382
2383 "null" revision belongs to "default" branch, but it shouldn't appear in set
2383 "null" revision belongs to "default" branch, but it shouldn't appear in set
2384 unless explicitly specified (issue4682)
2384 unless explicitly specified (issue4682)
2385
2385
2386 $ log 'children(branch(default))'
2386 $ log 'children(branch(default))'
2387 1
2387 1
2388 2
2388 2
2389 5
2389 5
2390
2390
2391 $ cd ..
2391 $ cd ..
2392
2392
2393 test author/desc/keyword in problematic encoding
2393 test author/desc/keyword in problematic encoding
2394 # unicode: cp932:
2394 # unicode: cp932:
2395 # u30A2 0x83 0x41(= 'A')
2395 # u30A2 0x83 0x41(= 'A')
2396 # u30C2 0x83 0x61(= 'a')
2396 # u30C2 0x83 0x61(= 'a')
2397
2397
2398 $ hg init problematicencoding
2398 $ hg init problematicencoding
2399 $ cd problematicencoding
2399 $ cd problematicencoding
2400
2400
2401 $ python > setup.sh <<EOF
2401 $ python > setup.sh <<EOF
2402 > print u'''
2402 > print u'''
2403 > echo a > text
2403 > echo a > text
2404 > hg add text
2404 > hg add text
2405 > hg --encoding utf-8 commit -u '\u30A2' -m none
2405 > hg --encoding utf-8 commit -u '\u30A2' -m none
2406 > echo b > text
2406 > echo b > text
2407 > hg --encoding utf-8 commit -u '\u30C2' -m none
2407 > hg --encoding utf-8 commit -u '\u30C2' -m none
2408 > echo c > text
2408 > echo c > text
2409 > hg --encoding utf-8 commit -u none -m '\u30A2'
2409 > hg --encoding utf-8 commit -u none -m '\u30A2'
2410 > echo d > text
2410 > echo d > text
2411 > hg --encoding utf-8 commit -u none -m '\u30C2'
2411 > hg --encoding utf-8 commit -u none -m '\u30C2'
2412 > '''.encode('utf-8')
2412 > '''.encode('utf-8')
2413 > EOF
2413 > EOF
2414 $ sh < setup.sh
2414 $ sh < setup.sh
2415
2415
2416 test in problematic encoding
2416 test in problematic encoding
2417 $ python > test.sh <<EOF
2417 $ python > test.sh <<EOF
2418 > print u'''
2418 > print u'''
2419 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)'
2419 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)'
2420 > echo ====
2420 > echo ====
2421 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)'
2421 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)'
2422 > echo ====
2422 > echo ====
2423 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)'
2423 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)'
2424 > echo ====
2424 > echo ====
2425 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)'
2425 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)'
2426 > echo ====
2426 > echo ====
2427 > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)'
2427 > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)'
2428 > echo ====
2428 > echo ====
2429 > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)'
2429 > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)'
2430 > '''.encode('cp932')
2430 > '''.encode('cp932')
2431 > EOF
2431 > EOF
2432 $ sh < test.sh
2432 $ sh < test.sh
2433 0
2433 0
2434 ====
2434 ====
2435 1
2435 1
2436 ====
2436 ====
2437 2
2437 2
2438 ====
2438 ====
2439 3
2439 3
2440 ====
2440 ====
2441 0
2441 0
2442 2
2442 2
2443 ====
2443 ====
2444 1
2444 1
2445 3
2445 3
2446
2446
2447 test error message of bad revset
2447 test error message of bad revset
2448 $ hg log -r 'foo\\'
2448 $ hg log -r 'foo\\'
2449 hg: parse error at 3: syntax error in revset 'foo\\'
2449 hg: parse error at 3: syntax error in revset 'foo\\'
2450 [255]
2450 [255]
2451
2451
2452 $ cd ..
2452 $ cd ..
2453
2453
2454 Test that revset predicate of extension isn't loaded at failure of
2454 Test that revset predicate of extension isn't loaded at failure of
2455 loading it
2455 loading it
2456
2456
2457 $ cd repo
2457 $ cd repo
2458
2458
2459 $ cat <<EOF > $TESTTMP/custompredicate.py
2459 $ cat <<EOF > $TESTTMP/custompredicate.py
2460 > from mercurial import error, registrar, revset
2460 > from mercurial import error, registrar, revset
2461 >
2461 >
2462 > revsetpredicate = registrar.revsetpredicate()
2462 > revsetpredicate = registrar.revsetpredicate()
2463 >
2463 >
2464 > @revsetpredicate('custom1()')
2464 > @revsetpredicate('custom1()')
2465 > def custom1(repo, subset, x):
2465 > def custom1(repo, subset, x):
2466 > return revset.baseset([1])
2466 > return revset.baseset([1])
2467 >
2467 >
2468 > raise error.Abort('intentional failure of loading extension')
2468 > raise error.Abort('intentional failure of loading extension')
2469 > EOF
2469 > EOF
2470 $ cat <<EOF > .hg/hgrc
2470 $ cat <<EOF > .hg/hgrc
2471 > [extensions]
2471 > [extensions]
2472 > custompredicate = $TESTTMP/custompredicate.py
2472 > custompredicate = $TESTTMP/custompredicate.py
2473 > EOF
2473 > EOF
2474
2474
2475 $ hg debugrevspec "custom1()"
2475 $ hg debugrevspec "custom1()"
2476 *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension
2476 *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension
2477 hg: parse error: unknown identifier: custom1
2477 hg: parse error: unknown identifier: custom1
2478 [255]
2478 [255]
2479
2479
2480 $ cd ..
2480 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now