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