##// END OF EJS Templates
templatekw: apply manifest template only if ctx.manifestnode() exists...
Yuya Nishihara -
r25736:8854ca3f default
parent child Browse files
Show More
@@ -1,490 +1,493 b''
1 # templatekw.py - common changeset template keywords
1 # templatekw.py - common changeset template keywords
2 #
2 #
3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from node import hex
8 from node import hex
9 import patch, util, error
9 import patch, util, error
10 import hbisect
10 import hbisect
11
11
12 # This helper class allows us to handle both:
12 # This helper class allows us to handle both:
13 # "{files}" (legacy command-line-specific list hack) and
13 # "{files}" (legacy command-line-specific list hack) and
14 # "{files % '{file}\n'}" (hgweb-style with inlining and function support)
14 # "{files % '{file}\n'}" (hgweb-style with inlining and function support)
15 # and to access raw values:
15 # and to access raw values:
16 # "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
16 # "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
17 # "{get(extras, key)}"
17 # "{get(extras, key)}"
18
18
19 class _hybrid(object):
19 class _hybrid(object):
20 def __init__(self, gen, values, makemap, joinfmt=None):
20 def __init__(self, gen, values, makemap, joinfmt=None):
21 self.gen = gen
21 self.gen = gen
22 self.values = values
22 self.values = values
23 self._makemap = makemap
23 self._makemap = makemap
24 if joinfmt:
24 if joinfmt:
25 self.joinfmt = joinfmt
25 self.joinfmt = joinfmt
26 else:
26 else:
27 self.joinfmt = lambda x: x.values()[0]
27 self.joinfmt = lambda x: x.values()[0]
28 def __iter__(self):
28 def __iter__(self):
29 return self.gen
29 return self.gen
30 def __call__(self):
30 def __call__(self):
31 makemap = self._makemap
31 makemap = self._makemap
32 for x in self.values:
32 for x in self.values:
33 yield makemap(x)
33 yield makemap(x)
34 def __contains__(self, x):
34 def __contains__(self, x):
35 return x in self.values
35 return x in self.values
36 def __len__(self):
36 def __len__(self):
37 return len(self.values)
37 return len(self.values)
38 def __getattr__(self, name):
38 def __getattr__(self, name):
39 if name != 'get':
39 if name != 'get':
40 raise AttributeError(name)
40 raise AttributeError(name)
41 return getattr(self.values, name)
41 return getattr(self.values, name)
42
42
43 def showlist(name, values, plural=None, element=None, separator=' ', **args):
43 def showlist(name, values, plural=None, element=None, separator=' ', **args):
44 if not element:
44 if not element:
45 element = name
45 element = name
46 f = _showlist(name, values, plural, separator, **args)
46 f = _showlist(name, values, plural, separator, **args)
47 return _hybrid(f, values, lambda x: {element: x})
47 return _hybrid(f, values, lambda x: {element: x})
48
48
49 def _showlist(name, values, plural=None, separator=' ', **args):
49 def _showlist(name, values, plural=None, separator=' ', **args):
50 '''expand set of values.
50 '''expand set of values.
51 name is name of key in template map.
51 name is name of key in template map.
52 values is list of strings or dicts.
52 values is list of strings or dicts.
53 plural is plural of name, if not simply name + 's'.
53 plural is plural of name, if not simply name + 's'.
54 separator is used to join values as a string
54 separator is used to join values as a string
55
55
56 expansion works like this, given name 'foo'.
56 expansion works like this, given name 'foo'.
57
57
58 if values is empty, expand 'no_foos'.
58 if values is empty, expand 'no_foos'.
59
59
60 if 'foo' not in template map, return values as a string,
60 if 'foo' not in template map, return values as a string,
61 joined by 'separator'.
61 joined by 'separator'.
62
62
63 expand 'start_foos'.
63 expand 'start_foos'.
64
64
65 for each value, expand 'foo'. if 'last_foo' in template
65 for each value, expand 'foo'. if 'last_foo' in template
66 map, expand it instead of 'foo' for last key.
66 map, expand it instead of 'foo' for last key.
67
67
68 expand 'end_foos'.
68 expand 'end_foos'.
69 '''
69 '''
70 templ = args['templ']
70 templ = args['templ']
71 if plural:
71 if plural:
72 names = plural
72 names = plural
73 else: names = name + 's'
73 else: names = name + 's'
74 if not values:
74 if not values:
75 noname = 'no_' + names
75 noname = 'no_' + names
76 if noname in templ:
76 if noname in templ:
77 yield templ(noname, **args)
77 yield templ(noname, **args)
78 return
78 return
79 if name not in templ:
79 if name not in templ:
80 if isinstance(values[0], str):
80 if isinstance(values[0], str):
81 yield separator.join(values)
81 yield separator.join(values)
82 else:
82 else:
83 for v in values:
83 for v in values:
84 yield dict(v, **args)
84 yield dict(v, **args)
85 return
85 return
86 startname = 'start_' + names
86 startname = 'start_' + names
87 if startname in templ:
87 if startname in templ:
88 yield templ(startname, **args)
88 yield templ(startname, **args)
89 vargs = args.copy()
89 vargs = args.copy()
90 def one(v, tag=name):
90 def one(v, tag=name):
91 try:
91 try:
92 vargs.update(v)
92 vargs.update(v)
93 except (AttributeError, ValueError):
93 except (AttributeError, ValueError):
94 try:
94 try:
95 for a, b in v:
95 for a, b in v:
96 vargs[a] = b
96 vargs[a] = b
97 except ValueError:
97 except ValueError:
98 vargs[name] = v
98 vargs[name] = v
99 return templ(tag, **vargs)
99 return templ(tag, **vargs)
100 lastname = 'last_' + name
100 lastname = 'last_' + name
101 if lastname in templ:
101 if lastname in templ:
102 last = values.pop()
102 last = values.pop()
103 else:
103 else:
104 last = None
104 last = None
105 for v in values:
105 for v in values:
106 yield one(v)
106 yield one(v)
107 if last is not None:
107 if last is not None:
108 yield one(last, tag=lastname)
108 yield one(last, tag=lastname)
109 endname = 'end_' + names
109 endname = 'end_' + names
110 if endname in templ:
110 if endname in templ:
111 yield templ(endname, **args)
111 yield templ(endname, **args)
112
112
113 def getfiles(repo, ctx, revcache):
113 def getfiles(repo, ctx, revcache):
114 if 'files' not in revcache:
114 if 'files' not in revcache:
115 revcache['files'] = repo.status(ctx.p1(), ctx)[:3]
115 revcache['files'] = repo.status(ctx.p1(), ctx)[:3]
116 return revcache['files']
116 return revcache['files']
117
117
118 def getlatesttags(repo, ctx, cache):
118 def getlatesttags(repo, ctx, cache):
119 '''return date, distance and name for the latest tag of rev'''
119 '''return date, distance and name for the latest tag of rev'''
120
120
121 if 'latesttags' not in cache:
121 if 'latesttags' not in cache:
122 # Cache mapping from rev to a tuple with tag date, tag
122 # Cache mapping from rev to a tuple with tag date, tag
123 # distance and tag name
123 # distance and tag name
124 cache['latesttags'] = {-1: (0, 0, ['null'])}
124 cache['latesttags'] = {-1: (0, 0, ['null'])}
125 latesttags = cache['latesttags']
125 latesttags = cache['latesttags']
126
126
127 rev = ctx.rev()
127 rev = ctx.rev()
128 todo = [rev]
128 todo = [rev]
129 while todo:
129 while todo:
130 rev = todo.pop()
130 rev = todo.pop()
131 if rev in latesttags:
131 if rev in latesttags:
132 continue
132 continue
133 ctx = repo[rev]
133 ctx = repo[rev]
134 tags = [t for t in ctx.tags()
134 tags = [t for t in ctx.tags()
135 if (repo.tagtype(t) and repo.tagtype(t) != 'local')]
135 if (repo.tagtype(t) and repo.tagtype(t) != 'local')]
136 if tags:
136 if tags:
137 latesttags[rev] = ctx.date()[0], 0, [t for t in sorted(tags)]
137 latesttags[rev] = ctx.date()[0], 0, [t for t in sorted(tags)]
138 continue
138 continue
139 try:
139 try:
140 # The tuples are laid out so the right one can be found by
140 # The tuples are laid out so the right one can be found by
141 # comparison.
141 # comparison.
142 pdate, pdist, ptag = max(
142 pdate, pdist, ptag = max(
143 latesttags[p.rev()] for p in ctx.parents())
143 latesttags[p.rev()] for p in ctx.parents())
144 except KeyError:
144 except KeyError:
145 # Cache miss - recurse
145 # Cache miss - recurse
146 todo.append(rev)
146 todo.append(rev)
147 todo.extend(p.rev() for p in ctx.parents())
147 todo.extend(p.rev() for p in ctx.parents())
148 continue
148 continue
149 latesttags[rev] = pdate, pdist + 1, ptag
149 latesttags[rev] = pdate, pdist + 1, ptag
150 return latesttags[rev]
150 return latesttags[rev]
151
151
152 def getrenamedfn(repo, endrev=None):
152 def getrenamedfn(repo, endrev=None):
153 rcache = {}
153 rcache = {}
154 if endrev is None:
154 if endrev is None:
155 endrev = len(repo)
155 endrev = len(repo)
156
156
157 def getrenamed(fn, rev):
157 def getrenamed(fn, rev):
158 '''looks up all renames for a file (up to endrev) the first
158 '''looks up all renames for a file (up to endrev) the first
159 time the file is given. It indexes on the changerev and only
159 time the file is given. It indexes on the changerev and only
160 parses the manifest if linkrev != changerev.
160 parses the manifest if linkrev != changerev.
161 Returns rename info for fn at changerev rev.'''
161 Returns rename info for fn at changerev rev.'''
162 if fn not in rcache:
162 if fn not in rcache:
163 rcache[fn] = {}
163 rcache[fn] = {}
164 fl = repo.file(fn)
164 fl = repo.file(fn)
165 for i in fl:
165 for i in fl:
166 lr = fl.linkrev(i)
166 lr = fl.linkrev(i)
167 renamed = fl.renamed(fl.node(i))
167 renamed = fl.renamed(fl.node(i))
168 rcache[fn][lr] = renamed
168 rcache[fn][lr] = renamed
169 if lr >= endrev:
169 if lr >= endrev:
170 break
170 break
171 if rev in rcache[fn]:
171 if rev in rcache[fn]:
172 return rcache[fn][rev]
172 return rcache[fn][rev]
173
173
174 # If linkrev != rev (i.e. rev not found in rcache) fallback to
174 # If linkrev != rev (i.e. rev not found in rcache) fallback to
175 # filectx logic.
175 # filectx logic.
176 try:
176 try:
177 return repo[rev][fn].renamed()
177 return repo[rev][fn].renamed()
178 except error.LookupError:
178 except error.LookupError:
179 return None
179 return None
180
180
181 return getrenamed
181 return getrenamed
182
182
183
183
184 def showauthor(repo, ctx, templ, **args):
184 def showauthor(repo, ctx, templ, **args):
185 """:author: String. The unmodified author of the changeset."""
185 """:author: String. The unmodified author of the changeset."""
186 return ctx.user()
186 return ctx.user()
187
187
188 def showbisect(repo, ctx, templ, **args):
188 def showbisect(repo, ctx, templ, **args):
189 """:bisect: String. The changeset bisection status."""
189 """:bisect: String. The changeset bisection status."""
190 return hbisect.label(repo, ctx.node())
190 return hbisect.label(repo, ctx.node())
191
191
192 def showbranch(**args):
192 def showbranch(**args):
193 """:branch: String. The name of the branch on which the changeset was
193 """:branch: String. The name of the branch on which the changeset was
194 committed.
194 committed.
195 """
195 """
196 return args['ctx'].branch()
196 return args['ctx'].branch()
197
197
198 def showbranches(**args):
198 def showbranches(**args):
199 """:branches: List of strings. The name of the branch on which the
199 """:branches: List of strings. The name of the branch on which the
200 changeset was committed. Will be empty if the branch name was
200 changeset was committed. Will be empty if the branch name was
201 default.
201 default.
202 """
202 """
203 branch = args['ctx'].branch()
203 branch = args['ctx'].branch()
204 if branch != 'default':
204 if branch != 'default':
205 return showlist('branch', [branch], plural='branches', **args)
205 return showlist('branch', [branch], plural='branches', **args)
206 return showlist('branch', [], plural='branches', **args)
206 return showlist('branch', [], plural='branches', **args)
207
207
208 def showbookmarks(**args):
208 def showbookmarks(**args):
209 """:bookmarks: List of strings. Any bookmarks associated with the
209 """:bookmarks: List of strings. Any bookmarks associated with the
210 changeset. Also sets 'active', the name of the active bookmark.
210 changeset. Also sets 'active', the name of the active bookmark.
211 """
211 """
212 repo = args['ctx']._repo
212 repo = args['ctx']._repo
213 bookmarks = args['ctx'].bookmarks()
213 bookmarks = args['ctx'].bookmarks()
214 active = repo._activebookmark
214 active = repo._activebookmark
215 makemap = lambda v: {'bookmark': v, 'active': active, 'current': active}
215 makemap = lambda v: {'bookmark': v, 'active': active, 'current': active}
216 f = _showlist('bookmark', bookmarks, **args)
216 f = _showlist('bookmark', bookmarks, **args)
217 return _hybrid(f, bookmarks, makemap, lambda x: x['bookmark'])
217 return _hybrid(f, bookmarks, makemap, lambda x: x['bookmark'])
218
218
219 def showchildren(**args):
219 def showchildren(**args):
220 """:children: List of strings. The children of the changeset."""
220 """:children: List of strings. The children of the changeset."""
221 ctx = args['ctx']
221 ctx = args['ctx']
222 childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()]
222 childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()]
223 return showlist('children', childrevs, element='child', **args)
223 return showlist('children', childrevs, element='child', **args)
224
224
225 # Deprecated, but kept alive for help generation a purpose.
225 # Deprecated, but kept alive for help generation a purpose.
226 def showcurrentbookmark(**args):
226 def showcurrentbookmark(**args):
227 """:currentbookmark: String. The active bookmark, if it is
227 """:currentbookmark: String. The active bookmark, if it is
228 associated with the changeset (DEPRECATED)"""
228 associated with the changeset (DEPRECATED)"""
229 return showactivebookmark(**args)
229 return showactivebookmark(**args)
230
230
231 def showactivebookmark(**args):
231 def showactivebookmark(**args):
232 """:activebookmark: String. The active bookmark, if it is
232 """:activebookmark: String. The active bookmark, if it is
233 associated with the changeset"""
233 associated with the changeset"""
234 active = args['repo']._activebookmark
234 active = args['repo']._activebookmark
235 if active and active in args['ctx'].bookmarks():
235 if active and active in args['ctx'].bookmarks():
236 return active
236 return active
237 return ''
237 return ''
238
238
239 def showdate(repo, ctx, templ, **args):
239 def showdate(repo, ctx, templ, **args):
240 """:date: Date information. The date when the changeset was committed."""
240 """:date: Date information. The date when the changeset was committed."""
241 return ctx.date()
241 return ctx.date()
242
242
243 def showdescription(repo, ctx, templ, **args):
243 def showdescription(repo, ctx, templ, **args):
244 """:desc: String. The text of the changeset description."""
244 """:desc: String. The text of the changeset description."""
245 return ctx.description().strip()
245 return ctx.description().strip()
246
246
247 def showdiffstat(repo, ctx, templ, **args):
247 def showdiffstat(repo, ctx, templ, **args):
248 """:diffstat: String. Statistics of changes with the following format:
248 """:diffstat: String. Statistics of changes with the following format:
249 "modified files: +added/-removed lines"
249 "modified files: +added/-removed lines"
250 """
250 """
251 stats = patch.diffstatdata(util.iterlines(ctx.diff()))
251 stats = patch.diffstatdata(util.iterlines(ctx.diff()))
252 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
252 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
253 return '%s: +%s/-%s' % (len(stats), adds, removes)
253 return '%s: +%s/-%s' % (len(stats), adds, removes)
254
254
255 def showextras(**args):
255 def showextras(**args):
256 """:extras: List of dicts with key, value entries of the 'extras'
256 """:extras: List of dicts with key, value entries of the 'extras'
257 field of this changeset."""
257 field of this changeset."""
258 extras = args['ctx'].extra()
258 extras = args['ctx'].extra()
259 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
259 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
260 makemap = lambda k: {'key': k, 'value': extras[k]}
260 makemap = lambda k: {'key': k, 'value': extras[k]}
261 c = [makemap(k) for k in extras]
261 c = [makemap(k) for k in extras]
262 f = _showlist('extra', c, plural='extras', **args)
262 f = _showlist('extra', c, plural='extras', **args)
263 return _hybrid(f, extras, makemap,
263 return _hybrid(f, extras, makemap,
264 lambda x: '%s=%s' % (x['key'], x['value']))
264 lambda x: '%s=%s' % (x['key'], x['value']))
265
265
266 def showfileadds(**args):
266 def showfileadds(**args):
267 """:file_adds: List of strings. Files added by this changeset."""
267 """:file_adds: List of strings. Files added by this changeset."""
268 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
268 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
269 return showlist('file_add', getfiles(repo, ctx, revcache)[1],
269 return showlist('file_add', getfiles(repo, ctx, revcache)[1],
270 element='file', **args)
270 element='file', **args)
271
271
272 def showfilecopies(**args):
272 def showfilecopies(**args):
273 """:file_copies: List of strings. Files copied in this changeset with
273 """:file_copies: List of strings. Files copied in this changeset with
274 their sources.
274 their sources.
275 """
275 """
276 cache, ctx = args['cache'], args['ctx']
276 cache, ctx = args['cache'], args['ctx']
277 copies = args['revcache'].get('copies')
277 copies = args['revcache'].get('copies')
278 if copies is None:
278 if copies is None:
279 if 'getrenamed' not in cache:
279 if 'getrenamed' not in cache:
280 cache['getrenamed'] = getrenamedfn(args['repo'])
280 cache['getrenamed'] = getrenamedfn(args['repo'])
281 copies = []
281 copies = []
282 getrenamed = cache['getrenamed']
282 getrenamed = cache['getrenamed']
283 for fn in ctx.files():
283 for fn in ctx.files():
284 rename = getrenamed(fn, ctx.rev())
284 rename = getrenamed(fn, ctx.rev())
285 if rename:
285 if rename:
286 copies.append((fn, rename[0]))
286 copies.append((fn, rename[0]))
287
287
288 copies = util.sortdict(copies)
288 copies = util.sortdict(copies)
289 makemap = lambda k: {'name': k, 'source': copies[k]}
289 makemap = lambda k: {'name': k, 'source': copies[k]}
290 c = [makemap(k) for k in copies]
290 c = [makemap(k) for k in copies]
291 f = _showlist('file_copy', c, plural='file_copies', **args)
291 f = _showlist('file_copy', c, plural='file_copies', **args)
292 return _hybrid(f, copies, makemap,
292 return _hybrid(f, copies, makemap,
293 lambda x: '%s (%s)' % (x['name'], x['source']))
293 lambda x: '%s (%s)' % (x['name'], x['source']))
294
294
295 # showfilecopiesswitch() displays file copies only if copy records are
295 # showfilecopiesswitch() displays file copies only if copy records are
296 # provided before calling the templater, usually with a --copies
296 # provided before calling the templater, usually with a --copies
297 # command line switch.
297 # command line switch.
298 def showfilecopiesswitch(**args):
298 def showfilecopiesswitch(**args):
299 """:file_copies_switch: List of strings. Like "file_copies" but displayed
299 """:file_copies_switch: List of strings. Like "file_copies" but displayed
300 only if the --copied switch is set.
300 only if the --copied switch is set.
301 """
301 """
302 copies = args['revcache'].get('copies') or []
302 copies = args['revcache'].get('copies') or []
303 copies = util.sortdict(copies)
303 copies = util.sortdict(copies)
304 makemap = lambda k: {'name': k, 'source': copies[k]}
304 makemap = lambda k: {'name': k, 'source': copies[k]}
305 c = [makemap(k) for k in copies]
305 c = [makemap(k) for k in copies]
306 f = _showlist('file_copy', c, plural='file_copies', **args)
306 f = _showlist('file_copy', c, plural='file_copies', **args)
307 return _hybrid(f, copies, makemap,
307 return _hybrid(f, copies, makemap,
308 lambda x: '%s (%s)' % (x['name'], x['source']))
308 lambda x: '%s (%s)' % (x['name'], x['source']))
309
309
310 def showfiledels(**args):
310 def showfiledels(**args):
311 """:file_dels: List of strings. Files removed by this changeset."""
311 """:file_dels: List of strings. Files removed by this changeset."""
312 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
312 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
313 return showlist('file_del', getfiles(repo, ctx, revcache)[2],
313 return showlist('file_del', getfiles(repo, ctx, revcache)[2],
314 element='file', **args)
314 element='file', **args)
315
315
316 def showfilemods(**args):
316 def showfilemods(**args):
317 """:file_mods: List of strings. Files modified by this changeset."""
317 """:file_mods: List of strings. Files modified by this changeset."""
318 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
318 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
319 return showlist('file_mod', getfiles(repo, ctx, revcache)[0],
319 return showlist('file_mod', getfiles(repo, ctx, revcache)[0],
320 element='file', **args)
320 element='file', **args)
321
321
322 def showfiles(**args):
322 def showfiles(**args):
323 """:files: List of strings. All files modified, added, or removed by this
323 """:files: List of strings. All files modified, added, or removed by this
324 changeset.
324 changeset.
325 """
325 """
326 return showlist('file', args['ctx'].files(), **args)
326 return showlist('file', args['ctx'].files(), **args)
327
327
328 def showlatesttag(**args):
328 def showlatesttag(**args):
329 """:latesttag: List of strings. The global tags on the most recent globally
329 """:latesttag: List of strings. The global tags on the most recent globally
330 tagged ancestor of this changeset.
330 tagged ancestor of this changeset.
331 """
331 """
332 repo, ctx = args['repo'], args['ctx']
332 repo, ctx = args['repo'], args['ctx']
333 cache = args['cache']
333 cache = args['cache']
334 latesttags = getlatesttags(repo, ctx, cache)[2]
334 latesttags = getlatesttags(repo, ctx, cache)[2]
335
335
336 return showlist('latesttag', latesttags, separator=':', **args)
336 return showlist('latesttag', latesttags, separator=':', **args)
337
337
338 def showlatesttagdistance(repo, ctx, templ, cache, **args):
338 def showlatesttagdistance(repo, ctx, templ, cache, **args):
339 """:latesttagdistance: Integer. Longest path to the latest tag."""
339 """:latesttagdistance: Integer. Longest path to the latest tag."""
340 return getlatesttags(repo, ctx, cache)[1]
340 return getlatesttags(repo, ctx, cache)[1]
341
341
342 def showchangessincelatesttag(repo, ctx, templ, cache, **args):
342 def showchangessincelatesttag(repo, ctx, templ, cache, **args):
343 """:changessincelatesttag: Integer. All ancestors not in the latest tag."""
343 """:changessincelatesttag: Integer. All ancestors not in the latest tag."""
344 latesttag = getlatesttags(repo, ctx, cache)[2][0]
344 latesttag = getlatesttags(repo, ctx, cache)[2][0]
345 offset = 0
345 offset = 0
346 revs = [ctx.rev()]
346 revs = [ctx.rev()]
347
347
348 # The only() revset doesn't currently support wdir()
348 # The only() revset doesn't currently support wdir()
349 if ctx.rev() is None:
349 if ctx.rev() is None:
350 offset = 1
350 offset = 1
351 revs = [p.rev() for p in ctx.parents()]
351 revs = [p.rev() for p in ctx.parents()]
352
352
353 return len(repo.revs('only(%ld, %s)', revs, latesttag)) + offset
353 return len(repo.revs('only(%ld, %s)', revs, latesttag)) + offset
354
354
355 def showmanifest(**args):
355 def showmanifest(**args):
356 repo, ctx, templ = args['repo'], args['ctx'], args['templ']
356 repo, ctx, templ = args['repo'], args['ctx'], args['templ']
357 mnode = ctx.manifestnode()
357 mnode = ctx.manifestnode()
358 if mnode is None:
359 # just avoid crash, we might want to use the 'ff...' hash in future
360 return
358 args = args.copy()
361 args = args.copy()
359 args.update({'rev': repo.manifest.rev(mnode), 'node': hex(mnode)})
362 args.update({'rev': repo.manifest.rev(mnode), 'node': hex(mnode)})
360 return templ('manifest', **args)
363 return templ('manifest', **args)
361
364
362 def shownode(repo, ctx, templ, **args):
365 def shownode(repo, ctx, templ, **args):
363 """:node: String. The changeset identification hash, as a 40 hexadecimal
366 """:node: String. The changeset identification hash, as a 40 hexadecimal
364 digit string.
367 digit string.
365 """
368 """
366 return ctx.hex()
369 return ctx.hex()
367
370
368 def showp1rev(repo, ctx, templ, **args):
371 def showp1rev(repo, ctx, templ, **args):
369 """:p1rev: Integer. The repository-local revision number of the changeset's
372 """:p1rev: Integer. The repository-local revision number of the changeset's
370 first parent, or -1 if the changeset has no parents."""
373 first parent, or -1 if the changeset has no parents."""
371 return ctx.p1().rev()
374 return ctx.p1().rev()
372
375
373 def showp2rev(repo, ctx, templ, **args):
376 def showp2rev(repo, ctx, templ, **args):
374 """:p2rev: Integer. The repository-local revision number of the changeset's
377 """:p2rev: Integer. The repository-local revision number of the changeset's
375 second parent, or -1 if the changeset has no second parent."""
378 second parent, or -1 if the changeset has no second parent."""
376 return ctx.p2().rev()
379 return ctx.p2().rev()
377
380
378 def showp1node(repo, ctx, templ, **args):
381 def showp1node(repo, ctx, templ, **args):
379 """:p1node: String. The identification hash of the changeset's first parent,
382 """:p1node: String. The identification hash of the changeset's first parent,
380 as a 40 digit hexadecimal string. If the changeset has no parents, all
383 as a 40 digit hexadecimal string. If the changeset has no parents, all
381 digits are 0."""
384 digits are 0."""
382 return ctx.p1().hex()
385 return ctx.p1().hex()
383
386
384 def showp2node(repo, ctx, templ, **args):
387 def showp2node(repo, ctx, templ, **args):
385 """:p2node: String. The identification hash of the changeset's second
388 """:p2node: String. The identification hash of the changeset's second
386 parent, as a 40 digit hexadecimal string. If the changeset has no second
389 parent, as a 40 digit hexadecimal string. If the changeset has no second
387 parent, all digits are 0."""
390 parent, all digits are 0."""
388 return ctx.p2().hex()
391 return ctx.p2().hex()
389
392
390 def showphase(repo, ctx, templ, **args):
393 def showphase(repo, ctx, templ, **args):
391 """:phase: String. The changeset phase name."""
394 """:phase: String. The changeset phase name."""
392 return ctx.phasestr()
395 return ctx.phasestr()
393
396
394 def showphaseidx(repo, ctx, templ, **args):
397 def showphaseidx(repo, ctx, templ, **args):
395 """:phaseidx: Integer. The changeset phase index."""
398 """:phaseidx: Integer. The changeset phase index."""
396 return ctx.phase()
399 return ctx.phase()
397
400
398 def showrev(repo, ctx, templ, **args):
401 def showrev(repo, ctx, templ, **args):
399 """:rev: Integer. The repository-local changeset revision number."""
402 """:rev: Integer. The repository-local changeset revision number."""
400 return ctx.rev()
403 return ctx.rev()
401
404
402 def showsubrepos(**args):
405 def showsubrepos(**args):
403 """:subrepos: List of strings. Updated subrepositories in the changeset."""
406 """:subrepos: List of strings. Updated subrepositories in the changeset."""
404 ctx = args['ctx']
407 ctx = args['ctx']
405 substate = ctx.substate
408 substate = ctx.substate
406 if not substate:
409 if not substate:
407 return showlist('subrepo', [], **args)
410 return showlist('subrepo', [], **args)
408 psubstate = ctx.parents()[0].substate or {}
411 psubstate = ctx.parents()[0].substate or {}
409 subrepos = []
412 subrepos = []
410 for sub in substate:
413 for sub in substate:
411 if sub not in psubstate or substate[sub] != psubstate[sub]:
414 if sub not in psubstate or substate[sub] != psubstate[sub]:
412 subrepos.append(sub) # modified or newly added in ctx
415 subrepos.append(sub) # modified or newly added in ctx
413 for sub in psubstate:
416 for sub in psubstate:
414 if sub not in substate:
417 if sub not in substate:
415 subrepos.append(sub) # removed in ctx
418 subrepos.append(sub) # removed in ctx
416 return showlist('subrepo', sorted(subrepos), **args)
419 return showlist('subrepo', sorted(subrepos), **args)
417
420
418 def shownames(namespace, **args):
421 def shownames(namespace, **args):
419 """helper method to generate a template keyword for a namespace"""
422 """helper method to generate a template keyword for a namespace"""
420 ctx = args['ctx']
423 ctx = args['ctx']
421 repo = ctx.repo()
424 repo = ctx.repo()
422 ns = repo.names[namespace]
425 ns = repo.names[namespace]
423 names = ns.names(repo, ctx.node())
426 names = ns.names(repo, ctx.node())
424 return showlist(ns.templatename, names, plural=namespace, **args)
427 return showlist(ns.templatename, names, plural=namespace, **args)
425
428
426 # don't remove "showtags" definition, even though namespaces will put
429 # don't remove "showtags" definition, even though namespaces will put
427 # a helper function for "tags" keyword into "keywords" map automatically,
430 # a helper function for "tags" keyword into "keywords" map automatically,
428 # because online help text is built without namespaces initialization
431 # because online help text is built without namespaces initialization
429 def showtags(**args):
432 def showtags(**args):
430 """:tags: List of strings. Any tags associated with the changeset."""
433 """:tags: List of strings. Any tags associated with the changeset."""
431 return shownames('tags', **args)
434 return shownames('tags', **args)
432
435
433 # keywords are callables like:
436 # keywords are callables like:
434 # fn(repo, ctx, templ, cache, revcache, **args)
437 # fn(repo, ctx, templ, cache, revcache, **args)
435 # with:
438 # with:
436 # repo - current repository instance
439 # repo - current repository instance
437 # ctx - the changectx being displayed
440 # ctx - the changectx being displayed
438 # templ - the templater instance
441 # templ - the templater instance
439 # cache - a cache dictionary for the whole templater run
442 # cache - a cache dictionary for the whole templater run
440 # revcache - a cache dictionary for the current revision
443 # revcache - a cache dictionary for the current revision
441 keywords = {
444 keywords = {
442 'activebookmark': showactivebookmark,
445 'activebookmark': showactivebookmark,
443 'author': showauthor,
446 'author': showauthor,
444 'bisect': showbisect,
447 'bisect': showbisect,
445 'branch': showbranch,
448 'branch': showbranch,
446 'branches': showbranches,
449 'branches': showbranches,
447 'bookmarks': showbookmarks,
450 'bookmarks': showbookmarks,
448 'changessincelatesttag': showchangessincelatesttag,
451 'changessincelatesttag': showchangessincelatesttag,
449 'children': showchildren,
452 'children': showchildren,
450 # currentbookmark is deprecated
453 # currentbookmark is deprecated
451 'currentbookmark': showcurrentbookmark,
454 'currentbookmark': showcurrentbookmark,
452 'date': showdate,
455 'date': showdate,
453 'desc': showdescription,
456 'desc': showdescription,
454 'diffstat': showdiffstat,
457 'diffstat': showdiffstat,
455 'extras': showextras,
458 'extras': showextras,
456 'file_adds': showfileadds,
459 'file_adds': showfileadds,
457 'file_copies': showfilecopies,
460 'file_copies': showfilecopies,
458 'file_copies_switch': showfilecopiesswitch,
461 'file_copies_switch': showfilecopiesswitch,
459 'file_dels': showfiledels,
462 'file_dels': showfiledels,
460 'file_mods': showfilemods,
463 'file_mods': showfilemods,
461 'files': showfiles,
464 'files': showfiles,
462 'latesttag': showlatesttag,
465 'latesttag': showlatesttag,
463 'latesttagdistance': showlatesttagdistance,
466 'latesttagdistance': showlatesttagdistance,
464 'manifest': showmanifest,
467 'manifest': showmanifest,
465 'node': shownode,
468 'node': shownode,
466 'p1rev': showp1rev,
469 'p1rev': showp1rev,
467 'p1node': showp1node,
470 'p1node': showp1node,
468 'p2rev': showp2rev,
471 'p2rev': showp2rev,
469 'p2node': showp2node,
472 'p2node': showp2node,
470 'phase': showphase,
473 'phase': showphase,
471 'phaseidx': showphaseidx,
474 'phaseidx': showphaseidx,
472 'rev': showrev,
475 'rev': showrev,
473 'subrepos': showsubrepos,
476 'subrepos': showsubrepos,
474 'tags': showtags,
477 'tags': showtags,
475 }
478 }
476
479
477 def _showparents(**args):
480 def _showparents(**args):
478 """:parents: List of strings. The parents of the changeset in "rev:node"
481 """:parents: List of strings. The parents of the changeset in "rev:node"
479 format. If the changeset has only one "natural" parent (the predecessor
482 format. If the changeset has only one "natural" parent (the predecessor
480 revision) nothing is shown."""
483 revision) nothing is shown."""
481 pass
484 pass
482
485
483 dockeywords = {
486 dockeywords = {
484 'parents': _showparents,
487 'parents': _showparents,
485 }
488 }
486 dockeywords.update(keywords)
489 dockeywords.update(keywords)
487 del dockeywords['branches']
490 del dockeywords['branches']
488
491
489 # tell hggettext to extract docstrings from these functions:
492 # tell hggettext to extract docstrings from these functions:
490 i18nfunctions = dockeywords.values()
493 i18nfunctions = dockeywords.values()
@@ -1,3373 +1,3379 b''
1 $ hg init a
1 $ hg init a
2 $ cd a
2 $ cd a
3 $ echo a > a
3 $ echo a > a
4 $ hg add a
4 $ hg add a
5 $ echo line 1 > b
5 $ echo line 1 > b
6 $ echo line 2 >> b
6 $ echo line 2 >> b
7 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
7 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
8
8
9 $ hg add b
9 $ hg add b
10 $ echo other 1 > c
10 $ echo other 1 > c
11 $ echo other 2 >> c
11 $ echo other 2 >> c
12 $ echo >> c
12 $ echo >> c
13 $ echo other 3 >> c
13 $ echo other 3 >> c
14 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
14 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
15
15
16 $ hg add c
16 $ hg add c
17 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
17 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
18 $ echo c >> c
18 $ echo c >> c
19 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
19 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
20
20
21 $ echo foo > .hg/branch
21 $ echo foo > .hg/branch
22 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
22 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
23
23
24 $ hg co -q 3
24 $ hg co -q 3
25 $ echo other 4 >> d
25 $ echo other 4 >> d
26 $ hg add d
26 $ hg add d
27 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
27 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
28
28
29 $ hg merge -q foo
29 $ hg merge -q foo
30 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
30 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
31
31
32 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 Some keywords are invalid for working-directory revision, but they should
55 never cause crash:
56
57 $ hg log -r 'wdir()' -T '{manifest}\n'
58
59
54 Quoting for ui.logtemplate
60 Quoting for ui.logtemplate
55
61
56 $ hg tip --config "ui.logtemplate={rev}\n"
62 $ hg tip --config "ui.logtemplate={rev}\n"
57 8
63 8
58 $ hg tip --config "ui.logtemplate='{rev}\n'"
64 $ hg tip --config "ui.logtemplate='{rev}\n'"
59 8
65 8
60 $ hg tip --config 'ui.logtemplate="{rev}\n"'
66 $ hg tip --config 'ui.logtemplate="{rev}\n"'
61 8
67 8
62
68
63 Make sure user/global hgrc does not affect tests
69 Make sure user/global hgrc does not affect tests
64
70
65 $ echo '[ui]' > .hg/hgrc
71 $ echo '[ui]' > .hg/hgrc
66 $ echo 'logtemplate =' >> .hg/hgrc
72 $ echo 'logtemplate =' >> .hg/hgrc
67 $ echo 'style =' >> .hg/hgrc
73 $ echo 'style =' >> .hg/hgrc
68
74
69 Add some simple styles to settings
75 Add some simple styles to settings
70
76
71 $ echo '[templates]' >> .hg/hgrc
77 $ echo '[templates]' >> .hg/hgrc
72 $ printf 'simple = "{rev}\\n"\n' >> .hg/hgrc
78 $ printf 'simple = "{rev}\\n"\n' >> .hg/hgrc
73 $ printf 'simple2 = {rev}\\n\n' >> .hg/hgrc
79 $ printf 'simple2 = {rev}\\n\n' >> .hg/hgrc
74
80
75 $ hg log -l1 -Tsimple
81 $ hg log -l1 -Tsimple
76 8
82 8
77 $ hg log -l1 -Tsimple2
83 $ hg log -l1 -Tsimple2
78 8
84 8
79
85
80 Test templates and style maps in files:
86 Test templates and style maps in files:
81
87
82 $ echo "{rev}" > tmpl
88 $ echo "{rev}" > tmpl
83 $ hg log -l1 -T./tmpl
89 $ hg log -l1 -T./tmpl
84 8
90 8
85 $ hg log -l1 -Tblah/blah
91 $ hg log -l1 -Tblah/blah
86 blah/blah (no-eol)
92 blah/blah (no-eol)
87
93
88 $ printf 'changeset = "{rev}\\n"\n' > map-simple
94 $ printf 'changeset = "{rev}\\n"\n' > map-simple
89 $ hg log -l1 -T./map-simple
95 $ hg log -l1 -T./map-simple
90 8
96 8
91
97
92 Template should precede style option
98 Template should precede style option
93
99
94 $ hg log -l1 --style default -T '{rev}\n'
100 $ hg log -l1 --style default -T '{rev}\n'
95 8
101 8
96
102
97 Add a commit with empty description, to ensure that the templates
103 Add a commit with empty description, to ensure that the templates
98 below will omit the description line.
104 below will omit the description line.
99
105
100 $ echo c >> c
106 $ echo c >> c
101 $ hg add c
107 $ hg add c
102 $ hg commit -qm ' '
108 $ hg commit -qm ' '
103
109
104 Default style is like normal output. Phases style should be the same
110 Default style is like normal output. Phases style should be the same
105 as default style, except for extra phase lines.
111 as default style, except for extra phase lines.
106
112
107 $ hg log > log.out
113 $ hg log > log.out
108 $ hg log --style default > style.out
114 $ hg log --style default > style.out
109 $ cmp log.out style.out || diff -u log.out style.out
115 $ cmp log.out style.out || diff -u log.out style.out
110 $ hg log -T phases > phases.out
116 $ hg log -T phases > phases.out
111 $ diff -U 0 log.out phases.out | grep -v '^---\|^+++'
117 $ diff -U 0 log.out phases.out | grep -v '^---\|^+++'
112 @@ -2,0 +3 @@
118 @@ -2,0 +3 @@
113 +phase: draft
119 +phase: draft
114 @@ -6,0 +8 @@
120 @@ -6,0 +8 @@
115 +phase: draft
121 +phase: draft
116 @@ -11,0 +14 @@
122 @@ -11,0 +14 @@
117 +phase: draft
123 +phase: draft
118 @@ -17,0 +21 @@
124 @@ -17,0 +21 @@
119 +phase: draft
125 +phase: draft
120 @@ -24,0 +29 @@
126 @@ -24,0 +29 @@
121 +phase: draft
127 +phase: draft
122 @@ -31,0 +37 @@
128 @@ -31,0 +37 @@
123 +phase: draft
129 +phase: draft
124 @@ -36,0 +43 @@
130 @@ -36,0 +43 @@
125 +phase: draft
131 +phase: draft
126 @@ -41,0 +49 @@
132 @@ -41,0 +49 @@
127 +phase: draft
133 +phase: draft
128 @@ -46,0 +55 @@
134 @@ -46,0 +55 @@
129 +phase: draft
135 +phase: draft
130 @@ -51,0 +61 @@
136 @@ -51,0 +61 @@
131 +phase: draft
137 +phase: draft
132
138
133 $ hg log -v > log.out
139 $ hg log -v > log.out
134 $ hg log -v --style default > style.out
140 $ hg log -v --style default > style.out
135 $ cmp log.out style.out || diff -u log.out style.out
141 $ cmp log.out style.out || diff -u log.out style.out
136 $ hg log -v -T phases > phases.out
142 $ hg log -v -T phases > phases.out
137 $ diff -U 0 log.out phases.out | grep -v '^---\|^+++'
143 $ diff -U 0 log.out phases.out | grep -v '^---\|^+++'
138 @@ -2,0 +3 @@
144 @@ -2,0 +3 @@
139 +phase: draft
145 +phase: draft
140 @@ -7,0 +9 @@
146 @@ -7,0 +9 @@
141 +phase: draft
147 +phase: draft
142 @@ -15,0 +18 @@
148 @@ -15,0 +18 @@
143 +phase: draft
149 +phase: draft
144 @@ -24,0 +28 @@
150 @@ -24,0 +28 @@
145 +phase: draft
151 +phase: draft
146 @@ -33,0 +38 @@
152 @@ -33,0 +38 @@
147 +phase: draft
153 +phase: draft
148 @@ -43,0 +49 @@
154 @@ -43,0 +49 @@
149 +phase: draft
155 +phase: draft
150 @@ -50,0 +57 @@
156 @@ -50,0 +57 @@
151 +phase: draft
157 +phase: draft
152 @@ -58,0 +66 @@
158 @@ -58,0 +66 @@
153 +phase: draft
159 +phase: draft
154 @@ -66,0 +75 @@
160 @@ -66,0 +75 @@
155 +phase: draft
161 +phase: draft
156 @@ -77,0 +87 @@
162 @@ -77,0 +87 @@
157 +phase: draft
163 +phase: draft
158
164
159 $ hg log -q > log.out
165 $ hg log -q > log.out
160 $ hg log -q --style default > style.out
166 $ hg log -q --style default > style.out
161 $ cmp log.out style.out || diff -u log.out style.out
167 $ cmp log.out style.out || diff -u log.out style.out
162 $ hg log -q -T phases > phases.out
168 $ hg log -q -T phases > phases.out
163 $ cmp log.out phases.out || diff -u log.out phases.out
169 $ cmp log.out phases.out || diff -u log.out phases.out
164
170
165 $ hg log --debug > log.out
171 $ hg log --debug > log.out
166 $ hg log --debug --style default > style.out
172 $ hg log --debug --style default > style.out
167 $ cmp log.out style.out || diff -u log.out style.out
173 $ cmp log.out style.out || diff -u log.out style.out
168 $ hg log --debug -T phases > phases.out
174 $ hg log --debug -T phases > phases.out
169 $ cmp log.out phases.out || diff -u log.out phases.out
175 $ cmp log.out phases.out || diff -u log.out phases.out
170
176
171 Default style should also preserve color information (issue2866):
177 Default style should also preserve color information (issue2866):
172
178
173 $ cp $HGRCPATH $HGRCPATH-bak
179 $ cp $HGRCPATH $HGRCPATH-bak
174 $ cat <<EOF >> $HGRCPATH
180 $ cat <<EOF >> $HGRCPATH
175 > [extensions]
181 > [extensions]
176 > color=
182 > color=
177 > EOF
183 > EOF
178
184
179 $ hg --color=debug log > log.out
185 $ hg --color=debug log > log.out
180 $ hg --color=debug log --style default > style.out
186 $ hg --color=debug log --style default > style.out
181 $ cmp log.out style.out || diff -u log.out style.out
187 $ cmp log.out style.out || diff -u log.out style.out
182 $ hg --color=debug log -T phases > phases.out
188 $ hg --color=debug log -T phases > phases.out
183 $ diff -U 0 log.out phases.out | grep -v '^---\|^+++'
189 $ diff -U 0 log.out phases.out | grep -v '^---\|^+++'
184 @@ -2,0 +3 @@
190 @@ -2,0 +3 @@
185 +[log.phase|phase: draft]
191 +[log.phase|phase: draft]
186 @@ -6,0 +8 @@
192 @@ -6,0 +8 @@
187 +[log.phase|phase: draft]
193 +[log.phase|phase: draft]
188 @@ -11,0 +14 @@
194 @@ -11,0 +14 @@
189 +[log.phase|phase: draft]
195 +[log.phase|phase: draft]
190 @@ -17,0 +21 @@
196 @@ -17,0 +21 @@
191 +[log.phase|phase: draft]
197 +[log.phase|phase: draft]
192 @@ -24,0 +29 @@
198 @@ -24,0 +29 @@
193 +[log.phase|phase: draft]
199 +[log.phase|phase: draft]
194 @@ -31,0 +37 @@
200 @@ -31,0 +37 @@
195 +[log.phase|phase: draft]
201 +[log.phase|phase: draft]
196 @@ -36,0 +43 @@
202 @@ -36,0 +43 @@
197 +[log.phase|phase: draft]
203 +[log.phase|phase: draft]
198 @@ -41,0 +49 @@
204 @@ -41,0 +49 @@
199 +[log.phase|phase: draft]
205 +[log.phase|phase: draft]
200 @@ -46,0 +55 @@
206 @@ -46,0 +55 @@
201 +[log.phase|phase: draft]
207 +[log.phase|phase: draft]
202 @@ -51,0 +61 @@
208 @@ -51,0 +61 @@
203 +[log.phase|phase: draft]
209 +[log.phase|phase: draft]
204
210
205 $ hg --color=debug -v log > log.out
211 $ hg --color=debug -v log > log.out
206 $ hg --color=debug -v log --style default > style.out
212 $ hg --color=debug -v log --style default > style.out
207 $ cmp log.out style.out || diff -u log.out style.out
213 $ cmp log.out style.out || diff -u log.out style.out
208 $ hg --color=debug -v log -T phases > phases.out
214 $ hg --color=debug -v log -T phases > phases.out
209 $ diff -U 0 log.out phases.out | grep -v '^---\|^+++'
215 $ diff -U 0 log.out phases.out | grep -v '^---\|^+++'
210 @@ -2,0 +3 @@
216 @@ -2,0 +3 @@
211 +[log.phase|phase: draft]
217 +[log.phase|phase: draft]
212 @@ -7,0 +9 @@
218 @@ -7,0 +9 @@
213 +[log.phase|phase: draft]
219 +[log.phase|phase: draft]
214 @@ -15,0 +18 @@
220 @@ -15,0 +18 @@
215 +[log.phase|phase: draft]
221 +[log.phase|phase: draft]
216 @@ -24,0 +28 @@
222 @@ -24,0 +28 @@
217 +[log.phase|phase: draft]
223 +[log.phase|phase: draft]
218 @@ -33,0 +38 @@
224 @@ -33,0 +38 @@
219 +[log.phase|phase: draft]
225 +[log.phase|phase: draft]
220 @@ -43,0 +49 @@
226 @@ -43,0 +49 @@
221 +[log.phase|phase: draft]
227 +[log.phase|phase: draft]
222 @@ -50,0 +57 @@
228 @@ -50,0 +57 @@
223 +[log.phase|phase: draft]
229 +[log.phase|phase: draft]
224 @@ -58,0 +66 @@
230 @@ -58,0 +66 @@
225 +[log.phase|phase: draft]
231 +[log.phase|phase: draft]
226 @@ -66,0 +75 @@
232 @@ -66,0 +75 @@
227 +[log.phase|phase: draft]
233 +[log.phase|phase: draft]
228 @@ -77,0 +87 @@
234 @@ -77,0 +87 @@
229 +[log.phase|phase: draft]
235 +[log.phase|phase: draft]
230
236
231 $ hg --color=debug -q log > log.out
237 $ hg --color=debug -q log > log.out
232 $ hg --color=debug -q log --style default > style.out
238 $ hg --color=debug -q log --style default > style.out
233 $ cmp log.out style.out || diff -u log.out style.out
239 $ cmp log.out style.out || diff -u log.out style.out
234 $ hg --color=debug -q log -T phases > phases.out
240 $ hg --color=debug -q log -T phases > phases.out
235 $ cmp log.out phases.out || diff -u log.out phases.out
241 $ cmp log.out phases.out || diff -u log.out phases.out
236
242
237 $ hg --color=debug --debug log > log.out
243 $ hg --color=debug --debug log > log.out
238 $ hg --color=debug --debug log --style default > style.out
244 $ hg --color=debug --debug log --style default > style.out
239 $ cmp log.out style.out || diff -u log.out style.out
245 $ cmp log.out style.out || diff -u log.out style.out
240 $ hg --color=debug --debug log -T phases > phases.out
246 $ hg --color=debug --debug log -T phases > phases.out
241 $ cmp log.out phases.out || diff -u log.out phases.out
247 $ cmp log.out phases.out || diff -u log.out phases.out
242
248
243 $ mv $HGRCPATH-bak $HGRCPATH
249 $ mv $HGRCPATH-bak $HGRCPATH
244
250
245 Remove commit with empty commit message, so as to not pollute further
251 Remove commit with empty commit message, so as to not pollute further
246 tests.
252 tests.
247
253
248 $ hg --config extensions.strip= strip -q .
254 $ hg --config extensions.strip= strip -q .
249
255
250 Revision with no copies (used to print a traceback):
256 Revision with no copies (used to print a traceback):
251
257
252 $ hg tip -v --template '\n'
258 $ hg tip -v --template '\n'
253
259
254
260
255 Compact style works:
261 Compact style works:
256
262
257 $ hg log -Tcompact
263 $ hg log -Tcompact
258 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
264 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
259 third
265 third
260
266
261 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
267 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
262 second
268 second
263
269
264 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
270 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
265 merge
271 merge
266
272
267 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
273 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
268 new head
274 new head
269
275
270 4 bbe44766e73d 1970-01-17 04:53 +0000 person
276 4 bbe44766e73d 1970-01-17 04:53 +0000 person
271 new branch
277 new branch
272
278
273 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
279 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
274 no user, no domain
280 no user, no domain
275
281
276 2 97054abb4ab8 1970-01-14 21:20 +0000 other
282 2 97054abb4ab8 1970-01-14 21:20 +0000 other
277 no person
283 no person
278
284
279 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
285 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
280 other 1
286 other 1
281
287
282 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
288 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
283 line 1
289 line 1
284
290
285
291
286 $ hg log -v --style compact
292 $ hg log -v --style compact
287 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
293 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
288 third
294 third
289
295
290 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
296 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
291 second
297 second
292
298
293 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
299 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
294 merge
300 merge
295
301
296 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
302 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
297 new head
303 new head
298
304
299 4 bbe44766e73d 1970-01-17 04:53 +0000 person
305 4 bbe44766e73d 1970-01-17 04:53 +0000 person
300 new branch
306 new branch
301
307
302 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
308 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
303 no user, no domain
309 no user, no domain
304
310
305 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
311 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
306 no person
312 no person
307
313
308 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
314 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
309 other 1
315 other 1
310 other 2
316 other 2
311
317
312 other 3
318 other 3
313
319
314 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
320 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
315 line 1
321 line 1
316 line 2
322 line 2
317
323
318
324
319 $ hg log --debug --style compact
325 $ hg log --debug --style compact
320 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
326 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
321 third
327 third
322
328
323 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
329 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
324 second
330 second
325
331
326 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
332 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
327 merge
333 merge
328
334
329 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
335 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
330 new head
336 new head
331
337
332 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
338 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
333 new branch
339 new branch
334
340
335 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
341 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
336 no user, no domain
342 no user, no domain
337
343
338 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
344 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
339 no person
345 no person
340
346
341 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
347 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
342 other 1
348 other 1
343 other 2
349 other 2
344
350
345 other 3
351 other 3
346
352
347 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
353 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
348 line 1
354 line 1
349 line 2
355 line 2
350
356
351
357
352 Test xml styles:
358 Test xml styles:
353
359
354 $ hg log --style xml
360 $ hg log --style xml
355 <?xml version="1.0"?>
361 <?xml version="1.0"?>
356 <log>
362 <log>
357 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
363 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
358 <tag>tip</tag>
364 <tag>tip</tag>
359 <author email="test">test</author>
365 <author email="test">test</author>
360 <date>2020-01-01T10:01:00+00:00</date>
366 <date>2020-01-01T10:01:00+00:00</date>
361 <msg xml:space="preserve">third</msg>
367 <msg xml:space="preserve">third</msg>
362 </logentry>
368 </logentry>
363 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
369 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
364 <parent revision="-1" node="0000000000000000000000000000000000000000" />
370 <parent revision="-1" node="0000000000000000000000000000000000000000" />
365 <author email="user@hostname">User Name</author>
371 <author email="user@hostname">User Name</author>
366 <date>1970-01-12T13:46:40+00:00</date>
372 <date>1970-01-12T13:46:40+00:00</date>
367 <msg xml:space="preserve">second</msg>
373 <msg xml:space="preserve">second</msg>
368 </logentry>
374 </logentry>
369 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
375 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
370 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
376 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
371 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
377 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
372 <author email="person">person</author>
378 <author email="person">person</author>
373 <date>1970-01-18T08:40:01+00:00</date>
379 <date>1970-01-18T08:40:01+00:00</date>
374 <msg xml:space="preserve">merge</msg>
380 <msg xml:space="preserve">merge</msg>
375 </logentry>
381 </logentry>
376 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
382 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
377 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
383 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
378 <author email="person">person</author>
384 <author email="person">person</author>
379 <date>1970-01-18T08:40:00+00:00</date>
385 <date>1970-01-18T08:40:00+00:00</date>
380 <msg xml:space="preserve">new head</msg>
386 <msg xml:space="preserve">new head</msg>
381 </logentry>
387 </logentry>
382 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
388 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
383 <branch>foo</branch>
389 <branch>foo</branch>
384 <author email="person">person</author>
390 <author email="person">person</author>
385 <date>1970-01-17T04:53:20+00:00</date>
391 <date>1970-01-17T04:53:20+00:00</date>
386 <msg xml:space="preserve">new branch</msg>
392 <msg xml:space="preserve">new branch</msg>
387 </logentry>
393 </logentry>
388 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
394 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
389 <author email="person">person</author>
395 <author email="person">person</author>
390 <date>1970-01-16T01:06:40+00:00</date>
396 <date>1970-01-16T01:06:40+00:00</date>
391 <msg xml:space="preserve">no user, no domain</msg>
397 <msg xml:space="preserve">no user, no domain</msg>
392 </logentry>
398 </logentry>
393 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
399 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
394 <author email="other@place">other</author>
400 <author email="other@place">other</author>
395 <date>1970-01-14T21:20:00+00:00</date>
401 <date>1970-01-14T21:20:00+00:00</date>
396 <msg xml:space="preserve">no person</msg>
402 <msg xml:space="preserve">no person</msg>
397 </logentry>
403 </logentry>
398 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
404 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
399 <author email="other@place">A. N. Other</author>
405 <author email="other@place">A. N. Other</author>
400 <date>1970-01-13T17:33:20+00:00</date>
406 <date>1970-01-13T17:33:20+00:00</date>
401 <msg xml:space="preserve">other 1
407 <msg xml:space="preserve">other 1
402 other 2
408 other 2
403
409
404 other 3</msg>
410 other 3</msg>
405 </logentry>
411 </logentry>
406 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
412 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
407 <author email="user@hostname">User Name</author>
413 <author email="user@hostname">User Name</author>
408 <date>1970-01-12T13:46:40+00:00</date>
414 <date>1970-01-12T13:46:40+00:00</date>
409 <msg xml:space="preserve">line 1
415 <msg xml:space="preserve">line 1
410 line 2</msg>
416 line 2</msg>
411 </logentry>
417 </logentry>
412 </log>
418 </log>
413
419
414 $ hg log -v --style xml
420 $ hg log -v --style xml
415 <?xml version="1.0"?>
421 <?xml version="1.0"?>
416 <log>
422 <log>
417 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
423 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
418 <tag>tip</tag>
424 <tag>tip</tag>
419 <author email="test">test</author>
425 <author email="test">test</author>
420 <date>2020-01-01T10:01:00+00:00</date>
426 <date>2020-01-01T10:01:00+00:00</date>
421 <msg xml:space="preserve">third</msg>
427 <msg xml:space="preserve">third</msg>
422 <paths>
428 <paths>
423 <path action="A">fourth</path>
429 <path action="A">fourth</path>
424 <path action="A">third</path>
430 <path action="A">third</path>
425 <path action="R">second</path>
431 <path action="R">second</path>
426 </paths>
432 </paths>
427 <copies>
433 <copies>
428 <copy source="second">fourth</copy>
434 <copy source="second">fourth</copy>
429 </copies>
435 </copies>
430 </logentry>
436 </logentry>
431 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
437 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
432 <parent revision="-1" node="0000000000000000000000000000000000000000" />
438 <parent revision="-1" node="0000000000000000000000000000000000000000" />
433 <author email="user@hostname">User Name</author>
439 <author email="user@hostname">User Name</author>
434 <date>1970-01-12T13:46:40+00:00</date>
440 <date>1970-01-12T13:46:40+00:00</date>
435 <msg xml:space="preserve">second</msg>
441 <msg xml:space="preserve">second</msg>
436 <paths>
442 <paths>
437 <path action="A">second</path>
443 <path action="A">second</path>
438 </paths>
444 </paths>
439 </logentry>
445 </logentry>
440 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
446 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
441 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
447 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
442 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
448 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
443 <author email="person">person</author>
449 <author email="person">person</author>
444 <date>1970-01-18T08:40:01+00:00</date>
450 <date>1970-01-18T08:40:01+00:00</date>
445 <msg xml:space="preserve">merge</msg>
451 <msg xml:space="preserve">merge</msg>
446 <paths>
452 <paths>
447 </paths>
453 </paths>
448 </logentry>
454 </logentry>
449 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
455 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
450 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
456 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
451 <author email="person">person</author>
457 <author email="person">person</author>
452 <date>1970-01-18T08:40:00+00:00</date>
458 <date>1970-01-18T08:40:00+00:00</date>
453 <msg xml:space="preserve">new head</msg>
459 <msg xml:space="preserve">new head</msg>
454 <paths>
460 <paths>
455 <path action="A">d</path>
461 <path action="A">d</path>
456 </paths>
462 </paths>
457 </logentry>
463 </logentry>
458 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
464 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
459 <branch>foo</branch>
465 <branch>foo</branch>
460 <author email="person">person</author>
466 <author email="person">person</author>
461 <date>1970-01-17T04:53:20+00:00</date>
467 <date>1970-01-17T04:53:20+00:00</date>
462 <msg xml:space="preserve">new branch</msg>
468 <msg xml:space="preserve">new branch</msg>
463 <paths>
469 <paths>
464 </paths>
470 </paths>
465 </logentry>
471 </logentry>
466 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
472 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
467 <author email="person">person</author>
473 <author email="person">person</author>
468 <date>1970-01-16T01:06:40+00:00</date>
474 <date>1970-01-16T01:06:40+00:00</date>
469 <msg xml:space="preserve">no user, no domain</msg>
475 <msg xml:space="preserve">no user, no domain</msg>
470 <paths>
476 <paths>
471 <path action="M">c</path>
477 <path action="M">c</path>
472 </paths>
478 </paths>
473 </logentry>
479 </logentry>
474 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
480 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
475 <author email="other@place">other</author>
481 <author email="other@place">other</author>
476 <date>1970-01-14T21:20:00+00:00</date>
482 <date>1970-01-14T21:20:00+00:00</date>
477 <msg xml:space="preserve">no person</msg>
483 <msg xml:space="preserve">no person</msg>
478 <paths>
484 <paths>
479 <path action="A">c</path>
485 <path action="A">c</path>
480 </paths>
486 </paths>
481 </logentry>
487 </logentry>
482 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
488 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
483 <author email="other@place">A. N. Other</author>
489 <author email="other@place">A. N. Other</author>
484 <date>1970-01-13T17:33:20+00:00</date>
490 <date>1970-01-13T17:33:20+00:00</date>
485 <msg xml:space="preserve">other 1
491 <msg xml:space="preserve">other 1
486 other 2
492 other 2
487
493
488 other 3</msg>
494 other 3</msg>
489 <paths>
495 <paths>
490 <path action="A">b</path>
496 <path action="A">b</path>
491 </paths>
497 </paths>
492 </logentry>
498 </logentry>
493 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
499 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
494 <author email="user@hostname">User Name</author>
500 <author email="user@hostname">User Name</author>
495 <date>1970-01-12T13:46:40+00:00</date>
501 <date>1970-01-12T13:46:40+00:00</date>
496 <msg xml:space="preserve">line 1
502 <msg xml:space="preserve">line 1
497 line 2</msg>
503 line 2</msg>
498 <paths>
504 <paths>
499 <path action="A">a</path>
505 <path action="A">a</path>
500 </paths>
506 </paths>
501 </logentry>
507 </logentry>
502 </log>
508 </log>
503
509
504 $ hg log --debug --style xml
510 $ hg log --debug --style xml
505 <?xml version="1.0"?>
511 <?xml version="1.0"?>
506 <log>
512 <log>
507 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
513 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
508 <tag>tip</tag>
514 <tag>tip</tag>
509 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
515 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
510 <parent revision="-1" node="0000000000000000000000000000000000000000" />
516 <parent revision="-1" node="0000000000000000000000000000000000000000" />
511 <author email="test">test</author>
517 <author email="test">test</author>
512 <date>2020-01-01T10:01:00+00:00</date>
518 <date>2020-01-01T10:01:00+00:00</date>
513 <msg xml:space="preserve">third</msg>
519 <msg xml:space="preserve">third</msg>
514 <paths>
520 <paths>
515 <path action="A">fourth</path>
521 <path action="A">fourth</path>
516 <path action="A">third</path>
522 <path action="A">third</path>
517 <path action="R">second</path>
523 <path action="R">second</path>
518 </paths>
524 </paths>
519 <copies>
525 <copies>
520 <copy source="second">fourth</copy>
526 <copy source="second">fourth</copy>
521 </copies>
527 </copies>
522 <extra key="branch">default</extra>
528 <extra key="branch">default</extra>
523 </logentry>
529 </logentry>
524 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
530 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
525 <parent revision="-1" node="0000000000000000000000000000000000000000" />
531 <parent revision="-1" node="0000000000000000000000000000000000000000" />
526 <parent revision="-1" node="0000000000000000000000000000000000000000" />
532 <parent revision="-1" node="0000000000000000000000000000000000000000" />
527 <author email="user@hostname">User Name</author>
533 <author email="user@hostname">User Name</author>
528 <date>1970-01-12T13:46:40+00:00</date>
534 <date>1970-01-12T13:46:40+00:00</date>
529 <msg xml:space="preserve">second</msg>
535 <msg xml:space="preserve">second</msg>
530 <paths>
536 <paths>
531 <path action="A">second</path>
537 <path action="A">second</path>
532 </paths>
538 </paths>
533 <extra key="branch">default</extra>
539 <extra key="branch">default</extra>
534 </logentry>
540 </logentry>
535 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
541 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
536 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
542 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
537 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
543 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
538 <author email="person">person</author>
544 <author email="person">person</author>
539 <date>1970-01-18T08:40:01+00:00</date>
545 <date>1970-01-18T08:40:01+00:00</date>
540 <msg xml:space="preserve">merge</msg>
546 <msg xml:space="preserve">merge</msg>
541 <paths>
547 <paths>
542 </paths>
548 </paths>
543 <extra key="branch">default</extra>
549 <extra key="branch">default</extra>
544 </logentry>
550 </logentry>
545 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
551 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
546 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
552 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
547 <parent revision="-1" node="0000000000000000000000000000000000000000" />
553 <parent revision="-1" node="0000000000000000000000000000000000000000" />
548 <author email="person">person</author>
554 <author email="person">person</author>
549 <date>1970-01-18T08:40:00+00:00</date>
555 <date>1970-01-18T08:40:00+00:00</date>
550 <msg xml:space="preserve">new head</msg>
556 <msg xml:space="preserve">new head</msg>
551 <paths>
557 <paths>
552 <path action="A">d</path>
558 <path action="A">d</path>
553 </paths>
559 </paths>
554 <extra key="branch">default</extra>
560 <extra key="branch">default</extra>
555 </logentry>
561 </logentry>
556 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
562 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
557 <branch>foo</branch>
563 <branch>foo</branch>
558 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
564 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
559 <parent revision="-1" node="0000000000000000000000000000000000000000" />
565 <parent revision="-1" node="0000000000000000000000000000000000000000" />
560 <author email="person">person</author>
566 <author email="person">person</author>
561 <date>1970-01-17T04:53:20+00:00</date>
567 <date>1970-01-17T04:53:20+00:00</date>
562 <msg xml:space="preserve">new branch</msg>
568 <msg xml:space="preserve">new branch</msg>
563 <paths>
569 <paths>
564 </paths>
570 </paths>
565 <extra key="branch">foo</extra>
571 <extra key="branch">foo</extra>
566 </logentry>
572 </logentry>
567 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
573 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
568 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
574 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
569 <parent revision="-1" node="0000000000000000000000000000000000000000" />
575 <parent revision="-1" node="0000000000000000000000000000000000000000" />
570 <author email="person">person</author>
576 <author email="person">person</author>
571 <date>1970-01-16T01:06:40+00:00</date>
577 <date>1970-01-16T01:06:40+00:00</date>
572 <msg xml:space="preserve">no user, no domain</msg>
578 <msg xml:space="preserve">no user, no domain</msg>
573 <paths>
579 <paths>
574 <path action="M">c</path>
580 <path action="M">c</path>
575 </paths>
581 </paths>
576 <extra key="branch">default</extra>
582 <extra key="branch">default</extra>
577 </logentry>
583 </logentry>
578 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
584 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
579 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
585 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
580 <parent revision="-1" node="0000000000000000000000000000000000000000" />
586 <parent revision="-1" node="0000000000000000000000000000000000000000" />
581 <author email="other@place">other</author>
587 <author email="other@place">other</author>
582 <date>1970-01-14T21:20:00+00:00</date>
588 <date>1970-01-14T21:20:00+00:00</date>
583 <msg xml:space="preserve">no person</msg>
589 <msg xml:space="preserve">no person</msg>
584 <paths>
590 <paths>
585 <path action="A">c</path>
591 <path action="A">c</path>
586 </paths>
592 </paths>
587 <extra key="branch">default</extra>
593 <extra key="branch">default</extra>
588 </logentry>
594 </logentry>
589 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
595 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
590 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
596 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
591 <parent revision="-1" node="0000000000000000000000000000000000000000" />
597 <parent revision="-1" node="0000000000000000000000000000000000000000" />
592 <author email="other@place">A. N. Other</author>
598 <author email="other@place">A. N. Other</author>
593 <date>1970-01-13T17:33:20+00:00</date>
599 <date>1970-01-13T17:33:20+00:00</date>
594 <msg xml:space="preserve">other 1
600 <msg xml:space="preserve">other 1
595 other 2
601 other 2
596
602
597 other 3</msg>
603 other 3</msg>
598 <paths>
604 <paths>
599 <path action="A">b</path>
605 <path action="A">b</path>
600 </paths>
606 </paths>
601 <extra key="branch">default</extra>
607 <extra key="branch">default</extra>
602 </logentry>
608 </logentry>
603 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
609 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
604 <parent revision="-1" node="0000000000000000000000000000000000000000" />
610 <parent revision="-1" node="0000000000000000000000000000000000000000" />
605 <parent revision="-1" node="0000000000000000000000000000000000000000" />
611 <parent revision="-1" node="0000000000000000000000000000000000000000" />
606 <author email="user@hostname">User Name</author>
612 <author email="user@hostname">User Name</author>
607 <date>1970-01-12T13:46:40+00:00</date>
613 <date>1970-01-12T13:46:40+00:00</date>
608 <msg xml:space="preserve">line 1
614 <msg xml:space="preserve">line 1
609 line 2</msg>
615 line 2</msg>
610 <paths>
616 <paths>
611 <path action="A">a</path>
617 <path action="A">a</path>
612 </paths>
618 </paths>
613 <extra key="branch">default</extra>
619 <extra key="branch">default</extra>
614 </logentry>
620 </logentry>
615 </log>
621 </log>
616
622
617
623
618 Test JSON style:
624 Test JSON style:
619
625
620 $ hg log -k nosuch -Tjson
626 $ hg log -k nosuch -Tjson
621 []
627 []
622
628
623 $ hg log -qr . -Tjson
629 $ hg log -qr . -Tjson
624 [
630 [
625 {
631 {
626 "rev": 8,
632 "rev": 8,
627 "node": "95c24699272ef57d062b8bccc32c878bf841784a"
633 "node": "95c24699272ef57d062b8bccc32c878bf841784a"
628 }
634 }
629 ]
635 ]
630
636
631 $ hg log -vpr . -Tjson --stat
637 $ hg log -vpr . -Tjson --stat
632 [
638 [
633 {
639 {
634 "rev": 8,
640 "rev": 8,
635 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
641 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
636 "branch": "default",
642 "branch": "default",
637 "phase": "draft",
643 "phase": "draft",
638 "user": "test",
644 "user": "test",
639 "date": [1577872860, 0],
645 "date": [1577872860, 0],
640 "desc": "third",
646 "desc": "third",
641 "bookmarks": [],
647 "bookmarks": [],
642 "tags": ["tip"],
648 "tags": ["tip"],
643 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
649 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
644 "files": ["fourth", "second", "third"],
650 "files": ["fourth", "second", "third"],
645 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
651 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
646 "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"
652 "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"
647 }
653 }
648 ]
654 ]
649
655
650 honor --git but not format-breaking diffopts
656 honor --git but not format-breaking diffopts
651 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
657 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
652 [
658 [
653 {
659 {
654 "rev": 8,
660 "rev": 8,
655 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
661 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
656 "branch": "default",
662 "branch": "default",
657 "phase": "draft",
663 "phase": "draft",
658 "user": "test",
664 "user": "test",
659 "date": [1577872860, 0],
665 "date": [1577872860, 0],
660 "desc": "third",
666 "desc": "third",
661 "bookmarks": [],
667 "bookmarks": [],
662 "tags": ["tip"],
668 "tags": ["tip"],
663 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
669 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
664 "files": ["fourth", "second", "third"],
670 "files": ["fourth", "second", "third"],
665 "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"
671 "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"
666 }
672 }
667 ]
673 ]
668
674
669 $ hg log -T json
675 $ hg log -T json
670 [
676 [
671 {
677 {
672 "rev": 8,
678 "rev": 8,
673 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
679 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
674 "branch": "default",
680 "branch": "default",
675 "phase": "draft",
681 "phase": "draft",
676 "user": "test",
682 "user": "test",
677 "date": [1577872860, 0],
683 "date": [1577872860, 0],
678 "desc": "third",
684 "desc": "third",
679 "bookmarks": [],
685 "bookmarks": [],
680 "tags": ["tip"],
686 "tags": ["tip"],
681 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"]
687 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"]
682 },
688 },
683 {
689 {
684 "rev": 7,
690 "rev": 7,
685 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
691 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
686 "branch": "default",
692 "branch": "default",
687 "phase": "draft",
693 "phase": "draft",
688 "user": "User Name <user@hostname>",
694 "user": "User Name <user@hostname>",
689 "date": [1000000, 0],
695 "date": [1000000, 0],
690 "desc": "second",
696 "desc": "second",
691 "bookmarks": [],
697 "bookmarks": [],
692 "tags": [],
698 "tags": [],
693 "parents": ["0000000000000000000000000000000000000000"]
699 "parents": ["0000000000000000000000000000000000000000"]
694 },
700 },
695 {
701 {
696 "rev": 6,
702 "rev": 6,
697 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
703 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
698 "branch": "default",
704 "branch": "default",
699 "phase": "draft",
705 "phase": "draft",
700 "user": "person",
706 "user": "person",
701 "date": [1500001, 0],
707 "date": [1500001, 0],
702 "desc": "merge",
708 "desc": "merge",
703 "bookmarks": [],
709 "bookmarks": [],
704 "tags": [],
710 "tags": [],
705 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"]
711 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"]
706 },
712 },
707 {
713 {
708 "rev": 5,
714 "rev": 5,
709 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
715 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
710 "branch": "default",
716 "branch": "default",
711 "phase": "draft",
717 "phase": "draft",
712 "user": "person",
718 "user": "person",
713 "date": [1500000, 0],
719 "date": [1500000, 0],
714 "desc": "new head",
720 "desc": "new head",
715 "bookmarks": [],
721 "bookmarks": [],
716 "tags": [],
722 "tags": [],
717 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
723 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
718 },
724 },
719 {
725 {
720 "rev": 4,
726 "rev": 4,
721 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
727 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
722 "branch": "foo",
728 "branch": "foo",
723 "phase": "draft",
729 "phase": "draft",
724 "user": "person",
730 "user": "person",
725 "date": [1400000, 0],
731 "date": [1400000, 0],
726 "desc": "new branch",
732 "desc": "new branch",
727 "bookmarks": [],
733 "bookmarks": [],
728 "tags": [],
734 "tags": [],
729 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
735 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
730 },
736 },
731 {
737 {
732 "rev": 3,
738 "rev": 3,
733 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
739 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
734 "branch": "default",
740 "branch": "default",
735 "phase": "draft",
741 "phase": "draft",
736 "user": "person",
742 "user": "person",
737 "date": [1300000, 0],
743 "date": [1300000, 0],
738 "desc": "no user, no domain",
744 "desc": "no user, no domain",
739 "bookmarks": [],
745 "bookmarks": [],
740 "tags": [],
746 "tags": [],
741 "parents": ["97054abb4ab824450e9164180baf491ae0078465"]
747 "parents": ["97054abb4ab824450e9164180baf491ae0078465"]
742 },
748 },
743 {
749 {
744 "rev": 2,
750 "rev": 2,
745 "node": "97054abb4ab824450e9164180baf491ae0078465",
751 "node": "97054abb4ab824450e9164180baf491ae0078465",
746 "branch": "default",
752 "branch": "default",
747 "phase": "draft",
753 "phase": "draft",
748 "user": "other@place",
754 "user": "other@place",
749 "date": [1200000, 0],
755 "date": [1200000, 0],
750 "desc": "no person",
756 "desc": "no person",
751 "bookmarks": [],
757 "bookmarks": [],
752 "tags": [],
758 "tags": [],
753 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"]
759 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"]
754 },
760 },
755 {
761 {
756 "rev": 1,
762 "rev": 1,
757 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
763 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
758 "branch": "default",
764 "branch": "default",
759 "phase": "draft",
765 "phase": "draft",
760 "user": "A. N. Other <other@place>",
766 "user": "A. N. Other <other@place>",
761 "date": [1100000, 0],
767 "date": [1100000, 0],
762 "desc": "other 1\nother 2\n\nother 3",
768 "desc": "other 1\nother 2\n\nother 3",
763 "bookmarks": [],
769 "bookmarks": [],
764 "tags": [],
770 "tags": [],
765 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"]
771 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"]
766 },
772 },
767 {
773 {
768 "rev": 0,
774 "rev": 0,
769 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
775 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
770 "branch": "default",
776 "branch": "default",
771 "phase": "draft",
777 "phase": "draft",
772 "user": "User Name <user@hostname>",
778 "user": "User Name <user@hostname>",
773 "date": [1000000, 0],
779 "date": [1000000, 0],
774 "desc": "line 1\nline 2",
780 "desc": "line 1\nline 2",
775 "bookmarks": [],
781 "bookmarks": [],
776 "tags": [],
782 "tags": [],
777 "parents": ["0000000000000000000000000000000000000000"]
783 "parents": ["0000000000000000000000000000000000000000"]
778 }
784 }
779 ]
785 ]
780
786
781 $ hg heads -v -Tjson
787 $ hg heads -v -Tjson
782 [
788 [
783 {
789 {
784 "rev": 8,
790 "rev": 8,
785 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
791 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
786 "branch": "default",
792 "branch": "default",
787 "phase": "draft",
793 "phase": "draft",
788 "user": "test",
794 "user": "test",
789 "date": [1577872860, 0],
795 "date": [1577872860, 0],
790 "desc": "third",
796 "desc": "third",
791 "bookmarks": [],
797 "bookmarks": [],
792 "tags": ["tip"],
798 "tags": ["tip"],
793 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
799 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
794 "files": ["fourth", "second", "third"]
800 "files": ["fourth", "second", "third"]
795 },
801 },
796 {
802 {
797 "rev": 6,
803 "rev": 6,
798 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
804 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
799 "branch": "default",
805 "branch": "default",
800 "phase": "draft",
806 "phase": "draft",
801 "user": "person",
807 "user": "person",
802 "date": [1500001, 0],
808 "date": [1500001, 0],
803 "desc": "merge",
809 "desc": "merge",
804 "bookmarks": [],
810 "bookmarks": [],
805 "tags": [],
811 "tags": [],
806 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
812 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
807 "files": []
813 "files": []
808 },
814 },
809 {
815 {
810 "rev": 4,
816 "rev": 4,
811 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
817 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
812 "branch": "foo",
818 "branch": "foo",
813 "phase": "draft",
819 "phase": "draft",
814 "user": "person",
820 "user": "person",
815 "date": [1400000, 0],
821 "date": [1400000, 0],
816 "desc": "new branch",
822 "desc": "new branch",
817 "bookmarks": [],
823 "bookmarks": [],
818 "tags": [],
824 "tags": [],
819 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
825 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
820 "files": []
826 "files": []
821 }
827 }
822 ]
828 ]
823
829
824 $ hg log --debug -Tjson
830 $ hg log --debug -Tjson
825 [
831 [
826 {
832 {
827 "rev": 8,
833 "rev": 8,
828 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
834 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
829 "branch": "default",
835 "branch": "default",
830 "phase": "draft",
836 "phase": "draft",
831 "user": "test",
837 "user": "test",
832 "date": [1577872860, 0],
838 "date": [1577872860, 0],
833 "desc": "third",
839 "desc": "third",
834 "bookmarks": [],
840 "bookmarks": [],
835 "tags": ["tip"],
841 "tags": ["tip"],
836 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
842 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
837 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
843 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
838 "extra": {"branch": "default"},
844 "extra": {"branch": "default"},
839 "modified": [],
845 "modified": [],
840 "added": ["fourth", "third"],
846 "added": ["fourth", "third"],
841 "removed": ["second"]
847 "removed": ["second"]
842 },
848 },
843 {
849 {
844 "rev": 7,
850 "rev": 7,
845 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
851 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
846 "branch": "default",
852 "branch": "default",
847 "phase": "draft",
853 "phase": "draft",
848 "user": "User Name <user@hostname>",
854 "user": "User Name <user@hostname>",
849 "date": [1000000, 0],
855 "date": [1000000, 0],
850 "desc": "second",
856 "desc": "second",
851 "bookmarks": [],
857 "bookmarks": [],
852 "tags": [],
858 "tags": [],
853 "parents": ["0000000000000000000000000000000000000000"],
859 "parents": ["0000000000000000000000000000000000000000"],
854 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
860 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
855 "extra": {"branch": "default"},
861 "extra": {"branch": "default"},
856 "modified": [],
862 "modified": [],
857 "added": ["second"],
863 "added": ["second"],
858 "removed": []
864 "removed": []
859 },
865 },
860 {
866 {
861 "rev": 6,
867 "rev": 6,
862 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
868 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
863 "branch": "default",
869 "branch": "default",
864 "phase": "draft",
870 "phase": "draft",
865 "user": "person",
871 "user": "person",
866 "date": [1500001, 0],
872 "date": [1500001, 0],
867 "desc": "merge",
873 "desc": "merge",
868 "bookmarks": [],
874 "bookmarks": [],
869 "tags": [],
875 "tags": [],
870 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
876 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
871 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
877 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
872 "extra": {"branch": "default"},
878 "extra": {"branch": "default"},
873 "modified": [],
879 "modified": [],
874 "added": [],
880 "added": [],
875 "removed": []
881 "removed": []
876 },
882 },
877 {
883 {
878 "rev": 5,
884 "rev": 5,
879 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
885 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
880 "branch": "default",
886 "branch": "default",
881 "phase": "draft",
887 "phase": "draft",
882 "user": "person",
888 "user": "person",
883 "date": [1500000, 0],
889 "date": [1500000, 0],
884 "desc": "new head",
890 "desc": "new head",
885 "bookmarks": [],
891 "bookmarks": [],
886 "tags": [],
892 "tags": [],
887 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
893 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
888 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
894 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
889 "extra": {"branch": "default"},
895 "extra": {"branch": "default"},
890 "modified": [],
896 "modified": [],
891 "added": ["d"],
897 "added": ["d"],
892 "removed": []
898 "removed": []
893 },
899 },
894 {
900 {
895 "rev": 4,
901 "rev": 4,
896 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
902 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
897 "branch": "foo",
903 "branch": "foo",
898 "phase": "draft",
904 "phase": "draft",
899 "user": "person",
905 "user": "person",
900 "date": [1400000, 0],
906 "date": [1400000, 0],
901 "desc": "new branch",
907 "desc": "new branch",
902 "bookmarks": [],
908 "bookmarks": [],
903 "tags": [],
909 "tags": [],
904 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
910 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
905 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
911 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
906 "extra": {"branch": "foo"},
912 "extra": {"branch": "foo"},
907 "modified": [],
913 "modified": [],
908 "added": [],
914 "added": [],
909 "removed": []
915 "removed": []
910 },
916 },
911 {
917 {
912 "rev": 3,
918 "rev": 3,
913 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
919 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
914 "branch": "default",
920 "branch": "default",
915 "phase": "draft",
921 "phase": "draft",
916 "user": "person",
922 "user": "person",
917 "date": [1300000, 0],
923 "date": [1300000, 0],
918 "desc": "no user, no domain",
924 "desc": "no user, no domain",
919 "bookmarks": [],
925 "bookmarks": [],
920 "tags": [],
926 "tags": [],
921 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
927 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
922 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
928 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
923 "extra": {"branch": "default"},
929 "extra": {"branch": "default"},
924 "modified": ["c"],
930 "modified": ["c"],
925 "added": [],
931 "added": [],
926 "removed": []
932 "removed": []
927 },
933 },
928 {
934 {
929 "rev": 2,
935 "rev": 2,
930 "node": "97054abb4ab824450e9164180baf491ae0078465",
936 "node": "97054abb4ab824450e9164180baf491ae0078465",
931 "branch": "default",
937 "branch": "default",
932 "phase": "draft",
938 "phase": "draft",
933 "user": "other@place",
939 "user": "other@place",
934 "date": [1200000, 0],
940 "date": [1200000, 0],
935 "desc": "no person",
941 "desc": "no person",
936 "bookmarks": [],
942 "bookmarks": [],
937 "tags": [],
943 "tags": [],
938 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
944 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
939 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
945 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
940 "extra": {"branch": "default"},
946 "extra": {"branch": "default"},
941 "modified": [],
947 "modified": [],
942 "added": ["c"],
948 "added": ["c"],
943 "removed": []
949 "removed": []
944 },
950 },
945 {
951 {
946 "rev": 1,
952 "rev": 1,
947 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
953 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
948 "branch": "default",
954 "branch": "default",
949 "phase": "draft",
955 "phase": "draft",
950 "user": "A. N. Other <other@place>",
956 "user": "A. N. Other <other@place>",
951 "date": [1100000, 0],
957 "date": [1100000, 0],
952 "desc": "other 1\nother 2\n\nother 3",
958 "desc": "other 1\nother 2\n\nother 3",
953 "bookmarks": [],
959 "bookmarks": [],
954 "tags": [],
960 "tags": [],
955 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
961 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
956 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
962 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
957 "extra": {"branch": "default"},
963 "extra": {"branch": "default"},
958 "modified": [],
964 "modified": [],
959 "added": ["b"],
965 "added": ["b"],
960 "removed": []
966 "removed": []
961 },
967 },
962 {
968 {
963 "rev": 0,
969 "rev": 0,
964 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
970 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
965 "branch": "default",
971 "branch": "default",
966 "phase": "draft",
972 "phase": "draft",
967 "user": "User Name <user@hostname>",
973 "user": "User Name <user@hostname>",
968 "date": [1000000, 0],
974 "date": [1000000, 0],
969 "desc": "line 1\nline 2",
975 "desc": "line 1\nline 2",
970 "bookmarks": [],
976 "bookmarks": [],
971 "tags": [],
977 "tags": [],
972 "parents": ["0000000000000000000000000000000000000000"],
978 "parents": ["0000000000000000000000000000000000000000"],
973 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
979 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
974 "extra": {"branch": "default"},
980 "extra": {"branch": "default"},
975 "modified": [],
981 "modified": [],
976 "added": ["a"],
982 "added": ["a"],
977 "removed": []
983 "removed": []
978 }
984 }
979 ]
985 ]
980
986
981 Error if style not readable:
987 Error if style not readable:
982
988
983 #if unix-permissions no-root
989 #if unix-permissions no-root
984 $ touch q
990 $ touch q
985 $ chmod 0 q
991 $ chmod 0 q
986 $ hg log --style ./q
992 $ hg log --style ./q
987 abort: Permission denied: ./q
993 abort: Permission denied: ./q
988 [255]
994 [255]
989 #endif
995 #endif
990
996
991 Error if no style:
997 Error if no style:
992
998
993 $ hg log --style notexist
999 $ hg log --style notexist
994 abort: style 'notexist' not found
1000 abort: style 'notexist' not found
995 (available styles: bisect, changelog, compact, default, phases, status, xml)
1001 (available styles: bisect, changelog, compact, default, phases, status, xml)
996 [255]
1002 [255]
997
1003
998 $ hg log -T list
1004 $ hg log -T list
999 available styles: bisect, changelog, compact, default, phases, status, xml
1005 available styles: bisect, changelog, compact, default, phases, status, xml
1000 abort: specify a template
1006 abort: specify a template
1001 [255]
1007 [255]
1002
1008
1003 Error if style missing key:
1009 Error if style missing key:
1004
1010
1005 $ echo 'q = q' > t
1011 $ echo 'q = q' > t
1006 $ hg log --style ./t
1012 $ hg log --style ./t
1007 abort: "changeset" not in template map
1013 abort: "changeset" not in template map
1008 [255]
1014 [255]
1009
1015
1010 Error if style missing value:
1016 Error if style missing value:
1011
1017
1012 $ echo 'changeset =' > t
1018 $ echo 'changeset =' > t
1013 $ hg log --style t
1019 $ hg log --style t
1014 abort: t:1: missing value
1020 abort: t:1: missing value
1015 [255]
1021 [255]
1016
1022
1017 Error if include fails:
1023 Error if include fails:
1018
1024
1019 $ echo 'changeset = q' >> t
1025 $ echo 'changeset = q' >> t
1020 #if unix-permissions no-root
1026 #if unix-permissions no-root
1021 $ hg log --style ./t
1027 $ hg log --style ./t
1022 abort: template file ./q: Permission denied
1028 abort: template file ./q: Permission denied
1023 [255]
1029 [255]
1024 $ rm q
1030 $ rm q
1025 #endif
1031 #endif
1026
1032
1027 Include works:
1033 Include works:
1028
1034
1029 $ echo '{rev}' > q
1035 $ echo '{rev}' > q
1030 $ hg log --style ./t
1036 $ hg log --style ./t
1031 8
1037 8
1032 7
1038 7
1033 6
1039 6
1034 5
1040 5
1035 4
1041 4
1036 3
1042 3
1037 2
1043 2
1038 1
1044 1
1039 0
1045 0
1040
1046
1041 Check that {phase} works correctly on parents:
1047 Check that {phase} works correctly on parents:
1042
1048
1043 $ cat << EOF > parentphase
1049 $ cat << EOF > parentphase
1044 > changeset_debug = '{rev} ({phase}):{parents}\n'
1050 > changeset_debug = '{rev} ({phase}):{parents}\n'
1045 > parent = ' {rev} ({phase})'
1051 > parent = ' {rev} ({phase})'
1046 > EOF
1052 > EOF
1047 $ hg phase -r 5 --public
1053 $ hg phase -r 5 --public
1048 $ hg phase -r 7 --secret --force
1054 $ hg phase -r 7 --secret --force
1049 $ hg log --debug -G --style ./parentphase
1055 $ hg log --debug -G --style ./parentphase
1050 @ 8 (secret): 7 (secret) -1 (public)
1056 @ 8 (secret): 7 (secret) -1 (public)
1051 |
1057 |
1052 o 7 (secret): -1 (public) -1 (public)
1058 o 7 (secret): -1 (public) -1 (public)
1053
1059
1054 o 6 (draft): 5 (public) 4 (draft)
1060 o 6 (draft): 5 (public) 4 (draft)
1055 |\
1061 |\
1056 | o 5 (public): 3 (public) -1 (public)
1062 | o 5 (public): 3 (public) -1 (public)
1057 | |
1063 | |
1058 o | 4 (draft): 3 (public) -1 (public)
1064 o | 4 (draft): 3 (public) -1 (public)
1059 |/
1065 |/
1060 o 3 (public): 2 (public) -1 (public)
1066 o 3 (public): 2 (public) -1 (public)
1061 |
1067 |
1062 o 2 (public): 1 (public) -1 (public)
1068 o 2 (public): 1 (public) -1 (public)
1063 |
1069 |
1064 o 1 (public): 0 (public) -1 (public)
1070 o 1 (public): 0 (public) -1 (public)
1065 |
1071 |
1066 o 0 (public): -1 (public) -1 (public)
1072 o 0 (public): -1 (public) -1 (public)
1067
1073
1068
1074
1069 Missing non-standard names give no error (backward compatibility):
1075 Missing non-standard names give no error (backward compatibility):
1070
1076
1071 $ echo "changeset = '{c}'" > t
1077 $ echo "changeset = '{c}'" > t
1072 $ hg log --style ./t
1078 $ hg log --style ./t
1073
1079
1074 Defining non-standard name works:
1080 Defining non-standard name works:
1075
1081
1076 $ cat <<EOF > t
1082 $ cat <<EOF > t
1077 > changeset = '{c}'
1083 > changeset = '{c}'
1078 > c = q
1084 > c = q
1079 > EOF
1085 > EOF
1080 $ hg log --style ./t
1086 $ hg log --style ./t
1081 8
1087 8
1082 7
1088 7
1083 6
1089 6
1084 5
1090 5
1085 4
1091 4
1086 3
1092 3
1087 2
1093 2
1088 1
1094 1
1089 0
1095 0
1090
1096
1091 ui.style works:
1097 ui.style works:
1092
1098
1093 $ echo '[ui]' > .hg/hgrc
1099 $ echo '[ui]' > .hg/hgrc
1094 $ echo 'style = t' >> .hg/hgrc
1100 $ echo 'style = t' >> .hg/hgrc
1095 $ hg log
1101 $ hg log
1096 8
1102 8
1097 7
1103 7
1098 6
1104 6
1099 5
1105 5
1100 4
1106 4
1101 3
1107 3
1102 2
1108 2
1103 1
1109 1
1104 0
1110 0
1105
1111
1106
1112
1107 Issue338:
1113 Issue338:
1108
1114
1109 $ hg log --style=changelog > changelog
1115 $ hg log --style=changelog > changelog
1110
1116
1111 $ cat changelog
1117 $ cat changelog
1112 2020-01-01 test <test>
1118 2020-01-01 test <test>
1113
1119
1114 * fourth, second, third:
1120 * fourth, second, third:
1115 third
1121 third
1116 [95c24699272e] [tip]
1122 [95c24699272e] [tip]
1117
1123
1118 1970-01-12 User Name <user@hostname>
1124 1970-01-12 User Name <user@hostname>
1119
1125
1120 * second:
1126 * second:
1121 second
1127 second
1122 [29114dbae42b]
1128 [29114dbae42b]
1123
1129
1124 1970-01-18 person <person>
1130 1970-01-18 person <person>
1125
1131
1126 * merge
1132 * merge
1127 [d41e714fe50d]
1133 [d41e714fe50d]
1128
1134
1129 * d:
1135 * d:
1130 new head
1136 new head
1131 [13207e5a10d9]
1137 [13207e5a10d9]
1132
1138
1133 1970-01-17 person <person>
1139 1970-01-17 person <person>
1134
1140
1135 * new branch
1141 * new branch
1136 [bbe44766e73d] <foo>
1142 [bbe44766e73d] <foo>
1137
1143
1138 1970-01-16 person <person>
1144 1970-01-16 person <person>
1139
1145
1140 * c:
1146 * c:
1141 no user, no domain
1147 no user, no domain
1142 [10e46f2dcbf4]
1148 [10e46f2dcbf4]
1143
1149
1144 1970-01-14 other <other@place>
1150 1970-01-14 other <other@place>
1145
1151
1146 * c:
1152 * c:
1147 no person
1153 no person
1148 [97054abb4ab8]
1154 [97054abb4ab8]
1149
1155
1150 1970-01-13 A. N. Other <other@place>
1156 1970-01-13 A. N. Other <other@place>
1151
1157
1152 * b:
1158 * b:
1153 other 1 other 2
1159 other 1 other 2
1154
1160
1155 other 3
1161 other 3
1156 [b608e9d1a3f0]
1162 [b608e9d1a3f0]
1157
1163
1158 1970-01-12 User Name <user@hostname>
1164 1970-01-12 User Name <user@hostname>
1159
1165
1160 * a:
1166 * a:
1161 line 1 line 2
1167 line 1 line 2
1162 [1e4e1b8f71e0]
1168 [1e4e1b8f71e0]
1163
1169
1164
1170
1165 Issue2130: xml output for 'hg heads' is malformed
1171 Issue2130: xml output for 'hg heads' is malformed
1166
1172
1167 $ hg heads --style changelog
1173 $ hg heads --style changelog
1168 2020-01-01 test <test>
1174 2020-01-01 test <test>
1169
1175
1170 * fourth, second, third:
1176 * fourth, second, third:
1171 third
1177 third
1172 [95c24699272e] [tip]
1178 [95c24699272e] [tip]
1173
1179
1174 1970-01-18 person <person>
1180 1970-01-18 person <person>
1175
1181
1176 * merge
1182 * merge
1177 [d41e714fe50d]
1183 [d41e714fe50d]
1178
1184
1179 1970-01-17 person <person>
1185 1970-01-17 person <person>
1180
1186
1181 * new branch
1187 * new branch
1182 [bbe44766e73d] <foo>
1188 [bbe44766e73d] <foo>
1183
1189
1184
1190
1185 Keys work:
1191 Keys work:
1186
1192
1187 $ for key in author branch branches date desc file_adds file_dels file_mods \
1193 $ for key in author branch branches date desc file_adds file_dels file_mods \
1188 > file_copies file_copies_switch files \
1194 > file_copies file_copies_switch files \
1189 > manifest node parents rev tags diffstat extras \
1195 > manifest node parents rev tags diffstat extras \
1190 > p1rev p2rev p1node p2node; do
1196 > p1rev p2rev p1node p2node; do
1191 > for mode in '' --verbose --debug; do
1197 > for mode in '' --verbose --debug; do
1192 > hg log $mode --template "$key$mode: {$key}\n"
1198 > hg log $mode --template "$key$mode: {$key}\n"
1193 > done
1199 > done
1194 > done
1200 > done
1195 author: test
1201 author: test
1196 author: User Name <user@hostname>
1202 author: User Name <user@hostname>
1197 author: person
1203 author: person
1198 author: person
1204 author: person
1199 author: person
1205 author: person
1200 author: person
1206 author: person
1201 author: other@place
1207 author: other@place
1202 author: A. N. Other <other@place>
1208 author: A. N. Other <other@place>
1203 author: User Name <user@hostname>
1209 author: User Name <user@hostname>
1204 author--verbose: test
1210 author--verbose: test
1205 author--verbose: User Name <user@hostname>
1211 author--verbose: User Name <user@hostname>
1206 author--verbose: person
1212 author--verbose: person
1207 author--verbose: person
1213 author--verbose: person
1208 author--verbose: person
1214 author--verbose: person
1209 author--verbose: person
1215 author--verbose: person
1210 author--verbose: other@place
1216 author--verbose: other@place
1211 author--verbose: A. N. Other <other@place>
1217 author--verbose: A. N. Other <other@place>
1212 author--verbose: User Name <user@hostname>
1218 author--verbose: User Name <user@hostname>
1213 author--debug: test
1219 author--debug: test
1214 author--debug: User Name <user@hostname>
1220 author--debug: User Name <user@hostname>
1215 author--debug: person
1221 author--debug: person
1216 author--debug: person
1222 author--debug: person
1217 author--debug: person
1223 author--debug: person
1218 author--debug: person
1224 author--debug: person
1219 author--debug: other@place
1225 author--debug: other@place
1220 author--debug: A. N. Other <other@place>
1226 author--debug: A. N. Other <other@place>
1221 author--debug: User Name <user@hostname>
1227 author--debug: User Name <user@hostname>
1222 branch: default
1228 branch: default
1223 branch: default
1229 branch: default
1224 branch: default
1230 branch: default
1225 branch: default
1231 branch: default
1226 branch: foo
1232 branch: foo
1227 branch: default
1233 branch: default
1228 branch: default
1234 branch: default
1229 branch: default
1235 branch: default
1230 branch: default
1236 branch: default
1231 branch--verbose: default
1237 branch--verbose: default
1232 branch--verbose: default
1238 branch--verbose: default
1233 branch--verbose: default
1239 branch--verbose: default
1234 branch--verbose: default
1240 branch--verbose: default
1235 branch--verbose: foo
1241 branch--verbose: foo
1236 branch--verbose: default
1242 branch--verbose: default
1237 branch--verbose: default
1243 branch--verbose: default
1238 branch--verbose: default
1244 branch--verbose: default
1239 branch--verbose: default
1245 branch--verbose: default
1240 branch--debug: default
1246 branch--debug: default
1241 branch--debug: default
1247 branch--debug: default
1242 branch--debug: default
1248 branch--debug: default
1243 branch--debug: default
1249 branch--debug: default
1244 branch--debug: foo
1250 branch--debug: foo
1245 branch--debug: default
1251 branch--debug: default
1246 branch--debug: default
1252 branch--debug: default
1247 branch--debug: default
1253 branch--debug: default
1248 branch--debug: default
1254 branch--debug: default
1249 branches:
1255 branches:
1250 branches:
1256 branches:
1251 branches:
1257 branches:
1252 branches:
1258 branches:
1253 branches: foo
1259 branches: foo
1254 branches:
1260 branches:
1255 branches:
1261 branches:
1256 branches:
1262 branches:
1257 branches:
1263 branches:
1258 branches--verbose:
1264 branches--verbose:
1259 branches--verbose:
1265 branches--verbose:
1260 branches--verbose:
1266 branches--verbose:
1261 branches--verbose:
1267 branches--verbose:
1262 branches--verbose: foo
1268 branches--verbose: foo
1263 branches--verbose:
1269 branches--verbose:
1264 branches--verbose:
1270 branches--verbose:
1265 branches--verbose:
1271 branches--verbose:
1266 branches--verbose:
1272 branches--verbose:
1267 branches--debug:
1273 branches--debug:
1268 branches--debug:
1274 branches--debug:
1269 branches--debug:
1275 branches--debug:
1270 branches--debug:
1276 branches--debug:
1271 branches--debug: foo
1277 branches--debug: foo
1272 branches--debug:
1278 branches--debug:
1273 branches--debug:
1279 branches--debug:
1274 branches--debug:
1280 branches--debug:
1275 branches--debug:
1281 branches--debug:
1276 date: 1577872860.00
1282 date: 1577872860.00
1277 date: 1000000.00
1283 date: 1000000.00
1278 date: 1500001.00
1284 date: 1500001.00
1279 date: 1500000.00
1285 date: 1500000.00
1280 date: 1400000.00
1286 date: 1400000.00
1281 date: 1300000.00
1287 date: 1300000.00
1282 date: 1200000.00
1288 date: 1200000.00
1283 date: 1100000.00
1289 date: 1100000.00
1284 date: 1000000.00
1290 date: 1000000.00
1285 date--verbose: 1577872860.00
1291 date--verbose: 1577872860.00
1286 date--verbose: 1000000.00
1292 date--verbose: 1000000.00
1287 date--verbose: 1500001.00
1293 date--verbose: 1500001.00
1288 date--verbose: 1500000.00
1294 date--verbose: 1500000.00
1289 date--verbose: 1400000.00
1295 date--verbose: 1400000.00
1290 date--verbose: 1300000.00
1296 date--verbose: 1300000.00
1291 date--verbose: 1200000.00
1297 date--verbose: 1200000.00
1292 date--verbose: 1100000.00
1298 date--verbose: 1100000.00
1293 date--verbose: 1000000.00
1299 date--verbose: 1000000.00
1294 date--debug: 1577872860.00
1300 date--debug: 1577872860.00
1295 date--debug: 1000000.00
1301 date--debug: 1000000.00
1296 date--debug: 1500001.00
1302 date--debug: 1500001.00
1297 date--debug: 1500000.00
1303 date--debug: 1500000.00
1298 date--debug: 1400000.00
1304 date--debug: 1400000.00
1299 date--debug: 1300000.00
1305 date--debug: 1300000.00
1300 date--debug: 1200000.00
1306 date--debug: 1200000.00
1301 date--debug: 1100000.00
1307 date--debug: 1100000.00
1302 date--debug: 1000000.00
1308 date--debug: 1000000.00
1303 desc: third
1309 desc: third
1304 desc: second
1310 desc: second
1305 desc: merge
1311 desc: merge
1306 desc: new head
1312 desc: new head
1307 desc: new branch
1313 desc: new branch
1308 desc: no user, no domain
1314 desc: no user, no domain
1309 desc: no person
1315 desc: no person
1310 desc: other 1
1316 desc: other 1
1311 other 2
1317 other 2
1312
1318
1313 other 3
1319 other 3
1314 desc: line 1
1320 desc: line 1
1315 line 2
1321 line 2
1316 desc--verbose: third
1322 desc--verbose: third
1317 desc--verbose: second
1323 desc--verbose: second
1318 desc--verbose: merge
1324 desc--verbose: merge
1319 desc--verbose: new head
1325 desc--verbose: new head
1320 desc--verbose: new branch
1326 desc--verbose: new branch
1321 desc--verbose: no user, no domain
1327 desc--verbose: no user, no domain
1322 desc--verbose: no person
1328 desc--verbose: no person
1323 desc--verbose: other 1
1329 desc--verbose: other 1
1324 other 2
1330 other 2
1325
1331
1326 other 3
1332 other 3
1327 desc--verbose: line 1
1333 desc--verbose: line 1
1328 line 2
1334 line 2
1329 desc--debug: third
1335 desc--debug: third
1330 desc--debug: second
1336 desc--debug: second
1331 desc--debug: merge
1337 desc--debug: merge
1332 desc--debug: new head
1338 desc--debug: new head
1333 desc--debug: new branch
1339 desc--debug: new branch
1334 desc--debug: no user, no domain
1340 desc--debug: no user, no domain
1335 desc--debug: no person
1341 desc--debug: no person
1336 desc--debug: other 1
1342 desc--debug: other 1
1337 other 2
1343 other 2
1338
1344
1339 other 3
1345 other 3
1340 desc--debug: line 1
1346 desc--debug: line 1
1341 line 2
1347 line 2
1342 file_adds: fourth third
1348 file_adds: fourth third
1343 file_adds: second
1349 file_adds: second
1344 file_adds:
1350 file_adds:
1345 file_adds: d
1351 file_adds: d
1346 file_adds:
1352 file_adds:
1347 file_adds:
1353 file_adds:
1348 file_adds: c
1354 file_adds: c
1349 file_adds: b
1355 file_adds: b
1350 file_adds: a
1356 file_adds: a
1351 file_adds--verbose: fourth third
1357 file_adds--verbose: fourth third
1352 file_adds--verbose: second
1358 file_adds--verbose: second
1353 file_adds--verbose:
1359 file_adds--verbose:
1354 file_adds--verbose: d
1360 file_adds--verbose: d
1355 file_adds--verbose:
1361 file_adds--verbose:
1356 file_adds--verbose:
1362 file_adds--verbose:
1357 file_adds--verbose: c
1363 file_adds--verbose: c
1358 file_adds--verbose: b
1364 file_adds--verbose: b
1359 file_adds--verbose: a
1365 file_adds--verbose: a
1360 file_adds--debug: fourth third
1366 file_adds--debug: fourth third
1361 file_adds--debug: second
1367 file_adds--debug: second
1362 file_adds--debug:
1368 file_adds--debug:
1363 file_adds--debug: d
1369 file_adds--debug: d
1364 file_adds--debug:
1370 file_adds--debug:
1365 file_adds--debug:
1371 file_adds--debug:
1366 file_adds--debug: c
1372 file_adds--debug: c
1367 file_adds--debug: b
1373 file_adds--debug: b
1368 file_adds--debug: a
1374 file_adds--debug: a
1369 file_dels: second
1375 file_dels: second
1370 file_dels:
1376 file_dels:
1371 file_dels:
1377 file_dels:
1372 file_dels:
1378 file_dels:
1373 file_dels:
1379 file_dels:
1374 file_dels:
1380 file_dels:
1375 file_dels:
1381 file_dels:
1376 file_dels:
1382 file_dels:
1377 file_dels:
1383 file_dels:
1378 file_dels--verbose: second
1384 file_dels--verbose: second
1379 file_dels--verbose:
1385 file_dels--verbose:
1380 file_dels--verbose:
1386 file_dels--verbose:
1381 file_dels--verbose:
1387 file_dels--verbose:
1382 file_dels--verbose:
1388 file_dels--verbose:
1383 file_dels--verbose:
1389 file_dels--verbose:
1384 file_dels--verbose:
1390 file_dels--verbose:
1385 file_dels--verbose:
1391 file_dels--verbose:
1386 file_dels--verbose:
1392 file_dels--verbose:
1387 file_dels--debug: second
1393 file_dels--debug: second
1388 file_dels--debug:
1394 file_dels--debug:
1389 file_dels--debug:
1395 file_dels--debug:
1390 file_dels--debug:
1396 file_dels--debug:
1391 file_dels--debug:
1397 file_dels--debug:
1392 file_dels--debug:
1398 file_dels--debug:
1393 file_dels--debug:
1399 file_dels--debug:
1394 file_dels--debug:
1400 file_dels--debug:
1395 file_dels--debug:
1401 file_dels--debug:
1396 file_mods:
1402 file_mods:
1397 file_mods:
1403 file_mods:
1398 file_mods:
1404 file_mods:
1399 file_mods:
1405 file_mods:
1400 file_mods:
1406 file_mods:
1401 file_mods: c
1407 file_mods: c
1402 file_mods:
1408 file_mods:
1403 file_mods:
1409 file_mods:
1404 file_mods:
1410 file_mods:
1405 file_mods--verbose:
1411 file_mods--verbose:
1406 file_mods--verbose:
1412 file_mods--verbose:
1407 file_mods--verbose:
1413 file_mods--verbose:
1408 file_mods--verbose:
1414 file_mods--verbose:
1409 file_mods--verbose:
1415 file_mods--verbose:
1410 file_mods--verbose: c
1416 file_mods--verbose: c
1411 file_mods--verbose:
1417 file_mods--verbose:
1412 file_mods--verbose:
1418 file_mods--verbose:
1413 file_mods--verbose:
1419 file_mods--verbose:
1414 file_mods--debug:
1420 file_mods--debug:
1415 file_mods--debug:
1421 file_mods--debug:
1416 file_mods--debug:
1422 file_mods--debug:
1417 file_mods--debug:
1423 file_mods--debug:
1418 file_mods--debug:
1424 file_mods--debug:
1419 file_mods--debug: c
1425 file_mods--debug: c
1420 file_mods--debug:
1426 file_mods--debug:
1421 file_mods--debug:
1427 file_mods--debug:
1422 file_mods--debug:
1428 file_mods--debug:
1423 file_copies: fourth (second)
1429 file_copies: fourth (second)
1424 file_copies:
1430 file_copies:
1425 file_copies:
1431 file_copies:
1426 file_copies:
1432 file_copies:
1427 file_copies:
1433 file_copies:
1428 file_copies:
1434 file_copies:
1429 file_copies:
1435 file_copies:
1430 file_copies:
1436 file_copies:
1431 file_copies:
1437 file_copies:
1432 file_copies--verbose: fourth (second)
1438 file_copies--verbose: fourth (second)
1433 file_copies--verbose:
1439 file_copies--verbose:
1434 file_copies--verbose:
1440 file_copies--verbose:
1435 file_copies--verbose:
1441 file_copies--verbose:
1436 file_copies--verbose:
1442 file_copies--verbose:
1437 file_copies--verbose:
1443 file_copies--verbose:
1438 file_copies--verbose:
1444 file_copies--verbose:
1439 file_copies--verbose:
1445 file_copies--verbose:
1440 file_copies--verbose:
1446 file_copies--verbose:
1441 file_copies--debug: fourth (second)
1447 file_copies--debug: fourth (second)
1442 file_copies--debug:
1448 file_copies--debug:
1443 file_copies--debug:
1449 file_copies--debug:
1444 file_copies--debug:
1450 file_copies--debug:
1445 file_copies--debug:
1451 file_copies--debug:
1446 file_copies--debug:
1452 file_copies--debug:
1447 file_copies--debug:
1453 file_copies--debug:
1448 file_copies--debug:
1454 file_copies--debug:
1449 file_copies--debug:
1455 file_copies--debug:
1450 file_copies_switch:
1456 file_copies_switch:
1451 file_copies_switch:
1457 file_copies_switch:
1452 file_copies_switch:
1458 file_copies_switch:
1453 file_copies_switch:
1459 file_copies_switch:
1454 file_copies_switch:
1460 file_copies_switch:
1455 file_copies_switch:
1461 file_copies_switch:
1456 file_copies_switch:
1462 file_copies_switch:
1457 file_copies_switch:
1463 file_copies_switch:
1458 file_copies_switch:
1464 file_copies_switch:
1459 file_copies_switch--verbose:
1465 file_copies_switch--verbose:
1460 file_copies_switch--verbose:
1466 file_copies_switch--verbose:
1461 file_copies_switch--verbose:
1467 file_copies_switch--verbose:
1462 file_copies_switch--verbose:
1468 file_copies_switch--verbose:
1463 file_copies_switch--verbose:
1469 file_copies_switch--verbose:
1464 file_copies_switch--verbose:
1470 file_copies_switch--verbose:
1465 file_copies_switch--verbose:
1471 file_copies_switch--verbose:
1466 file_copies_switch--verbose:
1472 file_copies_switch--verbose:
1467 file_copies_switch--verbose:
1473 file_copies_switch--verbose:
1468 file_copies_switch--debug:
1474 file_copies_switch--debug:
1469 file_copies_switch--debug:
1475 file_copies_switch--debug:
1470 file_copies_switch--debug:
1476 file_copies_switch--debug:
1471 file_copies_switch--debug:
1477 file_copies_switch--debug:
1472 file_copies_switch--debug:
1478 file_copies_switch--debug:
1473 file_copies_switch--debug:
1479 file_copies_switch--debug:
1474 file_copies_switch--debug:
1480 file_copies_switch--debug:
1475 file_copies_switch--debug:
1481 file_copies_switch--debug:
1476 file_copies_switch--debug:
1482 file_copies_switch--debug:
1477 files: fourth second third
1483 files: fourth second third
1478 files: second
1484 files: second
1479 files:
1485 files:
1480 files: d
1486 files: d
1481 files:
1487 files:
1482 files: c
1488 files: c
1483 files: c
1489 files: c
1484 files: b
1490 files: b
1485 files: a
1491 files: a
1486 files--verbose: fourth second third
1492 files--verbose: fourth second third
1487 files--verbose: second
1493 files--verbose: second
1488 files--verbose:
1494 files--verbose:
1489 files--verbose: d
1495 files--verbose: d
1490 files--verbose:
1496 files--verbose:
1491 files--verbose: c
1497 files--verbose: c
1492 files--verbose: c
1498 files--verbose: c
1493 files--verbose: b
1499 files--verbose: b
1494 files--verbose: a
1500 files--verbose: a
1495 files--debug: fourth second third
1501 files--debug: fourth second third
1496 files--debug: second
1502 files--debug: second
1497 files--debug:
1503 files--debug:
1498 files--debug: d
1504 files--debug: d
1499 files--debug:
1505 files--debug:
1500 files--debug: c
1506 files--debug: c
1501 files--debug: c
1507 files--debug: c
1502 files--debug: b
1508 files--debug: b
1503 files--debug: a
1509 files--debug: a
1504 manifest: 6:94961b75a2da
1510 manifest: 6:94961b75a2da
1505 manifest: 5:f2dbc354b94e
1511 manifest: 5:f2dbc354b94e
1506 manifest: 4:4dc3def4f9b4
1512 manifest: 4:4dc3def4f9b4
1507 manifest: 4:4dc3def4f9b4
1513 manifest: 4:4dc3def4f9b4
1508 manifest: 3:cb5a1327723b
1514 manifest: 3:cb5a1327723b
1509 manifest: 3:cb5a1327723b
1515 manifest: 3:cb5a1327723b
1510 manifest: 2:6e0e82995c35
1516 manifest: 2:6e0e82995c35
1511 manifest: 1:4e8d705b1e53
1517 manifest: 1:4e8d705b1e53
1512 manifest: 0:a0c8bcbbb45c
1518 manifest: 0:a0c8bcbbb45c
1513 manifest--verbose: 6:94961b75a2da
1519 manifest--verbose: 6:94961b75a2da
1514 manifest--verbose: 5:f2dbc354b94e
1520 manifest--verbose: 5:f2dbc354b94e
1515 manifest--verbose: 4:4dc3def4f9b4
1521 manifest--verbose: 4:4dc3def4f9b4
1516 manifest--verbose: 4:4dc3def4f9b4
1522 manifest--verbose: 4:4dc3def4f9b4
1517 manifest--verbose: 3:cb5a1327723b
1523 manifest--verbose: 3:cb5a1327723b
1518 manifest--verbose: 3:cb5a1327723b
1524 manifest--verbose: 3:cb5a1327723b
1519 manifest--verbose: 2:6e0e82995c35
1525 manifest--verbose: 2:6e0e82995c35
1520 manifest--verbose: 1:4e8d705b1e53
1526 manifest--verbose: 1:4e8d705b1e53
1521 manifest--verbose: 0:a0c8bcbbb45c
1527 manifest--verbose: 0:a0c8bcbbb45c
1522 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
1528 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
1523 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
1529 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
1524 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1530 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1525 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1531 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1526 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1532 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1527 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1533 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1528 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1534 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1529 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1535 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1530 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1536 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1531 node: 95c24699272ef57d062b8bccc32c878bf841784a
1537 node: 95c24699272ef57d062b8bccc32c878bf841784a
1532 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1538 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1533 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1539 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1534 node: 13207e5a10d9fd28ec424934298e176197f2c67f
1540 node: 13207e5a10d9fd28ec424934298e176197f2c67f
1535 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1541 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1536 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1542 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1537 node: 97054abb4ab824450e9164180baf491ae0078465
1543 node: 97054abb4ab824450e9164180baf491ae0078465
1538 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1544 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1539 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1545 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1540 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
1546 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
1541 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1547 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1542 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1548 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1543 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1549 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1544 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1550 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1545 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1551 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1546 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1552 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1547 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1553 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1548 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1554 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1549 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
1555 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
1550 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1556 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1551 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1557 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1552 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1558 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1553 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1559 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1554 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1560 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1555 node--debug: 97054abb4ab824450e9164180baf491ae0078465
1561 node--debug: 97054abb4ab824450e9164180baf491ae0078465
1556 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1562 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1557 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1563 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1558 parents:
1564 parents:
1559 parents: -1:000000000000
1565 parents: -1:000000000000
1560 parents: 5:13207e5a10d9 4:bbe44766e73d
1566 parents: 5:13207e5a10d9 4:bbe44766e73d
1561 parents: 3:10e46f2dcbf4
1567 parents: 3:10e46f2dcbf4
1562 parents:
1568 parents:
1563 parents:
1569 parents:
1564 parents:
1570 parents:
1565 parents:
1571 parents:
1566 parents:
1572 parents:
1567 parents--verbose:
1573 parents--verbose:
1568 parents--verbose: -1:000000000000
1574 parents--verbose: -1:000000000000
1569 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
1575 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
1570 parents--verbose: 3:10e46f2dcbf4
1576 parents--verbose: 3:10e46f2dcbf4
1571 parents--verbose:
1577 parents--verbose:
1572 parents--verbose:
1578 parents--verbose:
1573 parents--verbose:
1579 parents--verbose:
1574 parents--verbose:
1580 parents--verbose:
1575 parents--verbose:
1581 parents--verbose:
1576 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
1582 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
1577 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1583 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1578 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1584 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1579 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1585 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1580 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1586 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1581 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
1587 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
1582 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
1588 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
1583 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
1589 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
1584 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1590 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1585 rev: 8
1591 rev: 8
1586 rev: 7
1592 rev: 7
1587 rev: 6
1593 rev: 6
1588 rev: 5
1594 rev: 5
1589 rev: 4
1595 rev: 4
1590 rev: 3
1596 rev: 3
1591 rev: 2
1597 rev: 2
1592 rev: 1
1598 rev: 1
1593 rev: 0
1599 rev: 0
1594 rev--verbose: 8
1600 rev--verbose: 8
1595 rev--verbose: 7
1601 rev--verbose: 7
1596 rev--verbose: 6
1602 rev--verbose: 6
1597 rev--verbose: 5
1603 rev--verbose: 5
1598 rev--verbose: 4
1604 rev--verbose: 4
1599 rev--verbose: 3
1605 rev--verbose: 3
1600 rev--verbose: 2
1606 rev--verbose: 2
1601 rev--verbose: 1
1607 rev--verbose: 1
1602 rev--verbose: 0
1608 rev--verbose: 0
1603 rev--debug: 8
1609 rev--debug: 8
1604 rev--debug: 7
1610 rev--debug: 7
1605 rev--debug: 6
1611 rev--debug: 6
1606 rev--debug: 5
1612 rev--debug: 5
1607 rev--debug: 4
1613 rev--debug: 4
1608 rev--debug: 3
1614 rev--debug: 3
1609 rev--debug: 2
1615 rev--debug: 2
1610 rev--debug: 1
1616 rev--debug: 1
1611 rev--debug: 0
1617 rev--debug: 0
1612 tags: tip
1618 tags: tip
1613 tags:
1619 tags:
1614 tags:
1620 tags:
1615 tags:
1621 tags:
1616 tags:
1622 tags:
1617 tags:
1623 tags:
1618 tags:
1624 tags:
1619 tags:
1625 tags:
1620 tags:
1626 tags:
1621 tags--verbose: tip
1627 tags--verbose: tip
1622 tags--verbose:
1628 tags--verbose:
1623 tags--verbose:
1629 tags--verbose:
1624 tags--verbose:
1630 tags--verbose:
1625 tags--verbose:
1631 tags--verbose:
1626 tags--verbose:
1632 tags--verbose:
1627 tags--verbose:
1633 tags--verbose:
1628 tags--verbose:
1634 tags--verbose:
1629 tags--verbose:
1635 tags--verbose:
1630 tags--debug: tip
1636 tags--debug: tip
1631 tags--debug:
1637 tags--debug:
1632 tags--debug:
1638 tags--debug:
1633 tags--debug:
1639 tags--debug:
1634 tags--debug:
1640 tags--debug:
1635 tags--debug:
1641 tags--debug:
1636 tags--debug:
1642 tags--debug:
1637 tags--debug:
1643 tags--debug:
1638 tags--debug:
1644 tags--debug:
1639 diffstat: 3: +2/-1
1645 diffstat: 3: +2/-1
1640 diffstat: 1: +1/-0
1646 diffstat: 1: +1/-0
1641 diffstat: 0: +0/-0
1647 diffstat: 0: +0/-0
1642 diffstat: 1: +1/-0
1648 diffstat: 1: +1/-0
1643 diffstat: 0: +0/-0
1649 diffstat: 0: +0/-0
1644 diffstat: 1: +1/-0
1650 diffstat: 1: +1/-0
1645 diffstat: 1: +4/-0
1651 diffstat: 1: +4/-0
1646 diffstat: 1: +2/-0
1652 diffstat: 1: +2/-0
1647 diffstat: 1: +1/-0
1653 diffstat: 1: +1/-0
1648 diffstat--verbose: 3: +2/-1
1654 diffstat--verbose: 3: +2/-1
1649 diffstat--verbose: 1: +1/-0
1655 diffstat--verbose: 1: +1/-0
1650 diffstat--verbose: 0: +0/-0
1656 diffstat--verbose: 0: +0/-0
1651 diffstat--verbose: 1: +1/-0
1657 diffstat--verbose: 1: +1/-0
1652 diffstat--verbose: 0: +0/-0
1658 diffstat--verbose: 0: +0/-0
1653 diffstat--verbose: 1: +1/-0
1659 diffstat--verbose: 1: +1/-0
1654 diffstat--verbose: 1: +4/-0
1660 diffstat--verbose: 1: +4/-0
1655 diffstat--verbose: 1: +2/-0
1661 diffstat--verbose: 1: +2/-0
1656 diffstat--verbose: 1: +1/-0
1662 diffstat--verbose: 1: +1/-0
1657 diffstat--debug: 3: +2/-1
1663 diffstat--debug: 3: +2/-1
1658 diffstat--debug: 1: +1/-0
1664 diffstat--debug: 1: +1/-0
1659 diffstat--debug: 0: +0/-0
1665 diffstat--debug: 0: +0/-0
1660 diffstat--debug: 1: +1/-0
1666 diffstat--debug: 1: +1/-0
1661 diffstat--debug: 0: +0/-0
1667 diffstat--debug: 0: +0/-0
1662 diffstat--debug: 1: +1/-0
1668 diffstat--debug: 1: +1/-0
1663 diffstat--debug: 1: +4/-0
1669 diffstat--debug: 1: +4/-0
1664 diffstat--debug: 1: +2/-0
1670 diffstat--debug: 1: +2/-0
1665 diffstat--debug: 1: +1/-0
1671 diffstat--debug: 1: +1/-0
1666 extras: branch=default
1672 extras: branch=default
1667 extras: branch=default
1673 extras: branch=default
1668 extras: branch=default
1674 extras: branch=default
1669 extras: branch=default
1675 extras: branch=default
1670 extras: branch=foo
1676 extras: branch=foo
1671 extras: branch=default
1677 extras: branch=default
1672 extras: branch=default
1678 extras: branch=default
1673 extras: branch=default
1679 extras: branch=default
1674 extras: branch=default
1680 extras: branch=default
1675 extras--verbose: branch=default
1681 extras--verbose: branch=default
1676 extras--verbose: branch=default
1682 extras--verbose: branch=default
1677 extras--verbose: branch=default
1683 extras--verbose: branch=default
1678 extras--verbose: branch=default
1684 extras--verbose: branch=default
1679 extras--verbose: branch=foo
1685 extras--verbose: branch=foo
1680 extras--verbose: branch=default
1686 extras--verbose: branch=default
1681 extras--verbose: branch=default
1687 extras--verbose: branch=default
1682 extras--verbose: branch=default
1688 extras--verbose: branch=default
1683 extras--verbose: branch=default
1689 extras--verbose: branch=default
1684 extras--debug: branch=default
1690 extras--debug: branch=default
1685 extras--debug: branch=default
1691 extras--debug: branch=default
1686 extras--debug: branch=default
1692 extras--debug: branch=default
1687 extras--debug: branch=default
1693 extras--debug: branch=default
1688 extras--debug: branch=foo
1694 extras--debug: branch=foo
1689 extras--debug: branch=default
1695 extras--debug: branch=default
1690 extras--debug: branch=default
1696 extras--debug: branch=default
1691 extras--debug: branch=default
1697 extras--debug: branch=default
1692 extras--debug: branch=default
1698 extras--debug: branch=default
1693 p1rev: 7
1699 p1rev: 7
1694 p1rev: -1
1700 p1rev: -1
1695 p1rev: 5
1701 p1rev: 5
1696 p1rev: 3
1702 p1rev: 3
1697 p1rev: 3
1703 p1rev: 3
1698 p1rev: 2
1704 p1rev: 2
1699 p1rev: 1
1705 p1rev: 1
1700 p1rev: 0
1706 p1rev: 0
1701 p1rev: -1
1707 p1rev: -1
1702 p1rev--verbose: 7
1708 p1rev--verbose: 7
1703 p1rev--verbose: -1
1709 p1rev--verbose: -1
1704 p1rev--verbose: 5
1710 p1rev--verbose: 5
1705 p1rev--verbose: 3
1711 p1rev--verbose: 3
1706 p1rev--verbose: 3
1712 p1rev--verbose: 3
1707 p1rev--verbose: 2
1713 p1rev--verbose: 2
1708 p1rev--verbose: 1
1714 p1rev--verbose: 1
1709 p1rev--verbose: 0
1715 p1rev--verbose: 0
1710 p1rev--verbose: -1
1716 p1rev--verbose: -1
1711 p1rev--debug: 7
1717 p1rev--debug: 7
1712 p1rev--debug: -1
1718 p1rev--debug: -1
1713 p1rev--debug: 5
1719 p1rev--debug: 5
1714 p1rev--debug: 3
1720 p1rev--debug: 3
1715 p1rev--debug: 3
1721 p1rev--debug: 3
1716 p1rev--debug: 2
1722 p1rev--debug: 2
1717 p1rev--debug: 1
1723 p1rev--debug: 1
1718 p1rev--debug: 0
1724 p1rev--debug: 0
1719 p1rev--debug: -1
1725 p1rev--debug: -1
1720 p2rev: -1
1726 p2rev: -1
1721 p2rev: -1
1727 p2rev: -1
1722 p2rev: 4
1728 p2rev: 4
1723 p2rev: -1
1729 p2rev: -1
1724 p2rev: -1
1730 p2rev: -1
1725 p2rev: -1
1731 p2rev: -1
1726 p2rev: -1
1732 p2rev: -1
1727 p2rev: -1
1733 p2rev: -1
1728 p2rev: -1
1734 p2rev: -1
1729 p2rev--verbose: -1
1735 p2rev--verbose: -1
1730 p2rev--verbose: -1
1736 p2rev--verbose: -1
1731 p2rev--verbose: 4
1737 p2rev--verbose: 4
1732 p2rev--verbose: -1
1738 p2rev--verbose: -1
1733 p2rev--verbose: -1
1739 p2rev--verbose: -1
1734 p2rev--verbose: -1
1740 p2rev--verbose: -1
1735 p2rev--verbose: -1
1741 p2rev--verbose: -1
1736 p2rev--verbose: -1
1742 p2rev--verbose: -1
1737 p2rev--verbose: -1
1743 p2rev--verbose: -1
1738 p2rev--debug: -1
1744 p2rev--debug: -1
1739 p2rev--debug: -1
1745 p2rev--debug: -1
1740 p2rev--debug: 4
1746 p2rev--debug: 4
1741 p2rev--debug: -1
1747 p2rev--debug: -1
1742 p2rev--debug: -1
1748 p2rev--debug: -1
1743 p2rev--debug: -1
1749 p2rev--debug: -1
1744 p2rev--debug: -1
1750 p2rev--debug: -1
1745 p2rev--debug: -1
1751 p2rev--debug: -1
1746 p2rev--debug: -1
1752 p2rev--debug: -1
1747 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1753 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1748 p1node: 0000000000000000000000000000000000000000
1754 p1node: 0000000000000000000000000000000000000000
1749 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
1755 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
1750 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1756 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1751 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1757 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1752 p1node: 97054abb4ab824450e9164180baf491ae0078465
1758 p1node: 97054abb4ab824450e9164180baf491ae0078465
1753 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1759 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1754 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1760 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1755 p1node: 0000000000000000000000000000000000000000
1761 p1node: 0000000000000000000000000000000000000000
1756 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1762 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1757 p1node--verbose: 0000000000000000000000000000000000000000
1763 p1node--verbose: 0000000000000000000000000000000000000000
1758 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1764 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1759 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1765 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1760 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1766 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1761 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1767 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1762 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1768 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1763 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1769 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1764 p1node--verbose: 0000000000000000000000000000000000000000
1770 p1node--verbose: 0000000000000000000000000000000000000000
1765 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1771 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1766 p1node--debug: 0000000000000000000000000000000000000000
1772 p1node--debug: 0000000000000000000000000000000000000000
1767 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1773 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1768 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1774 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1769 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1775 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1770 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
1776 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
1771 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1777 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1772 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1778 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1773 p1node--debug: 0000000000000000000000000000000000000000
1779 p1node--debug: 0000000000000000000000000000000000000000
1774 p2node: 0000000000000000000000000000000000000000
1780 p2node: 0000000000000000000000000000000000000000
1775 p2node: 0000000000000000000000000000000000000000
1781 p2node: 0000000000000000000000000000000000000000
1776 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1782 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1777 p2node: 0000000000000000000000000000000000000000
1783 p2node: 0000000000000000000000000000000000000000
1778 p2node: 0000000000000000000000000000000000000000
1784 p2node: 0000000000000000000000000000000000000000
1779 p2node: 0000000000000000000000000000000000000000
1785 p2node: 0000000000000000000000000000000000000000
1780 p2node: 0000000000000000000000000000000000000000
1786 p2node: 0000000000000000000000000000000000000000
1781 p2node: 0000000000000000000000000000000000000000
1787 p2node: 0000000000000000000000000000000000000000
1782 p2node: 0000000000000000000000000000000000000000
1788 p2node: 0000000000000000000000000000000000000000
1783 p2node--verbose: 0000000000000000000000000000000000000000
1789 p2node--verbose: 0000000000000000000000000000000000000000
1784 p2node--verbose: 0000000000000000000000000000000000000000
1790 p2node--verbose: 0000000000000000000000000000000000000000
1785 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1791 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1786 p2node--verbose: 0000000000000000000000000000000000000000
1792 p2node--verbose: 0000000000000000000000000000000000000000
1787 p2node--verbose: 0000000000000000000000000000000000000000
1793 p2node--verbose: 0000000000000000000000000000000000000000
1788 p2node--verbose: 0000000000000000000000000000000000000000
1794 p2node--verbose: 0000000000000000000000000000000000000000
1789 p2node--verbose: 0000000000000000000000000000000000000000
1795 p2node--verbose: 0000000000000000000000000000000000000000
1790 p2node--verbose: 0000000000000000000000000000000000000000
1796 p2node--verbose: 0000000000000000000000000000000000000000
1791 p2node--verbose: 0000000000000000000000000000000000000000
1797 p2node--verbose: 0000000000000000000000000000000000000000
1792 p2node--debug: 0000000000000000000000000000000000000000
1798 p2node--debug: 0000000000000000000000000000000000000000
1793 p2node--debug: 0000000000000000000000000000000000000000
1799 p2node--debug: 0000000000000000000000000000000000000000
1794 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1800 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1795 p2node--debug: 0000000000000000000000000000000000000000
1801 p2node--debug: 0000000000000000000000000000000000000000
1796 p2node--debug: 0000000000000000000000000000000000000000
1802 p2node--debug: 0000000000000000000000000000000000000000
1797 p2node--debug: 0000000000000000000000000000000000000000
1803 p2node--debug: 0000000000000000000000000000000000000000
1798 p2node--debug: 0000000000000000000000000000000000000000
1804 p2node--debug: 0000000000000000000000000000000000000000
1799 p2node--debug: 0000000000000000000000000000000000000000
1805 p2node--debug: 0000000000000000000000000000000000000000
1800 p2node--debug: 0000000000000000000000000000000000000000
1806 p2node--debug: 0000000000000000000000000000000000000000
1801
1807
1802 Filters work:
1808 Filters work:
1803
1809
1804 $ hg log --template '{author|domain}\n'
1810 $ hg log --template '{author|domain}\n'
1805
1811
1806 hostname
1812 hostname
1807
1813
1808
1814
1809
1815
1810
1816
1811 place
1817 place
1812 place
1818 place
1813 hostname
1819 hostname
1814
1820
1815 $ hg log --template '{author|person}\n'
1821 $ hg log --template '{author|person}\n'
1816 test
1822 test
1817 User Name
1823 User Name
1818 person
1824 person
1819 person
1825 person
1820 person
1826 person
1821 person
1827 person
1822 other
1828 other
1823 A. N. Other
1829 A. N. Other
1824 User Name
1830 User Name
1825
1831
1826 $ hg log --template '{author|user}\n'
1832 $ hg log --template '{author|user}\n'
1827 test
1833 test
1828 user
1834 user
1829 person
1835 person
1830 person
1836 person
1831 person
1837 person
1832 person
1838 person
1833 other
1839 other
1834 other
1840 other
1835 user
1841 user
1836
1842
1837 $ hg log --template '{date|date}\n'
1843 $ hg log --template '{date|date}\n'
1838 Wed Jan 01 10:01:00 2020 +0000
1844 Wed Jan 01 10:01:00 2020 +0000
1839 Mon Jan 12 13:46:40 1970 +0000
1845 Mon Jan 12 13:46:40 1970 +0000
1840 Sun Jan 18 08:40:01 1970 +0000
1846 Sun Jan 18 08:40:01 1970 +0000
1841 Sun Jan 18 08:40:00 1970 +0000
1847 Sun Jan 18 08:40:00 1970 +0000
1842 Sat Jan 17 04:53:20 1970 +0000
1848 Sat Jan 17 04:53:20 1970 +0000
1843 Fri Jan 16 01:06:40 1970 +0000
1849 Fri Jan 16 01:06:40 1970 +0000
1844 Wed Jan 14 21:20:00 1970 +0000
1850 Wed Jan 14 21:20:00 1970 +0000
1845 Tue Jan 13 17:33:20 1970 +0000
1851 Tue Jan 13 17:33:20 1970 +0000
1846 Mon Jan 12 13:46:40 1970 +0000
1852 Mon Jan 12 13:46:40 1970 +0000
1847
1853
1848 $ hg log --template '{date|isodate}\n'
1854 $ hg log --template '{date|isodate}\n'
1849 2020-01-01 10:01 +0000
1855 2020-01-01 10:01 +0000
1850 1970-01-12 13:46 +0000
1856 1970-01-12 13:46 +0000
1851 1970-01-18 08:40 +0000
1857 1970-01-18 08:40 +0000
1852 1970-01-18 08:40 +0000
1858 1970-01-18 08:40 +0000
1853 1970-01-17 04:53 +0000
1859 1970-01-17 04:53 +0000
1854 1970-01-16 01:06 +0000
1860 1970-01-16 01:06 +0000
1855 1970-01-14 21:20 +0000
1861 1970-01-14 21:20 +0000
1856 1970-01-13 17:33 +0000
1862 1970-01-13 17:33 +0000
1857 1970-01-12 13:46 +0000
1863 1970-01-12 13:46 +0000
1858
1864
1859 $ hg log --template '{date|isodatesec}\n'
1865 $ hg log --template '{date|isodatesec}\n'
1860 2020-01-01 10:01:00 +0000
1866 2020-01-01 10:01:00 +0000
1861 1970-01-12 13:46:40 +0000
1867 1970-01-12 13:46:40 +0000
1862 1970-01-18 08:40:01 +0000
1868 1970-01-18 08:40:01 +0000
1863 1970-01-18 08:40:00 +0000
1869 1970-01-18 08:40:00 +0000
1864 1970-01-17 04:53:20 +0000
1870 1970-01-17 04:53:20 +0000
1865 1970-01-16 01:06:40 +0000
1871 1970-01-16 01:06:40 +0000
1866 1970-01-14 21:20:00 +0000
1872 1970-01-14 21:20:00 +0000
1867 1970-01-13 17:33:20 +0000
1873 1970-01-13 17:33:20 +0000
1868 1970-01-12 13:46:40 +0000
1874 1970-01-12 13:46:40 +0000
1869
1875
1870 $ hg log --template '{date|rfc822date}\n'
1876 $ hg log --template '{date|rfc822date}\n'
1871 Wed, 01 Jan 2020 10:01:00 +0000
1877 Wed, 01 Jan 2020 10:01:00 +0000
1872 Mon, 12 Jan 1970 13:46:40 +0000
1878 Mon, 12 Jan 1970 13:46:40 +0000
1873 Sun, 18 Jan 1970 08:40:01 +0000
1879 Sun, 18 Jan 1970 08:40:01 +0000
1874 Sun, 18 Jan 1970 08:40:00 +0000
1880 Sun, 18 Jan 1970 08:40:00 +0000
1875 Sat, 17 Jan 1970 04:53:20 +0000
1881 Sat, 17 Jan 1970 04:53:20 +0000
1876 Fri, 16 Jan 1970 01:06:40 +0000
1882 Fri, 16 Jan 1970 01:06:40 +0000
1877 Wed, 14 Jan 1970 21:20:00 +0000
1883 Wed, 14 Jan 1970 21:20:00 +0000
1878 Tue, 13 Jan 1970 17:33:20 +0000
1884 Tue, 13 Jan 1970 17:33:20 +0000
1879 Mon, 12 Jan 1970 13:46:40 +0000
1885 Mon, 12 Jan 1970 13:46:40 +0000
1880
1886
1881 $ hg log --template '{desc|firstline}\n'
1887 $ hg log --template '{desc|firstline}\n'
1882 third
1888 third
1883 second
1889 second
1884 merge
1890 merge
1885 new head
1891 new head
1886 new branch
1892 new branch
1887 no user, no domain
1893 no user, no domain
1888 no person
1894 no person
1889 other 1
1895 other 1
1890 line 1
1896 line 1
1891
1897
1892 $ hg log --template '{node|short}\n'
1898 $ hg log --template '{node|short}\n'
1893 95c24699272e
1899 95c24699272e
1894 29114dbae42b
1900 29114dbae42b
1895 d41e714fe50d
1901 d41e714fe50d
1896 13207e5a10d9
1902 13207e5a10d9
1897 bbe44766e73d
1903 bbe44766e73d
1898 10e46f2dcbf4
1904 10e46f2dcbf4
1899 97054abb4ab8
1905 97054abb4ab8
1900 b608e9d1a3f0
1906 b608e9d1a3f0
1901 1e4e1b8f71e0
1907 1e4e1b8f71e0
1902
1908
1903 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
1909 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
1904 <changeset author="test"/>
1910 <changeset author="test"/>
1905 <changeset author="User Name &lt;user@hostname&gt;"/>
1911 <changeset author="User Name &lt;user@hostname&gt;"/>
1906 <changeset author="person"/>
1912 <changeset author="person"/>
1907 <changeset author="person"/>
1913 <changeset author="person"/>
1908 <changeset author="person"/>
1914 <changeset author="person"/>
1909 <changeset author="person"/>
1915 <changeset author="person"/>
1910 <changeset author="other@place"/>
1916 <changeset author="other@place"/>
1911 <changeset author="A. N. Other &lt;other@place&gt;"/>
1917 <changeset author="A. N. Other &lt;other@place&gt;"/>
1912 <changeset author="User Name &lt;user@hostname&gt;"/>
1918 <changeset author="User Name &lt;user@hostname&gt;"/>
1913
1919
1914 $ hg log --template '{rev}: {children}\n'
1920 $ hg log --template '{rev}: {children}\n'
1915 8:
1921 8:
1916 7: 8:95c24699272e
1922 7: 8:95c24699272e
1917 6:
1923 6:
1918 5: 6:d41e714fe50d
1924 5: 6:d41e714fe50d
1919 4: 6:d41e714fe50d
1925 4: 6:d41e714fe50d
1920 3: 4:bbe44766e73d 5:13207e5a10d9
1926 3: 4:bbe44766e73d 5:13207e5a10d9
1921 2: 3:10e46f2dcbf4
1927 2: 3:10e46f2dcbf4
1922 1: 2:97054abb4ab8
1928 1: 2:97054abb4ab8
1923 0: 1:b608e9d1a3f0
1929 0: 1:b608e9d1a3f0
1924
1930
1925 Formatnode filter works:
1931 Formatnode filter works:
1926
1932
1927 $ hg -q log -r 0 --template '{node|formatnode}\n'
1933 $ hg -q log -r 0 --template '{node|formatnode}\n'
1928 1e4e1b8f71e0
1934 1e4e1b8f71e0
1929
1935
1930 $ hg log -r 0 --template '{node|formatnode}\n'
1936 $ hg log -r 0 --template '{node|formatnode}\n'
1931 1e4e1b8f71e0
1937 1e4e1b8f71e0
1932
1938
1933 $ hg -v log -r 0 --template '{node|formatnode}\n'
1939 $ hg -v log -r 0 --template '{node|formatnode}\n'
1934 1e4e1b8f71e0
1940 1e4e1b8f71e0
1935
1941
1936 $ hg --debug log -r 0 --template '{node|formatnode}\n'
1942 $ hg --debug log -r 0 --template '{node|formatnode}\n'
1937 1e4e1b8f71e05681d422154f5421e385fec3454f
1943 1e4e1b8f71e05681d422154f5421e385fec3454f
1938
1944
1939 Age filter:
1945 Age filter:
1940
1946
1941 $ hg init unstable-hash
1947 $ hg init unstable-hash
1942 $ cd unstable-hash
1948 $ cd unstable-hash
1943 $ hg log --template '{date|age}\n' > /dev/null || exit 1
1949 $ hg log --template '{date|age}\n' > /dev/null || exit 1
1944
1950
1945 >>> from datetime import datetime, timedelta
1951 >>> from datetime import datetime, timedelta
1946 >>> fp = open('a', 'w')
1952 >>> fp = open('a', 'w')
1947 >>> n = datetime.now() + timedelta(366 * 7)
1953 >>> n = datetime.now() + timedelta(366 * 7)
1948 >>> fp.write('%d-%d-%d 00:00' % (n.year, n.month, n.day))
1954 >>> fp.write('%d-%d-%d 00:00' % (n.year, n.month, n.day))
1949 >>> fp.close()
1955 >>> fp.close()
1950 $ hg add a
1956 $ hg add a
1951 $ hg commit -m future -d "`cat a`"
1957 $ hg commit -m future -d "`cat a`"
1952
1958
1953 $ hg log -l1 --template '{date|age}\n'
1959 $ hg log -l1 --template '{date|age}\n'
1954 7 years from now
1960 7 years from now
1955
1961
1956 $ cd ..
1962 $ cd ..
1957 $ rm -rf unstable-hash
1963 $ rm -rf unstable-hash
1958
1964
1959 Add a dummy commit to make up for the instability of the above:
1965 Add a dummy commit to make up for the instability of the above:
1960
1966
1961 $ echo a > a
1967 $ echo a > a
1962 $ hg add a
1968 $ hg add a
1963 $ hg ci -m future
1969 $ hg ci -m future
1964
1970
1965 Count filter:
1971 Count filter:
1966
1972
1967 $ hg log -l1 --template '{node|count} {node|short|count}\n'
1973 $ hg log -l1 --template '{node|count} {node|short|count}\n'
1968 40 12
1974 40 12
1969
1975
1970 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n'
1976 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n'
1971 0 1 4
1977 0 1 4
1972
1978
1973 $ hg log -G --template '{rev}: children: {children|count}, \
1979 $ hg log -G --template '{rev}: children: {children|count}, \
1974 > tags: {tags|count}, file_adds: {file_adds|count}, \
1980 > tags: {tags|count}, file_adds: {file_adds|count}, \
1975 > ancestors: {revset("ancestors(%s)", rev)|count}'
1981 > ancestors: {revset("ancestors(%s)", rev)|count}'
1976 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
1982 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
1977 |
1983 |
1978 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
1984 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
1979 |
1985 |
1980 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
1986 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
1981
1987
1982 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
1988 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
1983 |\
1989 |\
1984 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
1990 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
1985 | |
1991 | |
1986 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
1992 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
1987 |/
1993 |/
1988 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
1994 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
1989 |
1995 |
1990 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
1996 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
1991 |
1997 |
1992 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
1998 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
1993 |
1999 |
1994 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
2000 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
1995
2001
1996
2002
1997 Upper/lower filters:
2003 Upper/lower filters:
1998
2004
1999 $ hg log -r0 --template '{branch|upper}\n'
2005 $ hg log -r0 --template '{branch|upper}\n'
2000 DEFAULT
2006 DEFAULT
2001 $ hg log -r0 --template '{author|lower}\n'
2007 $ hg log -r0 --template '{author|lower}\n'
2002 user name <user@hostname>
2008 user name <user@hostname>
2003 $ hg log -r0 --template '{date|upper}\n'
2009 $ hg log -r0 --template '{date|upper}\n'
2004 abort: template filter 'upper' is not compatible with keyword 'date'
2010 abort: template filter 'upper' is not compatible with keyword 'date'
2005 [255]
2011 [255]
2006
2012
2007 Add a commit that does all possible modifications at once
2013 Add a commit that does all possible modifications at once
2008
2014
2009 $ echo modify >> third
2015 $ echo modify >> third
2010 $ touch b
2016 $ touch b
2011 $ hg add b
2017 $ hg add b
2012 $ hg mv fourth fifth
2018 $ hg mv fourth fifth
2013 $ hg rm a
2019 $ hg rm a
2014 $ hg ci -m "Modify, add, remove, rename"
2020 $ hg ci -m "Modify, add, remove, rename"
2015
2021
2016 Check the status template
2022 Check the status template
2017
2023
2018 $ cat <<EOF >> $HGRCPATH
2024 $ cat <<EOF >> $HGRCPATH
2019 > [extensions]
2025 > [extensions]
2020 > color=
2026 > color=
2021 > EOF
2027 > EOF
2022
2028
2023 $ hg log -T status -r 10
2029 $ hg log -T status -r 10
2024 changeset: 10:0f9759ec227a
2030 changeset: 10:0f9759ec227a
2025 tag: tip
2031 tag: tip
2026 user: test
2032 user: test
2027 date: Thu Jan 01 00:00:00 1970 +0000
2033 date: Thu Jan 01 00:00:00 1970 +0000
2028 summary: Modify, add, remove, rename
2034 summary: Modify, add, remove, rename
2029 files:
2035 files:
2030 M third
2036 M third
2031 A b
2037 A b
2032 A fifth
2038 A fifth
2033 R a
2039 R a
2034 R fourth
2040 R fourth
2035
2041
2036 $ hg log -T status -C -r 10
2042 $ hg log -T status -C -r 10
2037 changeset: 10:0f9759ec227a
2043 changeset: 10:0f9759ec227a
2038 tag: tip
2044 tag: tip
2039 user: test
2045 user: test
2040 date: Thu Jan 01 00:00:00 1970 +0000
2046 date: Thu Jan 01 00:00:00 1970 +0000
2041 summary: Modify, add, remove, rename
2047 summary: Modify, add, remove, rename
2042 files:
2048 files:
2043 M third
2049 M third
2044 A b
2050 A b
2045 A fifth
2051 A fifth
2046 fourth
2052 fourth
2047 R a
2053 R a
2048 R fourth
2054 R fourth
2049
2055
2050 $ hg log -T status -C -r 10 -v
2056 $ hg log -T status -C -r 10 -v
2051 changeset: 10:0f9759ec227a
2057 changeset: 10:0f9759ec227a
2052 tag: tip
2058 tag: tip
2053 user: test
2059 user: test
2054 date: Thu Jan 01 00:00:00 1970 +0000
2060 date: Thu Jan 01 00:00:00 1970 +0000
2055 description:
2061 description:
2056 Modify, add, remove, rename
2062 Modify, add, remove, rename
2057
2063
2058 files:
2064 files:
2059 M third
2065 M third
2060 A b
2066 A b
2061 A fifth
2067 A fifth
2062 fourth
2068 fourth
2063 R a
2069 R a
2064 R fourth
2070 R fourth
2065
2071
2066 $ hg log -T status -C -r 10 --debug
2072 $ hg log -T status -C -r 10 --debug
2067 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2073 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2068 tag: tip
2074 tag: tip
2069 phase: secret
2075 phase: secret
2070 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2076 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2071 parent: -1:0000000000000000000000000000000000000000
2077 parent: -1:0000000000000000000000000000000000000000
2072 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2078 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2073 user: test
2079 user: test
2074 date: Thu Jan 01 00:00:00 1970 +0000
2080 date: Thu Jan 01 00:00:00 1970 +0000
2075 extra: branch=default
2081 extra: branch=default
2076 description:
2082 description:
2077 Modify, add, remove, rename
2083 Modify, add, remove, rename
2078
2084
2079 files:
2085 files:
2080 M third
2086 M third
2081 A b
2087 A b
2082 A fifth
2088 A fifth
2083 fourth
2089 fourth
2084 R a
2090 R a
2085 R fourth
2091 R fourth
2086
2092
2087 $ hg log -T status -C -r 10 --quiet
2093 $ hg log -T status -C -r 10 --quiet
2088 10:0f9759ec227a
2094 10:0f9759ec227a
2089 $ hg --color=debug log -T status -r 10
2095 $ hg --color=debug log -T status -r 10
2090 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2096 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2091 [log.tag|tag: tip]
2097 [log.tag|tag: tip]
2092 [log.user|user: test]
2098 [log.user|user: test]
2093 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2099 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2094 [log.summary|summary: Modify, add, remove, rename]
2100 [log.summary|summary: Modify, add, remove, rename]
2095 [ui.note log.files|files:]
2101 [ui.note log.files|files:]
2096 [status.modified|M third]
2102 [status.modified|M third]
2097 [status.added|A b]
2103 [status.added|A b]
2098 [status.added|A fifth]
2104 [status.added|A fifth]
2099 [status.removed|R a]
2105 [status.removed|R a]
2100 [status.removed|R fourth]
2106 [status.removed|R fourth]
2101
2107
2102 $ hg --color=debug log -T status -C -r 10
2108 $ hg --color=debug log -T status -C -r 10
2103 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2109 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2104 [log.tag|tag: tip]
2110 [log.tag|tag: tip]
2105 [log.user|user: test]
2111 [log.user|user: test]
2106 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2112 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2107 [log.summary|summary: Modify, add, remove, rename]
2113 [log.summary|summary: Modify, add, remove, rename]
2108 [ui.note log.files|files:]
2114 [ui.note log.files|files:]
2109 [status.modified|M third]
2115 [status.modified|M third]
2110 [status.added|A b]
2116 [status.added|A b]
2111 [status.added|A fifth]
2117 [status.added|A fifth]
2112 [status.copied| fourth]
2118 [status.copied| fourth]
2113 [status.removed|R a]
2119 [status.removed|R a]
2114 [status.removed|R fourth]
2120 [status.removed|R fourth]
2115
2121
2116 $ hg --color=debug log -T status -C -r 10 -v
2122 $ hg --color=debug log -T status -C -r 10 -v
2117 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2123 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2118 [log.tag|tag: tip]
2124 [log.tag|tag: tip]
2119 [log.user|user: test]
2125 [log.user|user: test]
2120 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2126 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2121 [ui.note log.description|description:]
2127 [ui.note log.description|description:]
2122 [ui.note log.description|Modify, add, remove, rename]
2128 [ui.note log.description|Modify, add, remove, rename]
2123
2129
2124 [ui.note log.files|files:]
2130 [ui.note log.files|files:]
2125 [status.modified|M third]
2131 [status.modified|M third]
2126 [status.added|A b]
2132 [status.added|A b]
2127 [status.added|A fifth]
2133 [status.added|A fifth]
2128 [status.copied| fourth]
2134 [status.copied| fourth]
2129 [status.removed|R a]
2135 [status.removed|R a]
2130 [status.removed|R fourth]
2136 [status.removed|R fourth]
2131
2137
2132 $ hg --color=debug log -T status -C -r 10 --debug
2138 $ hg --color=debug log -T status -C -r 10 --debug
2133 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2139 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2134 [log.tag|tag: tip]
2140 [log.tag|tag: tip]
2135 [log.phase|phase: secret]
2141 [log.phase|phase: secret]
2136 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2142 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2137 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2143 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2138 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2144 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2139 [log.user|user: test]
2145 [log.user|user: test]
2140 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2146 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2141 [ui.debug log.extra|extra: branch=default]
2147 [ui.debug log.extra|extra: branch=default]
2142 [ui.note log.description|description:]
2148 [ui.note log.description|description:]
2143 [ui.note log.description|Modify, add, remove, rename]
2149 [ui.note log.description|Modify, add, remove, rename]
2144
2150
2145 [ui.note log.files|files:]
2151 [ui.note log.files|files:]
2146 [status.modified|M third]
2152 [status.modified|M third]
2147 [status.added|A b]
2153 [status.added|A b]
2148 [status.added|A fifth]
2154 [status.added|A fifth]
2149 [status.copied| fourth]
2155 [status.copied| fourth]
2150 [status.removed|R a]
2156 [status.removed|R a]
2151 [status.removed|R fourth]
2157 [status.removed|R fourth]
2152
2158
2153 $ hg --color=debug log -T status -C -r 10 --quiet
2159 $ hg --color=debug log -T status -C -r 10 --quiet
2154 [log.node|10:0f9759ec227a]
2160 [log.node|10:0f9759ec227a]
2155
2161
2156 Check the bisect template
2162 Check the bisect template
2157
2163
2158 $ hg bisect -g 1
2164 $ hg bisect -g 1
2159 $ hg bisect -b 3 --noupdate
2165 $ hg bisect -b 3 --noupdate
2160 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2166 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2161 $ hg log -T bisect -r 0:4
2167 $ hg log -T bisect -r 0:4
2162 changeset: 0:1e4e1b8f71e0
2168 changeset: 0:1e4e1b8f71e0
2163 bisect: good (implicit)
2169 bisect: good (implicit)
2164 user: User Name <user@hostname>
2170 user: User Name <user@hostname>
2165 date: Mon Jan 12 13:46:40 1970 +0000
2171 date: Mon Jan 12 13:46:40 1970 +0000
2166 summary: line 1
2172 summary: line 1
2167
2173
2168 changeset: 1:b608e9d1a3f0
2174 changeset: 1:b608e9d1a3f0
2169 bisect: good
2175 bisect: good
2170 user: A. N. Other <other@place>
2176 user: A. N. Other <other@place>
2171 date: Tue Jan 13 17:33:20 1970 +0000
2177 date: Tue Jan 13 17:33:20 1970 +0000
2172 summary: other 1
2178 summary: other 1
2173
2179
2174 changeset: 2:97054abb4ab8
2180 changeset: 2:97054abb4ab8
2175 bisect: untested
2181 bisect: untested
2176 user: other@place
2182 user: other@place
2177 date: Wed Jan 14 21:20:00 1970 +0000
2183 date: Wed Jan 14 21:20:00 1970 +0000
2178 summary: no person
2184 summary: no person
2179
2185
2180 changeset: 3:10e46f2dcbf4
2186 changeset: 3:10e46f2dcbf4
2181 bisect: bad
2187 bisect: bad
2182 user: person
2188 user: person
2183 date: Fri Jan 16 01:06:40 1970 +0000
2189 date: Fri Jan 16 01:06:40 1970 +0000
2184 summary: no user, no domain
2190 summary: no user, no domain
2185
2191
2186 changeset: 4:bbe44766e73d
2192 changeset: 4:bbe44766e73d
2187 bisect: bad (implicit)
2193 bisect: bad (implicit)
2188 branch: foo
2194 branch: foo
2189 user: person
2195 user: person
2190 date: Sat Jan 17 04:53:20 1970 +0000
2196 date: Sat Jan 17 04:53:20 1970 +0000
2191 summary: new branch
2197 summary: new branch
2192
2198
2193 $ hg log --debug -T bisect -r 0:4
2199 $ hg log --debug -T bisect -r 0:4
2194 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2200 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2195 bisect: good (implicit)
2201 bisect: good (implicit)
2196 phase: public
2202 phase: public
2197 parent: -1:0000000000000000000000000000000000000000
2203 parent: -1:0000000000000000000000000000000000000000
2198 parent: -1:0000000000000000000000000000000000000000
2204 parent: -1:0000000000000000000000000000000000000000
2199 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2205 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2200 user: User Name <user@hostname>
2206 user: User Name <user@hostname>
2201 date: Mon Jan 12 13:46:40 1970 +0000
2207 date: Mon Jan 12 13:46:40 1970 +0000
2202 files+: a
2208 files+: a
2203 extra: branch=default
2209 extra: branch=default
2204 description:
2210 description:
2205 line 1
2211 line 1
2206 line 2
2212 line 2
2207
2213
2208
2214
2209 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2215 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2210 bisect: good
2216 bisect: good
2211 phase: public
2217 phase: public
2212 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2218 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2213 parent: -1:0000000000000000000000000000000000000000
2219 parent: -1:0000000000000000000000000000000000000000
2214 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2220 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2215 user: A. N. Other <other@place>
2221 user: A. N. Other <other@place>
2216 date: Tue Jan 13 17:33:20 1970 +0000
2222 date: Tue Jan 13 17:33:20 1970 +0000
2217 files+: b
2223 files+: b
2218 extra: branch=default
2224 extra: branch=default
2219 description:
2225 description:
2220 other 1
2226 other 1
2221 other 2
2227 other 2
2222
2228
2223 other 3
2229 other 3
2224
2230
2225
2231
2226 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2232 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2227 bisect: untested
2233 bisect: untested
2228 phase: public
2234 phase: public
2229 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2235 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2230 parent: -1:0000000000000000000000000000000000000000
2236 parent: -1:0000000000000000000000000000000000000000
2231 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2237 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2232 user: other@place
2238 user: other@place
2233 date: Wed Jan 14 21:20:00 1970 +0000
2239 date: Wed Jan 14 21:20:00 1970 +0000
2234 files+: c
2240 files+: c
2235 extra: branch=default
2241 extra: branch=default
2236 description:
2242 description:
2237 no person
2243 no person
2238
2244
2239
2245
2240 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2246 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2241 bisect: bad
2247 bisect: bad
2242 phase: public
2248 phase: public
2243 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2249 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2244 parent: -1:0000000000000000000000000000000000000000
2250 parent: -1:0000000000000000000000000000000000000000
2245 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2251 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2246 user: person
2252 user: person
2247 date: Fri Jan 16 01:06:40 1970 +0000
2253 date: Fri Jan 16 01:06:40 1970 +0000
2248 files: c
2254 files: c
2249 extra: branch=default
2255 extra: branch=default
2250 description:
2256 description:
2251 no user, no domain
2257 no user, no domain
2252
2258
2253
2259
2254 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2260 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2255 bisect: bad (implicit)
2261 bisect: bad (implicit)
2256 branch: foo
2262 branch: foo
2257 phase: draft
2263 phase: draft
2258 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2264 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2259 parent: -1:0000000000000000000000000000000000000000
2265 parent: -1:0000000000000000000000000000000000000000
2260 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2266 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2261 user: person
2267 user: person
2262 date: Sat Jan 17 04:53:20 1970 +0000
2268 date: Sat Jan 17 04:53:20 1970 +0000
2263 extra: branch=foo
2269 extra: branch=foo
2264 description:
2270 description:
2265 new branch
2271 new branch
2266
2272
2267
2273
2268 $ hg log -v -T bisect -r 0:4
2274 $ hg log -v -T bisect -r 0:4
2269 changeset: 0:1e4e1b8f71e0
2275 changeset: 0:1e4e1b8f71e0
2270 bisect: good (implicit)
2276 bisect: good (implicit)
2271 user: User Name <user@hostname>
2277 user: User Name <user@hostname>
2272 date: Mon Jan 12 13:46:40 1970 +0000
2278 date: Mon Jan 12 13:46:40 1970 +0000
2273 files: a
2279 files: a
2274 description:
2280 description:
2275 line 1
2281 line 1
2276 line 2
2282 line 2
2277
2283
2278
2284
2279 changeset: 1:b608e9d1a3f0
2285 changeset: 1:b608e9d1a3f0
2280 bisect: good
2286 bisect: good
2281 user: A. N. Other <other@place>
2287 user: A. N. Other <other@place>
2282 date: Tue Jan 13 17:33:20 1970 +0000
2288 date: Tue Jan 13 17:33:20 1970 +0000
2283 files: b
2289 files: b
2284 description:
2290 description:
2285 other 1
2291 other 1
2286 other 2
2292 other 2
2287
2293
2288 other 3
2294 other 3
2289
2295
2290
2296
2291 changeset: 2:97054abb4ab8
2297 changeset: 2:97054abb4ab8
2292 bisect: untested
2298 bisect: untested
2293 user: other@place
2299 user: other@place
2294 date: Wed Jan 14 21:20:00 1970 +0000
2300 date: Wed Jan 14 21:20:00 1970 +0000
2295 files: c
2301 files: c
2296 description:
2302 description:
2297 no person
2303 no person
2298
2304
2299
2305
2300 changeset: 3:10e46f2dcbf4
2306 changeset: 3:10e46f2dcbf4
2301 bisect: bad
2307 bisect: bad
2302 user: person
2308 user: person
2303 date: Fri Jan 16 01:06:40 1970 +0000
2309 date: Fri Jan 16 01:06:40 1970 +0000
2304 files: c
2310 files: c
2305 description:
2311 description:
2306 no user, no domain
2312 no user, no domain
2307
2313
2308
2314
2309 changeset: 4:bbe44766e73d
2315 changeset: 4:bbe44766e73d
2310 bisect: bad (implicit)
2316 bisect: bad (implicit)
2311 branch: foo
2317 branch: foo
2312 user: person
2318 user: person
2313 date: Sat Jan 17 04:53:20 1970 +0000
2319 date: Sat Jan 17 04:53:20 1970 +0000
2314 description:
2320 description:
2315 new branch
2321 new branch
2316
2322
2317
2323
2318 $ hg --color=debug log -T bisect -r 0:4
2324 $ hg --color=debug log -T bisect -r 0:4
2319 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2325 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2320 [log.bisect bisect.good|bisect: good (implicit)]
2326 [log.bisect bisect.good|bisect: good (implicit)]
2321 [log.user|user: User Name <user@hostname>]
2327 [log.user|user: User Name <user@hostname>]
2322 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2328 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2323 [log.summary|summary: line 1]
2329 [log.summary|summary: line 1]
2324
2330
2325 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2331 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2326 [log.bisect bisect.good|bisect: good]
2332 [log.bisect bisect.good|bisect: good]
2327 [log.user|user: A. N. Other <other@place>]
2333 [log.user|user: A. N. Other <other@place>]
2328 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2334 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2329 [log.summary|summary: other 1]
2335 [log.summary|summary: other 1]
2330
2336
2331 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2337 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2332 [log.bisect bisect.untested|bisect: untested]
2338 [log.bisect bisect.untested|bisect: untested]
2333 [log.user|user: other@place]
2339 [log.user|user: other@place]
2334 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2340 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2335 [log.summary|summary: no person]
2341 [log.summary|summary: no person]
2336
2342
2337 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2343 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2338 [log.bisect bisect.bad|bisect: bad]
2344 [log.bisect bisect.bad|bisect: bad]
2339 [log.user|user: person]
2345 [log.user|user: person]
2340 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2346 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2341 [log.summary|summary: no user, no domain]
2347 [log.summary|summary: no user, no domain]
2342
2348
2343 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2349 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2344 [log.bisect bisect.bad|bisect: bad (implicit)]
2350 [log.bisect bisect.bad|bisect: bad (implicit)]
2345 [log.branch|branch: foo]
2351 [log.branch|branch: foo]
2346 [log.user|user: person]
2352 [log.user|user: person]
2347 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2353 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2348 [log.summary|summary: new branch]
2354 [log.summary|summary: new branch]
2349
2355
2350 $ hg --color=debug log --debug -T bisect -r 0:4
2356 $ hg --color=debug log --debug -T bisect -r 0:4
2351 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2357 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2352 [log.bisect bisect.good|bisect: good (implicit)]
2358 [log.bisect bisect.good|bisect: good (implicit)]
2353 [log.phase|phase: public]
2359 [log.phase|phase: public]
2354 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2360 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2355 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2361 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2356 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2362 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2357 [log.user|user: User Name <user@hostname>]
2363 [log.user|user: User Name <user@hostname>]
2358 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2364 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2359 [ui.debug log.files|files+: a]
2365 [ui.debug log.files|files+: a]
2360 [ui.debug log.extra|extra: branch=default]
2366 [ui.debug log.extra|extra: branch=default]
2361 [ui.note log.description|description:]
2367 [ui.note log.description|description:]
2362 [ui.note log.description|line 1
2368 [ui.note log.description|line 1
2363 line 2]
2369 line 2]
2364
2370
2365
2371
2366 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2372 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2367 [log.bisect bisect.good|bisect: good]
2373 [log.bisect bisect.good|bisect: good]
2368 [log.phase|phase: public]
2374 [log.phase|phase: public]
2369 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2375 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2370 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2376 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2371 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2377 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2372 [log.user|user: A. N. Other <other@place>]
2378 [log.user|user: A. N. Other <other@place>]
2373 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2379 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2374 [ui.debug log.files|files+: b]
2380 [ui.debug log.files|files+: b]
2375 [ui.debug log.extra|extra: branch=default]
2381 [ui.debug log.extra|extra: branch=default]
2376 [ui.note log.description|description:]
2382 [ui.note log.description|description:]
2377 [ui.note log.description|other 1
2383 [ui.note log.description|other 1
2378 other 2
2384 other 2
2379
2385
2380 other 3]
2386 other 3]
2381
2387
2382
2388
2383 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2389 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2384 [log.bisect bisect.untested|bisect: untested]
2390 [log.bisect bisect.untested|bisect: untested]
2385 [log.phase|phase: public]
2391 [log.phase|phase: public]
2386 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2392 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2387 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2393 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2388 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2394 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2389 [log.user|user: other@place]
2395 [log.user|user: other@place]
2390 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2396 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2391 [ui.debug log.files|files+: c]
2397 [ui.debug log.files|files+: c]
2392 [ui.debug log.extra|extra: branch=default]
2398 [ui.debug log.extra|extra: branch=default]
2393 [ui.note log.description|description:]
2399 [ui.note log.description|description:]
2394 [ui.note log.description|no person]
2400 [ui.note log.description|no person]
2395
2401
2396
2402
2397 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2403 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2398 [log.bisect bisect.bad|bisect: bad]
2404 [log.bisect bisect.bad|bisect: bad]
2399 [log.phase|phase: public]
2405 [log.phase|phase: public]
2400 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2406 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2401 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2407 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2402 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2408 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2403 [log.user|user: person]
2409 [log.user|user: person]
2404 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2410 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2405 [ui.debug log.files|files: c]
2411 [ui.debug log.files|files: c]
2406 [ui.debug log.extra|extra: branch=default]
2412 [ui.debug log.extra|extra: branch=default]
2407 [ui.note log.description|description:]
2413 [ui.note log.description|description:]
2408 [ui.note log.description|no user, no domain]
2414 [ui.note log.description|no user, no domain]
2409
2415
2410
2416
2411 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2417 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2412 [log.bisect bisect.bad|bisect: bad (implicit)]
2418 [log.bisect bisect.bad|bisect: bad (implicit)]
2413 [log.branch|branch: foo]
2419 [log.branch|branch: foo]
2414 [log.phase|phase: draft]
2420 [log.phase|phase: draft]
2415 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2421 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2416 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2422 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2417 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2423 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2418 [log.user|user: person]
2424 [log.user|user: person]
2419 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2425 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2420 [ui.debug log.extra|extra: branch=foo]
2426 [ui.debug log.extra|extra: branch=foo]
2421 [ui.note log.description|description:]
2427 [ui.note log.description|description:]
2422 [ui.note log.description|new branch]
2428 [ui.note log.description|new branch]
2423
2429
2424
2430
2425 $ hg --color=debug log -v -T bisect -r 0:4
2431 $ hg --color=debug log -v -T bisect -r 0:4
2426 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2432 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2427 [log.bisect bisect.good|bisect: good (implicit)]
2433 [log.bisect bisect.good|bisect: good (implicit)]
2428 [log.user|user: User Name <user@hostname>]
2434 [log.user|user: User Name <user@hostname>]
2429 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2435 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2430 [ui.note log.files|files: a]
2436 [ui.note log.files|files: a]
2431 [ui.note log.description|description:]
2437 [ui.note log.description|description:]
2432 [ui.note log.description|line 1
2438 [ui.note log.description|line 1
2433 line 2]
2439 line 2]
2434
2440
2435
2441
2436 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2442 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2437 [log.bisect bisect.good|bisect: good]
2443 [log.bisect bisect.good|bisect: good]
2438 [log.user|user: A. N. Other <other@place>]
2444 [log.user|user: A. N. Other <other@place>]
2439 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2445 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2440 [ui.note log.files|files: b]
2446 [ui.note log.files|files: b]
2441 [ui.note log.description|description:]
2447 [ui.note log.description|description:]
2442 [ui.note log.description|other 1
2448 [ui.note log.description|other 1
2443 other 2
2449 other 2
2444
2450
2445 other 3]
2451 other 3]
2446
2452
2447
2453
2448 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2454 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2449 [log.bisect bisect.untested|bisect: untested]
2455 [log.bisect bisect.untested|bisect: untested]
2450 [log.user|user: other@place]
2456 [log.user|user: other@place]
2451 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2457 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2452 [ui.note log.files|files: c]
2458 [ui.note log.files|files: c]
2453 [ui.note log.description|description:]
2459 [ui.note log.description|description:]
2454 [ui.note log.description|no person]
2460 [ui.note log.description|no person]
2455
2461
2456
2462
2457 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2463 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2458 [log.bisect bisect.bad|bisect: bad]
2464 [log.bisect bisect.bad|bisect: bad]
2459 [log.user|user: person]
2465 [log.user|user: person]
2460 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2466 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2461 [ui.note log.files|files: c]
2467 [ui.note log.files|files: c]
2462 [ui.note log.description|description:]
2468 [ui.note log.description|description:]
2463 [ui.note log.description|no user, no domain]
2469 [ui.note log.description|no user, no domain]
2464
2470
2465
2471
2466 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2472 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2467 [log.bisect bisect.bad|bisect: bad (implicit)]
2473 [log.bisect bisect.bad|bisect: bad (implicit)]
2468 [log.branch|branch: foo]
2474 [log.branch|branch: foo]
2469 [log.user|user: person]
2475 [log.user|user: person]
2470 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2476 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2471 [ui.note log.description|description:]
2477 [ui.note log.description|description:]
2472 [ui.note log.description|new branch]
2478 [ui.note log.description|new branch]
2473
2479
2474
2480
2475 $ hg bisect --reset
2481 $ hg bisect --reset
2476
2482
2477 Error on syntax:
2483 Error on syntax:
2478
2484
2479 $ echo 'x = "f' >> t
2485 $ echo 'x = "f' >> t
2480 $ hg log
2486 $ hg log
2481 abort: t:3: unmatched quotes
2487 abort: t:3: unmatched quotes
2482 [255]
2488 [255]
2483
2489
2484 Behind the scenes, this will throw TypeError
2490 Behind the scenes, this will throw TypeError
2485
2491
2486 $ hg log -l 3 --template '{date|obfuscate}\n'
2492 $ hg log -l 3 --template '{date|obfuscate}\n'
2487 abort: template filter 'obfuscate' is not compatible with keyword 'date'
2493 abort: template filter 'obfuscate' is not compatible with keyword 'date'
2488 [255]
2494 [255]
2489
2495
2490 Behind the scenes, this will throw a ValueError
2496 Behind the scenes, this will throw a ValueError
2491
2497
2492 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
2498 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
2493 abort: template filter 'shortdate' is not compatible with keyword 'desc'
2499 abort: template filter 'shortdate' is not compatible with keyword 'desc'
2494 [255]
2500 [255]
2495
2501
2496 Behind the scenes, this will throw AttributeError
2502 Behind the scenes, this will throw AttributeError
2497
2503
2498 $ hg log -l 3 --template 'line: {date|escape}\n'
2504 $ hg log -l 3 --template 'line: {date|escape}\n'
2499 abort: template filter 'escape' is not compatible with keyword 'date'
2505 abort: template filter 'escape' is not compatible with keyword 'date'
2500 [255]
2506 [255]
2501
2507
2502 Behind the scenes, this will throw ValueError
2508 Behind the scenes, this will throw ValueError
2503
2509
2504 $ hg tip --template '{author|email|date}\n'
2510 $ hg tip --template '{author|email|date}\n'
2505 abort: template filter 'datefilter' is not compatible with keyword 'author'
2511 abort: template filter 'datefilter' is not compatible with keyword 'author'
2506 [255]
2512 [255]
2507
2513
2508 Thrown an error if a template function doesn't exist
2514 Thrown an error if a template function doesn't exist
2509
2515
2510 $ hg tip --template '{foo()}\n'
2516 $ hg tip --template '{foo()}\n'
2511 hg: parse error: unknown function 'foo'
2517 hg: parse error: unknown function 'foo'
2512 [255]
2518 [255]
2513
2519
2514 Pass generator object created by template function to filter
2520 Pass generator object created by template function to filter
2515
2521
2516 $ hg log -l 1 --template '{if(author, author)|user}\n'
2522 $ hg log -l 1 --template '{if(author, author)|user}\n'
2517 test
2523 test
2518
2524
2519 Test diff function:
2525 Test diff function:
2520
2526
2521 $ hg diff -c 8
2527 $ hg diff -c 8
2522 diff -r 29114dbae42b -r 95c24699272e fourth
2528 diff -r 29114dbae42b -r 95c24699272e fourth
2523 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2529 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2524 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2530 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2525 @@ -0,0 +1,1 @@
2531 @@ -0,0 +1,1 @@
2526 +second
2532 +second
2527 diff -r 29114dbae42b -r 95c24699272e second
2533 diff -r 29114dbae42b -r 95c24699272e second
2528 --- a/second Mon Jan 12 13:46:40 1970 +0000
2534 --- a/second Mon Jan 12 13:46:40 1970 +0000
2529 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2535 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2530 @@ -1,1 +0,0 @@
2536 @@ -1,1 +0,0 @@
2531 -second
2537 -second
2532 diff -r 29114dbae42b -r 95c24699272e third
2538 diff -r 29114dbae42b -r 95c24699272e third
2533 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2539 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2534 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2540 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2535 @@ -0,0 +1,1 @@
2541 @@ -0,0 +1,1 @@
2536 +third
2542 +third
2537
2543
2538 $ hg log -r 8 -T "{diff()}"
2544 $ hg log -r 8 -T "{diff()}"
2539 diff -r 29114dbae42b -r 95c24699272e fourth
2545 diff -r 29114dbae42b -r 95c24699272e fourth
2540 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2546 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2541 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2547 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2542 @@ -0,0 +1,1 @@
2548 @@ -0,0 +1,1 @@
2543 +second
2549 +second
2544 diff -r 29114dbae42b -r 95c24699272e second
2550 diff -r 29114dbae42b -r 95c24699272e second
2545 --- a/second Mon Jan 12 13:46:40 1970 +0000
2551 --- a/second Mon Jan 12 13:46:40 1970 +0000
2546 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2552 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2547 @@ -1,1 +0,0 @@
2553 @@ -1,1 +0,0 @@
2548 -second
2554 -second
2549 diff -r 29114dbae42b -r 95c24699272e third
2555 diff -r 29114dbae42b -r 95c24699272e third
2550 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2556 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2551 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2557 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2552 @@ -0,0 +1,1 @@
2558 @@ -0,0 +1,1 @@
2553 +third
2559 +third
2554
2560
2555 $ hg log -r 8 -T "{diff('glob:f*')}"
2561 $ hg log -r 8 -T "{diff('glob:f*')}"
2556 diff -r 29114dbae42b -r 95c24699272e fourth
2562 diff -r 29114dbae42b -r 95c24699272e fourth
2557 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2563 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2558 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2564 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2559 @@ -0,0 +1,1 @@
2565 @@ -0,0 +1,1 @@
2560 +second
2566 +second
2561
2567
2562 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
2568 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
2563 diff -r 29114dbae42b -r 95c24699272e second
2569 diff -r 29114dbae42b -r 95c24699272e second
2564 --- a/second Mon Jan 12 13:46:40 1970 +0000
2570 --- a/second Mon Jan 12 13:46:40 1970 +0000
2565 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2571 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2566 @@ -1,1 +0,0 @@
2572 @@ -1,1 +0,0 @@
2567 -second
2573 -second
2568 diff -r 29114dbae42b -r 95c24699272e third
2574 diff -r 29114dbae42b -r 95c24699272e third
2569 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2575 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2570 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2576 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2571 @@ -0,0 +1,1 @@
2577 @@ -0,0 +1,1 @@
2572 +third
2578 +third
2573
2579
2574 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2580 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2575 diff -r 29114dbae42b -r 95c24699272e fourth
2581 diff -r 29114dbae42b -r 95c24699272e fourth
2576 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2582 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2577 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2583 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2578 @@ -0,0 +1,1 @@
2584 @@ -0,0 +1,1 @@
2579 +second
2585 +second
2580
2586
2581 $ cd ..
2587 $ cd ..
2582
2588
2583
2589
2584 latesttag:
2590 latesttag:
2585
2591
2586 $ hg init latesttag
2592 $ hg init latesttag
2587 $ cd latesttag
2593 $ cd latesttag
2588
2594
2589 $ echo a > file
2595 $ echo a > file
2590 $ hg ci -Am a -d '0 0'
2596 $ hg ci -Am a -d '0 0'
2591 adding file
2597 adding file
2592
2598
2593 $ echo b >> file
2599 $ echo b >> file
2594 $ hg ci -m b -d '1 0'
2600 $ hg ci -m b -d '1 0'
2595
2601
2596 $ echo c >> head1
2602 $ echo c >> head1
2597 $ hg ci -Am h1c -d '2 0'
2603 $ hg ci -Am h1c -d '2 0'
2598 adding head1
2604 adding head1
2599
2605
2600 $ hg update -q 1
2606 $ hg update -q 1
2601 $ echo d >> head2
2607 $ echo d >> head2
2602 $ hg ci -Am h2d -d '3 0'
2608 $ hg ci -Am h2d -d '3 0'
2603 adding head2
2609 adding head2
2604 created new head
2610 created new head
2605
2611
2606 $ echo e >> head2
2612 $ echo e >> head2
2607 $ hg ci -m h2e -d '4 0'
2613 $ hg ci -m h2e -d '4 0'
2608
2614
2609 $ hg merge -q
2615 $ hg merge -q
2610 $ hg ci -m merge -d '5 -3600'
2616 $ hg ci -m merge -d '5 -3600'
2611
2617
2612 No tag set:
2618 No tag set:
2613
2619
2614 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2620 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2615 5: null+5
2621 5: null+5
2616 4: null+4
2622 4: null+4
2617 3: null+3
2623 3: null+3
2618 2: null+3
2624 2: null+3
2619 1: null+2
2625 1: null+2
2620 0: null+1
2626 0: null+1
2621
2627
2622 One common tag: longest path wins:
2628 One common tag: longest path wins:
2623
2629
2624 $ hg tag -r 1 -m t1 -d '6 0' t1
2630 $ hg tag -r 1 -m t1 -d '6 0' t1
2625 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2631 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2626 6: t1+4
2632 6: t1+4
2627 5: t1+3
2633 5: t1+3
2628 4: t1+2
2634 4: t1+2
2629 3: t1+1
2635 3: t1+1
2630 2: t1+1
2636 2: t1+1
2631 1: t1+0
2637 1: t1+0
2632 0: null+1
2638 0: null+1
2633
2639
2634 One ancestor tag: more recent wins:
2640 One ancestor tag: more recent wins:
2635
2641
2636 $ hg tag -r 2 -m t2 -d '7 0' t2
2642 $ hg tag -r 2 -m t2 -d '7 0' t2
2637 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2643 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2638 7: t2+3
2644 7: t2+3
2639 6: t2+2
2645 6: t2+2
2640 5: t2+1
2646 5: t2+1
2641 4: t1+2
2647 4: t1+2
2642 3: t1+1
2648 3: t1+1
2643 2: t2+0
2649 2: t2+0
2644 1: t1+0
2650 1: t1+0
2645 0: null+1
2651 0: null+1
2646
2652
2647 Two branch tags: more recent wins:
2653 Two branch tags: more recent wins:
2648
2654
2649 $ hg tag -r 3 -m t3 -d '8 0' t3
2655 $ hg tag -r 3 -m t3 -d '8 0' t3
2650 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2656 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2651 8: t3+5
2657 8: t3+5
2652 7: t3+4
2658 7: t3+4
2653 6: t3+3
2659 6: t3+3
2654 5: t3+2
2660 5: t3+2
2655 4: t3+1
2661 4: t3+1
2656 3: t3+0
2662 3: t3+0
2657 2: t2+0
2663 2: t2+0
2658 1: t1+0
2664 1: t1+0
2659 0: null+1
2665 0: null+1
2660
2666
2661 Merged tag overrides:
2667 Merged tag overrides:
2662
2668
2663 $ hg tag -r 5 -m t5 -d '9 0' t5
2669 $ hg tag -r 5 -m t5 -d '9 0' t5
2664 $ hg tag -r 3 -m at3 -d '10 0' at3
2670 $ hg tag -r 3 -m at3 -d '10 0' at3
2665 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2671 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2666 10: t5+5
2672 10: t5+5
2667 9: t5+4
2673 9: t5+4
2668 8: t5+3
2674 8: t5+3
2669 7: t5+2
2675 7: t5+2
2670 6: t5+1
2676 6: t5+1
2671 5: t5+0
2677 5: t5+0
2672 4: at3:t3+1
2678 4: at3:t3+1
2673 3: at3:t3+0
2679 3: at3:t3+0
2674 2: t2+0
2680 2: t2+0
2675 1: t1+0
2681 1: t1+0
2676 0: null+1
2682 0: null+1
2677
2683
2678 $ cd ..
2684 $ cd ..
2679
2685
2680
2686
2681 Style path expansion: issue1948 - ui.style option doesn't work on OSX
2687 Style path expansion: issue1948 - ui.style option doesn't work on OSX
2682 if it is a relative path
2688 if it is a relative path
2683
2689
2684 $ mkdir -p home/styles
2690 $ mkdir -p home/styles
2685
2691
2686 $ cat > home/styles/teststyle <<EOF
2692 $ cat > home/styles/teststyle <<EOF
2687 > changeset = 'test {rev}:{node|short}\n'
2693 > changeset = 'test {rev}:{node|short}\n'
2688 > EOF
2694 > EOF
2689
2695
2690 $ HOME=`pwd`/home; export HOME
2696 $ HOME=`pwd`/home; export HOME
2691
2697
2692 $ cat > latesttag/.hg/hgrc <<EOF
2698 $ cat > latesttag/.hg/hgrc <<EOF
2693 > [ui]
2699 > [ui]
2694 > style = ~/styles/teststyle
2700 > style = ~/styles/teststyle
2695 > EOF
2701 > EOF
2696
2702
2697 $ hg -R latesttag tip
2703 $ hg -R latesttag tip
2698 test 10:9b4a630e5f5f
2704 test 10:9b4a630e5f5f
2699
2705
2700 Test recursive showlist template (issue1989):
2706 Test recursive showlist template (issue1989):
2701
2707
2702 $ cat > style1989 <<EOF
2708 $ cat > style1989 <<EOF
2703 > changeset = '{file_mods}{manifest}{extras}'
2709 > changeset = '{file_mods}{manifest}{extras}'
2704 > file_mod = 'M|{author|person}\n'
2710 > file_mod = 'M|{author|person}\n'
2705 > manifest = '{rev},{author}\n'
2711 > manifest = '{rev},{author}\n'
2706 > extra = '{key}: {author}\n'
2712 > extra = '{key}: {author}\n'
2707 > EOF
2713 > EOF
2708
2714
2709 $ hg -R latesttag log -r tip --style=style1989
2715 $ hg -R latesttag log -r tip --style=style1989
2710 M|test
2716 M|test
2711 10,test
2717 10,test
2712 branch: test
2718 branch: test
2713
2719
2714 Test new-style inline templating:
2720 Test new-style inline templating:
2715
2721
2716 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
2722 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
2717 modified files: .hgtags
2723 modified files: .hgtags
2718
2724
2719 Test the sub function of templating for expansion:
2725 Test the sub function of templating for expansion:
2720
2726
2721 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
2727 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
2722 xx
2728 xx
2723
2729
2724 Test the strip function with chars specified:
2730 Test the strip function with chars specified:
2725
2731
2726 $ hg log -R latesttag --template '{desc}\n'
2732 $ hg log -R latesttag --template '{desc}\n'
2727 at3
2733 at3
2728 t5
2734 t5
2729 t3
2735 t3
2730 t2
2736 t2
2731 t1
2737 t1
2732 merge
2738 merge
2733 h2e
2739 h2e
2734 h2d
2740 h2d
2735 h1c
2741 h1c
2736 b
2742 b
2737 a
2743 a
2738
2744
2739 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
2745 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
2740 at3
2746 at3
2741 5
2747 5
2742 3
2748 3
2743 2
2749 2
2744 1
2750 1
2745 merg
2751 merg
2746 h2
2752 h2
2747 h2d
2753 h2d
2748 h1c
2754 h1c
2749 b
2755 b
2750 a
2756 a
2751
2757
2752 Test date format:
2758 Test date format:
2753
2759
2754 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
2760 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
2755 date: 70 01 01 10 +0000
2761 date: 70 01 01 10 +0000
2756 date: 70 01 01 09 +0000
2762 date: 70 01 01 09 +0000
2757 date: 70 01 01 08 +0000
2763 date: 70 01 01 08 +0000
2758 date: 70 01 01 07 +0000
2764 date: 70 01 01 07 +0000
2759 date: 70 01 01 06 +0000
2765 date: 70 01 01 06 +0000
2760 date: 70 01 01 05 +0100
2766 date: 70 01 01 05 +0100
2761 date: 70 01 01 04 +0000
2767 date: 70 01 01 04 +0000
2762 date: 70 01 01 03 +0000
2768 date: 70 01 01 03 +0000
2763 date: 70 01 01 02 +0000
2769 date: 70 01 01 02 +0000
2764 date: 70 01 01 01 +0000
2770 date: 70 01 01 01 +0000
2765 date: 70 01 01 00 +0000
2771 date: 70 01 01 00 +0000
2766
2772
2767 Test invalid date:
2773 Test invalid date:
2768
2774
2769 $ hg log -R latesttag -T '{date(rev)}\n'
2775 $ hg log -R latesttag -T '{date(rev)}\n'
2770 hg: parse error: date expects a date information
2776 hg: parse error: date expects a date information
2771 [255]
2777 [255]
2772
2778
2773 Test integer literal:
2779 Test integer literal:
2774
2780
2775 $ hg log -Ra -r0 -T '{(0)}\n'
2781 $ hg log -Ra -r0 -T '{(0)}\n'
2776 0
2782 0
2777 $ hg log -Ra -r0 -T '{(123)}\n'
2783 $ hg log -Ra -r0 -T '{(123)}\n'
2778 123
2784 123
2779 $ hg log -Ra -r0 -T '{(-4)}\n'
2785 $ hg log -Ra -r0 -T '{(-4)}\n'
2780 -4
2786 -4
2781 $ hg log -Ra -r0 -T '{(-)}\n'
2787 $ hg log -Ra -r0 -T '{(-)}\n'
2782 hg: parse error at 2: integer literal without digits
2788 hg: parse error at 2: integer literal without digits
2783 [255]
2789 [255]
2784 $ hg log -Ra -r0 -T '{(-a)}\n'
2790 $ hg log -Ra -r0 -T '{(-a)}\n'
2785 hg: parse error at 2: integer literal without digits
2791 hg: parse error at 2: integer literal without digits
2786 [255]
2792 [255]
2787
2793
2788 top-level integer literal is interpreted as symbol (i.e. variable name):
2794 top-level integer literal is interpreted as symbol (i.e. variable name):
2789
2795
2790 $ hg log -Ra -r0 -T '{1}\n'
2796 $ hg log -Ra -r0 -T '{1}\n'
2791
2797
2792 $ hg log -Ra -r0 -T '{if("t", "{1}")}\n'
2798 $ hg log -Ra -r0 -T '{if("t", "{1}")}\n'
2793
2799
2794 $ hg log -Ra -r0 -T '{1|stringify}\n'
2800 $ hg log -Ra -r0 -T '{1|stringify}\n'
2795
2801
2796
2802
2797 unless explicit symbol is expected:
2803 unless explicit symbol is expected:
2798
2804
2799 $ hg log -Ra -r0 -T '{desc|1}\n'
2805 $ hg log -Ra -r0 -T '{desc|1}\n'
2800 hg: parse error: expected a symbol, got 'integer'
2806 hg: parse error: expected a symbol, got 'integer'
2801 [255]
2807 [255]
2802 $ hg log -Ra -r0 -T '{1()}\n'
2808 $ hg log -Ra -r0 -T '{1()}\n'
2803 hg: parse error: expected a symbol, got 'integer'
2809 hg: parse error: expected a symbol, got 'integer'
2804 [255]
2810 [255]
2805
2811
2806 Test string literal:
2812 Test string literal:
2807
2813
2808 $ hg log -Ra -r0 -T '{"string with no template fragment"}\n'
2814 $ hg log -Ra -r0 -T '{"string with no template fragment"}\n'
2809 string with no template fragment
2815 string with no template fragment
2810 $ hg log -Ra -r0 -T '{"template: {rev}"}\n'
2816 $ hg log -Ra -r0 -T '{"template: {rev}"}\n'
2811 template: 0
2817 template: 0
2812 $ hg log -Ra -r0 -T '{r"rawstring: {rev}"}\n'
2818 $ hg log -Ra -r0 -T '{r"rawstring: {rev}"}\n'
2813 rawstring: {rev}
2819 rawstring: {rev}
2814
2820
2815 because map operation requires template, raw string can't be used
2821 because map operation requires template, raw string can't be used
2816
2822
2817 $ hg log -Ra -r0 -T '{files % r"rawstring"}\n'
2823 $ hg log -Ra -r0 -T '{files % r"rawstring"}\n'
2818 hg: parse error: expected template specifier
2824 hg: parse error: expected template specifier
2819 [255]
2825 [255]
2820
2826
2821 Test string escaping:
2827 Test string escaping:
2822
2828
2823 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2829 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2824 >
2830 >
2825 <>\n<[>
2831 <>\n<[>
2826 <>\n<]>
2832 <>\n<]>
2827 <>\n<
2833 <>\n<
2828
2834
2829 $ hg log -R latesttag -r 0 \
2835 $ hg log -R latesttag -r 0 \
2830 > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2836 > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2831 >
2837 >
2832 <>\n<[>
2838 <>\n<[>
2833 <>\n<]>
2839 <>\n<]>
2834 <>\n<
2840 <>\n<
2835
2841
2836 $ hg log -R latesttag -r 0 -T esc \
2842 $ hg log -R latesttag -r 0 -T esc \
2837 > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2843 > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2838 >
2844 >
2839 <>\n<[>
2845 <>\n<[>
2840 <>\n<]>
2846 <>\n<]>
2841 <>\n<
2847 <>\n<
2842
2848
2843 $ cat <<'EOF' > esctmpl
2849 $ cat <<'EOF' > esctmpl
2844 > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2850 > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2845 > EOF
2851 > EOF
2846 $ hg log -R latesttag -r 0 --style ./esctmpl
2852 $ hg log -R latesttag -r 0 --style ./esctmpl
2847 >
2853 >
2848 <>\n<[>
2854 <>\n<[>
2849 <>\n<]>
2855 <>\n<]>
2850 <>\n<
2856 <>\n<
2851
2857
2852 Test string escaping of quotes:
2858 Test string escaping of quotes:
2853
2859
2854 $ hg log -Ra -r0 -T '{"\""}\n'
2860 $ hg log -Ra -r0 -T '{"\""}\n'
2855 "
2861 "
2856 $ hg log -Ra -r0 -T '{"\\\""}\n'
2862 $ hg log -Ra -r0 -T '{"\\\""}\n'
2857 \"
2863 \"
2858 $ hg log -Ra -r0 -T '{r"\""}\n'
2864 $ hg log -Ra -r0 -T '{r"\""}\n'
2859 \"
2865 \"
2860 $ hg log -Ra -r0 -T '{r"\\\""}\n'
2866 $ hg log -Ra -r0 -T '{r"\\\""}\n'
2861 \\\"
2867 \\\"
2862
2868
2863
2869
2864 $ hg log -Ra -r0 -T '{"\""}\n'
2870 $ hg log -Ra -r0 -T '{"\""}\n'
2865 "
2871 "
2866 $ hg log -Ra -r0 -T '{"\\\""}\n'
2872 $ hg log -Ra -r0 -T '{"\\\""}\n'
2867 \"
2873 \"
2868 $ hg log -Ra -r0 -T '{r"\""}\n'
2874 $ hg log -Ra -r0 -T '{r"\""}\n'
2869 \"
2875 \"
2870 $ hg log -Ra -r0 -T '{r"\\\""}\n'
2876 $ hg log -Ra -r0 -T '{r"\\\""}\n'
2871 \\\"
2877 \\\"
2872
2878
2873 Test exception in quoted template. single backslash before quotation mark is
2879 Test exception in quoted template. single backslash before quotation mark is
2874 stripped before parsing:
2880 stripped before parsing:
2875
2881
2876 $ cat <<'EOF' > escquotetmpl
2882 $ cat <<'EOF' > escquotetmpl
2877 > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n"
2883 > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n"
2878 > EOF
2884 > EOF
2879 $ cd latesttag
2885 $ cd latesttag
2880 $ hg log -r 2 --style ../escquotetmpl
2886 $ hg log -r 2 --style ../escquotetmpl
2881 " \" \" \\" head1
2887 " \" \" \\" head1
2882
2888
2883 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"'
2889 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"'
2884 valid
2890 valid
2885 $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'"
2891 $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'"
2886 valid
2892 valid
2887
2893
2888 Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested
2894 Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested
2889 _evalifliteral() templates (issue4733):
2895 _evalifliteral() templates (issue4733):
2890
2896
2891 $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n'
2897 $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n'
2892 "2
2898 "2
2893 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n'
2899 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n'
2894 "2
2900 "2
2895 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n'
2901 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n'
2896 "2
2902 "2
2897
2903
2898 $ hg log -r 2 -T '{if(rev, "\\\"")}\n'
2904 $ hg log -r 2 -T '{if(rev, "\\\"")}\n'
2899 \"
2905 \"
2900 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n'
2906 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n'
2901 \"
2907 \"
2902 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
2908 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
2903 \"
2909 \"
2904
2910
2905 $ hg log -r 2 -T '{if(rev, r"\\\"")}\n'
2911 $ hg log -r 2 -T '{if(rev, r"\\\"")}\n'
2906 \\\"
2912 \\\"
2907 $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n'
2913 $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n'
2908 \\\"
2914 \\\"
2909 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
2915 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
2910 \\\"
2916 \\\"
2911
2917
2912 escaped single quotes and errors:
2918 escaped single quotes and errors:
2913
2919
2914 $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n'
2920 $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n'
2915 foo
2921 foo
2916 $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n'
2922 $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n'
2917 foo
2923 foo
2918 $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n'
2924 $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n'
2919 hg: parse error at 11: unterminated string
2925 hg: parse error at 11: unterminated string
2920 [255]
2926 [255]
2921 $ hg log -r 2 -T '{if(rev, \"\\"")}\n'
2927 $ hg log -r 2 -T '{if(rev, \"\\"")}\n'
2922 hg: parse error at 11: syntax error
2928 hg: parse error at 11: syntax error
2923 [255]
2929 [255]
2924 $ hg log -r 2 -T '{if(rev, r\"\\"")}\n'
2930 $ hg log -r 2 -T '{if(rev, r\"\\"")}\n'
2925 hg: parse error at 12: syntax error
2931 hg: parse error at 12: syntax error
2926 [255]
2932 [255]
2927
2933
2928 $ cd ..
2934 $ cd ..
2929
2935
2930 Test leading backslashes:
2936 Test leading backslashes:
2931
2937
2932 $ cd latesttag
2938 $ cd latesttag
2933 $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n'
2939 $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n'
2934 {rev} {file}
2940 {rev} {file}
2935 $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n'
2941 $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n'
2936 \2 \head1
2942 \2 \head1
2937 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n'
2943 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n'
2938 \{rev} \{file}
2944 \{rev} \{file}
2939 $ cd ..
2945 $ cd ..
2940
2946
2941 Test leading backslashes in "if" expression (issue4714):
2947 Test leading backslashes in "if" expression (issue4714):
2942
2948
2943 $ cd latesttag
2949 $ cd latesttag
2944 $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n'
2950 $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n'
2945 {rev} \{rev}
2951 {rev} \{rev}
2946 $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n'
2952 $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n'
2947 \2 \\{rev}
2953 \2 \\{rev}
2948 $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n'
2954 $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n'
2949 \{rev} \\\{rev}
2955 \{rev} \\\{rev}
2950 $ cd ..
2956 $ cd ..
2951
2957
2952 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
2958 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
2953
2959
2954 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
2960 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
2955 \x6e
2961 \x6e
2956 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
2962 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
2957 \x5c\x786e
2963 \x5c\x786e
2958 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
2964 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
2959 \x6e
2965 \x6e
2960 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
2966 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
2961 \x5c\x786e
2967 \x5c\x786e
2962
2968
2963 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
2969 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
2964 \x6e
2970 \x6e
2965 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
2971 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
2966 \x5c\x786e
2972 \x5c\x786e
2967 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
2973 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
2968 \x6e
2974 \x6e
2969 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
2975 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
2970 \x5c\x786e
2976 \x5c\x786e
2971
2977
2972 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
2978 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
2973 fourth
2979 fourth
2974 second
2980 second
2975 third
2981 third
2976 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
2982 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
2977 fourth\nsecond\nthird
2983 fourth\nsecond\nthird
2978
2984
2979 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
2985 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
2980 <p>
2986 <p>
2981 1st
2987 1st
2982 </p>
2988 </p>
2983 <p>
2989 <p>
2984 2nd
2990 2nd
2985 </p>
2991 </p>
2986 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
2992 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
2987 <p>
2993 <p>
2988 1st\n\n2nd
2994 1st\n\n2nd
2989 </p>
2995 </p>
2990 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
2996 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
2991 1st
2997 1st
2992
2998
2993 2nd
2999 2nd
2994
3000
2995 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
3001 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
2996 o perso
3002 o perso
2997 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
3003 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
2998 no person
3004 no person
2999 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
3005 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
3000 o perso
3006 o perso
3001 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
3007 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
3002 no perso
3008 no perso
3003
3009
3004 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
3010 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
3005 -o perso-
3011 -o perso-
3006 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
3012 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
3007 no person
3013 no person
3008 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
3014 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
3009 \x2do perso\x2d
3015 \x2do perso\x2d
3010 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
3016 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
3011 -o perso-
3017 -o perso-
3012 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
3018 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
3013 \x2do perso\x6e
3019 \x2do perso\x6e
3014
3020
3015 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
3021 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
3016 fourth
3022 fourth
3017 second
3023 second
3018 third
3024 third
3019
3025
3020 Test string escaping in nested expression:
3026 Test string escaping in nested expression:
3021
3027
3022 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
3028 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
3023 fourth\x6esecond\x6ethird
3029 fourth\x6esecond\x6ethird
3024 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
3030 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
3025 fourth\x6esecond\x6ethird
3031 fourth\x6esecond\x6ethird
3026
3032
3027 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
3033 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
3028 fourth\x6esecond\x6ethird
3034 fourth\x6esecond\x6ethird
3029 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
3035 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
3030 fourth\x5c\x786esecond\x5c\x786ethird
3036 fourth\x5c\x786esecond\x5c\x786ethird
3031
3037
3032 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
3038 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
3033 3:\x6eo user, \x6eo domai\x6e
3039 3:\x6eo user, \x6eo domai\x6e
3034 4:\x5c\x786eew bra\x5c\x786ech
3040 4:\x5c\x786eew bra\x5c\x786ech
3035
3041
3036 Test recursive evaluation:
3042 Test recursive evaluation:
3037
3043
3038 $ hg init r
3044 $ hg init r
3039 $ cd r
3045 $ cd r
3040 $ echo a > a
3046 $ echo a > a
3041 $ hg ci -Am '{rev}'
3047 $ hg ci -Am '{rev}'
3042 adding a
3048 adding a
3043 $ hg log -r 0 --template '{if(rev, desc)}\n'
3049 $ hg log -r 0 --template '{if(rev, desc)}\n'
3044 {rev}
3050 {rev}
3045 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
3051 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
3046 test 0
3052 test 0
3047
3053
3048 $ hg branch -q 'text.{rev}'
3054 $ hg branch -q 'text.{rev}'
3049 $ echo aa >> aa
3055 $ echo aa >> aa
3050 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
3056 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
3051
3057
3052 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
3058 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
3053 {node|short}desc to
3059 {node|short}desc to
3054 text.{rev}be wrapped
3060 text.{rev}be wrapped
3055 text.{rev}desc to be
3061 text.{rev}desc to be
3056 text.{rev}wrapped (no-eol)
3062 text.{rev}wrapped (no-eol)
3057 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
3063 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
3058 bcc7ff960b8e:desc to
3064 bcc7ff960b8e:desc to
3059 text.1:be wrapped
3065 text.1:be wrapped
3060 text.1:desc to be
3066 text.1:desc to be
3061 text.1:wrapped (no-eol)
3067 text.1:wrapped (no-eol)
3062
3068
3063 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3069 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3064 {node|short} (no-eol)
3070 {node|short} (no-eol)
3065 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
3071 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
3066 bcc-ff---b-e (no-eol)
3072 bcc-ff---b-e (no-eol)
3067
3073
3068 $ cat >> .hg/hgrc <<EOF
3074 $ cat >> .hg/hgrc <<EOF
3069 > [extensions]
3075 > [extensions]
3070 > color=
3076 > color=
3071 > [color]
3077 > [color]
3072 > mode=ansi
3078 > mode=ansi
3073 > text.{rev} = red
3079 > text.{rev} = red
3074 > text.1 = green
3080 > text.1 = green
3075 > EOF
3081 > EOF
3076 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
3082 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
3077 \x1b[0;31mtext\x1b[0m (esc)
3083 \x1b[0;31mtext\x1b[0m (esc)
3078 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
3084 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
3079 \x1b[0;32mtext\x1b[0m (esc)
3085 \x1b[0;32mtext\x1b[0m (esc)
3080
3086
3081 Test branches inside if statement:
3087 Test branches inside if statement:
3082
3088
3083 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
3089 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
3084 no
3090 no
3085
3091
3086 Test get function:
3092 Test get function:
3087
3093
3088 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3094 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3089 default
3095 default
3090 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3096 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3091 hg: parse error: get() expects a dict as first argument
3097 hg: parse error: get() expects a dict as first argument
3092 [255]
3098 [255]
3093
3099
3094 Test shortest(node) function:
3100 Test shortest(node) function:
3095
3101
3096 $ echo b > b
3102 $ echo b > b
3097 $ hg ci -qAm b
3103 $ hg ci -qAm b
3098 $ hg log --template '{shortest(node)}\n'
3104 $ hg log --template '{shortest(node)}\n'
3099 e777
3105 e777
3100 bcc7
3106 bcc7
3101 f776
3107 f776
3102 $ hg log --template '{shortest(node, 10)}\n'
3108 $ hg log --template '{shortest(node, 10)}\n'
3103 e777603221
3109 e777603221
3104 bcc7ff960b
3110 bcc7ff960b
3105 f7769ec2ab
3111 f7769ec2ab
3106
3112
3107 Test pad function
3113 Test pad function
3108
3114
3109 $ hg log --template '{pad(rev, 20)} {author|user}\n'
3115 $ hg log --template '{pad(rev, 20)} {author|user}\n'
3110 2 test
3116 2 test
3111 1 {node|short}
3117 1 {node|short}
3112 0 test
3118 0 test
3113
3119
3114 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
3120 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
3115 2 test
3121 2 test
3116 1 {node|short}
3122 1 {node|short}
3117 0 test
3123 0 test
3118
3124
3119 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
3125 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
3120 2------------------- test
3126 2------------------- test
3121 1------------------- {node|short}
3127 1------------------- {node|short}
3122 0------------------- test
3128 0------------------- test
3123
3129
3124 Test template string in pad function
3130 Test template string in pad function
3125
3131
3126 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
3132 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
3127 {0} test
3133 {0} test
3128
3134
3129 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
3135 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
3130 \{rev} test
3136 \{rev} test
3131
3137
3132 Test ifcontains function
3138 Test ifcontains function
3133
3139
3134 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
3140 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
3135 2 is in the string
3141 2 is in the string
3136 1 is not
3142 1 is not
3137 0 is in the string
3143 0 is in the string
3138
3144
3139 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
3145 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
3140 2 did not add a
3146 2 did not add a
3141 1 did not add a
3147 1 did not add a
3142 0 added a
3148 0 added a
3143
3149
3144 Test revset function
3150 Test revset function
3145
3151
3146 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
3152 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
3147 2 current rev
3153 2 current rev
3148 1 not current rev
3154 1 not current rev
3149 0 not current rev
3155 0 not current rev
3150
3156
3151 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
3157 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
3152 2 match rev
3158 2 match rev
3153 1 match rev
3159 1 match rev
3154 0 not match rev
3160 0 not match rev
3155
3161
3156 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
3162 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
3157 2 Parents: 1
3163 2 Parents: 1
3158 1 Parents: 0
3164 1 Parents: 0
3159 0 Parents:
3165 0 Parents:
3160
3166
3161 $ cat >> .hg/hgrc <<EOF
3167 $ cat >> .hg/hgrc <<EOF
3162 > [revsetalias]
3168 > [revsetalias]
3163 > myparents(\$1) = parents(\$1)
3169 > myparents(\$1) = parents(\$1)
3164 > EOF
3170 > EOF
3165 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
3171 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
3166 2 Parents: 1
3172 2 Parents: 1
3167 1 Parents: 0
3173 1 Parents: 0
3168 0 Parents:
3174 0 Parents:
3169
3175
3170 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
3176 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
3171 Rev: 2
3177 Rev: 2
3172 Ancestor: 0
3178 Ancestor: 0
3173 Ancestor: 1
3179 Ancestor: 1
3174 Ancestor: 2
3180 Ancestor: 2
3175
3181
3176 Rev: 1
3182 Rev: 1
3177 Ancestor: 0
3183 Ancestor: 0
3178 Ancestor: 1
3184 Ancestor: 1
3179
3185
3180 Rev: 0
3186 Rev: 0
3181 Ancestor: 0
3187 Ancestor: 0
3182
3188
3183 $ hg log --template '{revset("TIP"|lower)}\n' -l1
3189 $ hg log --template '{revset("TIP"|lower)}\n' -l1
3184 2
3190 2
3185
3191
3186 Test active bookmark templating
3192 Test active bookmark templating
3187
3193
3188 $ hg book foo
3194 $ hg book foo
3189 $ hg book bar
3195 $ hg book bar
3190 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
3196 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
3191 2 bar* foo
3197 2 bar* foo
3192 1
3198 1
3193 0
3199 0
3194 $ hg log --template "{rev} {activebookmark}\n"
3200 $ hg log --template "{rev} {activebookmark}\n"
3195 2 bar
3201 2 bar
3196 1
3202 1
3197 0
3203 0
3198 $ hg bookmarks --inactive bar
3204 $ hg bookmarks --inactive bar
3199 $ hg log --template "{rev} {activebookmark}\n"
3205 $ hg log --template "{rev} {activebookmark}\n"
3200 2
3206 2
3201 1
3207 1
3202 0
3208 0
3203 $ hg book -r1 baz
3209 $ hg book -r1 baz
3204 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
3210 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
3205 2 bar foo
3211 2 bar foo
3206 1 baz
3212 1 baz
3207 0
3213 0
3208 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
3214 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
3209 2 t
3215 2 t
3210 1 f
3216 1 f
3211 0 f
3217 0 f
3212
3218
3213 Test stringify on sub expressions
3219 Test stringify on sub expressions
3214
3220
3215 $ cd ..
3221 $ cd ..
3216 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
3222 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
3217 fourth, second, third
3223 fourth, second, third
3218 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
3224 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
3219 abc
3225 abc
3220
3226
3221 Test splitlines
3227 Test splitlines
3222
3228
3223 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
3229 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
3224 @ foo Modify, add, remove, rename
3230 @ foo Modify, add, remove, rename
3225 |
3231 |
3226 o foo future
3232 o foo future
3227 |
3233 |
3228 o foo third
3234 o foo third
3229 |
3235 |
3230 o foo second
3236 o foo second
3231
3237
3232 o foo merge
3238 o foo merge
3233 |\
3239 |\
3234 | o foo new head
3240 | o foo new head
3235 | |
3241 | |
3236 o | foo new branch
3242 o | foo new branch
3237 |/
3243 |/
3238 o foo no user, no domain
3244 o foo no user, no domain
3239 |
3245 |
3240 o foo no person
3246 o foo no person
3241 |
3247 |
3242 o foo other 1
3248 o foo other 1
3243 | foo other 2
3249 | foo other 2
3244 | foo
3250 | foo
3245 | foo other 3
3251 | foo other 3
3246 o foo line 1
3252 o foo line 1
3247 foo line 2
3253 foo line 2
3248
3254
3249 Test startswith
3255 Test startswith
3250 $ hg log -Gv -R a --template "{startswith(desc)}"
3256 $ hg log -Gv -R a --template "{startswith(desc)}"
3251 hg: parse error: startswith expects two arguments
3257 hg: parse error: startswith expects two arguments
3252 [255]
3258 [255]
3253
3259
3254 $ hg log -Gv -R a --template "{startswith('line', desc)}"
3260 $ hg log -Gv -R a --template "{startswith('line', desc)}"
3255 @
3261 @
3256 |
3262 |
3257 o
3263 o
3258 |
3264 |
3259 o
3265 o
3260 |
3266 |
3261 o
3267 o
3262
3268
3263 o
3269 o
3264 |\
3270 |\
3265 | o
3271 | o
3266 | |
3272 | |
3267 o |
3273 o |
3268 |/
3274 |/
3269 o
3275 o
3270 |
3276 |
3271 o
3277 o
3272 |
3278 |
3273 o
3279 o
3274 |
3280 |
3275 o line 1
3281 o line 1
3276 line 2
3282 line 2
3277
3283
3278 Test bad template with better error message
3284 Test bad template with better error message
3279
3285
3280 $ hg log -Gv -R a --template '{desc|user()}'
3286 $ hg log -Gv -R a --template '{desc|user()}'
3281 hg: parse error: expected a symbol, got 'func'
3287 hg: parse error: expected a symbol, got 'func'
3282 [255]
3288 [255]
3283
3289
3284 Test word function (including index out of bounds graceful failure)
3290 Test word function (including index out of bounds graceful failure)
3285
3291
3286 $ hg log -Gv -R a --template "{word('1', desc)}"
3292 $ hg log -Gv -R a --template "{word('1', desc)}"
3287 @ add,
3293 @ add,
3288 |
3294 |
3289 o
3295 o
3290 |
3296 |
3291 o
3297 o
3292 |
3298 |
3293 o
3299 o
3294
3300
3295 o
3301 o
3296 |\
3302 |\
3297 | o head
3303 | o head
3298 | |
3304 | |
3299 o | branch
3305 o | branch
3300 |/
3306 |/
3301 o user,
3307 o user,
3302 |
3308 |
3303 o person
3309 o person
3304 |
3310 |
3305 o 1
3311 o 1
3306 |
3312 |
3307 o 1
3313 o 1
3308
3314
3309
3315
3310 Test word third parameter used as splitter
3316 Test word third parameter used as splitter
3311
3317
3312 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
3318 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
3313 @ M
3319 @ M
3314 |
3320 |
3315 o future
3321 o future
3316 |
3322 |
3317 o third
3323 o third
3318 |
3324 |
3319 o sec
3325 o sec
3320
3326
3321 o merge
3327 o merge
3322 |\
3328 |\
3323 | o new head
3329 | o new head
3324 | |
3330 | |
3325 o | new branch
3331 o | new branch
3326 |/
3332 |/
3327 o n
3333 o n
3328 |
3334 |
3329 o n
3335 o n
3330 |
3336 |
3331 o
3337 o
3332 |
3338 |
3333 o line 1
3339 o line 1
3334 line 2
3340 line 2
3335
3341
3336 Test word error messages for not enough and too many arguments
3342 Test word error messages for not enough and too many arguments
3337
3343
3338 $ hg log -Gv -R a --template "{word('0')}"
3344 $ hg log -Gv -R a --template "{word('0')}"
3339 hg: parse error: word expects two or three arguments, got 1
3345 hg: parse error: word expects two or three arguments, got 1
3340 [255]
3346 [255]
3341
3347
3342 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
3348 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
3343 hg: parse error: word expects two or three arguments, got 7
3349 hg: parse error: word expects two or three arguments, got 7
3344 [255]
3350 [255]
3345
3351
3346 Test word for integer literal
3352 Test word for integer literal
3347
3353
3348 $ hg log -R a --template "{word(2, desc)}\n" -r0
3354 $ hg log -R a --template "{word(2, desc)}\n" -r0
3349 line
3355 line
3350
3356
3351 Test word for invalid numbers
3357 Test word for invalid numbers
3352
3358
3353 $ hg log -Gv -R a --template "{word('a', desc)}"
3359 $ hg log -Gv -R a --template "{word('a', desc)}"
3354 hg: parse error: word expects an integer index
3360 hg: parse error: word expects an integer index
3355 [255]
3361 [255]
3356
3362
3357 Test indent and not adding to empty lines
3363 Test indent and not adding to empty lines
3358
3364
3359 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
3365 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
3360 -----
3366 -----
3361 > line 1
3367 > line 1
3362 >> line 2
3368 >> line 2
3363 -----
3369 -----
3364 > other 1
3370 > other 1
3365 >> other 2
3371 >> other 2
3366
3372
3367 >> other 3
3373 >> other 3
3368
3374
3369 Test with non-strings like dates
3375 Test with non-strings like dates
3370
3376
3371 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
3377 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
3372 1200000.00
3378 1200000.00
3373 1300000.00
3379 1300000.00
General Comments 0
You need to be logged in to leave comments. Login now