##// END OF EJS Templates
templater: restore the original string format of {date}...
Yuya Nishihara -
r38318:88e7105b default
parent child Browse files
Show More
@@ -1,810 +1,812 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 __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 from .i18n import _
10 from .i18n import _
11 from .node import (
11 from .node import (
12 hex,
12 hex,
13 nullid,
13 nullid,
14 )
14 )
15
15
16 from . import (
16 from . import (
17 encoding,
17 encoding,
18 error,
18 error,
19 hbisect,
19 hbisect,
20 i18n,
20 i18n,
21 obsutil,
21 obsutil,
22 patch,
22 patch,
23 pycompat,
23 pycompat,
24 registrar,
24 registrar,
25 scmutil,
25 scmutil,
26 templateutil,
26 templateutil,
27 util,
27 util,
28 )
28 )
29 from .utils import (
29 from .utils import (
30 stringutil,
30 stringutil,
31 )
31 )
32
32
33 _hybrid = templateutil.hybrid
33 _hybrid = templateutil.hybrid
34 hybriddict = templateutil.hybriddict
34 hybriddict = templateutil.hybriddict
35 hybridlist = templateutil.hybridlist
35 hybridlist = templateutil.hybridlist
36 compatdict = templateutil.compatdict
36 compatdict = templateutil.compatdict
37 compatlist = templateutil.compatlist
37 compatlist = templateutil.compatlist
38 _showcompatlist = templateutil._showcompatlist
38 _showcompatlist = templateutil._showcompatlist
39
39
40 def getlatesttags(context, mapping, pattern=None):
40 def getlatesttags(context, mapping, pattern=None):
41 '''return date, distance and name for the latest tag of rev'''
41 '''return date, distance and name for the latest tag of rev'''
42 repo = context.resource(mapping, 'repo')
42 repo = context.resource(mapping, 'repo')
43 ctx = context.resource(mapping, 'ctx')
43 ctx = context.resource(mapping, 'ctx')
44 cache = context.resource(mapping, 'cache')
44 cache = context.resource(mapping, 'cache')
45
45
46 cachename = 'latesttags'
46 cachename = 'latesttags'
47 if pattern is not None:
47 if pattern is not None:
48 cachename += '-' + pattern
48 cachename += '-' + pattern
49 match = stringutil.stringmatcher(pattern)[2]
49 match = stringutil.stringmatcher(pattern)[2]
50 else:
50 else:
51 match = util.always
51 match = util.always
52
52
53 if cachename not in cache:
53 if cachename not in cache:
54 # Cache mapping from rev to a tuple with tag date, tag
54 # Cache mapping from rev to a tuple with tag date, tag
55 # distance and tag name
55 # distance and tag name
56 cache[cachename] = {-1: (0, 0, ['null'])}
56 cache[cachename] = {-1: (0, 0, ['null'])}
57 latesttags = cache[cachename]
57 latesttags = cache[cachename]
58
58
59 rev = ctx.rev()
59 rev = ctx.rev()
60 todo = [rev]
60 todo = [rev]
61 while todo:
61 while todo:
62 rev = todo.pop()
62 rev = todo.pop()
63 if rev in latesttags:
63 if rev in latesttags:
64 continue
64 continue
65 ctx = repo[rev]
65 ctx = repo[rev]
66 tags = [t for t in ctx.tags()
66 tags = [t for t in ctx.tags()
67 if (repo.tagtype(t) and repo.tagtype(t) != 'local'
67 if (repo.tagtype(t) and repo.tagtype(t) != 'local'
68 and match(t))]
68 and match(t))]
69 if tags:
69 if tags:
70 latesttags[rev] = ctx.date()[0], 0, [t for t in sorted(tags)]
70 latesttags[rev] = ctx.date()[0], 0, [t for t in sorted(tags)]
71 continue
71 continue
72 try:
72 try:
73 ptags = [latesttags[p.rev()] for p in ctx.parents()]
73 ptags = [latesttags[p.rev()] for p in ctx.parents()]
74 if len(ptags) > 1:
74 if len(ptags) > 1:
75 if ptags[0][2] == ptags[1][2]:
75 if ptags[0][2] == ptags[1][2]:
76 # The tuples are laid out so the right one can be found by
76 # The tuples are laid out so the right one can be found by
77 # comparison in this case.
77 # comparison in this case.
78 pdate, pdist, ptag = max(ptags)
78 pdate, pdist, ptag = max(ptags)
79 else:
79 else:
80 def key(x):
80 def key(x):
81 changessincetag = len(repo.revs('only(%d, %s)',
81 changessincetag = len(repo.revs('only(%d, %s)',
82 ctx.rev(), x[2][0]))
82 ctx.rev(), x[2][0]))
83 # Smallest number of changes since tag wins. Date is
83 # Smallest number of changes since tag wins. Date is
84 # used as tiebreaker.
84 # used as tiebreaker.
85 return [-changessincetag, x[0]]
85 return [-changessincetag, x[0]]
86 pdate, pdist, ptag = max(ptags, key=key)
86 pdate, pdist, ptag = max(ptags, key=key)
87 else:
87 else:
88 pdate, pdist, ptag = ptags[0]
88 pdate, pdist, ptag = ptags[0]
89 except KeyError:
89 except KeyError:
90 # Cache miss - recurse
90 # Cache miss - recurse
91 todo.append(rev)
91 todo.append(rev)
92 todo.extend(p.rev() for p in ctx.parents())
92 todo.extend(p.rev() for p in ctx.parents())
93 continue
93 continue
94 latesttags[rev] = pdate, pdist + 1, ptag
94 latesttags[rev] = pdate, pdist + 1, ptag
95 return latesttags[rev]
95 return latesttags[rev]
96
96
97 def getrenamedfn(repo, endrev=None):
97 def getrenamedfn(repo, endrev=None):
98 rcache = {}
98 rcache = {}
99 if endrev is None:
99 if endrev is None:
100 endrev = len(repo)
100 endrev = len(repo)
101
101
102 def getrenamed(fn, rev):
102 def getrenamed(fn, rev):
103 '''looks up all renames for a file (up to endrev) the first
103 '''looks up all renames for a file (up to endrev) the first
104 time the file is given. It indexes on the changerev and only
104 time the file is given. It indexes on the changerev and only
105 parses the manifest if linkrev != changerev.
105 parses the manifest if linkrev != changerev.
106 Returns rename info for fn at changerev rev.'''
106 Returns rename info for fn at changerev rev.'''
107 if fn not in rcache:
107 if fn not in rcache:
108 rcache[fn] = {}
108 rcache[fn] = {}
109 fl = repo.file(fn)
109 fl = repo.file(fn)
110 for i in fl:
110 for i in fl:
111 lr = fl.linkrev(i)
111 lr = fl.linkrev(i)
112 renamed = fl.renamed(fl.node(i))
112 renamed = fl.renamed(fl.node(i))
113 rcache[fn][lr] = renamed and renamed[0]
113 rcache[fn][lr] = renamed and renamed[0]
114 if lr >= endrev:
114 if lr >= endrev:
115 break
115 break
116 if rev in rcache[fn]:
116 if rev in rcache[fn]:
117 return rcache[fn][rev]
117 return rcache[fn][rev]
118
118
119 # If linkrev != rev (i.e. rev not found in rcache) fallback to
119 # If linkrev != rev (i.e. rev not found in rcache) fallback to
120 # filectx logic.
120 # filectx logic.
121 try:
121 try:
122 renamed = repo[rev][fn].renamed()
122 renamed = repo[rev][fn].renamed()
123 return renamed and renamed[0]
123 return renamed and renamed[0]
124 except error.LookupError:
124 except error.LookupError:
125 return None
125 return None
126
126
127 return getrenamed
127 return getrenamed
128
128
129 def getlogcolumns():
129 def getlogcolumns():
130 """Return a dict of log column labels"""
130 """Return a dict of log column labels"""
131 _ = pycompat.identity # temporarily disable gettext
131 _ = pycompat.identity # temporarily disable gettext
132 # i18n: column positioning for "hg log"
132 # i18n: column positioning for "hg log"
133 columns = _('bookmark: %s\n'
133 columns = _('bookmark: %s\n'
134 'branch: %s\n'
134 'branch: %s\n'
135 'changeset: %s\n'
135 'changeset: %s\n'
136 'copies: %s\n'
136 'copies: %s\n'
137 'date: %s\n'
137 'date: %s\n'
138 'extra: %s=%s\n'
138 'extra: %s=%s\n'
139 'files+: %s\n'
139 'files+: %s\n'
140 'files-: %s\n'
140 'files-: %s\n'
141 'files: %s\n'
141 'files: %s\n'
142 'instability: %s\n'
142 'instability: %s\n'
143 'manifest: %s\n'
143 'manifest: %s\n'
144 'obsolete: %s\n'
144 'obsolete: %s\n'
145 'parent: %s\n'
145 'parent: %s\n'
146 'phase: %s\n'
146 'phase: %s\n'
147 'summary: %s\n'
147 'summary: %s\n'
148 'tag: %s\n'
148 'tag: %s\n'
149 'user: %s\n')
149 'user: %s\n')
150 return dict(zip([s.split(':', 1)[0] for s in columns.splitlines()],
150 return dict(zip([s.split(':', 1)[0] for s in columns.splitlines()],
151 i18n._(columns).splitlines(True)))
151 i18n._(columns).splitlines(True)))
152
152
153 # default templates internally used for rendering of lists
153 # default templates internally used for rendering of lists
154 defaulttempl = {
154 defaulttempl = {
155 'parent': '{rev}:{node|formatnode} ',
155 'parent': '{rev}:{node|formatnode} ',
156 'manifest': '{rev}:{node|formatnode}',
156 'manifest': '{rev}:{node|formatnode}',
157 'file_copy': '{name} ({source})',
157 'file_copy': '{name} ({source})',
158 'envvar': '{key}={value}',
158 'envvar': '{key}={value}',
159 'extra': '{key}={value|stringescape}'
159 'extra': '{key}={value|stringescape}'
160 }
160 }
161 # filecopy is preserved for compatibility reasons
161 # filecopy is preserved for compatibility reasons
162 defaulttempl['filecopy'] = defaulttempl['file_copy']
162 defaulttempl['filecopy'] = defaulttempl['file_copy']
163
163
164 # keywords are callables (see registrar.templatekeyword for details)
164 # keywords are callables (see registrar.templatekeyword for details)
165 keywords = {}
165 keywords = {}
166 templatekeyword = registrar.templatekeyword(keywords)
166 templatekeyword = registrar.templatekeyword(keywords)
167
167
168 @templatekeyword('author', requires={'ctx'})
168 @templatekeyword('author', requires={'ctx'})
169 def showauthor(context, mapping):
169 def showauthor(context, mapping):
170 """String. The unmodified author of the changeset."""
170 """String. The unmodified author of the changeset."""
171 ctx = context.resource(mapping, 'ctx')
171 ctx = context.resource(mapping, 'ctx')
172 return ctx.user()
172 return ctx.user()
173
173
174 @templatekeyword('bisect', requires={'repo', 'ctx'})
174 @templatekeyword('bisect', requires={'repo', 'ctx'})
175 def showbisect(context, mapping):
175 def showbisect(context, mapping):
176 """String. The changeset bisection status."""
176 """String. The changeset bisection status."""
177 repo = context.resource(mapping, 'repo')
177 repo = context.resource(mapping, 'repo')
178 ctx = context.resource(mapping, 'ctx')
178 ctx = context.resource(mapping, 'ctx')
179 return hbisect.label(repo, ctx.node())
179 return hbisect.label(repo, ctx.node())
180
180
181 @templatekeyword('branch', requires={'ctx'})
181 @templatekeyword('branch', requires={'ctx'})
182 def showbranch(context, mapping):
182 def showbranch(context, mapping):
183 """String. The name of the branch on which the changeset was
183 """String. The name of the branch on which the changeset was
184 committed.
184 committed.
185 """
185 """
186 ctx = context.resource(mapping, 'ctx')
186 ctx = context.resource(mapping, 'ctx')
187 return ctx.branch()
187 return ctx.branch()
188
188
189 @templatekeyword('branches', requires={'ctx'})
189 @templatekeyword('branches', requires={'ctx'})
190 def showbranches(context, mapping):
190 def showbranches(context, mapping):
191 """List of strings. The name of the branch on which the
191 """List of strings. The name of the branch on which the
192 changeset was committed. Will be empty if the branch name was
192 changeset was committed. Will be empty if the branch name was
193 default. (DEPRECATED)
193 default. (DEPRECATED)
194 """
194 """
195 ctx = context.resource(mapping, 'ctx')
195 ctx = context.resource(mapping, 'ctx')
196 branch = ctx.branch()
196 branch = ctx.branch()
197 if branch != 'default':
197 if branch != 'default':
198 return compatlist(context, mapping, 'branch', [branch],
198 return compatlist(context, mapping, 'branch', [branch],
199 plural='branches')
199 plural='branches')
200 return compatlist(context, mapping, 'branch', [], plural='branches')
200 return compatlist(context, mapping, 'branch', [], plural='branches')
201
201
202 @templatekeyword('bookmarks', requires={'repo', 'ctx'})
202 @templatekeyword('bookmarks', requires={'repo', 'ctx'})
203 def showbookmarks(context, mapping):
203 def showbookmarks(context, mapping):
204 """List of strings. Any bookmarks associated with the
204 """List of strings. Any bookmarks associated with the
205 changeset. Also sets 'active', the name of the active bookmark.
205 changeset. Also sets 'active', the name of the active bookmark.
206 """
206 """
207 repo = context.resource(mapping, 'repo')
207 repo = context.resource(mapping, 'repo')
208 ctx = context.resource(mapping, 'ctx')
208 ctx = context.resource(mapping, 'ctx')
209 bookmarks = ctx.bookmarks()
209 bookmarks = ctx.bookmarks()
210 active = repo._activebookmark
210 active = repo._activebookmark
211 makemap = lambda v: {'bookmark': v, 'active': active, 'current': active}
211 makemap = lambda v: {'bookmark': v, 'active': active, 'current': active}
212 f = _showcompatlist(context, mapping, 'bookmark', bookmarks)
212 f = _showcompatlist(context, mapping, 'bookmark', bookmarks)
213 return _hybrid(f, bookmarks, makemap, pycompat.identity)
213 return _hybrid(f, bookmarks, makemap, pycompat.identity)
214
214
215 @templatekeyword('children', requires={'ctx'})
215 @templatekeyword('children', requires={'ctx'})
216 def showchildren(context, mapping):
216 def showchildren(context, mapping):
217 """List of strings. The children of the changeset."""
217 """List of strings. The children of the changeset."""
218 ctx = context.resource(mapping, 'ctx')
218 ctx = context.resource(mapping, 'ctx')
219 childrevs = ['%d:%s' % (cctx.rev(), cctx) for cctx in ctx.children()]
219 childrevs = ['%d:%s' % (cctx.rev(), cctx) for cctx in ctx.children()]
220 return compatlist(context, mapping, 'children', childrevs, element='child')
220 return compatlist(context, mapping, 'children', childrevs, element='child')
221
221
222 # Deprecated, but kept alive for help generation a purpose.
222 # Deprecated, but kept alive for help generation a purpose.
223 @templatekeyword('currentbookmark', requires={'repo', 'ctx'})
223 @templatekeyword('currentbookmark', requires={'repo', 'ctx'})
224 def showcurrentbookmark(context, mapping):
224 def showcurrentbookmark(context, mapping):
225 """String. The active bookmark, if it is associated with the changeset.
225 """String. The active bookmark, if it is associated with the changeset.
226 (DEPRECATED)"""
226 (DEPRECATED)"""
227 return showactivebookmark(context, mapping)
227 return showactivebookmark(context, mapping)
228
228
229 @templatekeyword('activebookmark', requires={'repo', 'ctx'})
229 @templatekeyword('activebookmark', requires={'repo', 'ctx'})
230 def showactivebookmark(context, mapping):
230 def showactivebookmark(context, mapping):
231 """String. The active bookmark, if it is associated with the changeset."""
231 """String. The active bookmark, if it is associated with the changeset."""
232 repo = context.resource(mapping, 'repo')
232 repo = context.resource(mapping, 'repo')
233 ctx = context.resource(mapping, 'ctx')
233 ctx = context.resource(mapping, 'ctx')
234 active = repo._activebookmark
234 active = repo._activebookmark
235 if active and active in ctx.bookmarks():
235 if active and active in ctx.bookmarks():
236 return active
236 return active
237 return ''
237 return ''
238
238
239 @templatekeyword('date', requires={'ctx'})
239 @templatekeyword('date', requires={'ctx'})
240 def showdate(context, mapping):
240 def showdate(context, mapping):
241 """Date information. The date when the changeset was committed."""
241 """Date information. The date when the changeset was committed."""
242 ctx = context.resource(mapping, 'ctx')
242 ctx = context.resource(mapping, 'ctx')
243 return templateutil.date(ctx.date())
243 # the default string format is '<float(unixtime)><tzoffset>' because
244 # python-hglib splits date at decimal separator.
245 return templateutil.date(ctx.date(), showfmt='%d.0%d')
244
246
245 @templatekeyword('desc', requires={'ctx'})
247 @templatekeyword('desc', requires={'ctx'})
246 def showdescription(context, mapping):
248 def showdescription(context, mapping):
247 """String. The text of the changeset description."""
249 """String. The text of the changeset description."""
248 ctx = context.resource(mapping, 'ctx')
250 ctx = context.resource(mapping, 'ctx')
249 s = ctx.description()
251 s = ctx.description()
250 if isinstance(s, encoding.localstr):
252 if isinstance(s, encoding.localstr):
251 # try hard to preserve utf-8 bytes
253 # try hard to preserve utf-8 bytes
252 return encoding.tolocal(encoding.fromlocal(s).strip())
254 return encoding.tolocal(encoding.fromlocal(s).strip())
253 elif isinstance(s, encoding.safelocalstr):
255 elif isinstance(s, encoding.safelocalstr):
254 return encoding.safelocalstr(s.strip())
256 return encoding.safelocalstr(s.strip())
255 else:
257 else:
256 return s.strip()
258 return s.strip()
257
259
258 @templatekeyword('diffstat', requires={'ctx'})
260 @templatekeyword('diffstat', requires={'ctx'})
259 def showdiffstat(context, mapping):
261 def showdiffstat(context, mapping):
260 """String. Statistics of changes with the following format:
262 """String. Statistics of changes with the following format:
261 "modified files: +added/-removed lines"
263 "modified files: +added/-removed lines"
262 """
264 """
263 ctx = context.resource(mapping, 'ctx')
265 ctx = context.resource(mapping, 'ctx')
264 stats = patch.diffstatdata(util.iterlines(ctx.diff(noprefix=False)))
266 stats = patch.diffstatdata(util.iterlines(ctx.diff(noprefix=False)))
265 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
267 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
266 return '%d: +%d/-%d' % (len(stats), adds, removes)
268 return '%d: +%d/-%d' % (len(stats), adds, removes)
267
269
268 @templatekeyword('envvars', requires={'ui'})
270 @templatekeyword('envvars', requires={'ui'})
269 def showenvvars(context, mapping):
271 def showenvvars(context, mapping):
270 """A dictionary of environment variables. (EXPERIMENTAL)"""
272 """A dictionary of environment variables. (EXPERIMENTAL)"""
271 ui = context.resource(mapping, 'ui')
273 ui = context.resource(mapping, 'ui')
272 env = ui.exportableenviron()
274 env = ui.exportableenviron()
273 env = util.sortdict((k, env[k]) for k in sorted(env))
275 env = util.sortdict((k, env[k]) for k in sorted(env))
274 return compatdict(context, mapping, 'envvar', env, plural='envvars')
276 return compatdict(context, mapping, 'envvar', env, plural='envvars')
275
277
276 @templatekeyword('extras', requires={'ctx'})
278 @templatekeyword('extras', requires={'ctx'})
277 def showextras(context, mapping):
279 def showextras(context, mapping):
278 """List of dicts with key, value entries of the 'extras'
280 """List of dicts with key, value entries of the 'extras'
279 field of this changeset."""
281 field of this changeset."""
280 ctx = context.resource(mapping, 'ctx')
282 ctx = context.resource(mapping, 'ctx')
281 extras = ctx.extra()
283 extras = ctx.extra()
282 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
284 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
283 makemap = lambda k: {'key': k, 'value': extras[k]}
285 makemap = lambda k: {'key': k, 'value': extras[k]}
284 c = [makemap(k) for k in extras]
286 c = [makemap(k) for k in extras]
285 f = _showcompatlist(context, mapping, 'extra', c, plural='extras')
287 f = _showcompatlist(context, mapping, 'extra', c, plural='extras')
286 return _hybrid(f, extras, makemap,
288 return _hybrid(f, extras, makemap,
287 lambda k: '%s=%s' % (k, stringutil.escapestr(extras[k])))
289 lambda k: '%s=%s' % (k, stringutil.escapestr(extras[k])))
288
290
289 def _showfilesbystat(context, mapping, name, index):
291 def _showfilesbystat(context, mapping, name, index):
290 repo = context.resource(mapping, 'repo')
292 repo = context.resource(mapping, 'repo')
291 ctx = context.resource(mapping, 'ctx')
293 ctx = context.resource(mapping, 'ctx')
292 revcache = context.resource(mapping, 'revcache')
294 revcache = context.resource(mapping, 'revcache')
293 if 'files' not in revcache:
295 if 'files' not in revcache:
294 revcache['files'] = repo.status(ctx.p1(), ctx)[:3]
296 revcache['files'] = repo.status(ctx.p1(), ctx)[:3]
295 files = revcache['files'][index]
297 files = revcache['files'][index]
296 return compatlist(context, mapping, name, files, element='file')
298 return compatlist(context, mapping, name, files, element='file')
297
299
298 @templatekeyword('file_adds', requires={'repo', 'ctx', 'revcache'})
300 @templatekeyword('file_adds', requires={'repo', 'ctx', 'revcache'})
299 def showfileadds(context, mapping):
301 def showfileadds(context, mapping):
300 """List of strings. Files added by this changeset."""
302 """List of strings. Files added by this changeset."""
301 return _showfilesbystat(context, mapping, 'file_add', 1)
303 return _showfilesbystat(context, mapping, 'file_add', 1)
302
304
303 @templatekeyword('file_copies',
305 @templatekeyword('file_copies',
304 requires={'repo', 'ctx', 'cache', 'revcache'})
306 requires={'repo', 'ctx', 'cache', 'revcache'})
305 def showfilecopies(context, mapping):
307 def showfilecopies(context, mapping):
306 """List of strings. Files copied in this changeset with
308 """List of strings. Files copied in this changeset with
307 their sources.
309 their sources.
308 """
310 """
309 repo = context.resource(mapping, 'repo')
311 repo = context.resource(mapping, 'repo')
310 ctx = context.resource(mapping, 'ctx')
312 ctx = context.resource(mapping, 'ctx')
311 cache = context.resource(mapping, 'cache')
313 cache = context.resource(mapping, 'cache')
312 copies = context.resource(mapping, 'revcache').get('copies')
314 copies = context.resource(mapping, 'revcache').get('copies')
313 if copies is None:
315 if copies is None:
314 if 'getrenamed' not in cache:
316 if 'getrenamed' not in cache:
315 cache['getrenamed'] = getrenamedfn(repo)
317 cache['getrenamed'] = getrenamedfn(repo)
316 copies = []
318 copies = []
317 getrenamed = cache['getrenamed']
319 getrenamed = cache['getrenamed']
318 for fn in ctx.files():
320 for fn in ctx.files():
319 rename = getrenamed(fn, ctx.rev())
321 rename = getrenamed(fn, ctx.rev())
320 if rename:
322 if rename:
321 copies.append((fn, rename))
323 copies.append((fn, rename))
322
324
323 copies = util.sortdict(copies)
325 copies = util.sortdict(copies)
324 return compatdict(context, mapping, 'file_copy', copies,
326 return compatdict(context, mapping, 'file_copy', copies,
325 key='name', value='source', fmt='%s (%s)',
327 key='name', value='source', fmt='%s (%s)',
326 plural='file_copies')
328 plural='file_copies')
327
329
328 # showfilecopiesswitch() displays file copies only if copy records are
330 # showfilecopiesswitch() displays file copies only if copy records are
329 # provided before calling the templater, usually with a --copies
331 # provided before calling the templater, usually with a --copies
330 # command line switch.
332 # command line switch.
331 @templatekeyword('file_copies_switch', requires={'revcache'})
333 @templatekeyword('file_copies_switch', requires={'revcache'})
332 def showfilecopiesswitch(context, mapping):
334 def showfilecopiesswitch(context, mapping):
333 """List of strings. Like "file_copies" but displayed
335 """List of strings. Like "file_copies" but displayed
334 only if the --copied switch is set.
336 only if the --copied switch is set.
335 """
337 """
336 copies = context.resource(mapping, 'revcache').get('copies') or []
338 copies = context.resource(mapping, 'revcache').get('copies') or []
337 copies = util.sortdict(copies)
339 copies = util.sortdict(copies)
338 return compatdict(context, mapping, 'file_copy', copies,
340 return compatdict(context, mapping, 'file_copy', copies,
339 key='name', value='source', fmt='%s (%s)',
341 key='name', value='source', fmt='%s (%s)',
340 plural='file_copies')
342 plural='file_copies')
341
343
342 @templatekeyword('file_dels', requires={'repo', 'ctx', 'revcache'})
344 @templatekeyword('file_dels', requires={'repo', 'ctx', 'revcache'})
343 def showfiledels(context, mapping):
345 def showfiledels(context, mapping):
344 """List of strings. Files removed by this changeset."""
346 """List of strings. Files removed by this changeset."""
345 return _showfilesbystat(context, mapping, 'file_del', 2)
347 return _showfilesbystat(context, mapping, 'file_del', 2)
346
348
347 @templatekeyword('file_mods', requires={'repo', 'ctx', 'revcache'})
349 @templatekeyword('file_mods', requires={'repo', 'ctx', 'revcache'})
348 def showfilemods(context, mapping):
350 def showfilemods(context, mapping):
349 """List of strings. Files modified by this changeset."""
351 """List of strings. Files modified by this changeset."""
350 return _showfilesbystat(context, mapping, 'file_mod', 0)
352 return _showfilesbystat(context, mapping, 'file_mod', 0)
351
353
352 @templatekeyword('files', requires={'ctx'})
354 @templatekeyword('files', requires={'ctx'})
353 def showfiles(context, mapping):
355 def showfiles(context, mapping):
354 """List of strings. All files modified, added, or removed by this
356 """List of strings. All files modified, added, or removed by this
355 changeset.
357 changeset.
356 """
358 """
357 ctx = context.resource(mapping, 'ctx')
359 ctx = context.resource(mapping, 'ctx')
358 return compatlist(context, mapping, 'file', ctx.files())
360 return compatlist(context, mapping, 'file', ctx.files())
359
361
360 @templatekeyword('graphnode', requires={'repo', 'ctx'})
362 @templatekeyword('graphnode', requires={'repo', 'ctx'})
361 def showgraphnode(context, mapping):
363 def showgraphnode(context, mapping):
362 """String. The character representing the changeset node in an ASCII
364 """String. The character representing the changeset node in an ASCII
363 revision graph."""
365 revision graph."""
364 repo = context.resource(mapping, 'repo')
366 repo = context.resource(mapping, 'repo')
365 ctx = context.resource(mapping, 'ctx')
367 ctx = context.resource(mapping, 'ctx')
366 return getgraphnode(repo, ctx)
368 return getgraphnode(repo, ctx)
367
369
368 def getgraphnode(repo, ctx):
370 def getgraphnode(repo, ctx):
369 return getgraphnodecurrent(repo, ctx) or getgraphnodesymbol(ctx)
371 return getgraphnodecurrent(repo, ctx) or getgraphnodesymbol(ctx)
370
372
371 def getgraphnodecurrent(repo, ctx):
373 def getgraphnodecurrent(repo, ctx):
372 wpnodes = repo.dirstate.parents()
374 wpnodes = repo.dirstate.parents()
373 if wpnodes[1] == nullid:
375 if wpnodes[1] == nullid:
374 wpnodes = wpnodes[:1]
376 wpnodes = wpnodes[:1]
375 if ctx.node() in wpnodes:
377 if ctx.node() in wpnodes:
376 return '@'
378 return '@'
377 else:
379 else:
378 return ''
380 return ''
379
381
380 def getgraphnodesymbol(ctx):
382 def getgraphnodesymbol(ctx):
381 if ctx.obsolete():
383 if ctx.obsolete():
382 return 'x'
384 return 'x'
383 elif ctx.isunstable():
385 elif ctx.isunstable():
384 return '*'
386 return '*'
385 elif ctx.closesbranch():
387 elif ctx.closesbranch():
386 return '_'
388 return '_'
387 else:
389 else:
388 return 'o'
390 return 'o'
389
391
390 @templatekeyword('graphwidth', requires=())
392 @templatekeyword('graphwidth', requires=())
391 def showgraphwidth(context, mapping):
393 def showgraphwidth(context, mapping):
392 """Integer. The width of the graph drawn by 'log --graph' or zero."""
394 """Integer. The width of the graph drawn by 'log --graph' or zero."""
393 # just hosts documentation; should be overridden by template mapping
395 # just hosts documentation; should be overridden by template mapping
394 return 0
396 return 0
395
397
396 @templatekeyword('index', requires=())
398 @templatekeyword('index', requires=())
397 def showindex(context, mapping):
399 def showindex(context, mapping):
398 """Integer. The current iteration of the loop. (0 indexed)"""
400 """Integer. The current iteration of the loop. (0 indexed)"""
399 # just hosts documentation; should be overridden by template mapping
401 # just hosts documentation; should be overridden by template mapping
400 raise error.Abort(_("can't use index in this context"))
402 raise error.Abort(_("can't use index in this context"))
401
403
402 @templatekeyword('latesttag', requires={'repo', 'ctx', 'cache'})
404 @templatekeyword('latesttag', requires={'repo', 'ctx', 'cache'})
403 def showlatesttag(context, mapping):
405 def showlatesttag(context, mapping):
404 """List of strings. The global tags on the most recent globally
406 """List of strings. The global tags on the most recent globally
405 tagged ancestor of this changeset. If no such tags exist, the list
407 tagged ancestor of this changeset. If no such tags exist, the list
406 consists of the single string "null".
408 consists of the single string "null".
407 """
409 """
408 return showlatesttags(context, mapping, None)
410 return showlatesttags(context, mapping, None)
409
411
410 def showlatesttags(context, mapping, pattern):
412 def showlatesttags(context, mapping, pattern):
411 """helper method for the latesttag keyword and function"""
413 """helper method for the latesttag keyword and function"""
412 latesttags = getlatesttags(context, mapping, pattern)
414 latesttags = getlatesttags(context, mapping, pattern)
413
415
414 # latesttag[0] is an implementation detail for sorting csets on different
416 # latesttag[0] is an implementation detail for sorting csets on different
415 # branches in a stable manner- it is the date the tagged cset was created,
417 # branches in a stable manner- it is the date the tagged cset was created,
416 # not the date the tag was created. Therefore it isn't made visible here.
418 # not the date the tag was created. Therefore it isn't made visible here.
417 makemap = lambda v: {
419 makemap = lambda v: {
418 'changes': _showchangessincetag,
420 'changes': _showchangessincetag,
419 'distance': latesttags[1],
421 'distance': latesttags[1],
420 'latesttag': v, # BC with {latesttag % '{latesttag}'}
422 'latesttag': v, # BC with {latesttag % '{latesttag}'}
421 'tag': v
423 'tag': v
422 }
424 }
423
425
424 tags = latesttags[2]
426 tags = latesttags[2]
425 f = _showcompatlist(context, mapping, 'latesttag', tags, separator=':')
427 f = _showcompatlist(context, mapping, 'latesttag', tags, separator=':')
426 return _hybrid(f, tags, makemap, pycompat.identity)
428 return _hybrid(f, tags, makemap, pycompat.identity)
427
429
428 @templatekeyword('latesttagdistance', requires={'repo', 'ctx', 'cache'})
430 @templatekeyword('latesttagdistance', requires={'repo', 'ctx', 'cache'})
429 def showlatesttagdistance(context, mapping):
431 def showlatesttagdistance(context, mapping):
430 """Integer. Longest path to the latest tag."""
432 """Integer. Longest path to the latest tag."""
431 return getlatesttags(context, mapping)[1]
433 return getlatesttags(context, mapping)[1]
432
434
433 @templatekeyword('changessincelatesttag', requires={'repo', 'ctx', 'cache'})
435 @templatekeyword('changessincelatesttag', requires={'repo', 'ctx', 'cache'})
434 def showchangessincelatesttag(context, mapping):
436 def showchangessincelatesttag(context, mapping):
435 """Integer. All ancestors not in the latest tag."""
437 """Integer. All ancestors not in the latest tag."""
436 tag = getlatesttags(context, mapping)[2][0]
438 tag = getlatesttags(context, mapping)[2][0]
437 mapping = context.overlaymap(mapping, {'tag': tag})
439 mapping = context.overlaymap(mapping, {'tag': tag})
438 return _showchangessincetag(context, mapping)
440 return _showchangessincetag(context, mapping)
439
441
440 def _showchangessincetag(context, mapping):
442 def _showchangessincetag(context, mapping):
441 repo = context.resource(mapping, 'repo')
443 repo = context.resource(mapping, 'repo')
442 ctx = context.resource(mapping, 'ctx')
444 ctx = context.resource(mapping, 'ctx')
443 offset = 0
445 offset = 0
444 revs = [ctx.rev()]
446 revs = [ctx.rev()]
445 tag = context.symbol(mapping, 'tag')
447 tag = context.symbol(mapping, 'tag')
446
448
447 # The only() revset doesn't currently support wdir()
449 # The only() revset doesn't currently support wdir()
448 if ctx.rev() is None:
450 if ctx.rev() is None:
449 offset = 1
451 offset = 1
450 revs = [p.rev() for p in ctx.parents()]
452 revs = [p.rev() for p in ctx.parents()]
451
453
452 return len(repo.revs('only(%ld, %s)', revs, tag)) + offset
454 return len(repo.revs('only(%ld, %s)', revs, tag)) + offset
453
455
454 # teach templater latesttags.changes is switched to (context, mapping) API
456 # teach templater latesttags.changes is switched to (context, mapping) API
455 _showchangessincetag._requires = {'repo', 'ctx'}
457 _showchangessincetag._requires = {'repo', 'ctx'}
456
458
457 @templatekeyword('manifest', requires={'repo', 'ctx'})
459 @templatekeyword('manifest', requires={'repo', 'ctx'})
458 def showmanifest(context, mapping):
460 def showmanifest(context, mapping):
459 repo = context.resource(mapping, 'repo')
461 repo = context.resource(mapping, 'repo')
460 ctx = context.resource(mapping, 'ctx')
462 ctx = context.resource(mapping, 'ctx')
461 mnode = ctx.manifestnode()
463 mnode = ctx.manifestnode()
462 if mnode is None:
464 if mnode is None:
463 # just avoid crash, we might want to use the 'ff...' hash in future
465 # just avoid crash, we might want to use the 'ff...' hash in future
464 return
466 return
465 mrev = repo.manifestlog._revlog.rev(mnode)
467 mrev = repo.manifestlog._revlog.rev(mnode)
466 mhex = hex(mnode)
468 mhex = hex(mnode)
467 mapping = context.overlaymap(mapping, {'rev': mrev, 'node': mhex})
469 mapping = context.overlaymap(mapping, {'rev': mrev, 'node': mhex})
468 f = context.process('manifest', mapping)
470 f = context.process('manifest', mapping)
469 # TODO: perhaps 'ctx' should be dropped from mapping because manifest
471 # TODO: perhaps 'ctx' should be dropped from mapping because manifest
470 # rev and node are completely different from changeset's.
472 # rev and node are completely different from changeset's.
471 return templateutil.hybriditem(f, None, f,
473 return templateutil.hybriditem(f, None, f,
472 lambda x: {'rev': mrev, 'node': mhex})
474 lambda x: {'rev': mrev, 'node': mhex})
473
475
474 @templatekeyword('obsfate', requires={'ui', 'repo', 'ctx'})
476 @templatekeyword('obsfate', requires={'ui', 'repo', 'ctx'})
475 def showobsfate(context, mapping):
477 def showobsfate(context, mapping):
476 # this function returns a list containing pre-formatted obsfate strings.
478 # this function returns a list containing pre-formatted obsfate strings.
477 #
479 #
478 # This function will be replaced by templates fragments when we will have
480 # This function will be replaced by templates fragments when we will have
479 # the verbosity templatekw available.
481 # the verbosity templatekw available.
480 succsandmarkers = showsuccsandmarkers(context, mapping)
482 succsandmarkers = showsuccsandmarkers(context, mapping)
481
483
482 ui = context.resource(mapping, 'ui')
484 ui = context.resource(mapping, 'ui')
483 repo = context.resource(mapping, 'repo')
485 repo = context.resource(mapping, 'repo')
484 values = []
486 values = []
485
487
486 for x in succsandmarkers.tovalue(context, mapping):
488 for x in succsandmarkers.tovalue(context, mapping):
487 v = obsutil.obsfateprinter(ui, repo, x['successors'], x['markers'],
489 v = obsutil.obsfateprinter(ui, repo, x['successors'], x['markers'],
488 scmutil.formatchangeid)
490 scmutil.formatchangeid)
489 values.append(v)
491 values.append(v)
490
492
491 return compatlist(context, mapping, "fate", values)
493 return compatlist(context, mapping, "fate", values)
492
494
493 def shownames(context, mapping, namespace):
495 def shownames(context, mapping, namespace):
494 """helper method to generate a template keyword for a namespace"""
496 """helper method to generate a template keyword for a namespace"""
495 repo = context.resource(mapping, 'repo')
497 repo = context.resource(mapping, 'repo')
496 ctx = context.resource(mapping, 'ctx')
498 ctx = context.resource(mapping, 'ctx')
497 ns = repo.names[namespace]
499 ns = repo.names[namespace]
498 names = ns.names(repo, ctx.node())
500 names = ns.names(repo, ctx.node())
499 return compatlist(context, mapping, ns.templatename, names,
501 return compatlist(context, mapping, ns.templatename, names,
500 plural=namespace)
502 plural=namespace)
501
503
502 @templatekeyword('namespaces', requires={'repo', 'ctx'})
504 @templatekeyword('namespaces', requires={'repo', 'ctx'})
503 def shownamespaces(context, mapping):
505 def shownamespaces(context, mapping):
504 """Dict of lists. Names attached to this changeset per
506 """Dict of lists. Names attached to this changeset per
505 namespace."""
507 namespace."""
506 repo = context.resource(mapping, 'repo')
508 repo = context.resource(mapping, 'repo')
507 ctx = context.resource(mapping, 'ctx')
509 ctx = context.resource(mapping, 'ctx')
508
510
509 namespaces = util.sortdict()
511 namespaces = util.sortdict()
510 def makensmapfn(ns):
512 def makensmapfn(ns):
511 # 'name' for iterating over namespaces, templatename for local reference
513 # 'name' for iterating over namespaces, templatename for local reference
512 return lambda v: {'name': v, ns.templatename: v}
514 return lambda v: {'name': v, ns.templatename: v}
513
515
514 for k, ns in repo.names.iteritems():
516 for k, ns in repo.names.iteritems():
515 names = ns.names(repo, ctx.node())
517 names = ns.names(repo, ctx.node())
516 f = _showcompatlist(context, mapping, 'name', names)
518 f = _showcompatlist(context, mapping, 'name', names)
517 namespaces[k] = _hybrid(f, names, makensmapfn(ns), pycompat.identity)
519 namespaces[k] = _hybrid(f, names, makensmapfn(ns), pycompat.identity)
518
520
519 f = _showcompatlist(context, mapping, 'namespace', list(namespaces))
521 f = _showcompatlist(context, mapping, 'namespace', list(namespaces))
520
522
521 def makemap(ns):
523 def makemap(ns):
522 return {
524 return {
523 'namespace': ns,
525 'namespace': ns,
524 'names': namespaces[ns],
526 'names': namespaces[ns],
525 'builtin': repo.names[ns].builtin,
527 'builtin': repo.names[ns].builtin,
526 'colorname': repo.names[ns].colorname,
528 'colorname': repo.names[ns].colorname,
527 }
529 }
528
530
529 return _hybrid(f, namespaces, makemap, pycompat.identity)
531 return _hybrid(f, namespaces, makemap, pycompat.identity)
530
532
531 @templatekeyword('node', requires={'ctx'})
533 @templatekeyword('node', requires={'ctx'})
532 def shownode(context, mapping):
534 def shownode(context, mapping):
533 """String. The changeset identification hash, as a 40 hexadecimal
535 """String. The changeset identification hash, as a 40 hexadecimal
534 digit string.
536 digit string.
535 """
537 """
536 ctx = context.resource(mapping, 'ctx')
538 ctx = context.resource(mapping, 'ctx')
537 return ctx.hex()
539 return ctx.hex()
538
540
539 @templatekeyword('obsolete', requires={'ctx'})
541 @templatekeyword('obsolete', requires={'ctx'})
540 def showobsolete(context, mapping):
542 def showobsolete(context, mapping):
541 """String. Whether the changeset is obsolete. (EXPERIMENTAL)"""
543 """String. Whether the changeset is obsolete. (EXPERIMENTAL)"""
542 ctx = context.resource(mapping, 'ctx')
544 ctx = context.resource(mapping, 'ctx')
543 if ctx.obsolete():
545 if ctx.obsolete():
544 return 'obsolete'
546 return 'obsolete'
545 return ''
547 return ''
546
548
547 @templatekeyword('peerurls', requires={'repo'})
549 @templatekeyword('peerurls', requires={'repo'})
548 def showpeerurls(context, mapping):
550 def showpeerurls(context, mapping):
549 """A dictionary of repository locations defined in the [paths] section
551 """A dictionary of repository locations defined in the [paths] section
550 of your configuration file."""
552 of your configuration file."""
551 repo = context.resource(mapping, 'repo')
553 repo = context.resource(mapping, 'repo')
552 # see commands.paths() for naming of dictionary keys
554 # see commands.paths() for naming of dictionary keys
553 paths = repo.ui.paths
555 paths = repo.ui.paths
554 urls = util.sortdict((k, p.rawloc) for k, p in sorted(paths.iteritems()))
556 urls = util.sortdict((k, p.rawloc) for k, p in sorted(paths.iteritems()))
555 def makemap(k):
557 def makemap(k):
556 p = paths[k]
558 p = paths[k]
557 d = {'name': k, 'url': p.rawloc}
559 d = {'name': k, 'url': p.rawloc}
558 d.update((o, v) for o, v in sorted(p.suboptions.iteritems()))
560 d.update((o, v) for o, v in sorted(p.suboptions.iteritems()))
559 return d
561 return d
560 return _hybrid(None, urls, makemap, lambda k: '%s=%s' % (k, urls[k]))
562 return _hybrid(None, urls, makemap, lambda k: '%s=%s' % (k, urls[k]))
561
563
562 @templatekeyword("predecessors", requires={'repo', 'ctx'})
564 @templatekeyword("predecessors", requires={'repo', 'ctx'})
563 def showpredecessors(context, mapping):
565 def showpredecessors(context, mapping):
564 """Returns the list if the closest visible successors. (EXPERIMENTAL)"""
566 """Returns the list if the closest visible successors. (EXPERIMENTAL)"""
565 repo = context.resource(mapping, 'repo')
567 repo = context.resource(mapping, 'repo')
566 ctx = context.resource(mapping, 'ctx')
568 ctx = context.resource(mapping, 'ctx')
567 predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node()))
569 predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node()))
568 predecessors = map(hex, predecessors)
570 predecessors = map(hex, predecessors)
569
571
570 return _hybrid(None, predecessors,
572 return _hybrid(None, predecessors,
571 lambda x: {'ctx': repo[x]},
573 lambda x: {'ctx': repo[x]},
572 lambda x: scmutil.formatchangeid(repo[x]))
574 lambda x: scmutil.formatchangeid(repo[x]))
573
575
574 @templatekeyword('reporoot', requires={'repo'})
576 @templatekeyword('reporoot', requires={'repo'})
575 def showreporoot(context, mapping):
577 def showreporoot(context, mapping):
576 """String. The root directory of the current repository."""
578 """String. The root directory of the current repository."""
577 repo = context.resource(mapping, 'repo')
579 repo = context.resource(mapping, 'repo')
578 return repo.root
580 return repo.root
579
581
580 @templatekeyword("successorssets", requires={'repo', 'ctx'})
582 @templatekeyword("successorssets", requires={'repo', 'ctx'})
581 def showsuccessorssets(context, mapping):
583 def showsuccessorssets(context, mapping):
582 """Returns a string of sets of successors for a changectx. Format used
584 """Returns a string of sets of successors for a changectx. Format used
583 is: [ctx1, ctx2], [ctx3] if ctx has been splitted into ctx1 and ctx2
585 is: [ctx1, ctx2], [ctx3] if ctx has been splitted into ctx1 and ctx2
584 while also diverged into ctx3. (EXPERIMENTAL)"""
586 while also diverged into ctx3. (EXPERIMENTAL)"""
585 repo = context.resource(mapping, 'repo')
587 repo = context.resource(mapping, 'repo')
586 ctx = context.resource(mapping, 'ctx')
588 ctx = context.resource(mapping, 'ctx')
587 if not ctx.obsolete():
589 if not ctx.obsolete():
588 return ''
590 return ''
589
591
590 ssets = obsutil.successorssets(repo, ctx.node(), closest=True)
592 ssets = obsutil.successorssets(repo, ctx.node(), closest=True)
591 ssets = [[hex(n) for n in ss] for ss in ssets]
593 ssets = [[hex(n) for n in ss] for ss in ssets]
592
594
593 data = []
595 data = []
594 for ss in ssets:
596 for ss in ssets:
595 h = _hybrid(None, ss, lambda x: {'ctx': repo[x]},
597 h = _hybrid(None, ss, lambda x: {'ctx': repo[x]},
596 lambda x: scmutil.formatchangeid(repo[x]))
598 lambda x: scmutil.formatchangeid(repo[x]))
597 data.append(h)
599 data.append(h)
598
600
599 # Format the successorssets
601 # Format the successorssets
600 def render(d):
602 def render(d):
601 return templateutil.stringify(context, mapping, d)
603 return templateutil.stringify(context, mapping, d)
602
604
603 def gen(data):
605 def gen(data):
604 yield "; ".join(render(d) for d in data)
606 yield "; ".join(render(d) for d in data)
605
607
606 return _hybrid(gen(data), data, lambda x: {'successorset': x},
608 return _hybrid(gen(data), data, lambda x: {'successorset': x},
607 pycompat.identity)
609 pycompat.identity)
608
610
609 @templatekeyword("succsandmarkers", requires={'repo', 'ctx'})
611 @templatekeyword("succsandmarkers", requires={'repo', 'ctx'})
610 def showsuccsandmarkers(context, mapping):
612 def showsuccsandmarkers(context, mapping):
611 """Returns a list of dict for each final successor of ctx. The dict
613 """Returns a list of dict for each final successor of ctx. The dict
612 contains successors node id in "successors" keys and the list of
614 contains successors node id in "successors" keys and the list of
613 obs-markers from ctx to the set of successors in "markers".
615 obs-markers from ctx to the set of successors in "markers".
614 (EXPERIMENTAL)
616 (EXPERIMENTAL)
615 """
617 """
616 repo = context.resource(mapping, 'repo')
618 repo = context.resource(mapping, 'repo')
617 ctx = context.resource(mapping, 'ctx')
619 ctx = context.resource(mapping, 'ctx')
618
620
619 values = obsutil.successorsandmarkers(repo, ctx)
621 values = obsutil.successorsandmarkers(repo, ctx)
620
622
621 if values is None:
623 if values is None:
622 values = []
624 values = []
623
625
624 # Format successors and markers to avoid exposing binary to templates
626 # Format successors and markers to avoid exposing binary to templates
625 data = []
627 data = []
626 for i in values:
628 for i in values:
627 # Format successors
629 # Format successors
628 successors = i['successors']
630 successors = i['successors']
629
631
630 successors = [hex(n) for n in successors]
632 successors = [hex(n) for n in successors]
631 successors = _hybrid(None, successors,
633 successors = _hybrid(None, successors,
632 lambda x: {'ctx': repo[x]},
634 lambda x: {'ctx': repo[x]},
633 lambda x: scmutil.formatchangeid(repo[x]))
635 lambda x: scmutil.formatchangeid(repo[x]))
634
636
635 # Format markers
637 # Format markers
636 finalmarkers = []
638 finalmarkers = []
637 for m in i['markers']:
639 for m in i['markers']:
638 hexprec = hex(m[0])
640 hexprec = hex(m[0])
639 hexsucs = tuple(hex(n) for n in m[1])
641 hexsucs = tuple(hex(n) for n in m[1])
640 hexparents = None
642 hexparents = None
641 if m[5] is not None:
643 if m[5] is not None:
642 hexparents = tuple(hex(n) for n in m[5])
644 hexparents = tuple(hex(n) for n in m[5])
643 newmarker = (hexprec, hexsucs) + m[2:5] + (hexparents,) + m[6:]
645 newmarker = (hexprec, hexsucs) + m[2:5] + (hexparents,) + m[6:]
644 finalmarkers.append(newmarker)
646 finalmarkers.append(newmarker)
645
647
646 data.append({'successors': successors, 'markers': finalmarkers})
648 data.append({'successors': successors, 'markers': finalmarkers})
647
649
648 return templateutil.mappinglist(data)
650 return templateutil.mappinglist(data)
649
651
650 @templatekeyword('p1rev', requires={'ctx'})
652 @templatekeyword('p1rev', requires={'ctx'})
651 def showp1rev(context, mapping):
653 def showp1rev(context, mapping):
652 """Integer. The repository-local revision number of the changeset's
654 """Integer. The repository-local revision number of the changeset's
653 first parent, or -1 if the changeset has no parents."""
655 first parent, or -1 if the changeset has no parents."""
654 ctx = context.resource(mapping, 'ctx')
656 ctx = context.resource(mapping, 'ctx')
655 return ctx.p1().rev()
657 return ctx.p1().rev()
656
658
657 @templatekeyword('p2rev', requires={'ctx'})
659 @templatekeyword('p2rev', requires={'ctx'})
658 def showp2rev(context, mapping):
660 def showp2rev(context, mapping):
659 """Integer. The repository-local revision number of the changeset's
661 """Integer. The repository-local revision number of the changeset's
660 second parent, or -1 if the changeset has no second parent."""
662 second parent, or -1 if the changeset has no second parent."""
661 ctx = context.resource(mapping, 'ctx')
663 ctx = context.resource(mapping, 'ctx')
662 return ctx.p2().rev()
664 return ctx.p2().rev()
663
665
664 @templatekeyword('p1node', requires={'ctx'})
666 @templatekeyword('p1node', requires={'ctx'})
665 def showp1node(context, mapping):
667 def showp1node(context, mapping):
666 """String. The identification hash of the changeset's first parent,
668 """String. The identification hash of the changeset's first parent,
667 as a 40 digit hexadecimal string. If the changeset has no parents, all
669 as a 40 digit hexadecimal string. If the changeset has no parents, all
668 digits are 0."""
670 digits are 0."""
669 ctx = context.resource(mapping, 'ctx')
671 ctx = context.resource(mapping, 'ctx')
670 return ctx.p1().hex()
672 return ctx.p1().hex()
671
673
672 @templatekeyword('p2node', requires={'ctx'})
674 @templatekeyword('p2node', requires={'ctx'})
673 def showp2node(context, mapping):
675 def showp2node(context, mapping):
674 """String. The identification hash of the changeset's second
676 """String. The identification hash of the changeset's second
675 parent, as a 40 digit hexadecimal string. If the changeset has no second
677 parent, as a 40 digit hexadecimal string. If the changeset has no second
676 parent, all digits are 0."""
678 parent, all digits are 0."""
677 ctx = context.resource(mapping, 'ctx')
679 ctx = context.resource(mapping, 'ctx')
678 return ctx.p2().hex()
680 return ctx.p2().hex()
679
681
680 @templatekeyword('parents', requires={'repo', 'ctx'})
682 @templatekeyword('parents', requires={'repo', 'ctx'})
681 def showparents(context, mapping):
683 def showparents(context, mapping):
682 """List of strings. The parents of the changeset in "rev:node"
684 """List of strings. The parents of the changeset in "rev:node"
683 format. If the changeset has only one "natural" parent (the predecessor
685 format. If the changeset has only one "natural" parent (the predecessor
684 revision) nothing is shown."""
686 revision) nothing is shown."""
685 repo = context.resource(mapping, 'repo')
687 repo = context.resource(mapping, 'repo')
686 ctx = context.resource(mapping, 'ctx')
688 ctx = context.resource(mapping, 'ctx')
687 pctxs = scmutil.meaningfulparents(repo, ctx)
689 pctxs = scmutil.meaningfulparents(repo, ctx)
688 prevs = [p.rev() for p in pctxs]
690 prevs = [p.rev() for p in pctxs]
689 parents = [[('rev', p.rev()),
691 parents = [[('rev', p.rev()),
690 ('node', p.hex()),
692 ('node', p.hex()),
691 ('phase', p.phasestr())]
693 ('phase', p.phasestr())]
692 for p in pctxs]
694 for p in pctxs]
693 f = _showcompatlist(context, mapping, 'parent', parents)
695 f = _showcompatlist(context, mapping, 'parent', parents)
694 return _hybrid(f, prevs, lambda x: {'ctx': repo[x]},
696 return _hybrid(f, prevs, lambda x: {'ctx': repo[x]},
695 lambda x: scmutil.formatchangeid(repo[x]), keytype=int)
697 lambda x: scmutil.formatchangeid(repo[x]), keytype=int)
696
698
697 @templatekeyword('phase', requires={'ctx'})
699 @templatekeyword('phase', requires={'ctx'})
698 def showphase(context, mapping):
700 def showphase(context, mapping):
699 """String. The changeset phase name."""
701 """String. The changeset phase name."""
700 ctx = context.resource(mapping, 'ctx')
702 ctx = context.resource(mapping, 'ctx')
701 return ctx.phasestr()
703 return ctx.phasestr()
702
704
703 @templatekeyword('phaseidx', requires={'ctx'})
705 @templatekeyword('phaseidx', requires={'ctx'})
704 def showphaseidx(context, mapping):
706 def showphaseidx(context, mapping):
705 """Integer. The changeset phase index. (ADVANCED)"""
707 """Integer. The changeset phase index. (ADVANCED)"""
706 ctx = context.resource(mapping, 'ctx')
708 ctx = context.resource(mapping, 'ctx')
707 return ctx.phase()
709 return ctx.phase()
708
710
709 @templatekeyword('rev', requires={'ctx'})
711 @templatekeyword('rev', requires={'ctx'})
710 def showrev(context, mapping):
712 def showrev(context, mapping):
711 """Integer. The repository-local changeset revision number."""
713 """Integer. The repository-local changeset revision number."""
712 ctx = context.resource(mapping, 'ctx')
714 ctx = context.resource(mapping, 'ctx')
713 return scmutil.intrev(ctx)
715 return scmutil.intrev(ctx)
714
716
715 def showrevslist(context, mapping, name, revs):
717 def showrevslist(context, mapping, name, revs):
716 """helper to generate a list of revisions in which a mapped template will
718 """helper to generate a list of revisions in which a mapped template will
717 be evaluated"""
719 be evaluated"""
718 repo = context.resource(mapping, 'repo')
720 repo = context.resource(mapping, 'repo')
719 f = _showcompatlist(context, mapping, name, ['%d' % r for r in revs])
721 f = _showcompatlist(context, mapping, name, ['%d' % r for r in revs])
720 return _hybrid(f, revs,
722 return _hybrid(f, revs,
721 lambda x: {name: x, 'ctx': repo[x]},
723 lambda x: {name: x, 'ctx': repo[x]},
722 pycompat.identity, keytype=int)
724 pycompat.identity, keytype=int)
723
725
724 @templatekeyword('subrepos', requires={'ctx'})
726 @templatekeyword('subrepos', requires={'ctx'})
725 def showsubrepos(context, mapping):
727 def showsubrepos(context, mapping):
726 """List of strings. Updated subrepositories in the changeset."""
728 """List of strings. Updated subrepositories in the changeset."""
727 ctx = context.resource(mapping, 'ctx')
729 ctx = context.resource(mapping, 'ctx')
728 substate = ctx.substate
730 substate = ctx.substate
729 if not substate:
731 if not substate:
730 return compatlist(context, mapping, 'subrepo', [])
732 return compatlist(context, mapping, 'subrepo', [])
731 psubstate = ctx.parents()[0].substate or {}
733 psubstate = ctx.parents()[0].substate or {}
732 subrepos = []
734 subrepos = []
733 for sub in substate:
735 for sub in substate:
734 if sub not in psubstate or substate[sub] != psubstate[sub]:
736 if sub not in psubstate or substate[sub] != psubstate[sub]:
735 subrepos.append(sub) # modified or newly added in ctx
737 subrepos.append(sub) # modified or newly added in ctx
736 for sub in psubstate:
738 for sub in psubstate:
737 if sub not in substate:
739 if sub not in substate:
738 subrepos.append(sub) # removed in ctx
740 subrepos.append(sub) # removed in ctx
739 return compatlist(context, mapping, 'subrepo', sorted(subrepos))
741 return compatlist(context, mapping, 'subrepo', sorted(subrepos))
740
742
741 # don't remove "showtags" definition, even though namespaces will put
743 # don't remove "showtags" definition, even though namespaces will put
742 # a helper function for "tags" keyword into "keywords" map automatically,
744 # a helper function for "tags" keyword into "keywords" map automatically,
743 # because online help text is built without namespaces initialization
745 # because online help text is built without namespaces initialization
744 @templatekeyword('tags', requires={'repo', 'ctx'})
746 @templatekeyword('tags', requires={'repo', 'ctx'})
745 def showtags(context, mapping):
747 def showtags(context, mapping):
746 """List of strings. Any tags associated with the changeset."""
748 """List of strings. Any tags associated with the changeset."""
747 return shownames(context, mapping, 'tags')
749 return shownames(context, mapping, 'tags')
748
750
749 @templatekeyword('termwidth', requires={'ui'})
751 @templatekeyword('termwidth', requires={'ui'})
750 def showtermwidth(context, mapping):
752 def showtermwidth(context, mapping):
751 """Integer. The width of the current terminal."""
753 """Integer. The width of the current terminal."""
752 ui = context.resource(mapping, 'ui')
754 ui = context.resource(mapping, 'ui')
753 return ui.termwidth()
755 return ui.termwidth()
754
756
755 @templatekeyword('instabilities', requires={'ctx'})
757 @templatekeyword('instabilities', requires={'ctx'})
756 def showinstabilities(context, mapping):
758 def showinstabilities(context, mapping):
757 """List of strings. Evolution instabilities affecting the changeset.
759 """List of strings. Evolution instabilities affecting the changeset.
758 (EXPERIMENTAL)
760 (EXPERIMENTAL)
759 """
761 """
760 ctx = context.resource(mapping, 'ctx')
762 ctx = context.resource(mapping, 'ctx')
761 return compatlist(context, mapping, 'instability', ctx.instabilities(),
763 return compatlist(context, mapping, 'instability', ctx.instabilities(),
762 plural='instabilities')
764 plural='instabilities')
763
765
764 @templatekeyword('verbosity', requires={'ui'})
766 @templatekeyword('verbosity', requires={'ui'})
765 def showverbosity(context, mapping):
767 def showverbosity(context, mapping):
766 """String. The current output verbosity in 'debug', 'quiet', 'verbose',
768 """String. The current output verbosity in 'debug', 'quiet', 'verbose',
767 or ''."""
769 or ''."""
768 ui = context.resource(mapping, 'ui')
770 ui = context.resource(mapping, 'ui')
769 # see logcmdutil.changesettemplater for priority of these flags
771 # see logcmdutil.changesettemplater for priority of these flags
770 if ui.debugflag:
772 if ui.debugflag:
771 return 'debug'
773 return 'debug'
772 elif ui.quiet:
774 elif ui.quiet:
773 return 'quiet'
775 return 'quiet'
774 elif ui.verbose:
776 elif ui.verbose:
775 return 'verbose'
777 return 'verbose'
776 return ''
778 return ''
777
779
778 @templatekeyword('whyunstable', requires={'repo', 'ctx'})
780 @templatekeyword('whyunstable', requires={'repo', 'ctx'})
779 def showwhyunstable(context, mapping):
781 def showwhyunstable(context, mapping):
780 """List of dicts explaining all instabilities of a changeset.
782 """List of dicts explaining all instabilities of a changeset.
781 (EXPERIMENTAL)
783 (EXPERIMENTAL)
782 """
784 """
783 repo = context.resource(mapping, 'repo')
785 repo = context.resource(mapping, 'repo')
784 ctx = context.resource(mapping, 'ctx')
786 ctx = context.resource(mapping, 'ctx')
785
787
786 def formatnode(ctx):
788 def formatnode(ctx):
787 return '%s (%s)' % (scmutil.formatchangeid(ctx), ctx.phasestr())
789 return '%s (%s)' % (scmutil.formatchangeid(ctx), ctx.phasestr())
788
790
789 entries = obsutil.whyunstable(repo, ctx)
791 entries = obsutil.whyunstable(repo, ctx)
790
792
791 for entry in entries:
793 for entry in entries:
792 if entry.get('divergentnodes'):
794 if entry.get('divergentnodes'):
793 dnodes = entry['divergentnodes']
795 dnodes = entry['divergentnodes']
794 dnhybrid = _hybrid(None, [dnode.hex() for dnode in dnodes],
796 dnhybrid = _hybrid(None, [dnode.hex() for dnode in dnodes],
795 lambda x: {'ctx': repo[x]},
797 lambda x: {'ctx': repo[x]},
796 lambda x: formatnode(repo[x]))
798 lambda x: formatnode(repo[x]))
797 entry['divergentnodes'] = dnhybrid
799 entry['divergentnodes'] = dnhybrid
798
800
799 tmpl = ('{instability}:{if(divergentnodes, " ")}{divergentnodes} '
801 tmpl = ('{instability}:{if(divergentnodes, " ")}{divergentnodes} '
800 '{reason} {node|short}')
802 '{reason} {node|short}')
801 return templateutil.mappinglist(entries, tmpl=tmpl, sep='\n')
803 return templateutil.mappinglist(entries, tmpl=tmpl, sep='\n')
802
804
803 def loadkeyword(ui, extname, registrarobj):
805 def loadkeyword(ui, extname, registrarobj):
804 """Load template keyword from specified registrarobj
806 """Load template keyword from specified registrarobj
805 """
807 """
806 for name, func in registrarobj._table.iteritems():
808 for name, func in registrarobj._table.iteritems():
807 keywords[name] = func
809 keywords[name] = func
808
810
809 # tell hggettext to extract docstrings from these functions:
811 # tell hggettext to extract docstrings from these functions:
810 i18nfunctions = keywords.values()
812 i18nfunctions = keywords.values()
@@ -1,885 +1,886 b''
1 # templateutil.py - utility for template evaluation
1 # templateutil.py - utility for template evaluation
2 #
2 #
3 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import abc
10 import abc
11 import types
11 import types
12
12
13 from .i18n import _
13 from .i18n import _
14 from . import (
14 from . import (
15 error,
15 error,
16 pycompat,
16 pycompat,
17 util,
17 util,
18 )
18 )
19 from .utils import (
19 from .utils import (
20 dateutil,
20 dateutil,
21 stringutil,
21 stringutil,
22 )
22 )
23
23
24 class ResourceUnavailable(error.Abort):
24 class ResourceUnavailable(error.Abort):
25 pass
25 pass
26
26
27 class TemplateNotFound(error.Abort):
27 class TemplateNotFound(error.Abort):
28 pass
28 pass
29
29
30 class wrapped(object):
30 class wrapped(object):
31 """Object requiring extra conversion prior to displaying or processing
31 """Object requiring extra conversion prior to displaying or processing
32 as value
32 as value
33
33
34 Use unwrapvalue() or unwrapastype() to obtain the inner object.
34 Use unwrapvalue() or unwrapastype() to obtain the inner object.
35 """
35 """
36
36
37 __metaclass__ = abc.ABCMeta
37 __metaclass__ = abc.ABCMeta
38
38
39 @abc.abstractmethod
39 @abc.abstractmethod
40 def contains(self, context, mapping, item):
40 def contains(self, context, mapping, item):
41 """Test if the specified item is in self
41 """Test if the specified item is in self
42
42
43 The item argument may be a wrapped object.
43 The item argument may be a wrapped object.
44 """
44 """
45
45
46 @abc.abstractmethod
46 @abc.abstractmethod
47 def getmember(self, context, mapping, key):
47 def getmember(self, context, mapping, key):
48 """Return a member item for the specified key
48 """Return a member item for the specified key
49
49
50 The key argument may be a wrapped object.
50 The key argument may be a wrapped object.
51 A returned object may be either a wrapped object or a pure value
51 A returned object may be either a wrapped object or a pure value
52 depending on the self type.
52 depending on the self type.
53 """
53 """
54
54
55 @abc.abstractmethod
55 @abc.abstractmethod
56 def getmin(self, context, mapping):
56 def getmin(self, context, mapping):
57 """Return the smallest item, which may be either a wrapped or a pure
57 """Return the smallest item, which may be either a wrapped or a pure
58 value depending on the self type"""
58 value depending on the self type"""
59
59
60 @abc.abstractmethod
60 @abc.abstractmethod
61 def getmax(self, context, mapping):
61 def getmax(self, context, mapping):
62 """Return the largest item, which may be either a wrapped or a pure
62 """Return the largest item, which may be either a wrapped or a pure
63 value depending on the self type"""
63 value depending on the self type"""
64
64
65 @abc.abstractmethod
65 @abc.abstractmethod
66 def itermaps(self, context):
66 def itermaps(self, context):
67 """Yield each template mapping"""
67 """Yield each template mapping"""
68
68
69 @abc.abstractmethod
69 @abc.abstractmethod
70 def join(self, context, mapping, sep):
70 def join(self, context, mapping, sep):
71 """Join items with the separator; Returns a bytes or (possibly nested)
71 """Join items with the separator; Returns a bytes or (possibly nested)
72 generator of bytes
72 generator of bytes
73
73
74 A pre-configured template may be rendered per item if this container
74 A pre-configured template may be rendered per item if this container
75 holds unprintable items.
75 holds unprintable items.
76 """
76 """
77
77
78 @abc.abstractmethod
78 @abc.abstractmethod
79 def show(self, context, mapping):
79 def show(self, context, mapping):
80 """Return a bytes or (possibly nested) generator of bytes representing
80 """Return a bytes or (possibly nested) generator of bytes representing
81 the underlying object
81 the underlying object
82
82
83 A pre-configured template may be rendered if the underlying object is
83 A pre-configured template may be rendered if the underlying object is
84 not printable.
84 not printable.
85 """
85 """
86
86
87 @abc.abstractmethod
87 @abc.abstractmethod
88 def tobool(self, context, mapping):
88 def tobool(self, context, mapping):
89 """Return a boolean representation of the inner value"""
89 """Return a boolean representation of the inner value"""
90
90
91 @abc.abstractmethod
91 @abc.abstractmethod
92 def tovalue(self, context, mapping):
92 def tovalue(self, context, mapping):
93 """Move the inner value object out or create a value representation
93 """Move the inner value object out or create a value representation
94
94
95 A returned value must be serializable by templaterfilters.json().
95 A returned value must be serializable by templaterfilters.json().
96 """
96 """
97
97
98 class mappable(object):
98 class mappable(object):
99 """Object which can be converted to a single template mapping"""
99 """Object which can be converted to a single template mapping"""
100
100
101 def itermaps(self, context):
101 def itermaps(self, context):
102 yield self.tomap(context)
102 yield self.tomap(context)
103
103
104 @abc.abstractmethod
104 @abc.abstractmethod
105 def tomap(self, context):
105 def tomap(self, context):
106 """Create a single template mapping representing this"""
106 """Create a single template mapping representing this"""
107
107
108 class wrappedbytes(wrapped):
108 class wrappedbytes(wrapped):
109 """Wrapper for byte string"""
109 """Wrapper for byte string"""
110
110
111 def __init__(self, value):
111 def __init__(self, value):
112 self._value = value
112 self._value = value
113
113
114 def contains(self, context, mapping, item):
114 def contains(self, context, mapping, item):
115 item = stringify(context, mapping, item)
115 item = stringify(context, mapping, item)
116 return item in self._value
116 return item in self._value
117
117
118 def getmember(self, context, mapping, key):
118 def getmember(self, context, mapping, key):
119 raise error.ParseError(_('%r is not a dictionary')
119 raise error.ParseError(_('%r is not a dictionary')
120 % pycompat.bytestr(self._value))
120 % pycompat.bytestr(self._value))
121
121
122 def getmin(self, context, mapping):
122 def getmin(self, context, mapping):
123 return self._getby(context, mapping, min)
123 return self._getby(context, mapping, min)
124
124
125 def getmax(self, context, mapping):
125 def getmax(self, context, mapping):
126 return self._getby(context, mapping, max)
126 return self._getby(context, mapping, max)
127
127
128 def _getby(self, context, mapping, func):
128 def _getby(self, context, mapping, func):
129 if not self._value:
129 if not self._value:
130 raise error.ParseError(_('empty string'))
130 raise error.ParseError(_('empty string'))
131 return func(pycompat.iterbytestr(self._value))
131 return func(pycompat.iterbytestr(self._value))
132
132
133 def itermaps(self, context):
133 def itermaps(self, context):
134 raise error.ParseError(_('%r is not iterable of mappings')
134 raise error.ParseError(_('%r is not iterable of mappings')
135 % pycompat.bytestr(self._value))
135 % pycompat.bytestr(self._value))
136
136
137 def join(self, context, mapping, sep):
137 def join(self, context, mapping, sep):
138 return joinitems(pycompat.iterbytestr(self._value), sep)
138 return joinitems(pycompat.iterbytestr(self._value), sep)
139
139
140 def show(self, context, mapping):
140 def show(self, context, mapping):
141 return self._value
141 return self._value
142
142
143 def tobool(self, context, mapping):
143 def tobool(self, context, mapping):
144 return bool(self._value)
144 return bool(self._value)
145
145
146 def tovalue(self, context, mapping):
146 def tovalue(self, context, mapping):
147 return self._value
147 return self._value
148
148
149 class wrappedvalue(wrapped):
149 class wrappedvalue(wrapped):
150 """Generic wrapper for pure non-list/dict/bytes value"""
150 """Generic wrapper for pure non-list/dict/bytes value"""
151
151
152 def __init__(self, value):
152 def __init__(self, value):
153 self._value = value
153 self._value = value
154
154
155 def contains(self, context, mapping, item):
155 def contains(self, context, mapping, item):
156 raise error.ParseError(_("%r is not iterable") % self._value)
156 raise error.ParseError(_("%r is not iterable") % self._value)
157
157
158 def getmember(self, context, mapping, key):
158 def getmember(self, context, mapping, key):
159 raise error.ParseError(_('%r is not a dictionary') % self._value)
159 raise error.ParseError(_('%r is not a dictionary') % self._value)
160
160
161 def getmin(self, context, mapping):
161 def getmin(self, context, mapping):
162 raise error.ParseError(_("%r is not iterable") % self._value)
162 raise error.ParseError(_("%r is not iterable") % self._value)
163
163
164 def getmax(self, context, mapping):
164 def getmax(self, context, mapping):
165 raise error.ParseError(_("%r is not iterable") % self._value)
165 raise error.ParseError(_("%r is not iterable") % self._value)
166
166
167 def itermaps(self, context):
167 def itermaps(self, context):
168 raise error.ParseError(_('%r is not iterable of mappings')
168 raise error.ParseError(_('%r is not iterable of mappings')
169 % self._value)
169 % self._value)
170
170
171 def join(self, context, mapping, sep):
171 def join(self, context, mapping, sep):
172 raise error.ParseError(_('%r is not iterable') % self._value)
172 raise error.ParseError(_('%r is not iterable') % self._value)
173
173
174 def show(self, context, mapping):
174 def show(self, context, mapping):
175 if self._value is None:
175 if self._value is None:
176 return b''
176 return b''
177 return pycompat.bytestr(self._value)
177 return pycompat.bytestr(self._value)
178
178
179 def tobool(self, context, mapping):
179 def tobool(self, context, mapping):
180 if self._value is None:
180 if self._value is None:
181 return False
181 return False
182 if isinstance(self._value, bool):
182 if isinstance(self._value, bool):
183 return self._value
183 return self._value
184 # otherwise evaluate as string, which means 0 is True
184 # otherwise evaluate as string, which means 0 is True
185 return bool(pycompat.bytestr(self._value))
185 return bool(pycompat.bytestr(self._value))
186
186
187 def tovalue(self, context, mapping):
187 def tovalue(self, context, mapping):
188 return self._value
188 return self._value
189
189
190 class date(mappable, wrapped):
190 class date(mappable, wrapped):
191 """Wrapper for date tuple"""
191 """Wrapper for date tuple"""
192
192
193 def __init__(self, value):
193 def __init__(self, value, showfmt='%d %d'):
194 # value may be (float, int), but public interface shouldn't support
194 # value may be (float, int), but public interface shouldn't support
195 # floating-point timestamp
195 # floating-point timestamp
196 self._unixtime, self._tzoffset = map(int, value)
196 self._unixtime, self._tzoffset = map(int, value)
197 self._showfmt = showfmt
197
198
198 def contains(self, context, mapping, item):
199 def contains(self, context, mapping, item):
199 raise error.ParseError(_('date is not iterable'))
200 raise error.ParseError(_('date is not iterable'))
200
201
201 def getmember(self, context, mapping, key):
202 def getmember(self, context, mapping, key):
202 raise error.ParseError(_('date is not a dictionary'))
203 raise error.ParseError(_('date is not a dictionary'))
203
204
204 def getmin(self, context, mapping):
205 def getmin(self, context, mapping):
205 raise error.ParseError(_('date is not iterable'))
206 raise error.ParseError(_('date is not iterable'))
206
207
207 def getmax(self, context, mapping):
208 def getmax(self, context, mapping):
208 raise error.ParseError(_('date is not iterable'))
209 raise error.ParseError(_('date is not iterable'))
209
210
210 def join(self, context, mapping, sep):
211 def join(self, context, mapping, sep):
211 raise error.ParseError(_("date is not iterable"))
212 raise error.ParseError(_("date is not iterable"))
212
213
213 def show(self, context, mapping):
214 def show(self, context, mapping):
214 return '%d %d' % (self._unixtime, self._tzoffset)
215 return self._showfmt % (self._unixtime, self._tzoffset)
215
216
216 def tomap(self, context):
217 def tomap(self, context):
217 return {'unixtime': self._unixtime, 'tzoffset': self._tzoffset}
218 return {'unixtime': self._unixtime, 'tzoffset': self._tzoffset}
218
219
219 def tobool(self, context, mapping):
220 def tobool(self, context, mapping):
220 return True
221 return True
221
222
222 def tovalue(self, context, mapping):
223 def tovalue(self, context, mapping):
223 return (self._unixtime, self._tzoffset)
224 return (self._unixtime, self._tzoffset)
224
225
225 class hybrid(wrapped):
226 class hybrid(wrapped):
226 """Wrapper for list or dict to support legacy template
227 """Wrapper for list or dict to support legacy template
227
228
228 This class allows us to handle both:
229 This class allows us to handle both:
229 - "{files}" (legacy command-line-specific list hack) and
230 - "{files}" (legacy command-line-specific list hack) and
230 - "{files % '{file}\n'}" (hgweb-style with inlining and function support)
231 - "{files % '{file}\n'}" (hgweb-style with inlining and function support)
231 and to access raw values:
232 and to access raw values:
232 - "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
233 - "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
233 - "{get(extras, key)}"
234 - "{get(extras, key)}"
234 - "{files|json}"
235 - "{files|json}"
235 """
236 """
236
237
237 def __init__(self, gen, values, makemap, joinfmt, keytype=None):
238 def __init__(self, gen, values, makemap, joinfmt, keytype=None):
238 self._gen = gen # generator or function returning generator
239 self._gen = gen # generator or function returning generator
239 self._values = values
240 self._values = values
240 self._makemap = makemap
241 self._makemap = makemap
241 self._joinfmt = joinfmt
242 self._joinfmt = joinfmt
242 self._keytype = keytype # hint for 'x in y' where type(x) is unresolved
243 self._keytype = keytype # hint for 'x in y' where type(x) is unresolved
243
244
244 def contains(self, context, mapping, item):
245 def contains(self, context, mapping, item):
245 item = unwrapastype(context, mapping, item, self._keytype)
246 item = unwrapastype(context, mapping, item, self._keytype)
246 return item in self._values
247 return item in self._values
247
248
248 def getmember(self, context, mapping, key):
249 def getmember(self, context, mapping, key):
249 # TODO: maybe split hybrid list/dict types?
250 # TODO: maybe split hybrid list/dict types?
250 if not util.safehasattr(self._values, 'get'):
251 if not util.safehasattr(self._values, 'get'):
251 raise error.ParseError(_('not a dictionary'))
252 raise error.ParseError(_('not a dictionary'))
252 key = unwrapastype(context, mapping, key, self._keytype)
253 key = unwrapastype(context, mapping, key, self._keytype)
253 return self._wrapvalue(key, self._values.get(key))
254 return self._wrapvalue(key, self._values.get(key))
254
255
255 def getmin(self, context, mapping):
256 def getmin(self, context, mapping):
256 return self._getby(context, mapping, min)
257 return self._getby(context, mapping, min)
257
258
258 def getmax(self, context, mapping):
259 def getmax(self, context, mapping):
259 return self._getby(context, mapping, max)
260 return self._getby(context, mapping, max)
260
261
261 def _getby(self, context, mapping, func):
262 def _getby(self, context, mapping, func):
262 if not self._values:
263 if not self._values:
263 raise error.ParseError(_('empty sequence'))
264 raise error.ParseError(_('empty sequence'))
264 val = func(self._values)
265 val = func(self._values)
265 return self._wrapvalue(val, val)
266 return self._wrapvalue(val, val)
266
267
267 def _wrapvalue(self, key, val):
268 def _wrapvalue(self, key, val):
268 if val is None:
269 if val is None:
269 return
270 return
270 if util.safehasattr(val, '_makemap'):
271 if util.safehasattr(val, '_makemap'):
271 # a nested hybrid list/dict, which has its own way of map operation
272 # a nested hybrid list/dict, which has its own way of map operation
272 return val
273 return val
273 return hybriditem(None, key, val, self._makemap)
274 return hybriditem(None, key, val, self._makemap)
274
275
275 def itermaps(self, context):
276 def itermaps(self, context):
276 makemap = self._makemap
277 makemap = self._makemap
277 for x in self._values:
278 for x in self._values:
278 yield makemap(x)
279 yield makemap(x)
279
280
280 def join(self, context, mapping, sep):
281 def join(self, context, mapping, sep):
281 # TODO: switch gen to (context, mapping) API?
282 # TODO: switch gen to (context, mapping) API?
282 return joinitems((self._joinfmt(x) for x in self._values), sep)
283 return joinitems((self._joinfmt(x) for x in self._values), sep)
283
284
284 def show(self, context, mapping):
285 def show(self, context, mapping):
285 # TODO: switch gen to (context, mapping) API?
286 # TODO: switch gen to (context, mapping) API?
286 gen = self._gen
287 gen = self._gen
287 if gen is None:
288 if gen is None:
288 return self.join(context, mapping, ' ')
289 return self.join(context, mapping, ' ')
289 if callable(gen):
290 if callable(gen):
290 return gen()
291 return gen()
291 return gen
292 return gen
292
293
293 def tobool(self, context, mapping):
294 def tobool(self, context, mapping):
294 return bool(self._values)
295 return bool(self._values)
295
296
296 def tovalue(self, context, mapping):
297 def tovalue(self, context, mapping):
297 # TODO: make it non-recursive for trivial lists/dicts
298 # TODO: make it non-recursive for trivial lists/dicts
298 xs = self._values
299 xs = self._values
299 if util.safehasattr(xs, 'get'):
300 if util.safehasattr(xs, 'get'):
300 return {k: unwrapvalue(context, mapping, v)
301 return {k: unwrapvalue(context, mapping, v)
301 for k, v in xs.iteritems()}
302 for k, v in xs.iteritems()}
302 return [unwrapvalue(context, mapping, x) for x in xs]
303 return [unwrapvalue(context, mapping, x) for x in xs]
303
304
304 class hybriditem(mappable, wrapped):
305 class hybriditem(mappable, wrapped):
305 """Wrapper for non-list/dict object to support map operation
306 """Wrapper for non-list/dict object to support map operation
306
307
307 This class allows us to handle both:
308 This class allows us to handle both:
308 - "{manifest}"
309 - "{manifest}"
309 - "{manifest % '{rev}:{node}'}"
310 - "{manifest % '{rev}:{node}'}"
310 - "{manifest.rev}"
311 - "{manifest.rev}"
311 """
312 """
312
313
313 def __init__(self, gen, key, value, makemap):
314 def __init__(self, gen, key, value, makemap):
314 self._gen = gen # generator or function returning generator
315 self._gen = gen # generator or function returning generator
315 self._key = key
316 self._key = key
316 self._value = value # may be generator of strings
317 self._value = value # may be generator of strings
317 self._makemap = makemap
318 self._makemap = makemap
318
319
319 def tomap(self, context):
320 def tomap(self, context):
320 return self._makemap(self._key)
321 return self._makemap(self._key)
321
322
322 def contains(self, context, mapping, item):
323 def contains(self, context, mapping, item):
323 w = makewrapped(context, mapping, self._value)
324 w = makewrapped(context, mapping, self._value)
324 return w.contains(context, mapping, item)
325 return w.contains(context, mapping, item)
325
326
326 def getmember(self, context, mapping, key):
327 def getmember(self, context, mapping, key):
327 w = makewrapped(context, mapping, self._value)
328 w = makewrapped(context, mapping, self._value)
328 return w.getmember(context, mapping, key)
329 return w.getmember(context, mapping, key)
329
330
330 def getmin(self, context, mapping):
331 def getmin(self, context, mapping):
331 w = makewrapped(context, mapping, self._value)
332 w = makewrapped(context, mapping, self._value)
332 return w.getmin(context, mapping)
333 return w.getmin(context, mapping)
333
334
334 def getmax(self, context, mapping):
335 def getmax(self, context, mapping):
335 w = makewrapped(context, mapping, self._value)
336 w = makewrapped(context, mapping, self._value)
336 return w.getmax(context, mapping)
337 return w.getmax(context, mapping)
337
338
338 def join(self, context, mapping, sep):
339 def join(self, context, mapping, sep):
339 w = makewrapped(context, mapping, self._value)
340 w = makewrapped(context, mapping, self._value)
340 return w.join(context, mapping, sep)
341 return w.join(context, mapping, sep)
341
342
342 def show(self, context, mapping):
343 def show(self, context, mapping):
343 # TODO: switch gen to (context, mapping) API?
344 # TODO: switch gen to (context, mapping) API?
344 gen = self._gen
345 gen = self._gen
345 if gen is None:
346 if gen is None:
346 return pycompat.bytestr(self._value)
347 return pycompat.bytestr(self._value)
347 if callable(gen):
348 if callable(gen):
348 return gen()
349 return gen()
349 return gen
350 return gen
350
351
351 def tobool(self, context, mapping):
352 def tobool(self, context, mapping):
352 return bool(self.tovalue(context, mapping))
353 return bool(self.tovalue(context, mapping))
353
354
354 def tovalue(self, context, mapping):
355 def tovalue(self, context, mapping):
355 return _unthunk(context, mapping, self._value)
356 return _unthunk(context, mapping, self._value)
356
357
357 class _mappingsequence(wrapped):
358 class _mappingsequence(wrapped):
358 """Wrapper for sequence of template mappings
359 """Wrapper for sequence of template mappings
359
360
360 This represents an inner template structure (i.e. a list of dicts),
361 This represents an inner template structure (i.e. a list of dicts),
361 which can also be rendered by the specified named/literal template.
362 which can also be rendered by the specified named/literal template.
362
363
363 Template mappings may be nested.
364 Template mappings may be nested.
364 """
365 """
365
366
366 def __init__(self, name=None, tmpl=None, sep=''):
367 def __init__(self, name=None, tmpl=None, sep=''):
367 if name is not None and tmpl is not None:
368 if name is not None and tmpl is not None:
368 raise error.ProgrammingError('name and tmpl are mutually exclusive')
369 raise error.ProgrammingError('name and tmpl are mutually exclusive')
369 self._name = name
370 self._name = name
370 self._tmpl = tmpl
371 self._tmpl = tmpl
371 self._defaultsep = sep
372 self._defaultsep = sep
372
373
373 def contains(self, context, mapping, item):
374 def contains(self, context, mapping, item):
374 raise error.ParseError(_('not comparable'))
375 raise error.ParseError(_('not comparable'))
375
376
376 def getmember(self, context, mapping, key):
377 def getmember(self, context, mapping, key):
377 raise error.ParseError(_('not a dictionary'))
378 raise error.ParseError(_('not a dictionary'))
378
379
379 def getmin(self, context, mapping):
380 def getmin(self, context, mapping):
380 raise error.ParseError(_('not comparable'))
381 raise error.ParseError(_('not comparable'))
381
382
382 def getmax(self, context, mapping):
383 def getmax(self, context, mapping):
383 raise error.ParseError(_('not comparable'))
384 raise error.ParseError(_('not comparable'))
384
385
385 def join(self, context, mapping, sep):
386 def join(self, context, mapping, sep):
386 mapsiter = _iteroverlaymaps(context, mapping, self.itermaps(context))
387 mapsiter = _iteroverlaymaps(context, mapping, self.itermaps(context))
387 if self._name:
388 if self._name:
388 itemiter = (context.process(self._name, m) for m in mapsiter)
389 itemiter = (context.process(self._name, m) for m in mapsiter)
389 elif self._tmpl:
390 elif self._tmpl:
390 itemiter = (context.expand(self._tmpl, m) for m in mapsiter)
391 itemiter = (context.expand(self._tmpl, m) for m in mapsiter)
391 else:
392 else:
392 raise error.ParseError(_('not displayable without template'))
393 raise error.ParseError(_('not displayable without template'))
393 return joinitems(itemiter, sep)
394 return joinitems(itemiter, sep)
394
395
395 def show(self, context, mapping):
396 def show(self, context, mapping):
396 return self.join(context, mapping, self._defaultsep)
397 return self.join(context, mapping, self._defaultsep)
397
398
398 def tovalue(self, context, mapping):
399 def tovalue(self, context, mapping):
399 knownres = context.knownresourcekeys()
400 knownres = context.knownresourcekeys()
400 items = []
401 items = []
401 for nm in self.itermaps(context):
402 for nm in self.itermaps(context):
402 # drop internal resources (recursively) which shouldn't be displayed
403 # drop internal resources (recursively) which shouldn't be displayed
403 lm = context.overlaymap(mapping, nm)
404 lm = context.overlaymap(mapping, nm)
404 items.append({k: unwrapvalue(context, lm, v)
405 items.append({k: unwrapvalue(context, lm, v)
405 for k, v in nm.iteritems() if k not in knownres})
406 for k, v in nm.iteritems() if k not in knownres})
406 return items
407 return items
407
408
408 class mappinggenerator(_mappingsequence):
409 class mappinggenerator(_mappingsequence):
409 """Wrapper for generator of template mappings
410 """Wrapper for generator of template mappings
410
411
411 The function ``make(context, *args)`` should return a generator of
412 The function ``make(context, *args)`` should return a generator of
412 mapping dicts.
413 mapping dicts.
413 """
414 """
414
415
415 def __init__(self, make, args=(), name=None, tmpl=None, sep=''):
416 def __init__(self, make, args=(), name=None, tmpl=None, sep=''):
416 super(mappinggenerator, self).__init__(name, tmpl, sep)
417 super(mappinggenerator, self).__init__(name, tmpl, sep)
417 self._make = make
418 self._make = make
418 self._args = args
419 self._args = args
419
420
420 def itermaps(self, context):
421 def itermaps(self, context):
421 return self._make(context, *self._args)
422 return self._make(context, *self._args)
422
423
423 def tobool(self, context, mapping):
424 def tobool(self, context, mapping):
424 return _nonempty(self.itermaps(context))
425 return _nonempty(self.itermaps(context))
425
426
426 class mappinglist(_mappingsequence):
427 class mappinglist(_mappingsequence):
427 """Wrapper for list of template mappings"""
428 """Wrapper for list of template mappings"""
428
429
429 def __init__(self, mappings, name=None, tmpl=None, sep=''):
430 def __init__(self, mappings, name=None, tmpl=None, sep=''):
430 super(mappinglist, self).__init__(name, tmpl, sep)
431 super(mappinglist, self).__init__(name, tmpl, sep)
431 self._mappings = mappings
432 self._mappings = mappings
432
433
433 def itermaps(self, context):
434 def itermaps(self, context):
434 return iter(self._mappings)
435 return iter(self._mappings)
435
436
436 def tobool(self, context, mapping):
437 def tobool(self, context, mapping):
437 return bool(self._mappings)
438 return bool(self._mappings)
438
439
439 class mappedgenerator(wrapped):
440 class mappedgenerator(wrapped):
440 """Wrapper for generator of strings which acts as a list
441 """Wrapper for generator of strings which acts as a list
441
442
442 The function ``make(context, *args)`` should return a generator of
443 The function ``make(context, *args)`` should return a generator of
443 byte strings, or a generator of (possibly nested) generators of byte
444 byte strings, or a generator of (possibly nested) generators of byte
444 strings (i.e. a generator for a list of byte strings.)
445 strings (i.e. a generator for a list of byte strings.)
445 """
446 """
446
447
447 def __init__(self, make, args=()):
448 def __init__(self, make, args=()):
448 self._make = make
449 self._make = make
449 self._args = args
450 self._args = args
450
451
451 def contains(self, context, mapping, item):
452 def contains(self, context, mapping, item):
452 item = stringify(context, mapping, item)
453 item = stringify(context, mapping, item)
453 return item in self.tovalue(context, mapping)
454 return item in self.tovalue(context, mapping)
454
455
455 def _gen(self, context):
456 def _gen(self, context):
456 return self._make(context, *self._args)
457 return self._make(context, *self._args)
457
458
458 def getmember(self, context, mapping, key):
459 def getmember(self, context, mapping, key):
459 raise error.ParseError(_('not a dictionary'))
460 raise error.ParseError(_('not a dictionary'))
460
461
461 def getmin(self, context, mapping):
462 def getmin(self, context, mapping):
462 return self._getby(context, mapping, min)
463 return self._getby(context, mapping, min)
463
464
464 def getmax(self, context, mapping):
465 def getmax(self, context, mapping):
465 return self._getby(context, mapping, max)
466 return self._getby(context, mapping, max)
466
467
467 def _getby(self, context, mapping, func):
468 def _getby(self, context, mapping, func):
468 xs = self.tovalue(context, mapping)
469 xs = self.tovalue(context, mapping)
469 if not xs:
470 if not xs:
470 raise error.ParseError(_('empty sequence'))
471 raise error.ParseError(_('empty sequence'))
471 return func(xs)
472 return func(xs)
472
473
473 def itermaps(self, context):
474 def itermaps(self, context):
474 raise error.ParseError(_('list of strings is not mappable'))
475 raise error.ParseError(_('list of strings is not mappable'))
475
476
476 def join(self, context, mapping, sep):
477 def join(self, context, mapping, sep):
477 return joinitems(self._gen(context), sep)
478 return joinitems(self._gen(context), sep)
478
479
479 def show(self, context, mapping):
480 def show(self, context, mapping):
480 return self.join(context, mapping, '')
481 return self.join(context, mapping, '')
481
482
482 def tobool(self, context, mapping):
483 def tobool(self, context, mapping):
483 return _nonempty(self._gen(context))
484 return _nonempty(self._gen(context))
484
485
485 def tovalue(self, context, mapping):
486 def tovalue(self, context, mapping):
486 return [stringify(context, mapping, x) for x in self._gen(context)]
487 return [stringify(context, mapping, x) for x in self._gen(context)]
487
488
488 def hybriddict(data, key='key', value='value', fmt=None, gen=None):
489 def hybriddict(data, key='key', value='value', fmt=None, gen=None):
489 """Wrap data to support both dict-like and string-like operations"""
490 """Wrap data to support both dict-like and string-like operations"""
490 prefmt = pycompat.identity
491 prefmt = pycompat.identity
491 if fmt is None:
492 if fmt is None:
492 fmt = '%s=%s'
493 fmt = '%s=%s'
493 prefmt = pycompat.bytestr
494 prefmt = pycompat.bytestr
494 return hybrid(gen, data, lambda k: {key: k, value: data[k]},
495 return hybrid(gen, data, lambda k: {key: k, value: data[k]},
495 lambda k: fmt % (prefmt(k), prefmt(data[k])))
496 lambda k: fmt % (prefmt(k), prefmt(data[k])))
496
497
497 def hybridlist(data, name, fmt=None, gen=None):
498 def hybridlist(data, name, fmt=None, gen=None):
498 """Wrap data to support both list-like and string-like operations"""
499 """Wrap data to support both list-like and string-like operations"""
499 prefmt = pycompat.identity
500 prefmt = pycompat.identity
500 if fmt is None:
501 if fmt is None:
501 fmt = '%s'
502 fmt = '%s'
502 prefmt = pycompat.bytestr
503 prefmt = pycompat.bytestr
503 return hybrid(gen, data, lambda x: {name: x}, lambda x: fmt % prefmt(x))
504 return hybrid(gen, data, lambda x: {name: x}, lambda x: fmt % prefmt(x))
504
505
505 def compatdict(context, mapping, name, data, key='key', value='value',
506 def compatdict(context, mapping, name, data, key='key', value='value',
506 fmt=None, plural=None, separator=' '):
507 fmt=None, plural=None, separator=' '):
507 """Wrap data like hybriddict(), but also supports old-style list template
508 """Wrap data like hybriddict(), but also supports old-style list template
508
509
509 This exists for backward compatibility with the old-style template. Use
510 This exists for backward compatibility with the old-style template. Use
510 hybriddict() for new template keywords.
511 hybriddict() for new template keywords.
511 """
512 """
512 c = [{key: k, value: v} for k, v in data.iteritems()]
513 c = [{key: k, value: v} for k, v in data.iteritems()]
513 f = _showcompatlist(context, mapping, name, c, plural, separator)
514 f = _showcompatlist(context, mapping, name, c, plural, separator)
514 return hybriddict(data, key=key, value=value, fmt=fmt, gen=f)
515 return hybriddict(data, key=key, value=value, fmt=fmt, gen=f)
515
516
516 def compatlist(context, mapping, name, data, element=None, fmt=None,
517 def compatlist(context, mapping, name, data, element=None, fmt=None,
517 plural=None, separator=' '):
518 plural=None, separator=' '):
518 """Wrap data like hybridlist(), but also supports old-style list template
519 """Wrap data like hybridlist(), but also supports old-style list template
519
520
520 This exists for backward compatibility with the old-style template. Use
521 This exists for backward compatibility with the old-style template. Use
521 hybridlist() for new template keywords.
522 hybridlist() for new template keywords.
522 """
523 """
523 f = _showcompatlist(context, mapping, name, data, plural, separator)
524 f = _showcompatlist(context, mapping, name, data, plural, separator)
524 return hybridlist(data, name=element or name, fmt=fmt, gen=f)
525 return hybridlist(data, name=element or name, fmt=fmt, gen=f)
525
526
526 def _showcompatlist(context, mapping, name, values, plural=None, separator=' '):
527 def _showcompatlist(context, mapping, name, values, plural=None, separator=' '):
527 """Return a generator that renders old-style list template
528 """Return a generator that renders old-style list template
528
529
529 name is name of key in template map.
530 name is name of key in template map.
530 values is list of strings or dicts.
531 values is list of strings or dicts.
531 plural is plural of name, if not simply name + 's'.
532 plural is plural of name, if not simply name + 's'.
532 separator is used to join values as a string
533 separator is used to join values as a string
533
534
534 expansion works like this, given name 'foo'.
535 expansion works like this, given name 'foo'.
535
536
536 if values is empty, expand 'no_foos'.
537 if values is empty, expand 'no_foos'.
537
538
538 if 'foo' not in template map, return values as a string,
539 if 'foo' not in template map, return values as a string,
539 joined by 'separator'.
540 joined by 'separator'.
540
541
541 expand 'start_foos'.
542 expand 'start_foos'.
542
543
543 for each value, expand 'foo'. if 'last_foo' in template
544 for each value, expand 'foo'. if 'last_foo' in template
544 map, expand it instead of 'foo' for last key.
545 map, expand it instead of 'foo' for last key.
545
546
546 expand 'end_foos'.
547 expand 'end_foos'.
547 """
548 """
548 if not plural:
549 if not plural:
549 plural = name + 's'
550 plural = name + 's'
550 if not values:
551 if not values:
551 noname = 'no_' + plural
552 noname = 'no_' + plural
552 if context.preload(noname):
553 if context.preload(noname):
553 yield context.process(noname, mapping)
554 yield context.process(noname, mapping)
554 return
555 return
555 if not context.preload(name):
556 if not context.preload(name):
556 if isinstance(values[0], bytes):
557 if isinstance(values[0], bytes):
557 yield separator.join(values)
558 yield separator.join(values)
558 else:
559 else:
559 for v in values:
560 for v in values:
560 r = dict(v)
561 r = dict(v)
561 r.update(mapping)
562 r.update(mapping)
562 yield r
563 yield r
563 return
564 return
564 startname = 'start_' + plural
565 startname = 'start_' + plural
565 if context.preload(startname):
566 if context.preload(startname):
566 yield context.process(startname, mapping)
567 yield context.process(startname, mapping)
567 def one(v, tag=name):
568 def one(v, tag=name):
568 vmapping = {}
569 vmapping = {}
569 try:
570 try:
570 vmapping.update(v)
571 vmapping.update(v)
571 # Python 2 raises ValueError if the type of v is wrong. Python
572 # Python 2 raises ValueError if the type of v is wrong. Python
572 # 3 raises TypeError.
573 # 3 raises TypeError.
573 except (AttributeError, TypeError, ValueError):
574 except (AttributeError, TypeError, ValueError):
574 try:
575 try:
575 # Python 2 raises ValueError trying to destructure an e.g.
576 # Python 2 raises ValueError trying to destructure an e.g.
576 # bytes. Python 3 raises TypeError.
577 # bytes. Python 3 raises TypeError.
577 for a, b in v:
578 for a, b in v:
578 vmapping[a] = b
579 vmapping[a] = b
579 except (TypeError, ValueError):
580 except (TypeError, ValueError):
580 vmapping[name] = v
581 vmapping[name] = v
581 vmapping = context.overlaymap(mapping, vmapping)
582 vmapping = context.overlaymap(mapping, vmapping)
582 return context.process(tag, vmapping)
583 return context.process(tag, vmapping)
583 lastname = 'last_' + name
584 lastname = 'last_' + name
584 if context.preload(lastname):
585 if context.preload(lastname):
585 last = values.pop()
586 last = values.pop()
586 else:
587 else:
587 last = None
588 last = None
588 for v in values:
589 for v in values:
589 yield one(v)
590 yield one(v)
590 if last is not None:
591 if last is not None:
591 yield one(last, tag=lastname)
592 yield one(last, tag=lastname)
592 endname = 'end_' + plural
593 endname = 'end_' + plural
593 if context.preload(endname):
594 if context.preload(endname):
594 yield context.process(endname, mapping)
595 yield context.process(endname, mapping)
595
596
596 def flatten(context, mapping, thing):
597 def flatten(context, mapping, thing):
597 """Yield a single stream from a possibly nested set of iterators"""
598 """Yield a single stream from a possibly nested set of iterators"""
598 if isinstance(thing, wrapped):
599 if isinstance(thing, wrapped):
599 thing = thing.show(context, mapping)
600 thing = thing.show(context, mapping)
600 if isinstance(thing, bytes):
601 if isinstance(thing, bytes):
601 yield thing
602 yield thing
602 elif isinstance(thing, str):
603 elif isinstance(thing, str):
603 # We can only hit this on Python 3, and it's here to guard
604 # We can only hit this on Python 3, and it's here to guard
604 # against infinite recursion.
605 # against infinite recursion.
605 raise error.ProgrammingError('Mercurial IO including templates is done'
606 raise error.ProgrammingError('Mercurial IO including templates is done'
606 ' with bytes, not strings, got %r' % thing)
607 ' with bytes, not strings, got %r' % thing)
607 elif thing is None:
608 elif thing is None:
608 pass
609 pass
609 elif not util.safehasattr(thing, '__iter__'):
610 elif not util.safehasattr(thing, '__iter__'):
610 yield pycompat.bytestr(thing)
611 yield pycompat.bytestr(thing)
611 else:
612 else:
612 for i in thing:
613 for i in thing:
613 if isinstance(i, wrapped):
614 if isinstance(i, wrapped):
614 i = i.show(context, mapping)
615 i = i.show(context, mapping)
615 if isinstance(i, bytes):
616 if isinstance(i, bytes):
616 yield i
617 yield i
617 elif i is None:
618 elif i is None:
618 pass
619 pass
619 elif not util.safehasattr(i, '__iter__'):
620 elif not util.safehasattr(i, '__iter__'):
620 yield pycompat.bytestr(i)
621 yield pycompat.bytestr(i)
621 else:
622 else:
622 for j in flatten(context, mapping, i):
623 for j in flatten(context, mapping, i):
623 yield j
624 yield j
624
625
625 def stringify(context, mapping, thing):
626 def stringify(context, mapping, thing):
626 """Turn values into bytes by converting into text and concatenating them"""
627 """Turn values into bytes by converting into text and concatenating them"""
627 if isinstance(thing, bytes):
628 if isinstance(thing, bytes):
628 return thing # retain localstr to be round-tripped
629 return thing # retain localstr to be round-tripped
629 return b''.join(flatten(context, mapping, thing))
630 return b''.join(flatten(context, mapping, thing))
630
631
631 def findsymbolicname(arg):
632 def findsymbolicname(arg):
632 """Find symbolic name for the given compiled expression; returns None
633 """Find symbolic name for the given compiled expression; returns None
633 if nothing found reliably"""
634 if nothing found reliably"""
634 while True:
635 while True:
635 func, data = arg
636 func, data = arg
636 if func is runsymbol:
637 if func is runsymbol:
637 return data
638 return data
638 elif func is runfilter:
639 elif func is runfilter:
639 arg = data[0]
640 arg = data[0]
640 else:
641 else:
641 return None
642 return None
642
643
643 def _nonempty(xiter):
644 def _nonempty(xiter):
644 try:
645 try:
645 next(xiter)
646 next(xiter)
646 return True
647 return True
647 except StopIteration:
648 except StopIteration:
648 return False
649 return False
649
650
650 def _unthunk(context, mapping, thing):
651 def _unthunk(context, mapping, thing):
651 """Evaluate a lazy byte string into value"""
652 """Evaluate a lazy byte string into value"""
652 if not isinstance(thing, types.GeneratorType):
653 if not isinstance(thing, types.GeneratorType):
653 return thing
654 return thing
654 return stringify(context, mapping, thing)
655 return stringify(context, mapping, thing)
655
656
656 def evalrawexp(context, mapping, arg):
657 def evalrawexp(context, mapping, arg):
657 """Evaluate given argument as a bare template object which may require
658 """Evaluate given argument as a bare template object which may require
658 further processing (such as folding generator of strings)"""
659 further processing (such as folding generator of strings)"""
659 func, data = arg
660 func, data = arg
660 return func(context, mapping, data)
661 return func(context, mapping, data)
661
662
662 def evalwrapped(context, mapping, arg):
663 def evalwrapped(context, mapping, arg):
663 """Evaluate given argument to wrapped object"""
664 """Evaluate given argument to wrapped object"""
664 thing = evalrawexp(context, mapping, arg)
665 thing = evalrawexp(context, mapping, arg)
665 return makewrapped(context, mapping, thing)
666 return makewrapped(context, mapping, thing)
666
667
667 def makewrapped(context, mapping, thing):
668 def makewrapped(context, mapping, thing):
668 """Lift object to a wrapped type"""
669 """Lift object to a wrapped type"""
669 if isinstance(thing, wrapped):
670 if isinstance(thing, wrapped):
670 return thing
671 return thing
671 thing = _unthunk(context, mapping, thing)
672 thing = _unthunk(context, mapping, thing)
672 if isinstance(thing, bytes):
673 if isinstance(thing, bytes):
673 return wrappedbytes(thing)
674 return wrappedbytes(thing)
674 return wrappedvalue(thing)
675 return wrappedvalue(thing)
675
676
676 def evalfuncarg(context, mapping, arg):
677 def evalfuncarg(context, mapping, arg):
677 """Evaluate given argument as value type"""
678 """Evaluate given argument as value type"""
678 return unwrapvalue(context, mapping, evalrawexp(context, mapping, arg))
679 return unwrapvalue(context, mapping, evalrawexp(context, mapping, arg))
679
680
680 def unwrapvalue(context, mapping, thing):
681 def unwrapvalue(context, mapping, thing):
681 """Move the inner value object out of the wrapper"""
682 """Move the inner value object out of the wrapper"""
682 if isinstance(thing, wrapped):
683 if isinstance(thing, wrapped):
683 return thing.tovalue(context, mapping)
684 return thing.tovalue(context, mapping)
684 # evalrawexp() may return string, generator of strings or arbitrary object
685 # evalrawexp() may return string, generator of strings or arbitrary object
685 # such as date tuple, but filter does not want generator.
686 # such as date tuple, but filter does not want generator.
686 return _unthunk(context, mapping, thing)
687 return _unthunk(context, mapping, thing)
687
688
688 def evalboolean(context, mapping, arg):
689 def evalboolean(context, mapping, arg):
689 """Evaluate given argument as boolean, but also takes boolean literals"""
690 """Evaluate given argument as boolean, but also takes boolean literals"""
690 func, data = arg
691 func, data = arg
691 if func is runsymbol:
692 if func is runsymbol:
692 thing = func(context, mapping, data, default=None)
693 thing = func(context, mapping, data, default=None)
693 if thing is None:
694 if thing is None:
694 # not a template keyword, takes as a boolean literal
695 # not a template keyword, takes as a boolean literal
695 thing = stringutil.parsebool(data)
696 thing = stringutil.parsebool(data)
696 else:
697 else:
697 thing = func(context, mapping, data)
698 thing = func(context, mapping, data)
698 return makewrapped(context, mapping, thing).tobool(context, mapping)
699 return makewrapped(context, mapping, thing).tobool(context, mapping)
699
700
700 def evaldate(context, mapping, arg, err=None):
701 def evaldate(context, mapping, arg, err=None):
701 """Evaluate given argument as a date tuple or a date string; returns
702 """Evaluate given argument as a date tuple or a date string; returns
702 a (unixtime, offset) tuple"""
703 a (unixtime, offset) tuple"""
703 thing = evalrawexp(context, mapping, arg)
704 thing = evalrawexp(context, mapping, arg)
704 return unwrapdate(context, mapping, thing, err)
705 return unwrapdate(context, mapping, thing, err)
705
706
706 def unwrapdate(context, mapping, thing, err=None):
707 def unwrapdate(context, mapping, thing, err=None):
707 if isinstance(thing, date):
708 if isinstance(thing, date):
708 return thing.tovalue(context, mapping)
709 return thing.tovalue(context, mapping)
709 # TODO: update hgweb to not return bare tuple; then just stringify 'thing'
710 # TODO: update hgweb to not return bare tuple; then just stringify 'thing'
710 thing = unwrapvalue(context, mapping, thing)
711 thing = unwrapvalue(context, mapping, thing)
711 try:
712 try:
712 return dateutil.parsedate(thing)
713 return dateutil.parsedate(thing)
713 except AttributeError:
714 except AttributeError:
714 raise error.ParseError(err or _('not a date tuple nor a string'))
715 raise error.ParseError(err or _('not a date tuple nor a string'))
715 except error.ParseError:
716 except error.ParseError:
716 if not err:
717 if not err:
717 raise
718 raise
718 raise error.ParseError(err)
719 raise error.ParseError(err)
719
720
720 def evalinteger(context, mapping, arg, err=None):
721 def evalinteger(context, mapping, arg, err=None):
721 thing = evalrawexp(context, mapping, arg)
722 thing = evalrawexp(context, mapping, arg)
722 return unwrapinteger(context, mapping, thing, err)
723 return unwrapinteger(context, mapping, thing, err)
723
724
724 def unwrapinteger(context, mapping, thing, err=None):
725 def unwrapinteger(context, mapping, thing, err=None):
725 thing = unwrapvalue(context, mapping, thing)
726 thing = unwrapvalue(context, mapping, thing)
726 try:
727 try:
727 return int(thing)
728 return int(thing)
728 except (TypeError, ValueError):
729 except (TypeError, ValueError):
729 raise error.ParseError(err or _('not an integer'))
730 raise error.ParseError(err or _('not an integer'))
730
731
731 def evalstring(context, mapping, arg):
732 def evalstring(context, mapping, arg):
732 return stringify(context, mapping, evalrawexp(context, mapping, arg))
733 return stringify(context, mapping, evalrawexp(context, mapping, arg))
733
734
734 def evalstringliteral(context, mapping, arg):
735 def evalstringliteral(context, mapping, arg):
735 """Evaluate given argument as string template, but returns symbol name
736 """Evaluate given argument as string template, but returns symbol name
736 if it is unknown"""
737 if it is unknown"""
737 func, data = arg
738 func, data = arg
738 if func is runsymbol:
739 if func is runsymbol:
739 thing = func(context, mapping, data, default=data)
740 thing = func(context, mapping, data, default=data)
740 else:
741 else:
741 thing = func(context, mapping, data)
742 thing = func(context, mapping, data)
742 return stringify(context, mapping, thing)
743 return stringify(context, mapping, thing)
743
744
744 _unwrapfuncbytype = {
745 _unwrapfuncbytype = {
745 None: unwrapvalue,
746 None: unwrapvalue,
746 bytes: stringify,
747 bytes: stringify,
747 date: unwrapdate,
748 date: unwrapdate,
748 int: unwrapinteger,
749 int: unwrapinteger,
749 }
750 }
750
751
751 def unwrapastype(context, mapping, thing, typ):
752 def unwrapastype(context, mapping, thing, typ):
752 """Move the inner value object out of the wrapper and coerce its type"""
753 """Move the inner value object out of the wrapper and coerce its type"""
753 try:
754 try:
754 f = _unwrapfuncbytype[typ]
755 f = _unwrapfuncbytype[typ]
755 except KeyError:
756 except KeyError:
756 raise error.ProgrammingError('invalid type specified: %r' % typ)
757 raise error.ProgrammingError('invalid type specified: %r' % typ)
757 return f(context, mapping, thing)
758 return f(context, mapping, thing)
758
759
759 def runinteger(context, mapping, data):
760 def runinteger(context, mapping, data):
760 return int(data)
761 return int(data)
761
762
762 def runstring(context, mapping, data):
763 def runstring(context, mapping, data):
763 return data
764 return data
764
765
765 def _recursivesymbolblocker(key):
766 def _recursivesymbolblocker(key):
766 def showrecursion(**args):
767 def showrecursion(**args):
767 raise error.Abort(_("recursive reference '%s' in template") % key)
768 raise error.Abort(_("recursive reference '%s' in template") % key)
768 return showrecursion
769 return showrecursion
769
770
770 def runsymbol(context, mapping, key, default=''):
771 def runsymbol(context, mapping, key, default=''):
771 v = context.symbol(mapping, key)
772 v = context.symbol(mapping, key)
772 if v is None:
773 if v is None:
773 # put poison to cut recursion. we can't move this to parsing phase
774 # put poison to cut recursion. we can't move this to parsing phase
774 # because "x = {x}" is allowed if "x" is a keyword. (issue4758)
775 # because "x = {x}" is allowed if "x" is a keyword. (issue4758)
775 safemapping = mapping.copy()
776 safemapping = mapping.copy()
776 safemapping[key] = _recursivesymbolblocker(key)
777 safemapping[key] = _recursivesymbolblocker(key)
777 try:
778 try:
778 v = context.process(key, safemapping)
779 v = context.process(key, safemapping)
779 except TemplateNotFound:
780 except TemplateNotFound:
780 v = default
781 v = default
781 if callable(v) and getattr(v, '_requires', None) is None:
782 if callable(v) and getattr(v, '_requires', None) is None:
782 # old templatekw: expand all keywords and resources
783 # old templatekw: expand all keywords and resources
783 # (TODO: deprecate this after porting web template keywords to new API)
784 # (TODO: deprecate this after porting web template keywords to new API)
784 props = {k: context._resources.lookup(context, mapping, k)
785 props = {k: context._resources.lookup(context, mapping, k)
785 for k in context._resources.knownkeys()}
786 for k in context._resources.knownkeys()}
786 # pass context to _showcompatlist() through templatekw._showlist()
787 # pass context to _showcompatlist() through templatekw._showlist()
787 props['templ'] = context
788 props['templ'] = context
788 props.update(mapping)
789 props.update(mapping)
789 return v(**pycompat.strkwargs(props))
790 return v(**pycompat.strkwargs(props))
790 if callable(v):
791 if callable(v):
791 # new templatekw
792 # new templatekw
792 try:
793 try:
793 return v(context, mapping)
794 return v(context, mapping)
794 except ResourceUnavailable:
795 except ResourceUnavailable:
795 # unsupported keyword is mapped to empty just like unknown keyword
796 # unsupported keyword is mapped to empty just like unknown keyword
796 return None
797 return None
797 return v
798 return v
798
799
799 def runtemplate(context, mapping, template):
800 def runtemplate(context, mapping, template):
800 for arg in template:
801 for arg in template:
801 yield evalrawexp(context, mapping, arg)
802 yield evalrawexp(context, mapping, arg)
802
803
803 def runfilter(context, mapping, data):
804 def runfilter(context, mapping, data):
804 arg, filt = data
805 arg, filt = data
805 thing = evalrawexp(context, mapping, arg)
806 thing = evalrawexp(context, mapping, arg)
806 intype = getattr(filt, '_intype', None)
807 intype = getattr(filt, '_intype', None)
807 try:
808 try:
808 thing = unwrapastype(context, mapping, thing, intype)
809 thing = unwrapastype(context, mapping, thing, intype)
809 return filt(thing)
810 return filt(thing)
810 except error.ParseError as e:
811 except error.ParseError as e:
811 raise error.ParseError(bytes(e), hint=_formatfiltererror(arg, filt))
812 raise error.ParseError(bytes(e), hint=_formatfiltererror(arg, filt))
812
813
813 def _formatfiltererror(arg, filt):
814 def _formatfiltererror(arg, filt):
814 fn = pycompat.sysbytes(filt.__name__)
815 fn = pycompat.sysbytes(filt.__name__)
815 sym = findsymbolicname(arg)
816 sym = findsymbolicname(arg)
816 if not sym:
817 if not sym:
817 return _("incompatible use of template filter '%s'") % fn
818 return _("incompatible use of template filter '%s'") % fn
818 return (_("template filter '%s' is not compatible with keyword '%s'")
819 return (_("template filter '%s' is not compatible with keyword '%s'")
819 % (fn, sym))
820 % (fn, sym))
820
821
821 def _iteroverlaymaps(context, origmapping, newmappings):
822 def _iteroverlaymaps(context, origmapping, newmappings):
822 """Generate combined mappings from the original mapping and an iterable
823 """Generate combined mappings from the original mapping and an iterable
823 of partial mappings to override the original"""
824 of partial mappings to override the original"""
824 for i, nm in enumerate(newmappings):
825 for i, nm in enumerate(newmappings):
825 lm = context.overlaymap(origmapping, nm)
826 lm = context.overlaymap(origmapping, nm)
826 lm['index'] = i
827 lm['index'] = i
827 yield lm
828 yield lm
828
829
829 def _applymap(context, mapping, d, darg, targ):
830 def _applymap(context, mapping, d, darg, targ):
830 try:
831 try:
831 diter = d.itermaps(context)
832 diter = d.itermaps(context)
832 except error.ParseError as err:
833 except error.ParseError as err:
833 sym = findsymbolicname(darg)
834 sym = findsymbolicname(darg)
834 if not sym:
835 if not sym:
835 raise
836 raise
836 hint = _("keyword '%s' does not support map operation") % sym
837 hint = _("keyword '%s' does not support map operation") % sym
837 raise error.ParseError(bytes(err), hint=hint)
838 raise error.ParseError(bytes(err), hint=hint)
838 for lm in _iteroverlaymaps(context, mapping, diter):
839 for lm in _iteroverlaymaps(context, mapping, diter):
839 yield evalrawexp(context, lm, targ)
840 yield evalrawexp(context, lm, targ)
840
841
841 def runmap(context, mapping, data):
842 def runmap(context, mapping, data):
842 darg, targ = data
843 darg, targ = data
843 d = evalwrapped(context, mapping, darg)
844 d = evalwrapped(context, mapping, darg)
844 return mappedgenerator(_applymap, args=(mapping, d, darg, targ))
845 return mappedgenerator(_applymap, args=(mapping, d, darg, targ))
845
846
846 def runmember(context, mapping, data):
847 def runmember(context, mapping, data):
847 darg, memb = data
848 darg, memb = data
848 d = evalwrapped(context, mapping, darg)
849 d = evalwrapped(context, mapping, darg)
849 if isinstance(d, mappable):
850 if isinstance(d, mappable):
850 lm = context.overlaymap(mapping, d.tomap(context))
851 lm = context.overlaymap(mapping, d.tomap(context))
851 return runsymbol(context, lm, memb)
852 return runsymbol(context, lm, memb)
852 try:
853 try:
853 return d.getmember(context, mapping, memb)
854 return d.getmember(context, mapping, memb)
854 except error.ParseError as err:
855 except error.ParseError as err:
855 sym = findsymbolicname(darg)
856 sym = findsymbolicname(darg)
856 if not sym:
857 if not sym:
857 raise
858 raise
858 hint = _("keyword '%s' does not support member operation") % sym
859 hint = _("keyword '%s' does not support member operation") % sym
859 raise error.ParseError(bytes(err), hint=hint)
860 raise error.ParseError(bytes(err), hint=hint)
860
861
861 def runnegate(context, mapping, data):
862 def runnegate(context, mapping, data):
862 data = evalinteger(context, mapping, data,
863 data = evalinteger(context, mapping, data,
863 _('negation needs an integer argument'))
864 _('negation needs an integer argument'))
864 return -data
865 return -data
865
866
866 def runarithmetic(context, mapping, data):
867 def runarithmetic(context, mapping, data):
867 func, left, right = data
868 func, left, right = data
868 left = evalinteger(context, mapping, left,
869 left = evalinteger(context, mapping, left,
869 _('arithmetic only defined on integers'))
870 _('arithmetic only defined on integers'))
870 right = evalinteger(context, mapping, right,
871 right = evalinteger(context, mapping, right,
871 _('arithmetic only defined on integers'))
872 _('arithmetic only defined on integers'))
872 try:
873 try:
873 return func(left, right)
874 return func(left, right)
874 except ZeroDivisionError:
875 except ZeroDivisionError:
875 raise error.Abort(_('division by zero is not defined'))
876 raise error.Abort(_('division by zero is not defined'))
876
877
877 def joinitems(itemiter, sep):
878 def joinitems(itemiter, sep):
878 """Join items with the separator; Returns generator of bytes"""
879 """Join items with the separator; Returns generator of bytes"""
879 first = True
880 first = True
880 for x in itemiter:
881 for x in itemiter:
881 if first:
882 if first:
882 first = False
883 first = False
883 elif sep:
884 elif sep:
884 yield sep
885 yield sep
885 yield x
886 yield x
@@ -1,333 +1,333 b''
1 #testcases obsstore-off obsstore-on
1 #testcases obsstore-off obsstore-on
2
2
3 $ cat << EOF >> $HGRCPATH
3 $ cat << EOF >> $HGRCPATH
4 > [extensions]
4 > [extensions]
5 > amend=
5 > amend=
6 > debugdrawdag=$TESTDIR/drawdag.py
6 > debugdrawdag=$TESTDIR/drawdag.py
7 > [diff]
7 > [diff]
8 > git=1
8 > git=1
9 > EOF
9 > EOF
10
10
11 #if obsstore-on
11 #if obsstore-on
12 $ cat << EOF >> $HGRCPATH
12 $ cat << EOF >> $HGRCPATH
13 > [experimental]
13 > [experimental]
14 > evolution.createmarkers=True
14 > evolution.createmarkers=True
15 > EOF
15 > EOF
16 #endif
16 #endif
17
17
18 Basic amend
18 Basic amend
19
19
20 $ hg init repo1
20 $ hg init repo1
21 $ cd repo1
21 $ cd repo1
22 $ hg debugdrawdag <<'EOS'
22 $ hg debugdrawdag <<'EOS'
23 > B
23 > B
24 > |
24 > |
25 > A
25 > A
26 > EOS
26 > EOS
27
27
28 $ hg update B -q
28 $ hg update B -q
29 $ echo 2 >> B
29 $ echo 2 >> B
30
30
31 $ hg amend
31 $ hg amend
32 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/112478962961-7e959a55-amend.hg (obsstore-off !)
32 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/112478962961-7e959a55-amend.hg (obsstore-off !)
33 #if obsstore-off
33 #if obsstore-off
34 $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n'
34 $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n'
35 @ 1 be169c7e8dbe B
35 @ 1 be169c7e8dbe B
36 | diff --git a/B b/B
36 | diff --git a/B b/B
37 | new file mode 100644
37 | new file mode 100644
38 | --- /dev/null
38 | --- /dev/null
39 | +++ b/B
39 | +++ b/B
40 | @@ -0,0 +1,1 @@
40 | @@ -0,0 +1,1 @@
41 | +B2
41 | +B2
42 |
42 |
43 o 0 426bada5c675 A
43 o 0 426bada5c675 A
44 diff --git a/A b/A
44 diff --git a/A b/A
45 new file mode 100644
45 new file mode 100644
46 --- /dev/null
46 --- /dev/null
47 +++ b/A
47 +++ b/A
48 @@ -0,0 +1,1 @@
48 @@ -0,0 +1,1 @@
49 +A
49 +A
50 \ No newline at end of file
50 \ No newline at end of file
51
51
52 #else
52 #else
53 $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n'
53 $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n'
54 @ 2 be169c7e8dbe B
54 @ 2 be169c7e8dbe B
55 | diff --git a/B b/B
55 | diff --git a/B b/B
56 | new file mode 100644
56 | new file mode 100644
57 | --- /dev/null
57 | --- /dev/null
58 | +++ b/B
58 | +++ b/B
59 | @@ -0,0 +1,1 @@
59 | @@ -0,0 +1,1 @@
60 | +B2
60 | +B2
61 |
61 |
62 | x 1 112478962961 B
62 | x 1 112478962961 B
63 |/ diff --git a/B b/B
63 |/ diff --git a/B b/B
64 | new file mode 100644
64 | new file mode 100644
65 | --- /dev/null
65 | --- /dev/null
66 | +++ b/B
66 | +++ b/B
67 | @@ -0,0 +1,1 @@
67 | @@ -0,0 +1,1 @@
68 | +B
68 | +B
69 | \ No newline at end of file
69 | \ No newline at end of file
70 |
70 |
71 o 0 426bada5c675 A
71 o 0 426bada5c675 A
72 diff --git a/A b/A
72 diff --git a/A b/A
73 new file mode 100644
73 new file mode 100644
74 --- /dev/null
74 --- /dev/null
75 +++ b/A
75 +++ b/A
76 @@ -0,0 +1,1 @@
76 @@ -0,0 +1,1 @@
77 +A
77 +A
78 \ No newline at end of file
78 \ No newline at end of file
79
79
80 #endif
80 #endif
81
81
82 Nothing changed
82 Nothing changed
83
83
84 $ hg amend
84 $ hg amend
85 nothing changed
85 nothing changed
86 [1]
86 [1]
87
87
88 $ hg amend -d "0 0"
88 $ hg amend -d "0 0"
89 nothing changed
89 nothing changed
90 [1]
90 [1]
91
91
92 $ hg amend -d "Thu Jan 01 00:00:00 1970 UTC"
92 $ hg amend -d "Thu Jan 01 00:00:00 1970 UTC"
93 nothing changed
93 nothing changed
94 [1]
94 [1]
95
95
96 Matcher and metadata options
96 Matcher and metadata options
97
97
98 $ echo 3 > C
98 $ echo 3 > C
99 $ echo 4 > D
99 $ echo 4 > D
100 $ hg add C D
100 $ hg add C D
101 $ hg amend -m NEWMESSAGE -I C
101 $ hg amend -m NEWMESSAGE -I C
102 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/be169c7e8dbe-7684ddc5-amend.hg (obsstore-off !)
102 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/be169c7e8dbe-7684ddc5-amend.hg (obsstore-off !)
103 $ hg log -r . -T '{node|short} {desc} {files}\n'
103 $ hg log -r . -T '{node|short} {desc} {files}\n'
104 c7ba14d9075b NEWMESSAGE B C
104 c7ba14d9075b NEWMESSAGE B C
105 $ echo 5 > E
105 $ echo 5 > E
106 $ rm C
106 $ rm C
107 $ hg amend -d '2000 1000' -u 'Foo <foo@example.com>' -A C D
107 $ hg amend -d '2000 1000' -u 'Foo <foo@example.com>' -A C D
108 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/c7ba14d9075b-b3e76daa-amend.hg (obsstore-off !)
108 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/c7ba14d9075b-b3e76daa-amend.hg (obsstore-off !)
109 $ hg log -r . -T '{node|short} {desc} {files} {author} {date}\n'
109 $ hg log -r . -T '{node|short} {desc} {files} {author} {date}\n'
110 14f6c4bcc865 NEWMESSAGE B D Foo <foo@example.com> 2000 1000
110 14f6c4bcc865 NEWMESSAGE B D Foo <foo@example.com> 2000.01000
111
111
112 Amend with editor
112 Amend with editor
113
113
114 $ cat > $TESTTMP/prefix.sh <<'EOF'
114 $ cat > $TESTTMP/prefix.sh <<'EOF'
115 > printf 'EDITED: ' > $TESTTMP/msg
115 > printf 'EDITED: ' > $TESTTMP/msg
116 > cat "$1" >> $TESTTMP/msg
116 > cat "$1" >> $TESTTMP/msg
117 > mv $TESTTMP/msg "$1"
117 > mv $TESTTMP/msg "$1"
118 > EOF
118 > EOF
119 $ chmod +x $TESTTMP/prefix.sh
119 $ chmod +x $TESTTMP/prefix.sh
120
120
121 $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend --edit
121 $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend --edit
122 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/14f6c4bcc865-6591f15d-amend.hg (obsstore-off !)
122 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/14f6c4bcc865-6591f15d-amend.hg (obsstore-off !)
123 $ hg log -r . -T '{node|short} {desc}\n'
123 $ hg log -r . -T '{node|short} {desc}\n'
124 298f085230c3 EDITED: NEWMESSAGE
124 298f085230c3 EDITED: NEWMESSAGE
125 $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend -e -m MSG
125 $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend -e -m MSG
126 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/298f085230c3-d81a6ad3-amend.hg (obsstore-off !)
126 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/298f085230c3-d81a6ad3-amend.hg (obsstore-off !)
127 $ hg log -r . -T '{node|short} {desc}\n'
127 $ hg log -r . -T '{node|short} {desc}\n'
128 974f07f28537 EDITED: MSG
128 974f07f28537 EDITED: MSG
129
129
130 $ echo FOO > $TESTTMP/msg
130 $ echo FOO > $TESTTMP/msg
131 $ hg amend -l $TESTTMP/msg -m BAR
131 $ hg amend -l $TESTTMP/msg -m BAR
132 abort: options --message and --logfile are mutually exclusive
132 abort: options --message and --logfile are mutually exclusive
133 [255]
133 [255]
134 $ hg amend -l $TESTTMP/msg
134 $ hg amend -l $TESTTMP/msg
135 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/974f07f28537-edb6470a-amend.hg (obsstore-off !)
135 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/974f07f28537-edb6470a-amend.hg (obsstore-off !)
136 $ hg log -r . -T '{node|short} {desc}\n'
136 $ hg log -r . -T '{node|short} {desc}\n'
137 507be9bdac71 FOO
137 507be9bdac71 FOO
138
138
139 Interactive mode
139 Interactive mode
140
140
141 $ touch F G
141 $ touch F G
142 $ hg add F G
142 $ hg add F G
143 $ cat <<EOS | hg amend -i --config ui.interactive=1
143 $ cat <<EOS | hg amend -i --config ui.interactive=1
144 > y
144 > y
145 > n
145 > n
146 > EOS
146 > EOS
147 diff --git a/F b/F
147 diff --git a/F b/F
148 new file mode 100644
148 new file mode 100644
149 examine changes to 'F'? [Ynesfdaq?] y
149 examine changes to 'F'? [Ynesfdaq?] y
150
150
151 diff --git a/G b/G
151 diff --git a/G b/G
152 new file mode 100644
152 new file mode 100644
153 examine changes to 'G'? [Ynesfdaq?] n
153 examine changes to 'G'? [Ynesfdaq?] n
154
154
155 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/507be9bdac71-c8077452-amend.hg (obsstore-off !)
155 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/507be9bdac71-c8077452-amend.hg (obsstore-off !)
156 $ hg log -r . -T '{files}\n'
156 $ hg log -r . -T '{files}\n'
157 B D F
157 B D F
158
158
159 Amend in the middle of a stack
159 Amend in the middle of a stack
160
160
161 $ hg init $TESTTMP/repo2
161 $ hg init $TESTTMP/repo2
162 $ cd $TESTTMP/repo2
162 $ cd $TESTTMP/repo2
163 $ hg debugdrawdag <<'EOS'
163 $ hg debugdrawdag <<'EOS'
164 > C
164 > C
165 > |
165 > |
166 > B
166 > B
167 > |
167 > |
168 > A
168 > A
169 > EOS
169 > EOS
170
170
171 $ hg update -q B
171 $ hg update -q B
172 $ echo 2 >> B
172 $ echo 2 >> B
173 $ hg amend
173 $ hg amend
174 abort: cannot amend changeset with children
174 abort: cannot amend changeset with children
175 [255]
175 [255]
176
176
177 #if obsstore-on
177 #if obsstore-on
178
178
179 With allowunstable, amend could work in the middle of a stack
179 With allowunstable, amend could work in the middle of a stack
180
180
181 $ cat >> $HGRCPATH <<EOF
181 $ cat >> $HGRCPATH <<EOF
182 > [experimental]
182 > [experimental]
183 > evolution.createmarkers=True
183 > evolution.createmarkers=True
184 > evolution.allowunstable=True
184 > evolution.allowunstable=True
185 > EOF
185 > EOF
186
186
187 $ hg amend
187 $ hg amend
188 1 new orphan changesets
188 1 new orphan changesets
189 $ hg log -T '{rev} {node|short} {desc}\n' -G
189 $ hg log -T '{rev} {node|short} {desc}\n' -G
190 @ 3 be169c7e8dbe B
190 @ 3 be169c7e8dbe B
191 |
191 |
192 | * 2 26805aba1e60 C
192 | * 2 26805aba1e60 C
193 | |
193 | |
194 | x 1 112478962961 B
194 | x 1 112478962961 B
195 |/
195 |/
196 o 0 426bada5c675 A
196 o 0 426bada5c675 A
197
197
198 Checking the note stored in the obsmarker
198 Checking the note stored in the obsmarker
199
199
200 $ echo foo > bar
200 $ echo foo > bar
201 $ hg add bar
201 $ hg add bar
202 $ hg amend --note 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
202 $ hg amend --note 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
203 abort: cannot store a note of more than 255 bytes
203 abort: cannot store a note of more than 255 bytes
204 [255]
204 [255]
205 $ hg amend --note "adding bar"
205 $ hg amend --note "adding bar"
206 $ hg debugobsolete -r .
206 $ hg debugobsolete -r .
207 112478962961147124edd43549aedd1a335e44bf be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
207 112478962961147124edd43549aedd1a335e44bf be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
208 be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 16084da537dd8f84cfdb3055c633772269d62e1b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'adding bar', 'operation': 'amend', 'user': 'test'}
208 be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 16084da537dd8f84cfdb3055c633772269d62e1b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'adding bar', 'operation': 'amend', 'user': 'test'}
209 #endif
209 #endif
210
210
211 Cannot amend public changeset
211 Cannot amend public changeset
212
212
213 $ hg phase -r A --public
213 $ hg phase -r A --public
214 $ hg update -C -q A
214 $ hg update -C -q A
215 $ hg amend -m AMEND
215 $ hg amend -m AMEND
216 abort: cannot amend public changesets
216 abort: cannot amend public changesets
217 (see 'hg help phases' for details)
217 (see 'hg help phases' for details)
218 [255]
218 [255]
219
219
220 Amend a merge changeset
220 Amend a merge changeset
221
221
222 $ hg init $TESTTMP/repo3
222 $ hg init $TESTTMP/repo3
223 $ cd $TESTTMP/repo3
223 $ cd $TESTTMP/repo3
224 $ hg debugdrawdag <<'EOS'
224 $ hg debugdrawdag <<'EOS'
225 > C
225 > C
226 > /|
226 > /|
227 > A B
227 > A B
228 > EOS
228 > EOS
229 $ hg update -q C
229 $ hg update -q C
230 $ hg amend -m FOO
230 $ hg amend -m FOO
231 saved backup bundle to $TESTTMP/repo3/.hg/strip-backup/a35c07e8a2a4-15ff4612-amend.hg (obsstore-off !)
231 saved backup bundle to $TESTTMP/repo3/.hg/strip-backup/a35c07e8a2a4-15ff4612-amend.hg (obsstore-off !)
232 $ rm .hg/localtags
232 $ rm .hg/localtags
233 $ hg log -G -T '{desc}\n'
233 $ hg log -G -T '{desc}\n'
234 @ FOO
234 @ FOO
235 |\
235 |\
236 | o B
236 | o B
237 |
237 |
238 o A
238 o A
239
239
240
240
241 More complete test for status changes (issue5732)
241 More complete test for status changes (issue5732)
242 -------------------------------------------------
242 -------------------------------------------------
243
243
244 Generates history of files having 3 states, r0_r1_wc:
244 Generates history of files having 3 states, r0_r1_wc:
245
245
246 r0: ground (content/missing)
246 r0: ground (content/missing)
247 r1: old state to be amended (content/missing, where missing means removed)
247 r1: old state to be amended (content/missing, where missing means removed)
248 wc: changes to be included in r1 (content/missing-tracked/untracked)
248 wc: changes to be included in r1 (content/missing-tracked/untracked)
249
249
250 $ hg init $TESTTMP/wcstates
250 $ hg init $TESTTMP/wcstates
251 $ cd $TESTTMP/wcstates
251 $ cd $TESTTMP/wcstates
252
252
253 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 1
253 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 1
254 $ hg addremove -q --similarity 0
254 $ hg addremove -q --similarity 0
255 $ hg commit -m0
255 $ hg commit -m0
256
256
257 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 2
257 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 2
258 $ hg addremove -q --similarity 0
258 $ hg addremove -q --similarity 0
259 $ hg commit -m1
259 $ hg commit -m1
260
260
261 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 wc
261 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 wc
262 $ hg addremove -q --similarity 0
262 $ hg addremove -q --similarity 0
263 $ hg forget *_*_*-untracked
263 $ hg forget *_*_*-untracked
264 $ rm *_*_missing-*
264 $ rm *_*_missing-*
265
265
266 amend r1 to include wc changes
266 amend r1 to include wc changes
267
267
268 $ hg amend
268 $ hg amend
269 saved backup bundle to * (glob) (obsstore-off !)
269 saved backup bundle to * (glob) (obsstore-off !)
270
270
271 clean/modified/removed/added states of the amended revision
271 clean/modified/removed/added states of the amended revision
272
272
273 $ hg status --all --change . 'glob:content1_*_content1-tracked'
273 $ hg status --all --change . 'glob:content1_*_content1-tracked'
274 C content1_content1_content1-tracked
274 C content1_content1_content1-tracked
275 C content1_content2_content1-tracked
275 C content1_content2_content1-tracked
276 C content1_missing_content1-tracked
276 C content1_missing_content1-tracked
277 $ hg status --all --change . 'glob:content1_*_content[23]-tracked'
277 $ hg status --all --change . 'glob:content1_*_content[23]-tracked'
278 M content1_content1_content3-tracked
278 M content1_content1_content3-tracked
279 M content1_content2_content2-tracked
279 M content1_content2_content2-tracked
280 M content1_content2_content3-tracked
280 M content1_content2_content3-tracked
281 M content1_missing_content3-tracked
281 M content1_missing_content3-tracked
282 $ hg status --all --change . 'glob:content1_*_missing-tracked'
282 $ hg status --all --change . 'glob:content1_*_missing-tracked'
283 M content1_content2_missing-tracked
283 M content1_content2_missing-tracked
284 R content1_missing_missing-tracked
284 R content1_missing_missing-tracked
285 C content1_content1_missing-tracked
285 C content1_content1_missing-tracked
286 $ hg status --all --change . 'glob:content1_*_*-untracked'
286 $ hg status --all --change . 'glob:content1_*_*-untracked'
287 R content1_content1_content1-untracked
287 R content1_content1_content1-untracked
288 R content1_content1_content3-untracked
288 R content1_content1_content3-untracked
289 R content1_content1_missing-untracked
289 R content1_content1_missing-untracked
290 R content1_content2_content1-untracked
290 R content1_content2_content1-untracked
291 R content1_content2_content2-untracked
291 R content1_content2_content2-untracked
292 R content1_content2_content3-untracked
292 R content1_content2_content3-untracked
293 R content1_content2_missing-untracked
293 R content1_content2_missing-untracked
294 R content1_missing_content1-untracked
294 R content1_missing_content1-untracked
295 R content1_missing_content3-untracked
295 R content1_missing_content3-untracked
296 R content1_missing_missing-untracked
296 R content1_missing_missing-untracked
297 $ hg status --all --change . 'glob:missing_content2_*'
297 $ hg status --all --change . 'glob:missing_content2_*'
298 A missing_content2_content2-tracked
298 A missing_content2_content2-tracked
299 A missing_content2_content3-tracked
299 A missing_content2_content3-tracked
300 A missing_content2_missing-tracked
300 A missing_content2_missing-tracked
301 $ hg status --all --change . 'glob:missing_missing_*'
301 $ hg status --all --change . 'glob:missing_missing_*'
302 A missing_missing_content3-tracked
302 A missing_missing_content3-tracked
303
303
304 working directory should be all clean (with some missing/untracked files)
304 working directory should be all clean (with some missing/untracked files)
305
305
306 $ hg status --all 'glob:*_content?-tracked'
306 $ hg status --all 'glob:*_content?-tracked'
307 C content1_content1_content1-tracked
307 C content1_content1_content1-tracked
308 C content1_content1_content3-tracked
308 C content1_content1_content3-tracked
309 C content1_content2_content1-tracked
309 C content1_content2_content1-tracked
310 C content1_content2_content2-tracked
310 C content1_content2_content2-tracked
311 C content1_content2_content3-tracked
311 C content1_content2_content3-tracked
312 C content1_missing_content1-tracked
312 C content1_missing_content1-tracked
313 C content1_missing_content3-tracked
313 C content1_missing_content3-tracked
314 C missing_content2_content2-tracked
314 C missing_content2_content2-tracked
315 C missing_content2_content3-tracked
315 C missing_content2_content3-tracked
316 C missing_missing_content3-tracked
316 C missing_missing_content3-tracked
317 $ hg status --all 'glob:*_missing-tracked'
317 $ hg status --all 'glob:*_missing-tracked'
318 ! content1_content1_missing-tracked
318 ! content1_content1_missing-tracked
319 ! content1_content2_missing-tracked
319 ! content1_content2_missing-tracked
320 ! content1_missing_missing-tracked
320 ! content1_missing_missing-tracked
321 ! missing_content2_missing-tracked
321 ! missing_content2_missing-tracked
322 ! missing_missing_missing-tracked
322 ! missing_missing_missing-tracked
323 $ hg status --all 'glob:*-untracked'
323 $ hg status --all 'glob:*-untracked'
324 ? content1_content1_content1-untracked
324 ? content1_content1_content1-untracked
325 ? content1_content1_content3-untracked
325 ? content1_content1_content3-untracked
326 ? content1_content2_content1-untracked
326 ? content1_content2_content1-untracked
327 ? content1_content2_content2-untracked
327 ? content1_content2_content2-untracked
328 ? content1_content2_content3-untracked
328 ? content1_content2_content3-untracked
329 ? content1_missing_content1-untracked
329 ? content1_missing_content1-untracked
330 ? content1_missing_content3-untracked
330 ? content1_missing_content3-untracked
331 ? missing_content2_content2-untracked
331 ? missing_content2_content2-untracked
332 ? missing_content2_content3-untracked
332 ? missing_content2_content3-untracked
333 ? missing_missing_content3-untracked
333 ? missing_missing_content3-untracked
@@ -1,4991 +1,4991 b''
1 $ hg init a
1 $ hg init a
2 $ cd a
2 $ cd a
3 $ echo a > a
3 $ echo a > a
4 $ hg add a
4 $ hg add a
5 $ echo line 1 > b
5 $ echo line 1 > b
6 $ echo line 2 >> b
6 $ echo line 2 >> b
7 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
7 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
8
8
9 $ hg add b
9 $ hg add b
10 $ echo other 1 > c
10 $ echo other 1 > c
11 $ echo other 2 >> c
11 $ echo other 2 >> c
12 $ echo >> c
12 $ echo >> c
13 $ echo other 3 >> c
13 $ echo other 3 >> c
14 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
14 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
15
15
16 $ hg add c
16 $ hg add c
17 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
17 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
18 $ echo c >> c
18 $ echo c >> c
19 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
19 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
20
20
21 $ echo foo > .hg/branch
21 $ echo foo > .hg/branch
22 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
22 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
23
23
24 $ hg co -q 3
24 $ hg co -q 3
25 $ echo other 4 >> d
25 $ echo other 4 >> d
26 $ hg add d
26 $ hg add d
27 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
27 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
28
28
29 $ hg merge -q foo
29 $ hg merge -q foo
30 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
30 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
31
31
32 Test arithmetic operators have the right precedence:
32 Test arithmetic operators have the right precedence:
33
33
34 $ hg log -l 1 -T '{date(date, "%Y") + 5 * 10} {date(date, "%Y") - 2 * 3}\n'
34 $ hg log -l 1 -T '{date(date, "%Y") + 5 * 10} {date(date, "%Y") - 2 * 3}\n'
35 2020 1964
35 2020 1964
36 $ hg log -l 1 -T '{date(date, "%Y") * 5 + 10} {date(date, "%Y") * 3 - 2}\n'
36 $ hg log -l 1 -T '{date(date, "%Y") * 5 + 10} {date(date, "%Y") * 3 - 2}\n'
37 9860 5908
37 9860 5908
38
38
39 Test division:
39 Test division:
40
40
41 $ hg debugtemplate -r0 -v '{5 / 2} {mod(5, 2)}\n'
41 $ hg debugtemplate -r0 -v '{5 / 2} {mod(5, 2)}\n'
42 (template
42 (template
43 (/
43 (/
44 (integer '5')
44 (integer '5')
45 (integer '2'))
45 (integer '2'))
46 (string ' ')
46 (string ' ')
47 (func
47 (func
48 (symbol 'mod')
48 (symbol 'mod')
49 (list
49 (list
50 (integer '5')
50 (integer '5')
51 (integer '2')))
51 (integer '2')))
52 (string '\n'))
52 (string '\n'))
53 2 1
53 2 1
54 $ hg debugtemplate -r0 -v '{5 / -2} {mod(5, -2)}\n'
54 $ hg debugtemplate -r0 -v '{5 / -2} {mod(5, -2)}\n'
55 (template
55 (template
56 (/
56 (/
57 (integer '5')
57 (integer '5')
58 (negate
58 (negate
59 (integer '2')))
59 (integer '2')))
60 (string ' ')
60 (string ' ')
61 (func
61 (func
62 (symbol 'mod')
62 (symbol 'mod')
63 (list
63 (list
64 (integer '5')
64 (integer '5')
65 (negate
65 (negate
66 (integer '2'))))
66 (integer '2'))))
67 (string '\n'))
67 (string '\n'))
68 -3 -1
68 -3 -1
69 $ hg debugtemplate -r0 -v '{-5 / 2} {mod(-5, 2)}\n'
69 $ hg debugtemplate -r0 -v '{-5 / 2} {mod(-5, 2)}\n'
70 (template
70 (template
71 (/
71 (/
72 (negate
72 (negate
73 (integer '5'))
73 (integer '5'))
74 (integer '2'))
74 (integer '2'))
75 (string ' ')
75 (string ' ')
76 (func
76 (func
77 (symbol 'mod')
77 (symbol 'mod')
78 (list
78 (list
79 (negate
79 (negate
80 (integer '5'))
80 (integer '5'))
81 (integer '2')))
81 (integer '2')))
82 (string '\n'))
82 (string '\n'))
83 -3 1
83 -3 1
84 $ hg debugtemplate -r0 -v '{-5 / -2} {mod(-5, -2)}\n'
84 $ hg debugtemplate -r0 -v '{-5 / -2} {mod(-5, -2)}\n'
85 (template
85 (template
86 (/
86 (/
87 (negate
87 (negate
88 (integer '5'))
88 (integer '5'))
89 (negate
89 (negate
90 (integer '2')))
90 (integer '2')))
91 (string ' ')
91 (string ' ')
92 (func
92 (func
93 (symbol 'mod')
93 (symbol 'mod')
94 (list
94 (list
95 (negate
95 (negate
96 (integer '5'))
96 (integer '5'))
97 (negate
97 (negate
98 (integer '2'))))
98 (integer '2'))))
99 (string '\n'))
99 (string '\n'))
100 2 -1
100 2 -1
101
101
102 Filters bind closer than arithmetic:
102 Filters bind closer than arithmetic:
103
103
104 $ hg debugtemplate -r0 -v '{revset(".")|count - 1}\n'
104 $ hg debugtemplate -r0 -v '{revset(".")|count - 1}\n'
105 (template
105 (template
106 (-
106 (-
107 (|
107 (|
108 (func
108 (func
109 (symbol 'revset')
109 (symbol 'revset')
110 (string '.'))
110 (string '.'))
111 (symbol 'count'))
111 (symbol 'count'))
112 (integer '1'))
112 (integer '1'))
113 (string '\n'))
113 (string '\n'))
114 0
114 0
115
115
116 But negate binds closer still:
116 But negate binds closer still:
117
117
118 $ hg debugtemplate -r0 -v '{1-3|stringify}\n'
118 $ hg debugtemplate -r0 -v '{1-3|stringify}\n'
119 (template
119 (template
120 (-
120 (-
121 (integer '1')
121 (integer '1')
122 (|
122 (|
123 (integer '3')
123 (integer '3')
124 (symbol 'stringify')))
124 (symbol 'stringify')))
125 (string '\n'))
125 (string '\n'))
126 hg: parse error: arithmetic only defined on integers
126 hg: parse error: arithmetic only defined on integers
127 [255]
127 [255]
128 $ hg debugtemplate -r0 -v '{-3|stringify}\n'
128 $ hg debugtemplate -r0 -v '{-3|stringify}\n'
129 (template
129 (template
130 (|
130 (|
131 (negate
131 (negate
132 (integer '3'))
132 (integer '3'))
133 (symbol 'stringify'))
133 (symbol 'stringify'))
134 (string '\n'))
134 (string '\n'))
135 -3
135 -3
136
136
137 Filters bind as close as map operator:
137 Filters bind as close as map operator:
138
138
139 $ hg debugtemplate -r0 -v '{desc|splitlines % "{line}\n"}'
139 $ hg debugtemplate -r0 -v '{desc|splitlines % "{line}\n"}'
140 (template
140 (template
141 (%
141 (%
142 (|
142 (|
143 (symbol 'desc')
143 (symbol 'desc')
144 (symbol 'splitlines'))
144 (symbol 'splitlines'))
145 (template
145 (template
146 (symbol 'line')
146 (symbol 'line')
147 (string '\n'))))
147 (string '\n'))))
148 line 1
148 line 1
149 line 2
149 line 2
150
150
151 Keyword arguments:
151 Keyword arguments:
152
152
153 $ hg debugtemplate -r0 -v '{foo=bar|baz}'
153 $ hg debugtemplate -r0 -v '{foo=bar|baz}'
154 (template
154 (template
155 (keyvalue
155 (keyvalue
156 (symbol 'foo')
156 (symbol 'foo')
157 (|
157 (|
158 (symbol 'bar')
158 (symbol 'bar')
159 (symbol 'baz'))))
159 (symbol 'baz'))))
160 hg: parse error: can't use a key-value pair in this context
160 hg: parse error: can't use a key-value pair in this context
161 [255]
161 [255]
162
162
163 $ hg debugtemplate '{pad("foo", width=10, left=true)}\n'
163 $ hg debugtemplate '{pad("foo", width=10, left=true)}\n'
164 foo
164 foo
165
165
166 Call function which takes named arguments by filter syntax:
166 Call function which takes named arguments by filter syntax:
167
167
168 $ hg debugtemplate '{" "|separate}'
168 $ hg debugtemplate '{" "|separate}'
169 $ hg debugtemplate '{("not", "an", "argument", "list")|separate}'
169 $ hg debugtemplate '{("not", "an", "argument", "list")|separate}'
170 hg: parse error: unknown method 'list'
170 hg: parse error: unknown method 'list'
171 [255]
171 [255]
172
172
173 Second branch starting at nullrev:
173 Second branch starting at nullrev:
174
174
175 $ hg update null
175 $ hg update null
176 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
176 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
177 $ echo second > second
177 $ echo second > second
178 $ hg add second
178 $ hg add second
179 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
179 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
180 created new head
180 created new head
181
181
182 $ echo third > third
182 $ echo third > third
183 $ hg add third
183 $ hg add third
184 $ hg mv second fourth
184 $ hg mv second fourth
185 $ hg commit -m third -d "2020-01-01 10:01"
185 $ hg commit -m third -d "2020-01-01 10:01"
186
186
187 $ hg log --template '{join(file_copies, ",\n")}\n' -r .
187 $ hg log --template '{join(file_copies, ",\n")}\n' -r .
188 fourth (second)
188 fourth (second)
189 $ hg log -T '{file_copies % "{source} -> {name}\n"}' -r .
189 $ hg log -T '{file_copies % "{source} -> {name}\n"}' -r .
190 second -> fourth
190 second -> fourth
191 $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7
191 $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7
192 8 t
192 8 t
193 7 f
193 7 f
194
194
195 Working-directory revision has special identifiers, though they are still
195 Working-directory revision has special identifiers, though they are still
196 experimental:
196 experimental:
197
197
198 $ hg log -r 'wdir()' -T '{rev}:{node}\n'
198 $ hg log -r 'wdir()' -T '{rev}:{node}\n'
199 2147483647:ffffffffffffffffffffffffffffffffffffffff
199 2147483647:ffffffffffffffffffffffffffffffffffffffff
200
200
201 Some keywords are invalid for working-directory revision, but they should
201 Some keywords are invalid for working-directory revision, but they should
202 never cause crash:
202 never cause crash:
203
203
204 $ hg log -r 'wdir()' -T '{manifest}\n'
204 $ hg log -r 'wdir()' -T '{manifest}\n'
205
205
206
206
207 Internal resources shouldn't be exposed (issue5699):
207 Internal resources shouldn't be exposed (issue5699):
208
208
209 $ hg log -r. -T '{cache}{ctx}{repo}{revcache}{templ}{ui}'
209 $ hg log -r. -T '{cache}{ctx}{repo}{revcache}{templ}{ui}'
210
210
211 Never crash on internal resource not available:
211 Never crash on internal resource not available:
212
212
213 $ hg --cwd .. debugtemplate '{"c0bebeef"|shortest}\n'
213 $ hg --cwd .. debugtemplate '{"c0bebeef"|shortest}\n'
214 abort: template resource not available: ctx
214 abort: template resource not available: ctx
215 [255]
215 [255]
216
216
217 $ hg config -T '{author}'
217 $ hg config -T '{author}'
218
218
219 Quoting for ui.logtemplate
219 Quoting for ui.logtemplate
220
220
221 $ hg tip --config "ui.logtemplate={rev}\n"
221 $ hg tip --config "ui.logtemplate={rev}\n"
222 8
222 8
223 $ hg tip --config "ui.logtemplate='{rev}\n'"
223 $ hg tip --config "ui.logtemplate='{rev}\n'"
224 8
224 8
225 $ hg tip --config 'ui.logtemplate="{rev}\n"'
225 $ hg tip --config 'ui.logtemplate="{rev}\n"'
226 8
226 8
227 $ hg tip --config 'ui.logtemplate=n{rev}\n'
227 $ hg tip --config 'ui.logtemplate=n{rev}\n'
228 n8
228 n8
229
229
230 Make sure user/global hgrc does not affect tests
230 Make sure user/global hgrc does not affect tests
231
231
232 $ echo '[ui]' > .hg/hgrc
232 $ echo '[ui]' > .hg/hgrc
233 $ echo 'logtemplate =' >> .hg/hgrc
233 $ echo 'logtemplate =' >> .hg/hgrc
234 $ echo 'style =' >> .hg/hgrc
234 $ echo 'style =' >> .hg/hgrc
235
235
236 Add some simple styles to settings
236 Add some simple styles to settings
237
237
238 $ cat <<'EOF' >> .hg/hgrc
238 $ cat <<'EOF' >> .hg/hgrc
239 > [templates]
239 > [templates]
240 > simple = "{rev}\n"
240 > simple = "{rev}\n"
241 > simple2 = {rev}\n
241 > simple2 = {rev}\n
242 > rev = "should not precede {rev} keyword\n"
242 > rev = "should not precede {rev} keyword\n"
243 > EOF
243 > EOF
244
244
245 $ hg log -l1 -Tsimple
245 $ hg log -l1 -Tsimple
246 8
246 8
247 $ hg log -l1 -Tsimple2
247 $ hg log -l1 -Tsimple2
248 8
248 8
249 $ hg log -l1 -Trev
249 $ hg log -l1 -Trev
250 should not precede 8 keyword
250 should not precede 8 keyword
251 $ hg log -l1 -T '{simple}'
251 $ hg log -l1 -T '{simple}'
252 8
252 8
253
253
254 Map file shouldn't see user templates:
254 Map file shouldn't see user templates:
255
255
256 $ cat <<EOF > tmpl
256 $ cat <<EOF > tmpl
257 > changeset = 'nothing expanded:{simple}\n'
257 > changeset = 'nothing expanded:{simple}\n'
258 > EOF
258 > EOF
259 $ hg log -l1 --style ./tmpl
259 $ hg log -l1 --style ./tmpl
260 nothing expanded:
260 nothing expanded:
261
261
262 Test templates and style maps in files:
262 Test templates and style maps in files:
263
263
264 $ echo "{rev}" > tmpl
264 $ echo "{rev}" > tmpl
265 $ hg log -l1 -T./tmpl
265 $ hg log -l1 -T./tmpl
266 8
266 8
267 $ hg log -l1 -Tblah/blah
267 $ hg log -l1 -Tblah/blah
268 blah/blah (no-eol)
268 blah/blah (no-eol)
269
269
270 $ printf 'changeset = "{rev}\\n"\n' > map-simple
270 $ printf 'changeset = "{rev}\\n"\n' > map-simple
271 $ hg log -l1 -T./map-simple
271 $ hg log -l1 -T./map-simple
272 8
272 8
273
273
274 a map file may have [templates] and [templatealias] sections:
274 a map file may have [templates] and [templatealias] sections:
275
275
276 $ cat <<'EOF' > map-simple
276 $ cat <<'EOF' > map-simple
277 > [templates]
277 > [templates]
278 > changeset = "{a}\n"
278 > changeset = "{a}\n"
279 > [templatealias]
279 > [templatealias]
280 > a = rev
280 > a = rev
281 > EOF
281 > EOF
282 $ hg log -l1 -T./map-simple
282 $ hg log -l1 -T./map-simple
283 8
283 8
284
284
285 so it can be included in hgrc
285 so it can be included in hgrc
286
286
287 $ cat <<EOF > myhgrc
287 $ cat <<EOF > myhgrc
288 > %include $HGRCPATH
288 > %include $HGRCPATH
289 > %include map-simple
289 > %include map-simple
290 > [templates]
290 > [templates]
291 > foo = "{changeset}"
291 > foo = "{changeset}"
292 > EOF
292 > EOF
293 $ HGRCPATH=./myhgrc hg log -l1 -Tfoo
293 $ HGRCPATH=./myhgrc hg log -l1 -Tfoo
294 8
294 8
295 $ HGRCPATH=./myhgrc hg log -l1 -T'{a}\n'
295 $ HGRCPATH=./myhgrc hg log -l1 -T'{a}\n'
296 8
296 8
297
297
298 Test template map inheritance
298 Test template map inheritance
299
299
300 $ echo "__base__ = map-cmdline.default" > map-simple
300 $ echo "__base__ = map-cmdline.default" > map-simple
301 $ printf 'cset = "changeset: ***{rev}***\\n"\n' >> map-simple
301 $ printf 'cset = "changeset: ***{rev}***\\n"\n' >> map-simple
302 $ hg log -l1 -T./map-simple
302 $ hg log -l1 -T./map-simple
303 changeset: ***8***
303 changeset: ***8***
304 tag: tip
304 tag: tip
305 user: test
305 user: test
306 date: Wed Jan 01 10:01:00 2020 +0000
306 date: Wed Jan 01 10:01:00 2020 +0000
307 summary: third
307 summary: third
308
308
309
309
310 Test docheader, docfooter and separator in template map
310 Test docheader, docfooter and separator in template map
311
311
312 $ cat <<'EOF' > map-myjson
312 $ cat <<'EOF' > map-myjson
313 > docheader = '\{\n'
313 > docheader = '\{\n'
314 > docfooter = '\n}\n'
314 > docfooter = '\n}\n'
315 > separator = ',\n'
315 > separator = ',\n'
316 > changeset = ' {dict(rev, node|short)|json}'
316 > changeset = ' {dict(rev, node|short)|json}'
317 > EOF
317 > EOF
318 $ hg log -l2 -T./map-myjson
318 $ hg log -l2 -T./map-myjson
319 {
319 {
320 {"node": "95c24699272e", "rev": 8},
320 {"node": "95c24699272e", "rev": 8},
321 {"node": "29114dbae42b", "rev": 7}
321 {"node": "29114dbae42b", "rev": 7}
322 }
322 }
323
323
324 Test docheader, docfooter and separator in [templates] section
324 Test docheader, docfooter and separator in [templates] section
325
325
326 $ cat <<'EOF' >> .hg/hgrc
326 $ cat <<'EOF' >> .hg/hgrc
327 > [templates]
327 > [templates]
328 > myjson = ' {dict(rev, node|short)|json}'
328 > myjson = ' {dict(rev, node|short)|json}'
329 > myjson:docheader = '\{\n'
329 > myjson:docheader = '\{\n'
330 > myjson:docfooter = '\n}\n'
330 > myjson:docfooter = '\n}\n'
331 > myjson:separator = ',\n'
331 > myjson:separator = ',\n'
332 > :docheader = 'should not be selected as a docheader for literal templates\n'
332 > :docheader = 'should not be selected as a docheader for literal templates\n'
333 > EOF
333 > EOF
334 $ hg log -l2 -Tmyjson
334 $ hg log -l2 -Tmyjson
335 {
335 {
336 {"node": "95c24699272e", "rev": 8},
336 {"node": "95c24699272e", "rev": 8},
337 {"node": "29114dbae42b", "rev": 7}
337 {"node": "29114dbae42b", "rev": 7}
338 }
338 }
339 $ hg log -l1 -T'{rev}\n'
339 $ hg log -l1 -T'{rev}\n'
340 8
340 8
341
341
342 Template should precede style option
342 Template should precede style option
343
343
344 $ hg log -l1 --style default -T '{rev}\n'
344 $ hg log -l1 --style default -T '{rev}\n'
345 8
345 8
346
346
347 Add a commit with empty description, to ensure that the templates
347 Add a commit with empty description, to ensure that the templates
348 below will omit the description line.
348 below will omit the description line.
349
349
350 $ echo c >> c
350 $ echo c >> c
351 $ hg add c
351 $ hg add c
352 $ hg commit -qm ' '
352 $ hg commit -qm ' '
353
353
354 Default style is like normal output. Phases style should be the same
354 Default style is like normal output. Phases style should be the same
355 as default style, except for extra phase lines.
355 as default style, except for extra phase lines.
356
356
357 $ hg log > log.out
357 $ hg log > log.out
358 $ hg log --style default > style.out
358 $ hg log --style default > style.out
359 $ cmp log.out style.out || diff -u log.out style.out
359 $ cmp log.out style.out || diff -u log.out style.out
360 $ hg log -T phases > phases.out
360 $ hg log -T phases > phases.out
361 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
361 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
362 +phase: draft
362 +phase: draft
363 +phase: draft
363 +phase: draft
364 +phase: draft
364 +phase: draft
365 +phase: draft
365 +phase: draft
366 +phase: draft
366 +phase: draft
367 +phase: draft
367 +phase: draft
368 +phase: draft
368 +phase: draft
369 +phase: draft
369 +phase: draft
370 +phase: draft
370 +phase: draft
371 +phase: draft
371 +phase: draft
372
372
373 $ hg log -v > log.out
373 $ hg log -v > log.out
374 $ hg log -v --style default > style.out
374 $ hg log -v --style default > style.out
375 $ cmp log.out style.out || diff -u log.out style.out
375 $ cmp log.out style.out || diff -u log.out style.out
376 $ hg log -v -T phases > phases.out
376 $ hg log -v -T phases > phases.out
377 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
377 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
378 +phase: draft
378 +phase: draft
379 +phase: draft
379 +phase: draft
380 +phase: draft
380 +phase: draft
381 +phase: draft
381 +phase: draft
382 +phase: draft
382 +phase: draft
383 +phase: draft
383 +phase: draft
384 +phase: draft
384 +phase: draft
385 +phase: draft
385 +phase: draft
386 +phase: draft
386 +phase: draft
387 +phase: draft
387 +phase: draft
388
388
389 $ hg log -q > log.out
389 $ hg log -q > log.out
390 $ hg log -q --style default > style.out
390 $ hg log -q --style default > style.out
391 $ cmp log.out style.out || diff -u log.out style.out
391 $ cmp log.out style.out || diff -u log.out style.out
392 $ hg log -q -T phases > phases.out
392 $ hg log -q -T phases > phases.out
393 $ cmp log.out phases.out || diff -u log.out phases.out
393 $ cmp log.out phases.out || diff -u log.out phases.out
394
394
395 $ hg log --debug > log.out
395 $ hg log --debug > log.out
396 $ hg log --debug --style default > style.out
396 $ hg log --debug --style default > style.out
397 $ cmp log.out style.out || diff -u log.out style.out
397 $ cmp log.out style.out || diff -u log.out style.out
398 $ hg log --debug -T phases > phases.out
398 $ hg log --debug -T phases > phases.out
399 $ cmp log.out phases.out || diff -u log.out phases.out
399 $ cmp log.out phases.out || diff -u log.out phases.out
400
400
401 Default style of working-directory revision should also be the same (but
401 Default style of working-directory revision should also be the same (but
402 date may change while running tests):
402 date may change while running tests):
403
403
404 $ hg log -r 'wdir()' | sed 's|^date:.*|date:|' > log.out
404 $ hg log -r 'wdir()' | sed 's|^date:.*|date:|' > log.out
405 $ hg log -r 'wdir()' --style default | sed 's|^date:.*|date:|' > style.out
405 $ hg log -r 'wdir()' --style default | sed 's|^date:.*|date:|' > style.out
406 $ cmp log.out style.out || diff -u log.out style.out
406 $ cmp log.out style.out || diff -u log.out style.out
407
407
408 $ hg log -r 'wdir()' -v | sed 's|^date:.*|date:|' > log.out
408 $ hg log -r 'wdir()' -v | sed 's|^date:.*|date:|' > log.out
409 $ hg log -r 'wdir()' -v --style default | sed 's|^date:.*|date:|' > style.out
409 $ hg log -r 'wdir()' -v --style default | sed 's|^date:.*|date:|' > style.out
410 $ cmp log.out style.out || diff -u log.out style.out
410 $ cmp log.out style.out || diff -u log.out style.out
411
411
412 $ hg log -r 'wdir()' -q > log.out
412 $ hg log -r 'wdir()' -q > log.out
413 $ hg log -r 'wdir()' -q --style default > style.out
413 $ hg log -r 'wdir()' -q --style default > style.out
414 $ cmp log.out style.out || diff -u log.out style.out
414 $ cmp log.out style.out || diff -u log.out style.out
415
415
416 $ hg log -r 'wdir()' --debug | sed 's|^date:.*|date:|' > log.out
416 $ hg log -r 'wdir()' --debug | sed 's|^date:.*|date:|' > log.out
417 $ hg log -r 'wdir()' --debug --style default \
417 $ hg log -r 'wdir()' --debug --style default \
418 > | sed 's|^date:.*|date:|' > style.out
418 > | sed 's|^date:.*|date:|' > style.out
419 $ cmp log.out style.out || diff -u log.out style.out
419 $ cmp log.out style.out || diff -u log.out style.out
420
420
421 Default style should also preserve color information (issue2866):
421 Default style should also preserve color information (issue2866):
422
422
423 $ cp $HGRCPATH $HGRCPATH-bak
423 $ cp $HGRCPATH $HGRCPATH-bak
424 $ cat <<EOF >> $HGRCPATH
424 $ cat <<EOF >> $HGRCPATH
425 > [extensions]
425 > [extensions]
426 > color=
426 > color=
427 > EOF
427 > EOF
428
428
429 $ hg --color=debug log > log.out
429 $ hg --color=debug log > log.out
430 $ hg --color=debug log --style default > style.out
430 $ hg --color=debug log --style default > style.out
431 $ cmp log.out style.out || diff -u log.out style.out
431 $ cmp log.out style.out || diff -u log.out style.out
432 $ hg --color=debug log -T phases > phases.out
432 $ hg --color=debug log -T phases > phases.out
433 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
433 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
434 +[log.phase|phase: draft]
434 +[log.phase|phase: draft]
435 +[log.phase|phase: draft]
435 +[log.phase|phase: draft]
436 +[log.phase|phase: draft]
436 +[log.phase|phase: draft]
437 +[log.phase|phase: draft]
437 +[log.phase|phase: draft]
438 +[log.phase|phase: draft]
438 +[log.phase|phase: draft]
439 +[log.phase|phase: draft]
439 +[log.phase|phase: draft]
440 +[log.phase|phase: draft]
440 +[log.phase|phase: draft]
441 +[log.phase|phase: draft]
441 +[log.phase|phase: draft]
442 +[log.phase|phase: draft]
442 +[log.phase|phase: draft]
443 +[log.phase|phase: draft]
443 +[log.phase|phase: draft]
444
444
445 $ hg --color=debug -v log > log.out
445 $ hg --color=debug -v log > log.out
446 $ hg --color=debug -v log --style default > style.out
446 $ hg --color=debug -v log --style default > style.out
447 $ cmp log.out style.out || diff -u log.out style.out
447 $ cmp log.out style.out || diff -u log.out style.out
448 $ hg --color=debug -v log -T phases > phases.out
448 $ hg --color=debug -v log -T phases > phases.out
449 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
449 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
450 +[log.phase|phase: draft]
450 +[log.phase|phase: draft]
451 +[log.phase|phase: draft]
451 +[log.phase|phase: draft]
452 +[log.phase|phase: draft]
452 +[log.phase|phase: draft]
453 +[log.phase|phase: draft]
453 +[log.phase|phase: draft]
454 +[log.phase|phase: draft]
454 +[log.phase|phase: draft]
455 +[log.phase|phase: draft]
455 +[log.phase|phase: draft]
456 +[log.phase|phase: draft]
456 +[log.phase|phase: draft]
457 +[log.phase|phase: draft]
457 +[log.phase|phase: draft]
458 +[log.phase|phase: draft]
458 +[log.phase|phase: draft]
459 +[log.phase|phase: draft]
459 +[log.phase|phase: draft]
460
460
461 $ hg --color=debug -q log > log.out
461 $ hg --color=debug -q log > log.out
462 $ hg --color=debug -q log --style default > style.out
462 $ hg --color=debug -q log --style default > style.out
463 $ cmp log.out style.out || diff -u log.out style.out
463 $ cmp log.out style.out || diff -u log.out style.out
464 $ hg --color=debug -q log -T phases > phases.out
464 $ hg --color=debug -q log -T phases > phases.out
465 $ cmp log.out phases.out || diff -u log.out phases.out
465 $ cmp log.out phases.out || diff -u log.out phases.out
466
466
467 $ hg --color=debug --debug log > log.out
467 $ hg --color=debug --debug log > log.out
468 $ hg --color=debug --debug log --style default > style.out
468 $ hg --color=debug --debug log --style default > style.out
469 $ cmp log.out style.out || diff -u log.out style.out
469 $ cmp log.out style.out || diff -u log.out style.out
470 $ hg --color=debug --debug log -T phases > phases.out
470 $ hg --color=debug --debug log -T phases > phases.out
471 $ cmp log.out phases.out || diff -u log.out phases.out
471 $ cmp log.out phases.out || diff -u log.out phases.out
472
472
473 $ mv $HGRCPATH-bak $HGRCPATH
473 $ mv $HGRCPATH-bak $HGRCPATH
474
474
475 Remove commit with empty commit message, so as to not pollute further
475 Remove commit with empty commit message, so as to not pollute further
476 tests.
476 tests.
477
477
478 $ hg --config extensions.strip= strip -q .
478 $ hg --config extensions.strip= strip -q .
479
479
480 Revision with no copies (used to print a traceback):
480 Revision with no copies (used to print a traceback):
481
481
482 $ hg tip -v --template '\n'
482 $ hg tip -v --template '\n'
483
483
484
484
485 Compact style works:
485 Compact style works:
486
486
487 $ hg log -Tcompact
487 $ hg log -Tcompact
488 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
488 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
489 third
489 third
490
490
491 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
491 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
492 second
492 second
493
493
494 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
494 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
495 merge
495 merge
496
496
497 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
497 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
498 new head
498 new head
499
499
500 4 bbe44766e73d 1970-01-17 04:53 +0000 person
500 4 bbe44766e73d 1970-01-17 04:53 +0000 person
501 new branch
501 new branch
502
502
503 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
503 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
504 no user, no domain
504 no user, no domain
505
505
506 2 97054abb4ab8 1970-01-14 21:20 +0000 other
506 2 97054abb4ab8 1970-01-14 21:20 +0000 other
507 no person
507 no person
508
508
509 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
509 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
510 other 1
510 other 1
511
511
512 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
512 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
513 line 1
513 line 1
514
514
515
515
516 $ hg log -v --style compact
516 $ hg log -v --style compact
517 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
517 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
518 third
518 third
519
519
520 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
520 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
521 second
521 second
522
522
523 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
523 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
524 merge
524 merge
525
525
526 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
526 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
527 new head
527 new head
528
528
529 4 bbe44766e73d 1970-01-17 04:53 +0000 person
529 4 bbe44766e73d 1970-01-17 04:53 +0000 person
530 new branch
530 new branch
531
531
532 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
532 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
533 no user, no domain
533 no user, no domain
534
534
535 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
535 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
536 no person
536 no person
537
537
538 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
538 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
539 other 1
539 other 1
540 other 2
540 other 2
541
541
542 other 3
542 other 3
543
543
544 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
544 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
545 line 1
545 line 1
546 line 2
546 line 2
547
547
548
548
549 $ hg log --debug --style compact
549 $ hg log --debug --style compact
550 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
550 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
551 third
551 third
552
552
553 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
553 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
554 second
554 second
555
555
556 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
556 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
557 merge
557 merge
558
558
559 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
559 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
560 new head
560 new head
561
561
562 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
562 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
563 new branch
563 new branch
564
564
565 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
565 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
566 no user, no domain
566 no user, no domain
567
567
568 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
568 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
569 no person
569 no person
570
570
571 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
571 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
572 other 1
572 other 1
573 other 2
573 other 2
574
574
575 other 3
575 other 3
576
576
577 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
577 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
578 line 1
578 line 1
579 line 2
579 line 2
580
580
581
581
582 Test xml styles:
582 Test xml styles:
583
583
584 $ hg log --style xml -r 'not all()'
584 $ hg log --style xml -r 'not all()'
585 <?xml version="1.0"?>
585 <?xml version="1.0"?>
586 <log>
586 <log>
587 </log>
587 </log>
588
588
589 $ hg log --style xml
589 $ hg log --style xml
590 <?xml version="1.0"?>
590 <?xml version="1.0"?>
591 <log>
591 <log>
592 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
592 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
593 <tag>tip</tag>
593 <tag>tip</tag>
594 <author email="test">test</author>
594 <author email="test">test</author>
595 <date>2020-01-01T10:01:00+00:00</date>
595 <date>2020-01-01T10:01:00+00:00</date>
596 <msg xml:space="preserve">third</msg>
596 <msg xml:space="preserve">third</msg>
597 </logentry>
597 </logentry>
598 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
598 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
599 <parent revision="-1" node="0000000000000000000000000000000000000000" />
599 <parent revision="-1" node="0000000000000000000000000000000000000000" />
600 <author email="user@hostname">User Name</author>
600 <author email="user@hostname">User Name</author>
601 <date>1970-01-12T13:46:40+00:00</date>
601 <date>1970-01-12T13:46:40+00:00</date>
602 <msg xml:space="preserve">second</msg>
602 <msg xml:space="preserve">second</msg>
603 </logentry>
603 </logentry>
604 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
604 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
605 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
605 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
606 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
606 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
607 <author email="person">person</author>
607 <author email="person">person</author>
608 <date>1970-01-18T08:40:01+00:00</date>
608 <date>1970-01-18T08:40:01+00:00</date>
609 <msg xml:space="preserve">merge</msg>
609 <msg xml:space="preserve">merge</msg>
610 </logentry>
610 </logentry>
611 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
611 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
612 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
612 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
613 <author email="person">person</author>
613 <author email="person">person</author>
614 <date>1970-01-18T08:40:00+00:00</date>
614 <date>1970-01-18T08:40:00+00:00</date>
615 <msg xml:space="preserve">new head</msg>
615 <msg xml:space="preserve">new head</msg>
616 </logentry>
616 </logentry>
617 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
617 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
618 <branch>foo</branch>
618 <branch>foo</branch>
619 <author email="person">person</author>
619 <author email="person">person</author>
620 <date>1970-01-17T04:53:20+00:00</date>
620 <date>1970-01-17T04:53:20+00:00</date>
621 <msg xml:space="preserve">new branch</msg>
621 <msg xml:space="preserve">new branch</msg>
622 </logentry>
622 </logentry>
623 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
623 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
624 <author email="person">person</author>
624 <author email="person">person</author>
625 <date>1970-01-16T01:06:40+00:00</date>
625 <date>1970-01-16T01:06:40+00:00</date>
626 <msg xml:space="preserve">no user, no domain</msg>
626 <msg xml:space="preserve">no user, no domain</msg>
627 </logentry>
627 </logentry>
628 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
628 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
629 <author email="other@place">other</author>
629 <author email="other@place">other</author>
630 <date>1970-01-14T21:20:00+00:00</date>
630 <date>1970-01-14T21:20:00+00:00</date>
631 <msg xml:space="preserve">no person</msg>
631 <msg xml:space="preserve">no person</msg>
632 </logentry>
632 </logentry>
633 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
633 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
634 <author email="other@place">A. N. Other</author>
634 <author email="other@place">A. N. Other</author>
635 <date>1970-01-13T17:33:20+00:00</date>
635 <date>1970-01-13T17:33:20+00:00</date>
636 <msg xml:space="preserve">other 1
636 <msg xml:space="preserve">other 1
637 other 2
637 other 2
638
638
639 other 3</msg>
639 other 3</msg>
640 </logentry>
640 </logentry>
641 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
641 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
642 <author email="user@hostname">User Name</author>
642 <author email="user@hostname">User Name</author>
643 <date>1970-01-12T13:46:40+00:00</date>
643 <date>1970-01-12T13:46:40+00:00</date>
644 <msg xml:space="preserve">line 1
644 <msg xml:space="preserve">line 1
645 line 2</msg>
645 line 2</msg>
646 </logentry>
646 </logentry>
647 </log>
647 </log>
648
648
649 $ hg log -v --style xml
649 $ hg log -v --style xml
650 <?xml version="1.0"?>
650 <?xml version="1.0"?>
651 <log>
651 <log>
652 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
652 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
653 <tag>tip</tag>
653 <tag>tip</tag>
654 <author email="test">test</author>
654 <author email="test">test</author>
655 <date>2020-01-01T10:01:00+00:00</date>
655 <date>2020-01-01T10:01:00+00:00</date>
656 <msg xml:space="preserve">third</msg>
656 <msg xml:space="preserve">third</msg>
657 <paths>
657 <paths>
658 <path action="A">fourth</path>
658 <path action="A">fourth</path>
659 <path action="A">third</path>
659 <path action="A">third</path>
660 <path action="R">second</path>
660 <path action="R">second</path>
661 </paths>
661 </paths>
662 <copies>
662 <copies>
663 <copy source="second">fourth</copy>
663 <copy source="second">fourth</copy>
664 </copies>
664 </copies>
665 </logentry>
665 </logentry>
666 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
666 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
667 <parent revision="-1" node="0000000000000000000000000000000000000000" />
667 <parent revision="-1" node="0000000000000000000000000000000000000000" />
668 <author email="user@hostname">User Name</author>
668 <author email="user@hostname">User Name</author>
669 <date>1970-01-12T13:46:40+00:00</date>
669 <date>1970-01-12T13:46:40+00:00</date>
670 <msg xml:space="preserve">second</msg>
670 <msg xml:space="preserve">second</msg>
671 <paths>
671 <paths>
672 <path action="A">second</path>
672 <path action="A">second</path>
673 </paths>
673 </paths>
674 </logentry>
674 </logentry>
675 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
675 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
676 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
676 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
677 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
677 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
678 <author email="person">person</author>
678 <author email="person">person</author>
679 <date>1970-01-18T08:40:01+00:00</date>
679 <date>1970-01-18T08:40:01+00:00</date>
680 <msg xml:space="preserve">merge</msg>
680 <msg xml:space="preserve">merge</msg>
681 <paths>
681 <paths>
682 </paths>
682 </paths>
683 </logentry>
683 </logentry>
684 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
684 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
685 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
685 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
686 <author email="person">person</author>
686 <author email="person">person</author>
687 <date>1970-01-18T08:40:00+00:00</date>
687 <date>1970-01-18T08:40:00+00:00</date>
688 <msg xml:space="preserve">new head</msg>
688 <msg xml:space="preserve">new head</msg>
689 <paths>
689 <paths>
690 <path action="A">d</path>
690 <path action="A">d</path>
691 </paths>
691 </paths>
692 </logentry>
692 </logentry>
693 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
693 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
694 <branch>foo</branch>
694 <branch>foo</branch>
695 <author email="person">person</author>
695 <author email="person">person</author>
696 <date>1970-01-17T04:53:20+00:00</date>
696 <date>1970-01-17T04:53:20+00:00</date>
697 <msg xml:space="preserve">new branch</msg>
697 <msg xml:space="preserve">new branch</msg>
698 <paths>
698 <paths>
699 </paths>
699 </paths>
700 </logentry>
700 </logentry>
701 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
701 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
702 <author email="person">person</author>
702 <author email="person">person</author>
703 <date>1970-01-16T01:06:40+00:00</date>
703 <date>1970-01-16T01:06:40+00:00</date>
704 <msg xml:space="preserve">no user, no domain</msg>
704 <msg xml:space="preserve">no user, no domain</msg>
705 <paths>
705 <paths>
706 <path action="M">c</path>
706 <path action="M">c</path>
707 </paths>
707 </paths>
708 </logentry>
708 </logentry>
709 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
709 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
710 <author email="other@place">other</author>
710 <author email="other@place">other</author>
711 <date>1970-01-14T21:20:00+00:00</date>
711 <date>1970-01-14T21:20:00+00:00</date>
712 <msg xml:space="preserve">no person</msg>
712 <msg xml:space="preserve">no person</msg>
713 <paths>
713 <paths>
714 <path action="A">c</path>
714 <path action="A">c</path>
715 </paths>
715 </paths>
716 </logentry>
716 </logentry>
717 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
717 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
718 <author email="other@place">A. N. Other</author>
718 <author email="other@place">A. N. Other</author>
719 <date>1970-01-13T17:33:20+00:00</date>
719 <date>1970-01-13T17:33:20+00:00</date>
720 <msg xml:space="preserve">other 1
720 <msg xml:space="preserve">other 1
721 other 2
721 other 2
722
722
723 other 3</msg>
723 other 3</msg>
724 <paths>
724 <paths>
725 <path action="A">b</path>
725 <path action="A">b</path>
726 </paths>
726 </paths>
727 </logentry>
727 </logentry>
728 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
728 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
729 <author email="user@hostname">User Name</author>
729 <author email="user@hostname">User Name</author>
730 <date>1970-01-12T13:46:40+00:00</date>
730 <date>1970-01-12T13:46:40+00:00</date>
731 <msg xml:space="preserve">line 1
731 <msg xml:space="preserve">line 1
732 line 2</msg>
732 line 2</msg>
733 <paths>
733 <paths>
734 <path action="A">a</path>
734 <path action="A">a</path>
735 </paths>
735 </paths>
736 </logentry>
736 </logentry>
737 </log>
737 </log>
738
738
739 $ hg log --debug --style xml
739 $ hg log --debug --style xml
740 <?xml version="1.0"?>
740 <?xml version="1.0"?>
741 <log>
741 <log>
742 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
742 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
743 <tag>tip</tag>
743 <tag>tip</tag>
744 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
744 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
745 <parent revision="-1" node="0000000000000000000000000000000000000000" />
745 <parent revision="-1" node="0000000000000000000000000000000000000000" />
746 <author email="test">test</author>
746 <author email="test">test</author>
747 <date>2020-01-01T10:01:00+00:00</date>
747 <date>2020-01-01T10:01:00+00:00</date>
748 <msg xml:space="preserve">third</msg>
748 <msg xml:space="preserve">third</msg>
749 <paths>
749 <paths>
750 <path action="A">fourth</path>
750 <path action="A">fourth</path>
751 <path action="A">third</path>
751 <path action="A">third</path>
752 <path action="R">second</path>
752 <path action="R">second</path>
753 </paths>
753 </paths>
754 <copies>
754 <copies>
755 <copy source="second">fourth</copy>
755 <copy source="second">fourth</copy>
756 </copies>
756 </copies>
757 <extra key="branch">default</extra>
757 <extra key="branch">default</extra>
758 </logentry>
758 </logentry>
759 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
759 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
760 <parent revision="-1" node="0000000000000000000000000000000000000000" />
760 <parent revision="-1" node="0000000000000000000000000000000000000000" />
761 <parent revision="-1" node="0000000000000000000000000000000000000000" />
761 <parent revision="-1" node="0000000000000000000000000000000000000000" />
762 <author email="user@hostname">User Name</author>
762 <author email="user@hostname">User Name</author>
763 <date>1970-01-12T13:46:40+00:00</date>
763 <date>1970-01-12T13:46:40+00:00</date>
764 <msg xml:space="preserve">second</msg>
764 <msg xml:space="preserve">second</msg>
765 <paths>
765 <paths>
766 <path action="A">second</path>
766 <path action="A">second</path>
767 </paths>
767 </paths>
768 <extra key="branch">default</extra>
768 <extra key="branch">default</extra>
769 </logentry>
769 </logentry>
770 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
770 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
771 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
771 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
772 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
772 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
773 <author email="person">person</author>
773 <author email="person">person</author>
774 <date>1970-01-18T08:40:01+00:00</date>
774 <date>1970-01-18T08:40:01+00:00</date>
775 <msg xml:space="preserve">merge</msg>
775 <msg xml:space="preserve">merge</msg>
776 <paths>
776 <paths>
777 </paths>
777 </paths>
778 <extra key="branch">default</extra>
778 <extra key="branch">default</extra>
779 </logentry>
779 </logentry>
780 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
780 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
781 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
781 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
782 <parent revision="-1" node="0000000000000000000000000000000000000000" />
782 <parent revision="-1" node="0000000000000000000000000000000000000000" />
783 <author email="person">person</author>
783 <author email="person">person</author>
784 <date>1970-01-18T08:40:00+00:00</date>
784 <date>1970-01-18T08:40:00+00:00</date>
785 <msg xml:space="preserve">new head</msg>
785 <msg xml:space="preserve">new head</msg>
786 <paths>
786 <paths>
787 <path action="A">d</path>
787 <path action="A">d</path>
788 </paths>
788 </paths>
789 <extra key="branch">default</extra>
789 <extra key="branch">default</extra>
790 </logentry>
790 </logentry>
791 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
791 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
792 <branch>foo</branch>
792 <branch>foo</branch>
793 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
793 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
794 <parent revision="-1" node="0000000000000000000000000000000000000000" />
794 <parent revision="-1" node="0000000000000000000000000000000000000000" />
795 <author email="person">person</author>
795 <author email="person">person</author>
796 <date>1970-01-17T04:53:20+00:00</date>
796 <date>1970-01-17T04:53:20+00:00</date>
797 <msg xml:space="preserve">new branch</msg>
797 <msg xml:space="preserve">new branch</msg>
798 <paths>
798 <paths>
799 </paths>
799 </paths>
800 <extra key="branch">foo</extra>
800 <extra key="branch">foo</extra>
801 </logentry>
801 </logentry>
802 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
802 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
803 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
803 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
804 <parent revision="-1" node="0000000000000000000000000000000000000000" />
804 <parent revision="-1" node="0000000000000000000000000000000000000000" />
805 <author email="person">person</author>
805 <author email="person">person</author>
806 <date>1970-01-16T01:06:40+00:00</date>
806 <date>1970-01-16T01:06:40+00:00</date>
807 <msg xml:space="preserve">no user, no domain</msg>
807 <msg xml:space="preserve">no user, no domain</msg>
808 <paths>
808 <paths>
809 <path action="M">c</path>
809 <path action="M">c</path>
810 </paths>
810 </paths>
811 <extra key="branch">default</extra>
811 <extra key="branch">default</extra>
812 </logentry>
812 </logentry>
813 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
813 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
814 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
814 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
815 <parent revision="-1" node="0000000000000000000000000000000000000000" />
815 <parent revision="-1" node="0000000000000000000000000000000000000000" />
816 <author email="other@place">other</author>
816 <author email="other@place">other</author>
817 <date>1970-01-14T21:20:00+00:00</date>
817 <date>1970-01-14T21:20:00+00:00</date>
818 <msg xml:space="preserve">no person</msg>
818 <msg xml:space="preserve">no person</msg>
819 <paths>
819 <paths>
820 <path action="A">c</path>
820 <path action="A">c</path>
821 </paths>
821 </paths>
822 <extra key="branch">default</extra>
822 <extra key="branch">default</extra>
823 </logentry>
823 </logentry>
824 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
824 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
825 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
825 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
826 <parent revision="-1" node="0000000000000000000000000000000000000000" />
826 <parent revision="-1" node="0000000000000000000000000000000000000000" />
827 <author email="other@place">A. N. Other</author>
827 <author email="other@place">A. N. Other</author>
828 <date>1970-01-13T17:33:20+00:00</date>
828 <date>1970-01-13T17:33:20+00:00</date>
829 <msg xml:space="preserve">other 1
829 <msg xml:space="preserve">other 1
830 other 2
830 other 2
831
831
832 other 3</msg>
832 other 3</msg>
833 <paths>
833 <paths>
834 <path action="A">b</path>
834 <path action="A">b</path>
835 </paths>
835 </paths>
836 <extra key="branch">default</extra>
836 <extra key="branch">default</extra>
837 </logentry>
837 </logentry>
838 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
838 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
839 <parent revision="-1" node="0000000000000000000000000000000000000000" />
839 <parent revision="-1" node="0000000000000000000000000000000000000000" />
840 <parent revision="-1" node="0000000000000000000000000000000000000000" />
840 <parent revision="-1" node="0000000000000000000000000000000000000000" />
841 <author email="user@hostname">User Name</author>
841 <author email="user@hostname">User Name</author>
842 <date>1970-01-12T13:46:40+00:00</date>
842 <date>1970-01-12T13:46:40+00:00</date>
843 <msg xml:space="preserve">line 1
843 <msg xml:space="preserve">line 1
844 line 2</msg>
844 line 2</msg>
845 <paths>
845 <paths>
846 <path action="A">a</path>
846 <path action="A">a</path>
847 </paths>
847 </paths>
848 <extra key="branch">default</extra>
848 <extra key="branch">default</extra>
849 </logentry>
849 </logentry>
850 </log>
850 </log>
851
851
852
852
853 Test JSON style:
853 Test JSON style:
854
854
855 $ hg log -k nosuch -Tjson
855 $ hg log -k nosuch -Tjson
856 [
856 [
857 ]
857 ]
858
858
859 $ hg log -qr . -Tjson
859 $ hg log -qr . -Tjson
860 [
860 [
861 {
861 {
862 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
862 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
863 "rev": 8
863 "rev": 8
864 }
864 }
865 ]
865 ]
866
866
867 $ hg log -vpr . -Tjson --stat
867 $ hg log -vpr . -Tjson --stat
868 [
868 [
869 {
869 {
870 "bookmarks": [],
870 "bookmarks": [],
871 "branch": "default",
871 "branch": "default",
872 "date": [1577872860, 0],
872 "date": [1577872860, 0],
873 "desc": "third",
873 "desc": "third",
874 "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",
874 "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",
875 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
875 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
876 "files": ["fourth", "second", "third"],
876 "files": ["fourth", "second", "third"],
877 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
877 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
878 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
878 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
879 "phase": "draft",
879 "phase": "draft",
880 "rev": 8,
880 "rev": 8,
881 "tags": ["tip"],
881 "tags": ["tip"],
882 "user": "test"
882 "user": "test"
883 }
883 }
884 ]
884 ]
885
885
886 honor --git but not format-breaking diffopts
886 honor --git but not format-breaking diffopts
887 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
887 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
888 [
888 [
889 {
889 {
890 "bookmarks": [],
890 "bookmarks": [],
891 "branch": "default",
891 "branch": "default",
892 "date": [1577872860, 0],
892 "date": [1577872860, 0],
893 "desc": "third",
893 "desc": "third",
894 "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",
894 "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",
895 "files": ["fourth", "second", "third"],
895 "files": ["fourth", "second", "third"],
896 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
896 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
897 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
897 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
898 "phase": "draft",
898 "phase": "draft",
899 "rev": 8,
899 "rev": 8,
900 "tags": ["tip"],
900 "tags": ["tip"],
901 "user": "test"
901 "user": "test"
902 }
902 }
903 ]
903 ]
904
904
905 $ hg log -T json
905 $ hg log -T json
906 [
906 [
907 {
907 {
908 "bookmarks": [],
908 "bookmarks": [],
909 "branch": "default",
909 "branch": "default",
910 "date": [1577872860, 0],
910 "date": [1577872860, 0],
911 "desc": "third",
911 "desc": "third",
912 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
912 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
913 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
913 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
914 "phase": "draft",
914 "phase": "draft",
915 "rev": 8,
915 "rev": 8,
916 "tags": ["tip"],
916 "tags": ["tip"],
917 "user": "test"
917 "user": "test"
918 },
918 },
919 {
919 {
920 "bookmarks": [],
920 "bookmarks": [],
921 "branch": "default",
921 "branch": "default",
922 "date": [1000000, 0],
922 "date": [1000000, 0],
923 "desc": "second",
923 "desc": "second",
924 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
924 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
925 "parents": ["0000000000000000000000000000000000000000"],
925 "parents": ["0000000000000000000000000000000000000000"],
926 "phase": "draft",
926 "phase": "draft",
927 "rev": 7,
927 "rev": 7,
928 "tags": [],
928 "tags": [],
929 "user": "User Name <user@hostname>"
929 "user": "User Name <user@hostname>"
930 },
930 },
931 {
931 {
932 "bookmarks": [],
932 "bookmarks": [],
933 "branch": "default",
933 "branch": "default",
934 "date": [1500001, 0],
934 "date": [1500001, 0],
935 "desc": "merge",
935 "desc": "merge",
936 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
936 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
937 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
937 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
938 "phase": "draft",
938 "phase": "draft",
939 "rev": 6,
939 "rev": 6,
940 "tags": [],
940 "tags": [],
941 "user": "person"
941 "user": "person"
942 },
942 },
943 {
943 {
944 "bookmarks": [],
944 "bookmarks": [],
945 "branch": "default",
945 "branch": "default",
946 "date": [1500000, 0],
946 "date": [1500000, 0],
947 "desc": "new head",
947 "desc": "new head",
948 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
948 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
949 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
949 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
950 "phase": "draft",
950 "phase": "draft",
951 "rev": 5,
951 "rev": 5,
952 "tags": [],
952 "tags": [],
953 "user": "person"
953 "user": "person"
954 },
954 },
955 {
955 {
956 "bookmarks": [],
956 "bookmarks": [],
957 "branch": "foo",
957 "branch": "foo",
958 "date": [1400000, 0],
958 "date": [1400000, 0],
959 "desc": "new branch",
959 "desc": "new branch",
960 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
960 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
961 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
961 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
962 "phase": "draft",
962 "phase": "draft",
963 "rev": 4,
963 "rev": 4,
964 "tags": [],
964 "tags": [],
965 "user": "person"
965 "user": "person"
966 },
966 },
967 {
967 {
968 "bookmarks": [],
968 "bookmarks": [],
969 "branch": "default",
969 "branch": "default",
970 "date": [1300000, 0],
970 "date": [1300000, 0],
971 "desc": "no user, no domain",
971 "desc": "no user, no domain",
972 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
972 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
973 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
973 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
974 "phase": "draft",
974 "phase": "draft",
975 "rev": 3,
975 "rev": 3,
976 "tags": [],
976 "tags": [],
977 "user": "person"
977 "user": "person"
978 },
978 },
979 {
979 {
980 "bookmarks": [],
980 "bookmarks": [],
981 "branch": "default",
981 "branch": "default",
982 "date": [1200000, 0],
982 "date": [1200000, 0],
983 "desc": "no person",
983 "desc": "no person",
984 "node": "97054abb4ab824450e9164180baf491ae0078465",
984 "node": "97054abb4ab824450e9164180baf491ae0078465",
985 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
985 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
986 "phase": "draft",
986 "phase": "draft",
987 "rev": 2,
987 "rev": 2,
988 "tags": [],
988 "tags": [],
989 "user": "other@place"
989 "user": "other@place"
990 },
990 },
991 {
991 {
992 "bookmarks": [],
992 "bookmarks": [],
993 "branch": "default",
993 "branch": "default",
994 "date": [1100000, 0],
994 "date": [1100000, 0],
995 "desc": "other 1\nother 2\n\nother 3",
995 "desc": "other 1\nother 2\n\nother 3",
996 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
996 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
997 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
997 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
998 "phase": "draft",
998 "phase": "draft",
999 "rev": 1,
999 "rev": 1,
1000 "tags": [],
1000 "tags": [],
1001 "user": "A. N. Other <other@place>"
1001 "user": "A. N. Other <other@place>"
1002 },
1002 },
1003 {
1003 {
1004 "bookmarks": [],
1004 "bookmarks": [],
1005 "branch": "default",
1005 "branch": "default",
1006 "date": [1000000, 0],
1006 "date": [1000000, 0],
1007 "desc": "line 1\nline 2",
1007 "desc": "line 1\nline 2",
1008 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1008 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1009 "parents": ["0000000000000000000000000000000000000000"],
1009 "parents": ["0000000000000000000000000000000000000000"],
1010 "phase": "draft",
1010 "phase": "draft",
1011 "rev": 0,
1011 "rev": 0,
1012 "tags": [],
1012 "tags": [],
1013 "user": "User Name <user@hostname>"
1013 "user": "User Name <user@hostname>"
1014 }
1014 }
1015 ]
1015 ]
1016
1016
1017 $ hg heads -v -Tjson
1017 $ hg heads -v -Tjson
1018 [
1018 [
1019 {
1019 {
1020 "bookmarks": [],
1020 "bookmarks": [],
1021 "branch": "default",
1021 "branch": "default",
1022 "date": [1577872860, 0],
1022 "date": [1577872860, 0],
1023 "desc": "third",
1023 "desc": "third",
1024 "files": ["fourth", "second", "third"],
1024 "files": ["fourth", "second", "third"],
1025 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1025 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1026 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1026 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1027 "phase": "draft",
1027 "phase": "draft",
1028 "rev": 8,
1028 "rev": 8,
1029 "tags": ["tip"],
1029 "tags": ["tip"],
1030 "user": "test"
1030 "user": "test"
1031 },
1031 },
1032 {
1032 {
1033 "bookmarks": [],
1033 "bookmarks": [],
1034 "branch": "default",
1034 "branch": "default",
1035 "date": [1500001, 0],
1035 "date": [1500001, 0],
1036 "desc": "merge",
1036 "desc": "merge",
1037 "files": [],
1037 "files": [],
1038 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1038 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1039 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1039 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1040 "phase": "draft",
1040 "phase": "draft",
1041 "rev": 6,
1041 "rev": 6,
1042 "tags": [],
1042 "tags": [],
1043 "user": "person"
1043 "user": "person"
1044 },
1044 },
1045 {
1045 {
1046 "bookmarks": [],
1046 "bookmarks": [],
1047 "branch": "foo",
1047 "branch": "foo",
1048 "date": [1400000, 0],
1048 "date": [1400000, 0],
1049 "desc": "new branch",
1049 "desc": "new branch",
1050 "files": [],
1050 "files": [],
1051 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1051 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1052 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1052 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1053 "phase": "draft",
1053 "phase": "draft",
1054 "rev": 4,
1054 "rev": 4,
1055 "tags": [],
1055 "tags": [],
1056 "user": "person"
1056 "user": "person"
1057 }
1057 }
1058 ]
1058 ]
1059
1059
1060 $ hg log --debug -Tjson
1060 $ hg log --debug -Tjson
1061 [
1061 [
1062 {
1062 {
1063 "added": ["fourth", "third"],
1063 "added": ["fourth", "third"],
1064 "bookmarks": [],
1064 "bookmarks": [],
1065 "branch": "default",
1065 "branch": "default",
1066 "date": [1577872860, 0],
1066 "date": [1577872860, 0],
1067 "desc": "third",
1067 "desc": "third",
1068 "extra": {"branch": "default"},
1068 "extra": {"branch": "default"},
1069 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
1069 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
1070 "modified": [],
1070 "modified": [],
1071 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1071 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1072 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1072 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1073 "phase": "draft",
1073 "phase": "draft",
1074 "removed": ["second"],
1074 "removed": ["second"],
1075 "rev": 8,
1075 "rev": 8,
1076 "tags": ["tip"],
1076 "tags": ["tip"],
1077 "user": "test"
1077 "user": "test"
1078 },
1078 },
1079 {
1079 {
1080 "added": ["second"],
1080 "added": ["second"],
1081 "bookmarks": [],
1081 "bookmarks": [],
1082 "branch": "default",
1082 "branch": "default",
1083 "date": [1000000, 0],
1083 "date": [1000000, 0],
1084 "desc": "second",
1084 "desc": "second",
1085 "extra": {"branch": "default"},
1085 "extra": {"branch": "default"},
1086 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
1086 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
1087 "modified": [],
1087 "modified": [],
1088 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
1088 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
1089 "parents": ["0000000000000000000000000000000000000000"],
1089 "parents": ["0000000000000000000000000000000000000000"],
1090 "phase": "draft",
1090 "phase": "draft",
1091 "removed": [],
1091 "removed": [],
1092 "rev": 7,
1092 "rev": 7,
1093 "tags": [],
1093 "tags": [],
1094 "user": "User Name <user@hostname>"
1094 "user": "User Name <user@hostname>"
1095 },
1095 },
1096 {
1096 {
1097 "added": [],
1097 "added": [],
1098 "bookmarks": [],
1098 "bookmarks": [],
1099 "branch": "default",
1099 "branch": "default",
1100 "date": [1500001, 0],
1100 "date": [1500001, 0],
1101 "desc": "merge",
1101 "desc": "merge",
1102 "extra": {"branch": "default"},
1102 "extra": {"branch": "default"},
1103 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1103 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1104 "modified": [],
1104 "modified": [],
1105 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1105 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1106 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1106 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1107 "phase": "draft",
1107 "phase": "draft",
1108 "removed": [],
1108 "removed": [],
1109 "rev": 6,
1109 "rev": 6,
1110 "tags": [],
1110 "tags": [],
1111 "user": "person"
1111 "user": "person"
1112 },
1112 },
1113 {
1113 {
1114 "added": ["d"],
1114 "added": ["d"],
1115 "bookmarks": [],
1115 "bookmarks": [],
1116 "branch": "default",
1116 "branch": "default",
1117 "date": [1500000, 0],
1117 "date": [1500000, 0],
1118 "desc": "new head",
1118 "desc": "new head",
1119 "extra": {"branch": "default"},
1119 "extra": {"branch": "default"},
1120 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1120 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1121 "modified": [],
1121 "modified": [],
1122 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
1122 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
1123 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1123 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1124 "phase": "draft",
1124 "phase": "draft",
1125 "removed": [],
1125 "removed": [],
1126 "rev": 5,
1126 "rev": 5,
1127 "tags": [],
1127 "tags": [],
1128 "user": "person"
1128 "user": "person"
1129 },
1129 },
1130 {
1130 {
1131 "added": [],
1131 "added": [],
1132 "bookmarks": [],
1132 "bookmarks": [],
1133 "branch": "foo",
1133 "branch": "foo",
1134 "date": [1400000, 0],
1134 "date": [1400000, 0],
1135 "desc": "new branch",
1135 "desc": "new branch",
1136 "extra": {"branch": "foo"},
1136 "extra": {"branch": "foo"},
1137 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1137 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1138 "modified": [],
1138 "modified": [],
1139 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1139 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1140 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1140 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1141 "phase": "draft",
1141 "phase": "draft",
1142 "removed": [],
1142 "removed": [],
1143 "rev": 4,
1143 "rev": 4,
1144 "tags": [],
1144 "tags": [],
1145 "user": "person"
1145 "user": "person"
1146 },
1146 },
1147 {
1147 {
1148 "added": [],
1148 "added": [],
1149 "bookmarks": [],
1149 "bookmarks": [],
1150 "branch": "default",
1150 "branch": "default",
1151 "date": [1300000, 0],
1151 "date": [1300000, 0],
1152 "desc": "no user, no domain",
1152 "desc": "no user, no domain",
1153 "extra": {"branch": "default"},
1153 "extra": {"branch": "default"},
1154 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1154 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1155 "modified": ["c"],
1155 "modified": ["c"],
1156 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
1156 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
1157 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
1157 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
1158 "phase": "draft",
1158 "phase": "draft",
1159 "removed": [],
1159 "removed": [],
1160 "rev": 3,
1160 "rev": 3,
1161 "tags": [],
1161 "tags": [],
1162 "user": "person"
1162 "user": "person"
1163 },
1163 },
1164 {
1164 {
1165 "added": ["c"],
1165 "added": ["c"],
1166 "bookmarks": [],
1166 "bookmarks": [],
1167 "branch": "default",
1167 "branch": "default",
1168 "date": [1200000, 0],
1168 "date": [1200000, 0],
1169 "desc": "no person",
1169 "desc": "no person",
1170 "extra": {"branch": "default"},
1170 "extra": {"branch": "default"},
1171 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
1171 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
1172 "modified": [],
1172 "modified": [],
1173 "node": "97054abb4ab824450e9164180baf491ae0078465",
1173 "node": "97054abb4ab824450e9164180baf491ae0078465",
1174 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
1174 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
1175 "phase": "draft",
1175 "phase": "draft",
1176 "removed": [],
1176 "removed": [],
1177 "rev": 2,
1177 "rev": 2,
1178 "tags": [],
1178 "tags": [],
1179 "user": "other@place"
1179 "user": "other@place"
1180 },
1180 },
1181 {
1181 {
1182 "added": ["b"],
1182 "added": ["b"],
1183 "bookmarks": [],
1183 "bookmarks": [],
1184 "branch": "default",
1184 "branch": "default",
1185 "date": [1100000, 0],
1185 "date": [1100000, 0],
1186 "desc": "other 1\nother 2\n\nother 3",
1186 "desc": "other 1\nother 2\n\nother 3",
1187 "extra": {"branch": "default"},
1187 "extra": {"branch": "default"},
1188 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
1188 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
1189 "modified": [],
1189 "modified": [],
1190 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
1190 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
1191 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
1191 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
1192 "phase": "draft",
1192 "phase": "draft",
1193 "removed": [],
1193 "removed": [],
1194 "rev": 1,
1194 "rev": 1,
1195 "tags": [],
1195 "tags": [],
1196 "user": "A. N. Other <other@place>"
1196 "user": "A. N. Other <other@place>"
1197 },
1197 },
1198 {
1198 {
1199 "added": ["a"],
1199 "added": ["a"],
1200 "bookmarks": [],
1200 "bookmarks": [],
1201 "branch": "default",
1201 "branch": "default",
1202 "date": [1000000, 0],
1202 "date": [1000000, 0],
1203 "desc": "line 1\nline 2",
1203 "desc": "line 1\nline 2",
1204 "extra": {"branch": "default"},
1204 "extra": {"branch": "default"},
1205 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
1205 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
1206 "modified": [],
1206 "modified": [],
1207 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1207 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1208 "parents": ["0000000000000000000000000000000000000000"],
1208 "parents": ["0000000000000000000000000000000000000000"],
1209 "phase": "draft",
1209 "phase": "draft",
1210 "removed": [],
1210 "removed": [],
1211 "rev": 0,
1211 "rev": 0,
1212 "tags": [],
1212 "tags": [],
1213 "user": "User Name <user@hostname>"
1213 "user": "User Name <user@hostname>"
1214 }
1214 }
1215 ]
1215 ]
1216
1216
1217 Error if style not readable:
1217 Error if style not readable:
1218
1218
1219 #if unix-permissions no-root
1219 #if unix-permissions no-root
1220 $ touch q
1220 $ touch q
1221 $ chmod 0 q
1221 $ chmod 0 q
1222 $ hg log --style ./q
1222 $ hg log --style ./q
1223 abort: Permission denied: ./q
1223 abort: Permission denied: ./q
1224 [255]
1224 [255]
1225 #endif
1225 #endif
1226
1226
1227 Error if no style:
1227 Error if no style:
1228
1228
1229 $ hg log --style notexist
1229 $ hg log --style notexist
1230 abort: style 'notexist' not found
1230 abort: style 'notexist' not found
1231 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
1231 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
1232 [255]
1232 [255]
1233
1233
1234 $ hg log -T list
1234 $ hg log -T list
1235 available styles: bisect, changelog, compact, default, phases, show, status, xml
1235 available styles: bisect, changelog, compact, default, phases, show, status, xml
1236 abort: specify a template
1236 abort: specify a template
1237 [255]
1237 [255]
1238
1238
1239 Error if style missing key:
1239 Error if style missing key:
1240
1240
1241 $ echo 'q = q' > t
1241 $ echo 'q = q' > t
1242 $ hg log --style ./t
1242 $ hg log --style ./t
1243 abort: "changeset" not in template map
1243 abort: "changeset" not in template map
1244 [255]
1244 [255]
1245
1245
1246 Error if style missing value:
1246 Error if style missing value:
1247
1247
1248 $ echo 'changeset =' > t
1248 $ echo 'changeset =' > t
1249 $ hg log --style t
1249 $ hg log --style t
1250 hg: parse error at t:1: missing value
1250 hg: parse error at t:1: missing value
1251 [255]
1251 [255]
1252
1252
1253 Error if include fails:
1253 Error if include fails:
1254
1254
1255 $ echo 'changeset = q' >> t
1255 $ echo 'changeset = q' >> t
1256 #if unix-permissions no-root
1256 #if unix-permissions no-root
1257 $ hg log --style ./t
1257 $ hg log --style ./t
1258 abort: template file ./q: Permission denied
1258 abort: template file ./q: Permission denied
1259 [255]
1259 [255]
1260 $ rm -f q
1260 $ rm -f q
1261 #endif
1261 #endif
1262
1262
1263 Include works:
1263 Include works:
1264
1264
1265 $ echo '{rev}' > q
1265 $ echo '{rev}' > q
1266 $ hg log --style ./t
1266 $ hg log --style ./t
1267 8
1267 8
1268 7
1268 7
1269 6
1269 6
1270 5
1270 5
1271 4
1271 4
1272 3
1272 3
1273 2
1273 2
1274 1
1274 1
1275 0
1275 0
1276
1276
1277 Check that recursive reference does not fall into RuntimeError (issue4758):
1277 Check that recursive reference does not fall into RuntimeError (issue4758):
1278
1278
1279 common mistake:
1279 common mistake:
1280
1280
1281 $ cat << EOF > issue4758
1281 $ cat << EOF > issue4758
1282 > changeset = '{changeset}\n'
1282 > changeset = '{changeset}\n'
1283 > EOF
1283 > EOF
1284 $ hg log --style ./issue4758
1284 $ hg log --style ./issue4758
1285 abort: recursive reference 'changeset' in template
1285 abort: recursive reference 'changeset' in template
1286 [255]
1286 [255]
1287
1287
1288 circular reference:
1288 circular reference:
1289
1289
1290 $ cat << EOF > issue4758
1290 $ cat << EOF > issue4758
1291 > changeset = '{foo}'
1291 > changeset = '{foo}'
1292 > foo = '{changeset}'
1292 > foo = '{changeset}'
1293 > EOF
1293 > EOF
1294 $ hg log --style ./issue4758
1294 $ hg log --style ./issue4758
1295 abort: recursive reference 'foo' in template
1295 abort: recursive reference 'foo' in template
1296 [255]
1296 [255]
1297
1297
1298 buildmap() -> gettemplate(), where no thunk was made:
1298 buildmap() -> gettemplate(), where no thunk was made:
1299
1299
1300 $ cat << EOF > issue4758
1300 $ cat << EOF > issue4758
1301 > changeset = '{files % changeset}\n'
1301 > changeset = '{files % changeset}\n'
1302 > EOF
1302 > EOF
1303 $ hg log --style ./issue4758
1303 $ hg log --style ./issue4758
1304 abort: recursive reference 'changeset' in template
1304 abort: recursive reference 'changeset' in template
1305 [255]
1305 [255]
1306
1306
1307 not a recursion if a keyword of the same name exists:
1307 not a recursion if a keyword of the same name exists:
1308
1308
1309 $ cat << EOF > issue4758
1309 $ cat << EOF > issue4758
1310 > changeset = '{tags % rev}'
1310 > changeset = '{tags % rev}'
1311 > rev = '{rev} {tag}\n'
1311 > rev = '{rev} {tag}\n'
1312 > EOF
1312 > EOF
1313 $ hg log --style ./issue4758 -r tip
1313 $ hg log --style ./issue4758 -r tip
1314 8 tip
1314 8 tip
1315
1315
1316 Check that {phase} works correctly on parents:
1316 Check that {phase} works correctly on parents:
1317
1317
1318 $ cat << EOF > parentphase
1318 $ cat << EOF > parentphase
1319 > changeset_debug = '{rev} ({phase}):{parents}\n'
1319 > changeset_debug = '{rev} ({phase}):{parents}\n'
1320 > parent = ' {rev} ({phase})'
1320 > parent = ' {rev} ({phase})'
1321 > EOF
1321 > EOF
1322 $ hg phase -r 5 --public
1322 $ hg phase -r 5 --public
1323 $ hg phase -r 7 --secret --force
1323 $ hg phase -r 7 --secret --force
1324 $ hg log --debug -G --style ./parentphase
1324 $ hg log --debug -G --style ./parentphase
1325 @ 8 (secret): 7 (secret) -1 (public)
1325 @ 8 (secret): 7 (secret) -1 (public)
1326 |
1326 |
1327 o 7 (secret): -1 (public) -1 (public)
1327 o 7 (secret): -1 (public) -1 (public)
1328
1328
1329 o 6 (draft): 5 (public) 4 (draft)
1329 o 6 (draft): 5 (public) 4 (draft)
1330 |\
1330 |\
1331 | o 5 (public): 3 (public) -1 (public)
1331 | o 5 (public): 3 (public) -1 (public)
1332 | |
1332 | |
1333 o | 4 (draft): 3 (public) -1 (public)
1333 o | 4 (draft): 3 (public) -1 (public)
1334 |/
1334 |/
1335 o 3 (public): 2 (public) -1 (public)
1335 o 3 (public): 2 (public) -1 (public)
1336 |
1336 |
1337 o 2 (public): 1 (public) -1 (public)
1337 o 2 (public): 1 (public) -1 (public)
1338 |
1338 |
1339 o 1 (public): 0 (public) -1 (public)
1339 o 1 (public): 0 (public) -1 (public)
1340 |
1340 |
1341 o 0 (public): -1 (public) -1 (public)
1341 o 0 (public): -1 (public) -1 (public)
1342
1342
1343
1343
1344 Missing non-standard names give no error (backward compatibility):
1344 Missing non-standard names give no error (backward compatibility):
1345
1345
1346 $ echo "changeset = '{c}'" > t
1346 $ echo "changeset = '{c}'" > t
1347 $ hg log --style ./t
1347 $ hg log --style ./t
1348
1348
1349 Defining non-standard name works:
1349 Defining non-standard name works:
1350
1350
1351 $ cat <<EOF > t
1351 $ cat <<EOF > t
1352 > changeset = '{c}'
1352 > changeset = '{c}'
1353 > c = q
1353 > c = q
1354 > EOF
1354 > EOF
1355 $ hg log --style ./t
1355 $ hg log --style ./t
1356 8
1356 8
1357 7
1357 7
1358 6
1358 6
1359 5
1359 5
1360 4
1360 4
1361 3
1361 3
1362 2
1362 2
1363 1
1363 1
1364 0
1364 0
1365
1365
1366 ui.style works:
1366 ui.style works:
1367
1367
1368 $ echo '[ui]' > .hg/hgrc
1368 $ echo '[ui]' > .hg/hgrc
1369 $ echo 'style = t' >> .hg/hgrc
1369 $ echo 'style = t' >> .hg/hgrc
1370 $ hg log
1370 $ hg log
1371 8
1371 8
1372 7
1372 7
1373 6
1373 6
1374 5
1374 5
1375 4
1375 4
1376 3
1376 3
1377 2
1377 2
1378 1
1378 1
1379 0
1379 0
1380
1380
1381
1381
1382 Issue338:
1382 Issue338:
1383
1383
1384 $ hg log --style=changelog > changelog
1384 $ hg log --style=changelog > changelog
1385
1385
1386 $ cat changelog
1386 $ cat changelog
1387 2020-01-01 test <test>
1387 2020-01-01 test <test>
1388
1388
1389 * fourth, second, third:
1389 * fourth, second, third:
1390 third
1390 third
1391 [95c24699272e] [tip]
1391 [95c24699272e] [tip]
1392
1392
1393 1970-01-12 User Name <user@hostname>
1393 1970-01-12 User Name <user@hostname>
1394
1394
1395 * second:
1395 * second:
1396 second
1396 second
1397 [29114dbae42b]
1397 [29114dbae42b]
1398
1398
1399 1970-01-18 person <person>
1399 1970-01-18 person <person>
1400
1400
1401 * merge
1401 * merge
1402 [d41e714fe50d]
1402 [d41e714fe50d]
1403
1403
1404 * d:
1404 * d:
1405 new head
1405 new head
1406 [13207e5a10d9]
1406 [13207e5a10d9]
1407
1407
1408 1970-01-17 person <person>
1408 1970-01-17 person <person>
1409
1409
1410 * new branch
1410 * new branch
1411 [bbe44766e73d] <foo>
1411 [bbe44766e73d] <foo>
1412
1412
1413 1970-01-16 person <person>
1413 1970-01-16 person <person>
1414
1414
1415 * c:
1415 * c:
1416 no user, no domain
1416 no user, no domain
1417 [10e46f2dcbf4]
1417 [10e46f2dcbf4]
1418
1418
1419 1970-01-14 other <other@place>
1419 1970-01-14 other <other@place>
1420
1420
1421 * c:
1421 * c:
1422 no person
1422 no person
1423 [97054abb4ab8]
1423 [97054abb4ab8]
1424
1424
1425 1970-01-13 A. N. Other <other@place>
1425 1970-01-13 A. N. Other <other@place>
1426
1426
1427 * b:
1427 * b:
1428 other 1 other 2
1428 other 1 other 2
1429
1429
1430 other 3
1430 other 3
1431 [b608e9d1a3f0]
1431 [b608e9d1a3f0]
1432
1432
1433 1970-01-12 User Name <user@hostname>
1433 1970-01-12 User Name <user@hostname>
1434
1434
1435 * a:
1435 * a:
1436 line 1 line 2
1436 line 1 line 2
1437 [1e4e1b8f71e0]
1437 [1e4e1b8f71e0]
1438
1438
1439
1439
1440 Issue2130: xml output for 'hg heads' is malformed
1440 Issue2130: xml output for 'hg heads' is malformed
1441
1441
1442 $ hg heads --style changelog
1442 $ hg heads --style changelog
1443 2020-01-01 test <test>
1443 2020-01-01 test <test>
1444
1444
1445 * fourth, second, third:
1445 * fourth, second, third:
1446 third
1446 third
1447 [95c24699272e] [tip]
1447 [95c24699272e] [tip]
1448
1448
1449 1970-01-18 person <person>
1449 1970-01-18 person <person>
1450
1450
1451 * merge
1451 * merge
1452 [d41e714fe50d]
1452 [d41e714fe50d]
1453
1453
1454 1970-01-17 person <person>
1454 1970-01-17 person <person>
1455
1455
1456 * new branch
1456 * new branch
1457 [bbe44766e73d] <foo>
1457 [bbe44766e73d] <foo>
1458
1458
1459
1459
1460 Keys work:
1460 Keys work:
1461
1461
1462 $ for key in author branch branches date desc file_adds file_dels file_mods \
1462 $ for key in author branch branches date desc file_adds file_dels file_mods \
1463 > file_copies file_copies_switch files \
1463 > file_copies file_copies_switch files \
1464 > manifest node parents rev tags diffstat extras \
1464 > manifest node parents rev tags diffstat extras \
1465 > p1rev p2rev p1node p2node; do
1465 > p1rev p2rev p1node p2node; do
1466 > for mode in '' --verbose --debug; do
1466 > for mode in '' --verbose --debug; do
1467 > hg log $mode --template "$key$mode: {$key}\n"
1467 > hg log $mode --template "$key$mode: {$key}\n"
1468 > done
1468 > done
1469 > done
1469 > done
1470 author: test
1470 author: test
1471 author: User Name <user@hostname>
1471 author: User Name <user@hostname>
1472 author: person
1472 author: person
1473 author: person
1473 author: person
1474 author: person
1474 author: person
1475 author: person
1475 author: person
1476 author: other@place
1476 author: other@place
1477 author: A. N. Other <other@place>
1477 author: A. N. Other <other@place>
1478 author: User Name <user@hostname>
1478 author: User Name <user@hostname>
1479 author--verbose: test
1479 author--verbose: test
1480 author--verbose: User Name <user@hostname>
1480 author--verbose: User Name <user@hostname>
1481 author--verbose: person
1481 author--verbose: person
1482 author--verbose: person
1482 author--verbose: person
1483 author--verbose: person
1483 author--verbose: person
1484 author--verbose: person
1484 author--verbose: person
1485 author--verbose: other@place
1485 author--verbose: other@place
1486 author--verbose: A. N. Other <other@place>
1486 author--verbose: A. N. Other <other@place>
1487 author--verbose: User Name <user@hostname>
1487 author--verbose: User Name <user@hostname>
1488 author--debug: test
1488 author--debug: test
1489 author--debug: User Name <user@hostname>
1489 author--debug: User Name <user@hostname>
1490 author--debug: person
1490 author--debug: person
1491 author--debug: person
1491 author--debug: person
1492 author--debug: person
1492 author--debug: person
1493 author--debug: person
1493 author--debug: person
1494 author--debug: other@place
1494 author--debug: other@place
1495 author--debug: A. N. Other <other@place>
1495 author--debug: A. N. Other <other@place>
1496 author--debug: User Name <user@hostname>
1496 author--debug: User Name <user@hostname>
1497 branch: default
1497 branch: default
1498 branch: default
1498 branch: default
1499 branch: default
1499 branch: default
1500 branch: default
1500 branch: default
1501 branch: foo
1501 branch: foo
1502 branch: default
1502 branch: default
1503 branch: default
1503 branch: default
1504 branch: default
1504 branch: default
1505 branch: default
1505 branch: default
1506 branch--verbose: default
1506 branch--verbose: default
1507 branch--verbose: default
1507 branch--verbose: default
1508 branch--verbose: default
1508 branch--verbose: default
1509 branch--verbose: default
1509 branch--verbose: default
1510 branch--verbose: foo
1510 branch--verbose: foo
1511 branch--verbose: default
1511 branch--verbose: default
1512 branch--verbose: default
1512 branch--verbose: default
1513 branch--verbose: default
1513 branch--verbose: default
1514 branch--verbose: default
1514 branch--verbose: default
1515 branch--debug: default
1515 branch--debug: default
1516 branch--debug: default
1516 branch--debug: default
1517 branch--debug: default
1517 branch--debug: default
1518 branch--debug: default
1518 branch--debug: default
1519 branch--debug: foo
1519 branch--debug: foo
1520 branch--debug: default
1520 branch--debug: default
1521 branch--debug: default
1521 branch--debug: default
1522 branch--debug: default
1522 branch--debug: default
1523 branch--debug: default
1523 branch--debug: default
1524 branches:
1524 branches:
1525 branches:
1525 branches:
1526 branches:
1526 branches:
1527 branches:
1527 branches:
1528 branches: foo
1528 branches: foo
1529 branches:
1529 branches:
1530 branches:
1530 branches:
1531 branches:
1531 branches:
1532 branches:
1532 branches:
1533 branches--verbose:
1533 branches--verbose:
1534 branches--verbose:
1534 branches--verbose:
1535 branches--verbose:
1535 branches--verbose:
1536 branches--verbose:
1536 branches--verbose:
1537 branches--verbose: foo
1537 branches--verbose: foo
1538 branches--verbose:
1538 branches--verbose:
1539 branches--verbose:
1539 branches--verbose:
1540 branches--verbose:
1540 branches--verbose:
1541 branches--verbose:
1541 branches--verbose:
1542 branches--debug:
1542 branches--debug:
1543 branches--debug:
1543 branches--debug:
1544 branches--debug:
1544 branches--debug:
1545 branches--debug:
1545 branches--debug:
1546 branches--debug: foo
1546 branches--debug: foo
1547 branches--debug:
1547 branches--debug:
1548 branches--debug:
1548 branches--debug:
1549 branches--debug:
1549 branches--debug:
1550 branches--debug:
1550 branches--debug:
1551 date: 1577872860 0
1551 date: 1577872860.00
1552 date: 1000000 0
1552 date: 1000000.00
1553 date: 1500001 0
1553 date: 1500001.00
1554 date: 1500000 0
1554 date: 1500000.00
1555 date: 1400000 0
1555 date: 1400000.00
1556 date: 1300000 0
1556 date: 1300000.00
1557 date: 1200000 0
1557 date: 1200000.00
1558 date: 1100000 0
1558 date: 1100000.00
1559 date: 1000000 0
1559 date: 1000000.00
1560 date--verbose: 1577872860 0
1560 date--verbose: 1577872860.00
1561 date--verbose: 1000000 0
1561 date--verbose: 1000000.00
1562 date--verbose: 1500001 0
1562 date--verbose: 1500001.00
1563 date--verbose: 1500000 0
1563 date--verbose: 1500000.00
1564 date--verbose: 1400000 0
1564 date--verbose: 1400000.00
1565 date--verbose: 1300000 0
1565 date--verbose: 1300000.00
1566 date--verbose: 1200000 0
1566 date--verbose: 1200000.00
1567 date--verbose: 1100000 0
1567 date--verbose: 1100000.00
1568 date--verbose: 1000000 0
1568 date--verbose: 1000000.00
1569 date--debug: 1577872860 0
1569 date--debug: 1577872860.00
1570 date--debug: 1000000 0
1570 date--debug: 1000000.00
1571 date--debug: 1500001 0
1571 date--debug: 1500001.00
1572 date--debug: 1500000 0
1572 date--debug: 1500000.00
1573 date--debug: 1400000 0
1573 date--debug: 1400000.00
1574 date--debug: 1300000 0
1574 date--debug: 1300000.00
1575 date--debug: 1200000 0
1575 date--debug: 1200000.00
1576 date--debug: 1100000 0
1576 date--debug: 1100000.00
1577 date--debug: 1000000 0
1577 date--debug: 1000000.00
1578 desc: third
1578 desc: third
1579 desc: second
1579 desc: second
1580 desc: merge
1580 desc: merge
1581 desc: new head
1581 desc: new head
1582 desc: new branch
1582 desc: new branch
1583 desc: no user, no domain
1583 desc: no user, no domain
1584 desc: no person
1584 desc: no person
1585 desc: other 1
1585 desc: other 1
1586 other 2
1586 other 2
1587
1587
1588 other 3
1588 other 3
1589 desc: line 1
1589 desc: line 1
1590 line 2
1590 line 2
1591 desc--verbose: third
1591 desc--verbose: third
1592 desc--verbose: second
1592 desc--verbose: second
1593 desc--verbose: merge
1593 desc--verbose: merge
1594 desc--verbose: new head
1594 desc--verbose: new head
1595 desc--verbose: new branch
1595 desc--verbose: new branch
1596 desc--verbose: no user, no domain
1596 desc--verbose: no user, no domain
1597 desc--verbose: no person
1597 desc--verbose: no person
1598 desc--verbose: other 1
1598 desc--verbose: other 1
1599 other 2
1599 other 2
1600
1600
1601 other 3
1601 other 3
1602 desc--verbose: line 1
1602 desc--verbose: line 1
1603 line 2
1603 line 2
1604 desc--debug: third
1604 desc--debug: third
1605 desc--debug: second
1605 desc--debug: second
1606 desc--debug: merge
1606 desc--debug: merge
1607 desc--debug: new head
1607 desc--debug: new head
1608 desc--debug: new branch
1608 desc--debug: new branch
1609 desc--debug: no user, no domain
1609 desc--debug: no user, no domain
1610 desc--debug: no person
1610 desc--debug: no person
1611 desc--debug: other 1
1611 desc--debug: other 1
1612 other 2
1612 other 2
1613
1613
1614 other 3
1614 other 3
1615 desc--debug: line 1
1615 desc--debug: line 1
1616 line 2
1616 line 2
1617 file_adds: fourth third
1617 file_adds: fourth third
1618 file_adds: second
1618 file_adds: second
1619 file_adds:
1619 file_adds:
1620 file_adds: d
1620 file_adds: d
1621 file_adds:
1621 file_adds:
1622 file_adds:
1622 file_adds:
1623 file_adds: c
1623 file_adds: c
1624 file_adds: b
1624 file_adds: b
1625 file_adds: a
1625 file_adds: a
1626 file_adds--verbose: fourth third
1626 file_adds--verbose: fourth third
1627 file_adds--verbose: second
1627 file_adds--verbose: second
1628 file_adds--verbose:
1628 file_adds--verbose:
1629 file_adds--verbose: d
1629 file_adds--verbose: d
1630 file_adds--verbose:
1630 file_adds--verbose:
1631 file_adds--verbose:
1631 file_adds--verbose:
1632 file_adds--verbose: c
1632 file_adds--verbose: c
1633 file_adds--verbose: b
1633 file_adds--verbose: b
1634 file_adds--verbose: a
1634 file_adds--verbose: a
1635 file_adds--debug: fourth third
1635 file_adds--debug: fourth third
1636 file_adds--debug: second
1636 file_adds--debug: second
1637 file_adds--debug:
1637 file_adds--debug:
1638 file_adds--debug: d
1638 file_adds--debug: d
1639 file_adds--debug:
1639 file_adds--debug:
1640 file_adds--debug:
1640 file_adds--debug:
1641 file_adds--debug: c
1641 file_adds--debug: c
1642 file_adds--debug: b
1642 file_adds--debug: b
1643 file_adds--debug: a
1643 file_adds--debug: a
1644 file_dels: second
1644 file_dels: second
1645 file_dels:
1645 file_dels:
1646 file_dels:
1646 file_dels:
1647 file_dels:
1647 file_dels:
1648 file_dels:
1648 file_dels:
1649 file_dels:
1649 file_dels:
1650 file_dels:
1650 file_dels:
1651 file_dels:
1651 file_dels:
1652 file_dels:
1652 file_dels:
1653 file_dels--verbose: second
1653 file_dels--verbose: second
1654 file_dels--verbose:
1654 file_dels--verbose:
1655 file_dels--verbose:
1655 file_dels--verbose:
1656 file_dels--verbose:
1656 file_dels--verbose:
1657 file_dels--verbose:
1657 file_dels--verbose:
1658 file_dels--verbose:
1658 file_dels--verbose:
1659 file_dels--verbose:
1659 file_dels--verbose:
1660 file_dels--verbose:
1660 file_dels--verbose:
1661 file_dels--verbose:
1661 file_dels--verbose:
1662 file_dels--debug: second
1662 file_dels--debug: second
1663 file_dels--debug:
1663 file_dels--debug:
1664 file_dels--debug:
1664 file_dels--debug:
1665 file_dels--debug:
1665 file_dels--debug:
1666 file_dels--debug:
1666 file_dels--debug:
1667 file_dels--debug:
1667 file_dels--debug:
1668 file_dels--debug:
1668 file_dels--debug:
1669 file_dels--debug:
1669 file_dels--debug:
1670 file_dels--debug:
1670 file_dels--debug:
1671 file_mods:
1671 file_mods:
1672 file_mods:
1672 file_mods:
1673 file_mods:
1673 file_mods:
1674 file_mods:
1674 file_mods:
1675 file_mods:
1675 file_mods:
1676 file_mods: c
1676 file_mods: c
1677 file_mods:
1677 file_mods:
1678 file_mods:
1678 file_mods:
1679 file_mods:
1679 file_mods:
1680 file_mods--verbose:
1680 file_mods--verbose:
1681 file_mods--verbose:
1681 file_mods--verbose:
1682 file_mods--verbose:
1682 file_mods--verbose:
1683 file_mods--verbose:
1683 file_mods--verbose:
1684 file_mods--verbose:
1684 file_mods--verbose:
1685 file_mods--verbose: c
1685 file_mods--verbose: c
1686 file_mods--verbose:
1686 file_mods--verbose:
1687 file_mods--verbose:
1687 file_mods--verbose:
1688 file_mods--verbose:
1688 file_mods--verbose:
1689 file_mods--debug:
1689 file_mods--debug:
1690 file_mods--debug:
1690 file_mods--debug:
1691 file_mods--debug:
1691 file_mods--debug:
1692 file_mods--debug:
1692 file_mods--debug:
1693 file_mods--debug:
1693 file_mods--debug:
1694 file_mods--debug: c
1694 file_mods--debug: c
1695 file_mods--debug:
1695 file_mods--debug:
1696 file_mods--debug:
1696 file_mods--debug:
1697 file_mods--debug:
1697 file_mods--debug:
1698 file_copies: fourth (second)
1698 file_copies: fourth (second)
1699 file_copies:
1699 file_copies:
1700 file_copies:
1700 file_copies:
1701 file_copies:
1701 file_copies:
1702 file_copies:
1702 file_copies:
1703 file_copies:
1703 file_copies:
1704 file_copies:
1704 file_copies:
1705 file_copies:
1705 file_copies:
1706 file_copies:
1706 file_copies:
1707 file_copies--verbose: fourth (second)
1707 file_copies--verbose: fourth (second)
1708 file_copies--verbose:
1708 file_copies--verbose:
1709 file_copies--verbose:
1709 file_copies--verbose:
1710 file_copies--verbose:
1710 file_copies--verbose:
1711 file_copies--verbose:
1711 file_copies--verbose:
1712 file_copies--verbose:
1712 file_copies--verbose:
1713 file_copies--verbose:
1713 file_copies--verbose:
1714 file_copies--verbose:
1714 file_copies--verbose:
1715 file_copies--verbose:
1715 file_copies--verbose:
1716 file_copies--debug: fourth (second)
1716 file_copies--debug: fourth (second)
1717 file_copies--debug:
1717 file_copies--debug:
1718 file_copies--debug:
1718 file_copies--debug:
1719 file_copies--debug:
1719 file_copies--debug:
1720 file_copies--debug:
1720 file_copies--debug:
1721 file_copies--debug:
1721 file_copies--debug:
1722 file_copies--debug:
1722 file_copies--debug:
1723 file_copies--debug:
1723 file_copies--debug:
1724 file_copies--debug:
1724 file_copies--debug:
1725 file_copies_switch:
1725 file_copies_switch:
1726 file_copies_switch:
1726 file_copies_switch:
1727 file_copies_switch:
1727 file_copies_switch:
1728 file_copies_switch:
1728 file_copies_switch:
1729 file_copies_switch:
1729 file_copies_switch:
1730 file_copies_switch:
1730 file_copies_switch:
1731 file_copies_switch:
1731 file_copies_switch:
1732 file_copies_switch:
1732 file_copies_switch:
1733 file_copies_switch:
1733 file_copies_switch:
1734 file_copies_switch--verbose:
1734 file_copies_switch--verbose:
1735 file_copies_switch--verbose:
1735 file_copies_switch--verbose:
1736 file_copies_switch--verbose:
1736 file_copies_switch--verbose:
1737 file_copies_switch--verbose:
1737 file_copies_switch--verbose:
1738 file_copies_switch--verbose:
1738 file_copies_switch--verbose:
1739 file_copies_switch--verbose:
1739 file_copies_switch--verbose:
1740 file_copies_switch--verbose:
1740 file_copies_switch--verbose:
1741 file_copies_switch--verbose:
1741 file_copies_switch--verbose:
1742 file_copies_switch--verbose:
1742 file_copies_switch--verbose:
1743 file_copies_switch--debug:
1743 file_copies_switch--debug:
1744 file_copies_switch--debug:
1744 file_copies_switch--debug:
1745 file_copies_switch--debug:
1745 file_copies_switch--debug:
1746 file_copies_switch--debug:
1746 file_copies_switch--debug:
1747 file_copies_switch--debug:
1747 file_copies_switch--debug:
1748 file_copies_switch--debug:
1748 file_copies_switch--debug:
1749 file_copies_switch--debug:
1749 file_copies_switch--debug:
1750 file_copies_switch--debug:
1750 file_copies_switch--debug:
1751 file_copies_switch--debug:
1751 file_copies_switch--debug:
1752 files: fourth second third
1752 files: fourth second third
1753 files: second
1753 files: second
1754 files:
1754 files:
1755 files: d
1755 files: d
1756 files:
1756 files:
1757 files: c
1757 files: c
1758 files: c
1758 files: c
1759 files: b
1759 files: b
1760 files: a
1760 files: a
1761 files--verbose: fourth second third
1761 files--verbose: fourth second third
1762 files--verbose: second
1762 files--verbose: second
1763 files--verbose:
1763 files--verbose:
1764 files--verbose: d
1764 files--verbose: d
1765 files--verbose:
1765 files--verbose:
1766 files--verbose: c
1766 files--verbose: c
1767 files--verbose: c
1767 files--verbose: c
1768 files--verbose: b
1768 files--verbose: b
1769 files--verbose: a
1769 files--verbose: a
1770 files--debug: fourth second third
1770 files--debug: fourth second third
1771 files--debug: second
1771 files--debug: second
1772 files--debug:
1772 files--debug:
1773 files--debug: d
1773 files--debug: d
1774 files--debug:
1774 files--debug:
1775 files--debug: c
1775 files--debug: c
1776 files--debug: c
1776 files--debug: c
1777 files--debug: b
1777 files--debug: b
1778 files--debug: a
1778 files--debug: a
1779 manifest: 6:94961b75a2da
1779 manifest: 6:94961b75a2da
1780 manifest: 5:f2dbc354b94e
1780 manifest: 5:f2dbc354b94e
1781 manifest: 4:4dc3def4f9b4
1781 manifest: 4:4dc3def4f9b4
1782 manifest: 4:4dc3def4f9b4
1782 manifest: 4:4dc3def4f9b4
1783 manifest: 3:cb5a1327723b
1783 manifest: 3:cb5a1327723b
1784 manifest: 3:cb5a1327723b
1784 manifest: 3:cb5a1327723b
1785 manifest: 2:6e0e82995c35
1785 manifest: 2:6e0e82995c35
1786 manifest: 1:4e8d705b1e53
1786 manifest: 1:4e8d705b1e53
1787 manifest: 0:a0c8bcbbb45c
1787 manifest: 0:a0c8bcbbb45c
1788 manifest--verbose: 6:94961b75a2da
1788 manifest--verbose: 6:94961b75a2da
1789 manifest--verbose: 5:f2dbc354b94e
1789 manifest--verbose: 5:f2dbc354b94e
1790 manifest--verbose: 4:4dc3def4f9b4
1790 manifest--verbose: 4:4dc3def4f9b4
1791 manifest--verbose: 4:4dc3def4f9b4
1791 manifest--verbose: 4:4dc3def4f9b4
1792 manifest--verbose: 3:cb5a1327723b
1792 manifest--verbose: 3:cb5a1327723b
1793 manifest--verbose: 3:cb5a1327723b
1793 manifest--verbose: 3:cb5a1327723b
1794 manifest--verbose: 2:6e0e82995c35
1794 manifest--verbose: 2:6e0e82995c35
1795 manifest--verbose: 1:4e8d705b1e53
1795 manifest--verbose: 1:4e8d705b1e53
1796 manifest--verbose: 0:a0c8bcbbb45c
1796 manifest--verbose: 0:a0c8bcbbb45c
1797 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
1797 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
1798 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
1798 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
1799 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1799 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1800 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1800 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1801 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1801 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1802 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1802 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1803 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1803 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1804 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1804 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1805 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1805 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1806 node: 95c24699272ef57d062b8bccc32c878bf841784a
1806 node: 95c24699272ef57d062b8bccc32c878bf841784a
1807 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1807 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1808 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1808 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1809 node: 13207e5a10d9fd28ec424934298e176197f2c67f
1809 node: 13207e5a10d9fd28ec424934298e176197f2c67f
1810 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1810 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1811 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1811 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1812 node: 97054abb4ab824450e9164180baf491ae0078465
1812 node: 97054abb4ab824450e9164180baf491ae0078465
1813 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1813 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1814 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1814 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1815 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
1815 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
1816 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1816 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1817 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1817 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1818 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1818 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1819 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1819 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1820 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1820 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1821 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1821 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1822 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1822 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1823 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1823 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1824 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
1824 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
1825 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1825 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1826 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1826 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1827 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1827 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1828 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1828 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1829 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1829 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1830 node--debug: 97054abb4ab824450e9164180baf491ae0078465
1830 node--debug: 97054abb4ab824450e9164180baf491ae0078465
1831 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1831 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1832 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1832 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1833 parents:
1833 parents:
1834 parents: -1:000000000000
1834 parents: -1:000000000000
1835 parents: 5:13207e5a10d9 4:bbe44766e73d
1835 parents: 5:13207e5a10d9 4:bbe44766e73d
1836 parents: 3:10e46f2dcbf4
1836 parents: 3:10e46f2dcbf4
1837 parents:
1837 parents:
1838 parents:
1838 parents:
1839 parents:
1839 parents:
1840 parents:
1840 parents:
1841 parents:
1841 parents:
1842 parents--verbose:
1842 parents--verbose:
1843 parents--verbose: -1:000000000000
1843 parents--verbose: -1:000000000000
1844 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
1844 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
1845 parents--verbose: 3:10e46f2dcbf4
1845 parents--verbose: 3:10e46f2dcbf4
1846 parents--verbose:
1846 parents--verbose:
1847 parents--verbose:
1847 parents--verbose:
1848 parents--verbose:
1848 parents--verbose:
1849 parents--verbose:
1849 parents--verbose:
1850 parents--verbose:
1850 parents--verbose:
1851 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
1851 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
1852 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1852 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1853 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1853 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1854 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1854 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1855 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1855 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1856 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
1856 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
1857 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
1857 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
1858 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
1858 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
1859 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1859 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1860 rev: 8
1860 rev: 8
1861 rev: 7
1861 rev: 7
1862 rev: 6
1862 rev: 6
1863 rev: 5
1863 rev: 5
1864 rev: 4
1864 rev: 4
1865 rev: 3
1865 rev: 3
1866 rev: 2
1866 rev: 2
1867 rev: 1
1867 rev: 1
1868 rev: 0
1868 rev: 0
1869 rev--verbose: 8
1869 rev--verbose: 8
1870 rev--verbose: 7
1870 rev--verbose: 7
1871 rev--verbose: 6
1871 rev--verbose: 6
1872 rev--verbose: 5
1872 rev--verbose: 5
1873 rev--verbose: 4
1873 rev--verbose: 4
1874 rev--verbose: 3
1874 rev--verbose: 3
1875 rev--verbose: 2
1875 rev--verbose: 2
1876 rev--verbose: 1
1876 rev--verbose: 1
1877 rev--verbose: 0
1877 rev--verbose: 0
1878 rev--debug: 8
1878 rev--debug: 8
1879 rev--debug: 7
1879 rev--debug: 7
1880 rev--debug: 6
1880 rev--debug: 6
1881 rev--debug: 5
1881 rev--debug: 5
1882 rev--debug: 4
1882 rev--debug: 4
1883 rev--debug: 3
1883 rev--debug: 3
1884 rev--debug: 2
1884 rev--debug: 2
1885 rev--debug: 1
1885 rev--debug: 1
1886 rev--debug: 0
1886 rev--debug: 0
1887 tags: tip
1887 tags: tip
1888 tags:
1888 tags:
1889 tags:
1889 tags:
1890 tags:
1890 tags:
1891 tags:
1891 tags:
1892 tags:
1892 tags:
1893 tags:
1893 tags:
1894 tags:
1894 tags:
1895 tags:
1895 tags:
1896 tags--verbose: tip
1896 tags--verbose: tip
1897 tags--verbose:
1897 tags--verbose:
1898 tags--verbose:
1898 tags--verbose:
1899 tags--verbose:
1899 tags--verbose:
1900 tags--verbose:
1900 tags--verbose:
1901 tags--verbose:
1901 tags--verbose:
1902 tags--verbose:
1902 tags--verbose:
1903 tags--verbose:
1903 tags--verbose:
1904 tags--verbose:
1904 tags--verbose:
1905 tags--debug: tip
1905 tags--debug: tip
1906 tags--debug:
1906 tags--debug:
1907 tags--debug:
1907 tags--debug:
1908 tags--debug:
1908 tags--debug:
1909 tags--debug:
1909 tags--debug:
1910 tags--debug:
1910 tags--debug:
1911 tags--debug:
1911 tags--debug:
1912 tags--debug:
1912 tags--debug:
1913 tags--debug:
1913 tags--debug:
1914 diffstat: 3: +2/-1
1914 diffstat: 3: +2/-1
1915 diffstat: 1: +1/-0
1915 diffstat: 1: +1/-0
1916 diffstat: 0: +0/-0
1916 diffstat: 0: +0/-0
1917 diffstat: 1: +1/-0
1917 diffstat: 1: +1/-0
1918 diffstat: 0: +0/-0
1918 diffstat: 0: +0/-0
1919 diffstat: 1: +1/-0
1919 diffstat: 1: +1/-0
1920 diffstat: 1: +4/-0
1920 diffstat: 1: +4/-0
1921 diffstat: 1: +2/-0
1921 diffstat: 1: +2/-0
1922 diffstat: 1: +1/-0
1922 diffstat: 1: +1/-0
1923 diffstat--verbose: 3: +2/-1
1923 diffstat--verbose: 3: +2/-1
1924 diffstat--verbose: 1: +1/-0
1924 diffstat--verbose: 1: +1/-0
1925 diffstat--verbose: 0: +0/-0
1925 diffstat--verbose: 0: +0/-0
1926 diffstat--verbose: 1: +1/-0
1926 diffstat--verbose: 1: +1/-0
1927 diffstat--verbose: 0: +0/-0
1927 diffstat--verbose: 0: +0/-0
1928 diffstat--verbose: 1: +1/-0
1928 diffstat--verbose: 1: +1/-0
1929 diffstat--verbose: 1: +4/-0
1929 diffstat--verbose: 1: +4/-0
1930 diffstat--verbose: 1: +2/-0
1930 diffstat--verbose: 1: +2/-0
1931 diffstat--verbose: 1: +1/-0
1931 diffstat--verbose: 1: +1/-0
1932 diffstat--debug: 3: +2/-1
1932 diffstat--debug: 3: +2/-1
1933 diffstat--debug: 1: +1/-0
1933 diffstat--debug: 1: +1/-0
1934 diffstat--debug: 0: +0/-0
1934 diffstat--debug: 0: +0/-0
1935 diffstat--debug: 1: +1/-0
1935 diffstat--debug: 1: +1/-0
1936 diffstat--debug: 0: +0/-0
1936 diffstat--debug: 0: +0/-0
1937 diffstat--debug: 1: +1/-0
1937 diffstat--debug: 1: +1/-0
1938 diffstat--debug: 1: +4/-0
1938 diffstat--debug: 1: +4/-0
1939 diffstat--debug: 1: +2/-0
1939 diffstat--debug: 1: +2/-0
1940 diffstat--debug: 1: +1/-0
1940 diffstat--debug: 1: +1/-0
1941 extras: branch=default
1941 extras: branch=default
1942 extras: branch=default
1942 extras: branch=default
1943 extras: branch=default
1943 extras: branch=default
1944 extras: branch=default
1944 extras: branch=default
1945 extras: branch=foo
1945 extras: branch=foo
1946 extras: branch=default
1946 extras: branch=default
1947 extras: branch=default
1947 extras: branch=default
1948 extras: branch=default
1948 extras: branch=default
1949 extras: branch=default
1949 extras: branch=default
1950 extras--verbose: branch=default
1950 extras--verbose: branch=default
1951 extras--verbose: branch=default
1951 extras--verbose: branch=default
1952 extras--verbose: branch=default
1952 extras--verbose: branch=default
1953 extras--verbose: branch=default
1953 extras--verbose: branch=default
1954 extras--verbose: branch=foo
1954 extras--verbose: branch=foo
1955 extras--verbose: branch=default
1955 extras--verbose: branch=default
1956 extras--verbose: branch=default
1956 extras--verbose: branch=default
1957 extras--verbose: branch=default
1957 extras--verbose: branch=default
1958 extras--verbose: branch=default
1958 extras--verbose: branch=default
1959 extras--debug: branch=default
1959 extras--debug: branch=default
1960 extras--debug: branch=default
1960 extras--debug: branch=default
1961 extras--debug: branch=default
1961 extras--debug: branch=default
1962 extras--debug: branch=default
1962 extras--debug: branch=default
1963 extras--debug: branch=foo
1963 extras--debug: branch=foo
1964 extras--debug: branch=default
1964 extras--debug: branch=default
1965 extras--debug: branch=default
1965 extras--debug: branch=default
1966 extras--debug: branch=default
1966 extras--debug: branch=default
1967 extras--debug: branch=default
1967 extras--debug: branch=default
1968 p1rev: 7
1968 p1rev: 7
1969 p1rev: -1
1969 p1rev: -1
1970 p1rev: 5
1970 p1rev: 5
1971 p1rev: 3
1971 p1rev: 3
1972 p1rev: 3
1972 p1rev: 3
1973 p1rev: 2
1973 p1rev: 2
1974 p1rev: 1
1974 p1rev: 1
1975 p1rev: 0
1975 p1rev: 0
1976 p1rev: -1
1976 p1rev: -1
1977 p1rev--verbose: 7
1977 p1rev--verbose: 7
1978 p1rev--verbose: -1
1978 p1rev--verbose: -1
1979 p1rev--verbose: 5
1979 p1rev--verbose: 5
1980 p1rev--verbose: 3
1980 p1rev--verbose: 3
1981 p1rev--verbose: 3
1981 p1rev--verbose: 3
1982 p1rev--verbose: 2
1982 p1rev--verbose: 2
1983 p1rev--verbose: 1
1983 p1rev--verbose: 1
1984 p1rev--verbose: 0
1984 p1rev--verbose: 0
1985 p1rev--verbose: -1
1985 p1rev--verbose: -1
1986 p1rev--debug: 7
1986 p1rev--debug: 7
1987 p1rev--debug: -1
1987 p1rev--debug: -1
1988 p1rev--debug: 5
1988 p1rev--debug: 5
1989 p1rev--debug: 3
1989 p1rev--debug: 3
1990 p1rev--debug: 3
1990 p1rev--debug: 3
1991 p1rev--debug: 2
1991 p1rev--debug: 2
1992 p1rev--debug: 1
1992 p1rev--debug: 1
1993 p1rev--debug: 0
1993 p1rev--debug: 0
1994 p1rev--debug: -1
1994 p1rev--debug: -1
1995 p2rev: -1
1995 p2rev: -1
1996 p2rev: -1
1996 p2rev: -1
1997 p2rev: 4
1997 p2rev: 4
1998 p2rev: -1
1998 p2rev: -1
1999 p2rev: -1
1999 p2rev: -1
2000 p2rev: -1
2000 p2rev: -1
2001 p2rev: -1
2001 p2rev: -1
2002 p2rev: -1
2002 p2rev: -1
2003 p2rev: -1
2003 p2rev: -1
2004 p2rev--verbose: -1
2004 p2rev--verbose: -1
2005 p2rev--verbose: -1
2005 p2rev--verbose: -1
2006 p2rev--verbose: 4
2006 p2rev--verbose: 4
2007 p2rev--verbose: -1
2007 p2rev--verbose: -1
2008 p2rev--verbose: -1
2008 p2rev--verbose: -1
2009 p2rev--verbose: -1
2009 p2rev--verbose: -1
2010 p2rev--verbose: -1
2010 p2rev--verbose: -1
2011 p2rev--verbose: -1
2011 p2rev--verbose: -1
2012 p2rev--verbose: -1
2012 p2rev--verbose: -1
2013 p2rev--debug: -1
2013 p2rev--debug: -1
2014 p2rev--debug: -1
2014 p2rev--debug: -1
2015 p2rev--debug: 4
2015 p2rev--debug: 4
2016 p2rev--debug: -1
2016 p2rev--debug: -1
2017 p2rev--debug: -1
2017 p2rev--debug: -1
2018 p2rev--debug: -1
2018 p2rev--debug: -1
2019 p2rev--debug: -1
2019 p2rev--debug: -1
2020 p2rev--debug: -1
2020 p2rev--debug: -1
2021 p2rev--debug: -1
2021 p2rev--debug: -1
2022 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2022 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2023 p1node: 0000000000000000000000000000000000000000
2023 p1node: 0000000000000000000000000000000000000000
2024 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
2024 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
2025 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2025 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2026 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2026 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2027 p1node: 97054abb4ab824450e9164180baf491ae0078465
2027 p1node: 97054abb4ab824450e9164180baf491ae0078465
2028 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2028 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2029 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
2029 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
2030 p1node: 0000000000000000000000000000000000000000
2030 p1node: 0000000000000000000000000000000000000000
2031 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2031 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2032 p1node--verbose: 0000000000000000000000000000000000000000
2032 p1node--verbose: 0000000000000000000000000000000000000000
2033 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
2033 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
2034 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2034 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2035 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2035 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2036 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
2036 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
2037 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2037 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2038 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
2038 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
2039 p1node--verbose: 0000000000000000000000000000000000000000
2039 p1node--verbose: 0000000000000000000000000000000000000000
2040 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2040 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2041 p1node--debug: 0000000000000000000000000000000000000000
2041 p1node--debug: 0000000000000000000000000000000000000000
2042 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
2042 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
2043 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2043 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2044 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2044 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2045 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
2045 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
2046 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2046 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2047 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
2047 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
2048 p1node--debug: 0000000000000000000000000000000000000000
2048 p1node--debug: 0000000000000000000000000000000000000000
2049 p2node: 0000000000000000000000000000000000000000
2049 p2node: 0000000000000000000000000000000000000000
2050 p2node: 0000000000000000000000000000000000000000
2050 p2node: 0000000000000000000000000000000000000000
2051 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2051 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2052 p2node: 0000000000000000000000000000000000000000
2052 p2node: 0000000000000000000000000000000000000000
2053 p2node: 0000000000000000000000000000000000000000
2053 p2node: 0000000000000000000000000000000000000000
2054 p2node: 0000000000000000000000000000000000000000
2054 p2node: 0000000000000000000000000000000000000000
2055 p2node: 0000000000000000000000000000000000000000
2055 p2node: 0000000000000000000000000000000000000000
2056 p2node: 0000000000000000000000000000000000000000
2056 p2node: 0000000000000000000000000000000000000000
2057 p2node: 0000000000000000000000000000000000000000
2057 p2node: 0000000000000000000000000000000000000000
2058 p2node--verbose: 0000000000000000000000000000000000000000
2058 p2node--verbose: 0000000000000000000000000000000000000000
2059 p2node--verbose: 0000000000000000000000000000000000000000
2059 p2node--verbose: 0000000000000000000000000000000000000000
2060 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2060 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2061 p2node--verbose: 0000000000000000000000000000000000000000
2061 p2node--verbose: 0000000000000000000000000000000000000000
2062 p2node--verbose: 0000000000000000000000000000000000000000
2062 p2node--verbose: 0000000000000000000000000000000000000000
2063 p2node--verbose: 0000000000000000000000000000000000000000
2063 p2node--verbose: 0000000000000000000000000000000000000000
2064 p2node--verbose: 0000000000000000000000000000000000000000
2064 p2node--verbose: 0000000000000000000000000000000000000000
2065 p2node--verbose: 0000000000000000000000000000000000000000
2065 p2node--verbose: 0000000000000000000000000000000000000000
2066 p2node--verbose: 0000000000000000000000000000000000000000
2066 p2node--verbose: 0000000000000000000000000000000000000000
2067 p2node--debug: 0000000000000000000000000000000000000000
2067 p2node--debug: 0000000000000000000000000000000000000000
2068 p2node--debug: 0000000000000000000000000000000000000000
2068 p2node--debug: 0000000000000000000000000000000000000000
2069 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2069 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2070 p2node--debug: 0000000000000000000000000000000000000000
2070 p2node--debug: 0000000000000000000000000000000000000000
2071 p2node--debug: 0000000000000000000000000000000000000000
2071 p2node--debug: 0000000000000000000000000000000000000000
2072 p2node--debug: 0000000000000000000000000000000000000000
2072 p2node--debug: 0000000000000000000000000000000000000000
2073 p2node--debug: 0000000000000000000000000000000000000000
2073 p2node--debug: 0000000000000000000000000000000000000000
2074 p2node--debug: 0000000000000000000000000000000000000000
2074 p2node--debug: 0000000000000000000000000000000000000000
2075 p2node--debug: 0000000000000000000000000000000000000000
2075 p2node--debug: 0000000000000000000000000000000000000000
2076
2076
2077 Filters work:
2077 Filters work:
2078
2078
2079 $ hg log --template '{author|domain}\n'
2079 $ hg log --template '{author|domain}\n'
2080
2080
2081 hostname
2081 hostname
2082
2082
2083
2083
2084
2084
2085
2085
2086 place
2086 place
2087 place
2087 place
2088 hostname
2088 hostname
2089
2089
2090 $ hg log --template '{author|person}\n'
2090 $ hg log --template '{author|person}\n'
2091 test
2091 test
2092 User Name
2092 User Name
2093 person
2093 person
2094 person
2094 person
2095 person
2095 person
2096 person
2096 person
2097 other
2097 other
2098 A. N. Other
2098 A. N. Other
2099 User Name
2099 User Name
2100
2100
2101 $ hg log --template '{author|user}\n'
2101 $ hg log --template '{author|user}\n'
2102 test
2102 test
2103 user
2103 user
2104 person
2104 person
2105 person
2105 person
2106 person
2106 person
2107 person
2107 person
2108 other
2108 other
2109 other
2109 other
2110 user
2110 user
2111
2111
2112 $ hg log --template '{date|date}\n'
2112 $ hg log --template '{date|date}\n'
2113 Wed Jan 01 10:01:00 2020 +0000
2113 Wed Jan 01 10:01:00 2020 +0000
2114 Mon Jan 12 13:46:40 1970 +0000
2114 Mon Jan 12 13:46:40 1970 +0000
2115 Sun Jan 18 08:40:01 1970 +0000
2115 Sun Jan 18 08:40:01 1970 +0000
2116 Sun Jan 18 08:40:00 1970 +0000
2116 Sun Jan 18 08:40:00 1970 +0000
2117 Sat Jan 17 04:53:20 1970 +0000
2117 Sat Jan 17 04:53:20 1970 +0000
2118 Fri Jan 16 01:06:40 1970 +0000
2118 Fri Jan 16 01:06:40 1970 +0000
2119 Wed Jan 14 21:20:00 1970 +0000
2119 Wed Jan 14 21:20:00 1970 +0000
2120 Tue Jan 13 17:33:20 1970 +0000
2120 Tue Jan 13 17:33:20 1970 +0000
2121 Mon Jan 12 13:46:40 1970 +0000
2121 Mon Jan 12 13:46:40 1970 +0000
2122
2122
2123 $ hg log --template '{date|isodate}\n'
2123 $ hg log --template '{date|isodate}\n'
2124 2020-01-01 10:01 +0000
2124 2020-01-01 10:01 +0000
2125 1970-01-12 13:46 +0000
2125 1970-01-12 13:46 +0000
2126 1970-01-18 08:40 +0000
2126 1970-01-18 08:40 +0000
2127 1970-01-18 08:40 +0000
2127 1970-01-18 08:40 +0000
2128 1970-01-17 04:53 +0000
2128 1970-01-17 04:53 +0000
2129 1970-01-16 01:06 +0000
2129 1970-01-16 01:06 +0000
2130 1970-01-14 21:20 +0000
2130 1970-01-14 21:20 +0000
2131 1970-01-13 17:33 +0000
2131 1970-01-13 17:33 +0000
2132 1970-01-12 13:46 +0000
2132 1970-01-12 13:46 +0000
2133
2133
2134 $ hg log --template '{date|isodatesec}\n'
2134 $ hg log --template '{date|isodatesec}\n'
2135 2020-01-01 10:01:00 +0000
2135 2020-01-01 10:01:00 +0000
2136 1970-01-12 13:46:40 +0000
2136 1970-01-12 13:46:40 +0000
2137 1970-01-18 08:40:01 +0000
2137 1970-01-18 08:40:01 +0000
2138 1970-01-18 08:40:00 +0000
2138 1970-01-18 08:40:00 +0000
2139 1970-01-17 04:53:20 +0000
2139 1970-01-17 04:53:20 +0000
2140 1970-01-16 01:06:40 +0000
2140 1970-01-16 01:06:40 +0000
2141 1970-01-14 21:20:00 +0000
2141 1970-01-14 21:20:00 +0000
2142 1970-01-13 17:33:20 +0000
2142 1970-01-13 17:33:20 +0000
2143 1970-01-12 13:46:40 +0000
2143 1970-01-12 13:46:40 +0000
2144
2144
2145 $ hg log --template '{date|rfc822date}\n'
2145 $ hg log --template '{date|rfc822date}\n'
2146 Wed, 01 Jan 2020 10:01:00 +0000
2146 Wed, 01 Jan 2020 10:01:00 +0000
2147 Mon, 12 Jan 1970 13:46:40 +0000
2147 Mon, 12 Jan 1970 13:46:40 +0000
2148 Sun, 18 Jan 1970 08:40:01 +0000
2148 Sun, 18 Jan 1970 08:40:01 +0000
2149 Sun, 18 Jan 1970 08:40:00 +0000
2149 Sun, 18 Jan 1970 08:40:00 +0000
2150 Sat, 17 Jan 1970 04:53:20 +0000
2150 Sat, 17 Jan 1970 04:53:20 +0000
2151 Fri, 16 Jan 1970 01:06:40 +0000
2151 Fri, 16 Jan 1970 01:06:40 +0000
2152 Wed, 14 Jan 1970 21:20:00 +0000
2152 Wed, 14 Jan 1970 21:20:00 +0000
2153 Tue, 13 Jan 1970 17:33:20 +0000
2153 Tue, 13 Jan 1970 17:33:20 +0000
2154 Mon, 12 Jan 1970 13:46:40 +0000
2154 Mon, 12 Jan 1970 13:46:40 +0000
2155
2155
2156 $ hg log --template '{desc|firstline}\n'
2156 $ hg log --template '{desc|firstline}\n'
2157 third
2157 third
2158 second
2158 second
2159 merge
2159 merge
2160 new head
2160 new head
2161 new branch
2161 new branch
2162 no user, no domain
2162 no user, no domain
2163 no person
2163 no person
2164 other 1
2164 other 1
2165 line 1
2165 line 1
2166
2166
2167 $ hg log --template '{node|short}\n'
2167 $ hg log --template '{node|short}\n'
2168 95c24699272e
2168 95c24699272e
2169 29114dbae42b
2169 29114dbae42b
2170 d41e714fe50d
2170 d41e714fe50d
2171 13207e5a10d9
2171 13207e5a10d9
2172 bbe44766e73d
2172 bbe44766e73d
2173 10e46f2dcbf4
2173 10e46f2dcbf4
2174 97054abb4ab8
2174 97054abb4ab8
2175 b608e9d1a3f0
2175 b608e9d1a3f0
2176 1e4e1b8f71e0
2176 1e4e1b8f71e0
2177
2177
2178 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
2178 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
2179 <changeset author="test"/>
2179 <changeset author="test"/>
2180 <changeset author="User Name &lt;user@hostname&gt;"/>
2180 <changeset author="User Name &lt;user@hostname&gt;"/>
2181 <changeset author="person"/>
2181 <changeset author="person"/>
2182 <changeset author="person"/>
2182 <changeset author="person"/>
2183 <changeset author="person"/>
2183 <changeset author="person"/>
2184 <changeset author="person"/>
2184 <changeset author="person"/>
2185 <changeset author="other@place"/>
2185 <changeset author="other@place"/>
2186 <changeset author="A. N. Other &lt;other@place&gt;"/>
2186 <changeset author="A. N. Other &lt;other@place&gt;"/>
2187 <changeset author="User Name &lt;user@hostname&gt;"/>
2187 <changeset author="User Name &lt;user@hostname&gt;"/>
2188
2188
2189 $ hg log --template '{rev}: {children}\n'
2189 $ hg log --template '{rev}: {children}\n'
2190 8:
2190 8:
2191 7: 8:95c24699272e
2191 7: 8:95c24699272e
2192 6:
2192 6:
2193 5: 6:d41e714fe50d
2193 5: 6:d41e714fe50d
2194 4: 6:d41e714fe50d
2194 4: 6:d41e714fe50d
2195 3: 4:bbe44766e73d 5:13207e5a10d9
2195 3: 4:bbe44766e73d 5:13207e5a10d9
2196 2: 3:10e46f2dcbf4
2196 2: 3:10e46f2dcbf4
2197 1: 2:97054abb4ab8
2197 1: 2:97054abb4ab8
2198 0: 1:b608e9d1a3f0
2198 0: 1:b608e9d1a3f0
2199
2199
2200 Formatnode filter works:
2200 Formatnode filter works:
2201
2201
2202 $ hg -q log -r 0 --template '{node|formatnode}\n'
2202 $ hg -q log -r 0 --template '{node|formatnode}\n'
2203 1e4e1b8f71e0
2203 1e4e1b8f71e0
2204
2204
2205 $ hg log -r 0 --template '{node|formatnode}\n'
2205 $ hg log -r 0 --template '{node|formatnode}\n'
2206 1e4e1b8f71e0
2206 1e4e1b8f71e0
2207
2207
2208 $ hg -v log -r 0 --template '{node|formatnode}\n'
2208 $ hg -v log -r 0 --template '{node|formatnode}\n'
2209 1e4e1b8f71e0
2209 1e4e1b8f71e0
2210
2210
2211 $ hg --debug log -r 0 --template '{node|formatnode}\n'
2211 $ hg --debug log -r 0 --template '{node|formatnode}\n'
2212 1e4e1b8f71e05681d422154f5421e385fec3454f
2212 1e4e1b8f71e05681d422154f5421e385fec3454f
2213
2213
2214 Age filter:
2214 Age filter:
2215
2215
2216 $ hg init unstable-hash
2216 $ hg init unstable-hash
2217 $ cd unstable-hash
2217 $ cd unstable-hash
2218 $ hg log --template '{date|age}\n' > /dev/null || exit 1
2218 $ hg log --template '{date|age}\n' > /dev/null || exit 1
2219
2219
2220 >>> from __future__ import absolute_import
2220 >>> from __future__ import absolute_import
2221 >>> import datetime
2221 >>> import datetime
2222 >>> fp = open('a', 'wb')
2222 >>> fp = open('a', 'wb')
2223 >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
2223 >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
2224 >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day)) and None
2224 >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day)) and None
2225 >>> fp.close()
2225 >>> fp.close()
2226 $ hg add a
2226 $ hg add a
2227 $ hg commit -m future -d "`cat a`"
2227 $ hg commit -m future -d "`cat a`"
2228
2228
2229 $ hg log -l1 --template '{date|age}\n'
2229 $ hg log -l1 --template '{date|age}\n'
2230 7 years from now
2230 7 years from now
2231
2231
2232 $ cd ..
2232 $ cd ..
2233 $ rm -rf unstable-hash
2233 $ rm -rf unstable-hash
2234
2234
2235 Filename filters:
2235 Filename filters:
2236
2236
2237 $ hg debugtemplate '{"foo/bar"|basename}|{"foo/"|basename}|{"foo"|basename}|\n'
2237 $ hg debugtemplate '{"foo/bar"|basename}|{"foo/"|basename}|{"foo"|basename}|\n'
2238 bar||foo|
2238 bar||foo|
2239 $ hg debugtemplate '{"foo/bar"|dirname}|{"foo/"|dirname}|{"foo"|dirname}|\n'
2239 $ hg debugtemplate '{"foo/bar"|dirname}|{"foo/"|dirname}|{"foo"|dirname}|\n'
2240 foo|foo||
2240 foo|foo||
2241 $ hg debugtemplate '{"foo/bar"|stripdir}|{"foo/"|stripdir}|{"foo"|stripdir}|\n'
2241 $ hg debugtemplate '{"foo/bar"|stripdir}|{"foo/"|stripdir}|{"foo"|stripdir}|\n'
2242 foo|foo|foo|
2242 foo|foo|foo|
2243
2243
2244 Add a dummy commit to make up for the instability of the above:
2244 Add a dummy commit to make up for the instability of the above:
2245
2245
2246 $ echo a > a
2246 $ echo a > a
2247 $ hg add a
2247 $ hg add a
2248 $ hg ci -m future
2248 $ hg ci -m future
2249
2249
2250 Count filter:
2250 Count filter:
2251
2251
2252 $ hg log -l1 --template '{node|count} {node|short|count}\n'
2252 $ hg log -l1 --template '{node|count} {node|short|count}\n'
2253 40 12
2253 40 12
2254
2254
2255 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n'
2255 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n'
2256 0 1 4
2256 0 1 4
2257
2257
2258 $ hg log -G --template '{rev}: children: {children|count}, \
2258 $ hg log -G --template '{rev}: children: {children|count}, \
2259 > tags: {tags|count}, file_adds: {file_adds|count}, \
2259 > tags: {tags|count}, file_adds: {file_adds|count}, \
2260 > ancestors: {revset("ancestors(%s)", rev)|count}'
2260 > ancestors: {revset("ancestors(%s)", rev)|count}'
2261 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
2261 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
2262 |
2262 |
2263 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
2263 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
2264 |
2264 |
2265 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
2265 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
2266
2266
2267 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
2267 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
2268 |\
2268 |\
2269 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
2269 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
2270 | |
2270 | |
2271 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
2271 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
2272 |/
2272 |/
2273 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
2273 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
2274 |
2274 |
2275 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
2275 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
2276 |
2276 |
2277 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
2277 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
2278 |
2278 |
2279 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
2279 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
2280
2280
2281
2281
2282 $ hg log -l1 -T '{termwidth|count}\n'
2282 $ hg log -l1 -T '{termwidth|count}\n'
2283 hg: parse error: not countable
2283 hg: parse error: not countable
2284 (template filter 'count' is not compatible with keyword 'termwidth')
2284 (template filter 'count' is not compatible with keyword 'termwidth')
2285 [255]
2285 [255]
2286
2286
2287 Upper/lower filters:
2287 Upper/lower filters:
2288
2288
2289 $ hg log -r0 --template '{branch|upper}\n'
2289 $ hg log -r0 --template '{branch|upper}\n'
2290 DEFAULT
2290 DEFAULT
2291 $ hg log -r0 --template '{author|lower}\n'
2291 $ hg log -r0 --template '{author|lower}\n'
2292 user name <user@hostname>
2292 user name <user@hostname>
2293 $ hg log -r0 --template '{date|upper}\n'
2293 $ hg log -r0 --template '{date|upper}\n'
2294 1000000 0
2294 1000000.00
2295
2295
2296 Add a commit that does all possible modifications at once
2296 Add a commit that does all possible modifications at once
2297
2297
2298 $ echo modify >> third
2298 $ echo modify >> third
2299 $ touch b
2299 $ touch b
2300 $ hg add b
2300 $ hg add b
2301 $ hg mv fourth fifth
2301 $ hg mv fourth fifth
2302 $ hg rm a
2302 $ hg rm a
2303 $ hg ci -m "Modify, add, remove, rename"
2303 $ hg ci -m "Modify, add, remove, rename"
2304
2304
2305 Check the status template
2305 Check the status template
2306
2306
2307 $ cat <<EOF >> $HGRCPATH
2307 $ cat <<EOF >> $HGRCPATH
2308 > [extensions]
2308 > [extensions]
2309 > color=
2309 > color=
2310 > EOF
2310 > EOF
2311
2311
2312 $ hg log -T status -r 10
2312 $ hg log -T status -r 10
2313 changeset: 10:0f9759ec227a
2313 changeset: 10:0f9759ec227a
2314 tag: tip
2314 tag: tip
2315 user: test
2315 user: test
2316 date: Thu Jan 01 00:00:00 1970 +0000
2316 date: Thu Jan 01 00:00:00 1970 +0000
2317 summary: Modify, add, remove, rename
2317 summary: Modify, add, remove, rename
2318 files:
2318 files:
2319 M third
2319 M third
2320 A b
2320 A b
2321 A fifth
2321 A fifth
2322 R a
2322 R a
2323 R fourth
2323 R fourth
2324
2324
2325 $ hg log -T status -C -r 10
2325 $ hg log -T status -C -r 10
2326 changeset: 10:0f9759ec227a
2326 changeset: 10:0f9759ec227a
2327 tag: tip
2327 tag: tip
2328 user: test
2328 user: test
2329 date: Thu Jan 01 00:00:00 1970 +0000
2329 date: Thu Jan 01 00:00:00 1970 +0000
2330 summary: Modify, add, remove, rename
2330 summary: Modify, add, remove, rename
2331 files:
2331 files:
2332 M third
2332 M third
2333 A b
2333 A b
2334 A fifth
2334 A fifth
2335 fourth
2335 fourth
2336 R a
2336 R a
2337 R fourth
2337 R fourth
2338
2338
2339 $ hg log -T status -C -r 10 -v
2339 $ hg log -T status -C -r 10 -v
2340 changeset: 10:0f9759ec227a
2340 changeset: 10:0f9759ec227a
2341 tag: tip
2341 tag: tip
2342 user: test
2342 user: test
2343 date: Thu Jan 01 00:00:00 1970 +0000
2343 date: Thu Jan 01 00:00:00 1970 +0000
2344 description:
2344 description:
2345 Modify, add, remove, rename
2345 Modify, add, remove, rename
2346
2346
2347 files:
2347 files:
2348 M third
2348 M third
2349 A b
2349 A b
2350 A fifth
2350 A fifth
2351 fourth
2351 fourth
2352 R a
2352 R a
2353 R fourth
2353 R fourth
2354
2354
2355 $ hg log -T status -C -r 10 --debug
2355 $ hg log -T status -C -r 10 --debug
2356 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2356 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2357 tag: tip
2357 tag: tip
2358 phase: secret
2358 phase: secret
2359 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2359 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2360 parent: -1:0000000000000000000000000000000000000000
2360 parent: -1:0000000000000000000000000000000000000000
2361 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2361 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2362 user: test
2362 user: test
2363 date: Thu Jan 01 00:00:00 1970 +0000
2363 date: Thu Jan 01 00:00:00 1970 +0000
2364 extra: branch=default
2364 extra: branch=default
2365 description:
2365 description:
2366 Modify, add, remove, rename
2366 Modify, add, remove, rename
2367
2367
2368 files:
2368 files:
2369 M third
2369 M third
2370 A b
2370 A b
2371 A fifth
2371 A fifth
2372 fourth
2372 fourth
2373 R a
2373 R a
2374 R fourth
2374 R fourth
2375
2375
2376 $ hg log -T status -C -r 10 --quiet
2376 $ hg log -T status -C -r 10 --quiet
2377 10:0f9759ec227a
2377 10:0f9759ec227a
2378 $ hg --color=debug log -T status -r 10
2378 $ hg --color=debug log -T status -r 10
2379 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2379 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2380 [log.tag|tag: tip]
2380 [log.tag|tag: tip]
2381 [log.user|user: test]
2381 [log.user|user: test]
2382 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2382 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2383 [log.summary|summary: Modify, add, remove, rename]
2383 [log.summary|summary: Modify, add, remove, rename]
2384 [ui.note log.files|files:]
2384 [ui.note log.files|files:]
2385 [status.modified|M third]
2385 [status.modified|M third]
2386 [status.added|A b]
2386 [status.added|A b]
2387 [status.added|A fifth]
2387 [status.added|A fifth]
2388 [status.removed|R a]
2388 [status.removed|R a]
2389 [status.removed|R fourth]
2389 [status.removed|R fourth]
2390
2390
2391 $ hg --color=debug log -T status -C -r 10
2391 $ hg --color=debug log -T status -C -r 10
2392 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2392 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2393 [log.tag|tag: tip]
2393 [log.tag|tag: tip]
2394 [log.user|user: test]
2394 [log.user|user: test]
2395 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2395 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2396 [log.summary|summary: Modify, add, remove, rename]
2396 [log.summary|summary: Modify, add, remove, rename]
2397 [ui.note log.files|files:]
2397 [ui.note log.files|files:]
2398 [status.modified|M third]
2398 [status.modified|M third]
2399 [status.added|A b]
2399 [status.added|A b]
2400 [status.added|A fifth]
2400 [status.added|A fifth]
2401 [status.copied| fourth]
2401 [status.copied| fourth]
2402 [status.removed|R a]
2402 [status.removed|R a]
2403 [status.removed|R fourth]
2403 [status.removed|R fourth]
2404
2404
2405 $ hg --color=debug log -T status -C -r 10 -v
2405 $ hg --color=debug log -T status -C -r 10 -v
2406 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2406 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2407 [log.tag|tag: tip]
2407 [log.tag|tag: tip]
2408 [log.user|user: test]
2408 [log.user|user: test]
2409 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2409 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2410 [ui.note log.description|description:]
2410 [ui.note log.description|description:]
2411 [ui.note log.description|Modify, add, remove, rename]
2411 [ui.note log.description|Modify, add, remove, rename]
2412
2412
2413 [ui.note log.files|files:]
2413 [ui.note log.files|files:]
2414 [status.modified|M third]
2414 [status.modified|M third]
2415 [status.added|A b]
2415 [status.added|A b]
2416 [status.added|A fifth]
2416 [status.added|A fifth]
2417 [status.copied| fourth]
2417 [status.copied| fourth]
2418 [status.removed|R a]
2418 [status.removed|R a]
2419 [status.removed|R fourth]
2419 [status.removed|R fourth]
2420
2420
2421 $ hg --color=debug log -T status -C -r 10 --debug
2421 $ hg --color=debug log -T status -C -r 10 --debug
2422 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2422 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2423 [log.tag|tag: tip]
2423 [log.tag|tag: tip]
2424 [log.phase|phase: secret]
2424 [log.phase|phase: secret]
2425 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2425 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2426 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2426 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2427 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2427 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2428 [log.user|user: test]
2428 [log.user|user: test]
2429 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2429 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2430 [ui.debug log.extra|extra: branch=default]
2430 [ui.debug log.extra|extra: branch=default]
2431 [ui.note log.description|description:]
2431 [ui.note log.description|description:]
2432 [ui.note log.description|Modify, add, remove, rename]
2432 [ui.note log.description|Modify, add, remove, rename]
2433
2433
2434 [ui.note log.files|files:]
2434 [ui.note log.files|files:]
2435 [status.modified|M third]
2435 [status.modified|M third]
2436 [status.added|A b]
2436 [status.added|A b]
2437 [status.added|A fifth]
2437 [status.added|A fifth]
2438 [status.copied| fourth]
2438 [status.copied| fourth]
2439 [status.removed|R a]
2439 [status.removed|R a]
2440 [status.removed|R fourth]
2440 [status.removed|R fourth]
2441
2441
2442 $ hg --color=debug log -T status -C -r 10 --quiet
2442 $ hg --color=debug log -T status -C -r 10 --quiet
2443 [log.node|10:0f9759ec227a]
2443 [log.node|10:0f9759ec227a]
2444
2444
2445 Check the bisect template
2445 Check the bisect template
2446
2446
2447 $ hg bisect -g 1
2447 $ hg bisect -g 1
2448 $ hg bisect -b 3 --noupdate
2448 $ hg bisect -b 3 --noupdate
2449 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2449 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2450 $ hg log -T bisect -r 0:4
2450 $ hg log -T bisect -r 0:4
2451 changeset: 0:1e4e1b8f71e0
2451 changeset: 0:1e4e1b8f71e0
2452 bisect: good (implicit)
2452 bisect: good (implicit)
2453 user: User Name <user@hostname>
2453 user: User Name <user@hostname>
2454 date: Mon Jan 12 13:46:40 1970 +0000
2454 date: Mon Jan 12 13:46:40 1970 +0000
2455 summary: line 1
2455 summary: line 1
2456
2456
2457 changeset: 1:b608e9d1a3f0
2457 changeset: 1:b608e9d1a3f0
2458 bisect: good
2458 bisect: good
2459 user: A. N. Other <other@place>
2459 user: A. N. Other <other@place>
2460 date: Tue Jan 13 17:33:20 1970 +0000
2460 date: Tue Jan 13 17:33:20 1970 +0000
2461 summary: other 1
2461 summary: other 1
2462
2462
2463 changeset: 2:97054abb4ab8
2463 changeset: 2:97054abb4ab8
2464 bisect: untested
2464 bisect: untested
2465 user: other@place
2465 user: other@place
2466 date: Wed Jan 14 21:20:00 1970 +0000
2466 date: Wed Jan 14 21:20:00 1970 +0000
2467 summary: no person
2467 summary: no person
2468
2468
2469 changeset: 3:10e46f2dcbf4
2469 changeset: 3:10e46f2dcbf4
2470 bisect: bad
2470 bisect: bad
2471 user: person
2471 user: person
2472 date: Fri Jan 16 01:06:40 1970 +0000
2472 date: Fri Jan 16 01:06:40 1970 +0000
2473 summary: no user, no domain
2473 summary: no user, no domain
2474
2474
2475 changeset: 4:bbe44766e73d
2475 changeset: 4:bbe44766e73d
2476 bisect: bad (implicit)
2476 bisect: bad (implicit)
2477 branch: foo
2477 branch: foo
2478 user: person
2478 user: person
2479 date: Sat Jan 17 04:53:20 1970 +0000
2479 date: Sat Jan 17 04:53:20 1970 +0000
2480 summary: new branch
2480 summary: new branch
2481
2481
2482 $ hg log --debug -T bisect -r 0:4
2482 $ hg log --debug -T bisect -r 0:4
2483 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2483 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2484 bisect: good (implicit)
2484 bisect: good (implicit)
2485 phase: public
2485 phase: public
2486 parent: -1:0000000000000000000000000000000000000000
2486 parent: -1:0000000000000000000000000000000000000000
2487 parent: -1:0000000000000000000000000000000000000000
2487 parent: -1:0000000000000000000000000000000000000000
2488 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2488 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2489 user: User Name <user@hostname>
2489 user: User Name <user@hostname>
2490 date: Mon Jan 12 13:46:40 1970 +0000
2490 date: Mon Jan 12 13:46:40 1970 +0000
2491 files+: a
2491 files+: a
2492 extra: branch=default
2492 extra: branch=default
2493 description:
2493 description:
2494 line 1
2494 line 1
2495 line 2
2495 line 2
2496
2496
2497
2497
2498 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2498 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2499 bisect: good
2499 bisect: good
2500 phase: public
2500 phase: public
2501 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2501 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2502 parent: -1:0000000000000000000000000000000000000000
2502 parent: -1:0000000000000000000000000000000000000000
2503 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2503 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2504 user: A. N. Other <other@place>
2504 user: A. N. Other <other@place>
2505 date: Tue Jan 13 17:33:20 1970 +0000
2505 date: Tue Jan 13 17:33:20 1970 +0000
2506 files+: b
2506 files+: b
2507 extra: branch=default
2507 extra: branch=default
2508 description:
2508 description:
2509 other 1
2509 other 1
2510 other 2
2510 other 2
2511
2511
2512 other 3
2512 other 3
2513
2513
2514
2514
2515 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2515 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2516 bisect: untested
2516 bisect: untested
2517 phase: public
2517 phase: public
2518 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2518 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2519 parent: -1:0000000000000000000000000000000000000000
2519 parent: -1:0000000000000000000000000000000000000000
2520 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2520 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2521 user: other@place
2521 user: other@place
2522 date: Wed Jan 14 21:20:00 1970 +0000
2522 date: Wed Jan 14 21:20:00 1970 +0000
2523 files+: c
2523 files+: c
2524 extra: branch=default
2524 extra: branch=default
2525 description:
2525 description:
2526 no person
2526 no person
2527
2527
2528
2528
2529 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2529 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2530 bisect: bad
2530 bisect: bad
2531 phase: public
2531 phase: public
2532 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2532 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2533 parent: -1:0000000000000000000000000000000000000000
2533 parent: -1:0000000000000000000000000000000000000000
2534 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2534 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2535 user: person
2535 user: person
2536 date: Fri Jan 16 01:06:40 1970 +0000
2536 date: Fri Jan 16 01:06:40 1970 +0000
2537 files: c
2537 files: c
2538 extra: branch=default
2538 extra: branch=default
2539 description:
2539 description:
2540 no user, no domain
2540 no user, no domain
2541
2541
2542
2542
2543 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2543 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2544 bisect: bad (implicit)
2544 bisect: bad (implicit)
2545 branch: foo
2545 branch: foo
2546 phase: draft
2546 phase: draft
2547 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2547 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2548 parent: -1:0000000000000000000000000000000000000000
2548 parent: -1:0000000000000000000000000000000000000000
2549 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2549 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2550 user: person
2550 user: person
2551 date: Sat Jan 17 04:53:20 1970 +0000
2551 date: Sat Jan 17 04:53:20 1970 +0000
2552 extra: branch=foo
2552 extra: branch=foo
2553 description:
2553 description:
2554 new branch
2554 new branch
2555
2555
2556
2556
2557 $ hg log -v -T bisect -r 0:4
2557 $ hg log -v -T bisect -r 0:4
2558 changeset: 0:1e4e1b8f71e0
2558 changeset: 0:1e4e1b8f71e0
2559 bisect: good (implicit)
2559 bisect: good (implicit)
2560 user: User Name <user@hostname>
2560 user: User Name <user@hostname>
2561 date: Mon Jan 12 13:46:40 1970 +0000
2561 date: Mon Jan 12 13:46:40 1970 +0000
2562 files: a
2562 files: a
2563 description:
2563 description:
2564 line 1
2564 line 1
2565 line 2
2565 line 2
2566
2566
2567
2567
2568 changeset: 1:b608e9d1a3f0
2568 changeset: 1:b608e9d1a3f0
2569 bisect: good
2569 bisect: good
2570 user: A. N. Other <other@place>
2570 user: A. N. Other <other@place>
2571 date: Tue Jan 13 17:33:20 1970 +0000
2571 date: Tue Jan 13 17:33:20 1970 +0000
2572 files: b
2572 files: b
2573 description:
2573 description:
2574 other 1
2574 other 1
2575 other 2
2575 other 2
2576
2576
2577 other 3
2577 other 3
2578
2578
2579
2579
2580 changeset: 2:97054abb4ab8
2580 changeset: 2:97054abb4ab8
2581 bisect: untested
2581 bisect: untested
2582 user: other@place
2582 user: other@place
2583 date: Wed Jan 14 21:20:00 1970 +0000
2583 date: Wed Jan 14 21:20:00 1970 +0000
2584 files: c
2584 files: c
2585 description:
2585 description:
2586 no person
2586 no person
2587
2587
2588
2588
2589 changeset: 3:10e46f2dcbf4
2589 changeset: 3:10e46f2dcbf4
2590 bisect: bad
2590 bisect: bad
2591 user: person
2591 user: person
2592 date: Fri Jan 16 01:06:40 1970 +0000
2592 date: Fri Jan 16 01:06:40 1970 +0000
2593 files: c
2593 files: c
2594 description:
2594 description:
2595 no user, no domain
2595 no user, no domain
2596
2596
2597
2597
2598 changeset: 4:bbe44766e73d
2598 changeset: 4:bbe44766e73d
2599 bisect: bad (implicit)
2599 bisect: bad (implicit)
2600 branch: foo
2600 branch: foo
2601 user: person
2601 user: person
2602 date: Sat Jan 17 04:53:20 1970 +0000
2602 date: Sat Jan 17 04:53:20 1970 +0000
2603 description:
2603 description:
2604 new branch
2604 new branch
2605
2605
2606
2606
2607 $ hg --color=debug log -T bisect -r 0:4
2607 $ hg --color=debug log -T bisect -r 0:4
2608 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2608 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2609 [log.bisect bisect.good|bisect: good (implicit)]
2609 [log.bisect bisect.good|bisect: good (implicit)]
2610 [log.user|user: User Name <user@hostname>]
2610 [log.user|user: User Name <user@hostname>]
2611 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2611 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2612 [log.summary|summary: line 1]
2612 [log.summary|summary: line 1]
2613
2613
2614 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2614 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2615 [log.bisect bisect.good|bisect: good]
2615 [log.bisect bisect.good|bisect: good]
2616 [log.user|user: A. N. Other <other@place>]
2616 [log.user|user: A. N. Other <other@place>]
2617 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2617 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2618 [log.summary|summary: other 1]
2618 [log.summary|summary: other 1]
2619
2619
2620 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2620 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2621 [log.bisect bisect.untested|bisect: untested]
2621 [log.bisect bisect.untested|bisect: untested]
2622 [log.user|user: other@place]
2622 [log.user|user: other@place]
2623 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2623 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2624 [log.summary|summary: no person]
2624 [log.summary|summary: no person]
2625
2625
2626 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2626 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2627 [log.bisect bisect.bad|bisect: bad]
2627 [log.bisect bisect.bad|bisect: bad]
2628 [log.user|user: person]
2628 [log.user|user: person]
2629 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2629 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2630 [log.summary|summary: no user, no domain]
2630 [log.summary|summary: no user, no domain]
2631
2631
2632 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2632 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2633 [log.bisect bisect.bad|bisect: bad (implicit)]
2633 [log.bisect bisect.bad|bisect: bad (implicit)]
2634 [log.branch|branch: foo]
2634 [log.branch|branch: foo]
2635 [log.user|user: person]
2635 [log.user|user: person]
2636 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2636 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2637 [log.summary|summary: new branch]
2637 [log.summary|summary: new branch]
2638
2638
2639 $ hg --color=debug log --debug -T bisect -r 0:4
2639 $ hg --color=debug log --debug -T bisect -r 0:4
2640 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2640 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2641 [log.bisect bisect.good|bisect: good (implicit)]
2641 [log.bisect bisect.good|bisect: good (implicit)]
2642 [log.phase|phase: public]
2642 [log.phase|phase: public]
2643 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2643 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2644 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2644 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2645 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2645 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2646 [log.user|user: User Name <user@hostname>]
2646 [log.user|user: User Name <user@hostname>]
2647 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2647 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2648 [ui.debug log.files|files+: a]
2648 [ui.debug log.files|files+: a]
2649 [ui.debug log.extra|extra: branch=default]
2649 [ui.debug log.extra|extra: branch=default]
2650 [ui.note log.description|description:]
2650 [ui.note log.description|description:]
2651 [ui.note log.description|line 1
2651 [ui.note log.description|line 1
2652 line 2]
2652 line 2]
2653
2653
2654
2654
2655 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2655 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2656 [log.bisect bisect.good|bisect: good]
2656 [log.bisect bisect.good|bisect: good]
2657 [log.phase|phase: public]
2657 [log.phase|phase: public]
2658 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2658 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2659 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2659 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2660 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2660 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2661 [log.user|user: A. N. Other <other@place>]
2661 [log.user|user: A. N. Other <other@place>]
2662 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2662 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2663 [ui.debug log.files|files+: b]
2663 [ui.debug log.files|files+: b]
2664 [ui.debug log.extra|extra: branch=default]
2664 [ui.debug log.extra|extra: branch=default]
2665 [ui.note log.description|description:]
2665 [ui.note log.description|description:]
2666 [ui.note log.description|other 1
2666 [ui.note log.description|other 1
2667 other 2
2667 other 2
2668
2668
2669 other 3]
2669 other 3]
2670
2670
2671
2671
2672 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2672 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2673 [log.bisect bisect.untested|bisect: untested]
2673 [log.bisect bisect.untested|bisect: untested]
2674 [log.phase|phase: public]
2674 [log.phase|phase: public]
2675 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2675 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2676 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2676 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2677 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2677 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2678 [log.user|user: other@place]
2678 [log.user|user: other@place]
2679 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2679 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2680 [ui.debug log.files|files+: c]
2680 [ui.debug log.files|files+: c]
2681 [ui.debug log.extra|extra: branch=default]
2681 [ui.debug log.extra|extra: branch=default]
2682 [ui.note log.description|description:]
2682 [ui.note log.description|description:]
2683 [ui.note log.description|no person]
2683 [ui.note log.description|no person]
2684
2684
2685
2685
2686 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2686 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2687 [log.bisect bisect.bad|bisect: bad]
2687 [log.bisect bisect.bad|bisect: bad]
2688 [log.phase|phase: public]
2688 [log.phase|phase: public]
2689 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2689 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2690 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2690 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2691 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2691 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2692 [log.user|user: person]
2692 [log.user|user: person]
2693 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2693 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2694 [ui.debug log.files|files: c]
2694 [ui.debug log.files|files: c]
2695 [ui.debug log.extra|extra: branch=default]
2695 [ui.debug log.extra|extra: branch=default]
2696 [ui.note log.description|description:]
2696 [ui.note log.description|description:]
2697 [ui.note log.description|no user, no domain]
2697 [ui.note log.description|no user, no domain]
2698
2698
2699
2699
2700 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2700 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2701 [log.bisect bisect.bad|bisect: bad (implicit)]
2701 [log.bisect bisect.bad|bisect: bad (implicit)]
2702 [log.branch|branch: foo]
2702 [log.branch|branch: foo]
2703 [log.phase|phase: draft]
2703 [log.phase|phase: draft]
2704 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2704 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2705 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2705 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2706 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2706 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2707 [log.user|user: person]
2707 [log.user|user: person]
2708 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2708 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2709 [ui.debug log.extra|extra: branch=foo]
2709 [ui.debug log.extra|extra: branch=foo]
2710 [ui.note log.description|description:]
2710 [ui.note log.description|description:]
2711 [ui.note log.description|new branch]
2711 [ui.note log.description|new branch]
2712
2712
2713
2713
2714 $ hg --color=debug log -v -T bisect -r 0:4
2714 $ hg --color=debug log -v -T bisect -r 0:4
2715 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2715 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2716 [log.bisect bisect.good|bisect: good (implicit)]
2716 [log.bisect bisect.good|bisect: good (implicit)]
2717 [log.user|user: User Name <user@hostname>]
2717 [log.user|user: User Name <user@hostname>]
2718 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2718 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2719 [ui.note log.files|files: a]
2719 [ui.note log.files|files: a]
2720 [ui.note log.description|description:]
2720 [ui.note log.description|description:]
2721 [ui.note log.description|line 1
2721 [ui.note log.description|line 1
2722 line 2]
2722 line 2]
2723
2723
2724
2724
2725 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2725 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2726 [log.bisect bisect.good|bisect: good]
2726 [log.bisect bisect.good|bisect: good]
2727 [log.user|user: A. N. Other <other@place>]
2727 [log.user|user: A. N. Other <other@place>]
2728 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2728 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2729 [ui.note log.files|files: b]
2729 [ui.note log.files|files: b]
2730 [ui.note log.description|description:]
2730 [ui.note log.description|description:]
2731 [ui.note log.description|other 1
2731 [ui.note log.description|other 1
2732 other 2
2732 other 2
2733
2733
2734 other 3]
2734 other 3]
2735
2735
2736
2736
2737 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2737 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2738 [log.bisect bisect.untested|bisect: untested]
2738 [log.bisect bisect.untested|bisect: untested]
2739 [log.user|user: other@place]
2739 [log.user|user: other@place]
2740 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2740 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2741 [ui.note log.files|files: c]
2741 [ui.note log.files|files: c]
2742 [ui.note log.description|description:]
2742 [ui.note log.description|description:]
2743 [ui.note log.description|no person]
2743 [ui.note log.description|no person]
2744
2744
2745
2745
2746 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2746 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2747 [log.bisect bisect.bad|bisect: bad]
2747 [log.bisect bisect.bad|bisect: bad]
2748 [log.user|user: person]
2748 [log.user|user: person]
2749 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2749 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2750 [ui.note log.files|files: c]
2750 [ui.note log.files|files: c]
2751 [ui.note log.description|description:]
2751 [ui.note log.description|description:]
2752 [ui.note log.description|no user, no domain]
2752 [ui.note log.description|no user, no domain]
2753
2753
2754
2754
2755 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2755 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2756 [log.bisect bisect.bad|bisect: bad (implicit)]
2756 [log.bisect bisect.bad|bisect: bad (implicit)]
2757 [log.branch|branch: foo]
2757 [log.branch|branch: foo]
2758 [log.user|user: person]
2758 [log.user|user: person]
2759 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2759 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2760 [ui.note log.description|description:]
2760 [ui.note log.description|description:]
2761 [ui.note log.description|new branch]
2761 [ui.note log.description|new branch]
2762
2762
2763
2763
2764 $ hg bisect --reset
2764 $ hg bisect --reset
2765
2765
2766 Error on syntax:
2766 Error on syntax:
2767
2767
2768 $ echo 'x = "f' >> t
2768 $ echo 'x = "f' >> t
2769 $ hg log
2769 $ hg log
2770 hg: parse error at t:3: unmatched quotes
2770 hg: parse error at t:3: unmatched quotes
2771 [255]
2771 [255]
2772
2772
2773 $ hg log -T '{date'
2773 $ hg log -T '{date'
2774 hg: parse error at 1: unterminated template expansion
2774 hg: parse error at 1: unterminated template expansion
2775 ({date
2775 ({date
2776 ^ here)
2776 ^ here)
2777 [255]
2777 [255]
2778 $ hg log -T '{date(}'
2778 $ hg log -T '{date(}'
2779 hg: parse error at 6: not a prefix: end
2779 hg: parse error at 6: not a prefix: end
2780 ({date(}
2780 ({date(}
2781 ^ here)
2781 ^ here)
2782 [255]
2782 [255]
2783 $ hg log -T '{date)}'
2783 $ hg log -T '{date)}'
2784 hg: parse error at 5: invalid token
2784 hg: parse error at 5: invalid token
2785 ({date)}
2785 ({date)}
2786 ^ here)
2786 ^ here)
2787 [255]
2787 [255]
2788 $ hg log -T '{date date}'
2788 $ hg log -T '{date date}'
2789 hg: parse error at 6: invalid token
2789 hg: parse error at 6: invalid token
2790 ({date date}
2790 ({date date}
2791 ^ here)
2791 ^ here)
2792 [255]
2792 [255]
2793
2793
2794 $ hg log -T '{}'
2794 $ hg log -T '{}'
2795 hg: parse error at 1: not a prefix: end
2795 hg: parse error at 1: not a prefix: end
2796 ({}
2796 ({}
2797 ^ here)
2797 ^ here)
2798 [255]
2798 [255]
2799 $ hg debugtemplate -v '{()}'
2799 $ hg debugtemplate -v '{()}'
2800 (template
2800 (template
2801 (group
2801 (group
2802 None))
2802 None))
2803 hg: parse error: missing argument
2803 hg: parse error: missing argument
2804 [255]
2804 [255]
2805
2805
2806 Behind the scenes, this would throw TypeError without intype=bytes
2806 Behind the scenes, this would throw TypeError without intype=bytes
2807
2807
2808 $ hg log -l 3 --template '{date|obfuscate}\n'
2808 $ hg log -l 3 --template '{date|obfuscate}\n'
2809 &#48;&#32;&#48;
2809 &#48;&#46;&#48;&#48;
2810 &#48;&#32;&#48;
2810 &#48;&#46;&#48;&#48;
2811 &#49;&#53;&#55;&#55;&#56;&#55;&#50;&#56;&#54;&#48;&#32;&#48;
2811 &#49;&#53;&#55;&#55;&#56;&#55;&#50;&#56;&#54;&#48;&#46;&#48;&#48;
2812
2812
2813 Behind the scenes, this will throw a ValueError
2813 Behind the scenes, this will throw a ValueError
2814
2814
2815 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
2815 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
2816 hg: parse error: invalid date: 'Modify, add, remove, rename'
2816 hg: parse error: invalid date: 'Modify, add, remove, rename'
2817 (template filter 'shortdate' is not compatible with keyword 'desc')
2817 (template filter 'shortdate' is not compatible with keyword 'desc')
2818 [255]
2818 [255]
2819
2819
2820 Behind the scenes, this would throw AttributeError without intype=bytes
2820 Behind the scenes, this would throw AttributeError without intype=bytes
2821
2821
2822 $ hg log -l 3 --template 'line: {date|escape}\n'
2822 $ hg log -l 3 --template 'line: {date|escape}\n'
2823 line: 0 0
2823 line: 0.00
2824 line: 0 0
2824 line: 0.00
2825 line: 1577872860 0
2825 line: 1577872860.00
2826
2826
2827 $ hg log -l 3 --template 'line: {extras|localdate}\n'
2827 $ hg log -l 3 --template 'line: {extras|localdate}\n'
2828 hg: parse error: localdate expects a date information
2828 hg: parse error: localdate expects a date information
2829 [255]
2829 [255]
2830
2830
2831 Behind the scenes, this will throw ValueError
2831 Behind the scenes, this will throw ValueError
2832
2832
2833 $ hg tip --template '{author|email|date}\n'
2833 $ hg tip --template '{author|email|date}\n'
2834 hg: parse error: date expects a date information
2834 hg: parse error: date expects a date information
2835 [255]
2835 [255]
2836
2836
2837 $ hg tip -T '{author|email|shortdate}\n'
2837 $ hg tip -T '{author|email|shortdate}\n'
2838 hg: parse error: invalid date: 'test'
2838 hg: parse error: invalid date: 'test'
2839 (template filter 'shortdate' is not compatible with keyword 'author')
2839 (template filter 'shortdate' is not compatible with keyword 'author')
2840 [255]
2840 [255]
2841
2841
2842 $ hg tip -T '{get(extras, "branch")|shortdate}\n'
2842 $ hg tip -T '{get(extras, "branch")|shortdate}\n'
2843 hg: parse error: invalid date: 'default'
2843 hg: parse error: invalid date: 'default'
2844 (incompatible use of template filter 'shortdate')
2844 (incompatible use of template filter 'shortdate')
2845 [255]
2845 [255]
2846
2846
2847 Error in nested template:
2847 Error in nested template:
2848
2848
2849 $ hg log -T '{"date'
2849 $ hg log -T '{"date'
2850 hg: parse error at 2: unterminated string
2850 hg: parse error at 2: unterminated string
2851 ({"date
2851 ({"date
2852 ^ here)
2852 ^ here)
2853 [255]
2853 [255]
2854
2854
2855 $ hg log -T '{"foo{date|?}"}'
2855 $ hg log -T '{"foo{date|?}"}'
2856 hg: parse error at 11: syntax error
2856 hg: parse error at 11: syntax error
2857 ({"foo{date|?}"}
2857 ({"foo{date|?}"}
2858 ^ here)
2858 ^ here)
2859 [255]
2859 [255]
2860
2860
2861 Thrown an error if a template function doesn't exist
2861 Thrown an error if a template function doesn't exist
2862
2862
2863 $ hg tip --template '{foo()}\n'
2863 $ hg tip --template '{foo()}\n'
2864 hg: parse error: unknown function 'foo'
2864 hg: parse error: unknown function 'foo'
2865 [255]
2865 [255]
2866
2866
2867 Pass generator object created by template function to filter
2867 Pass generator object created by template function to filter
2868
2868
2869 $ hg log -l 1 --template '{if(author, author)|user}\n'
2869 $ hg log -l 1 --template '{if(author, author)|user}\n'
2870 test
2870 test
2871
2871
2872 Test index keyword:
2872 Test index keyword:
2873
2873
2874 $ hg log -l 2 -T '{index + 10}{files % " {index}:{file}"}\n'
2874 $ hg log -l 2 -T '{index + 10}{files % " {index}:{file}"}\n'
2875 10 0:a 1:b 2:fifth 3:fourth 4:third
2875 10 0:a 1:b 2:fifth 3:fourth 4:third
2876 11 0:a
2876 11 0:a
2877
2877
2878 $ hg branches -T '{index} {branch}\n'
2878 $ hg branches -T '{index} {branch}\n'
2879 0 default
2879 0 default
2880 1 foo
2880 1 foo
2881
2881
2882 Test diff function:
2882 Test diff function:
2883
2883
2884 $ hg diff -c 8
2884 $ hg diff -c 8
2885 diff -r 29114dbae42b -r 95c24699272e fourth
2885 diff -r 29114dbae42b -r 95c24699272e fourth
2886 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2886 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2887 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2887 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2888 @@ -0,0 +1,1 @@
2888 @@ -0,0 +1,1 @@
2889 +second
2889 +second
2890 diff -r 29114dbae42b -r 95c24699272e second
2890 diff -r 29114dbae42b -r 95c24699272e second
2891 --- a/second Mon Jan 12 13:46:40 1970 +0000
2891 --- a/second Mon Jan 12 13:46:40 1970 +0000
2892 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2892 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2893 @@ -1,1 +0,0 @@
2893 @@ -1,1 +0,0 @@
2894 -second
2894 -second
2895 diff -r 29114dbae42b -r 95c24699272e third
2895 diff -r 29114dbae42b -r 95c24699272e third
2896 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2896 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2897 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2897 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2898 @@ -0,0 +1,1 @@
2898 @@ -0,0 +1,1 @@
2899 +third
2899 +third
2900
2900
2901 $ hg log -r 8 -T "{diff()}"
2901 $ hg log -r 8 -T "{diff()}"
2902 diff -r 29114dbae42b -r 95c24699272e fourth
2902 diff -r 29114dbae42b -r 95c24699272e fourth
2903 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2903 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2904 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2904 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2905 @@ -0,0 +1,1 @@
2905 @@ -0,0 +1,1 @@
2906 +second
2906 +second
2907 diff -r 29114dbae42b -r 95c24699272e second
2907 diff -r 29114dbae42b -r 95c24699272e second
2908 --- a/second Mon Jan 12 13:46:40 1970 +0000
2908 --- a/second Mon Jan 12 13:46:40 1970 +0000
2909 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2909 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2910 @@ -1,1 +0,0 @@
2910 @@ -1,1 +0,0 @@
2911 -second
2911 -second
2912 diff -r 29114dbae42b -r 95c24699272e third
2912 diff -r 29114dbae42b -r 95c24699272e third
2913 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2913 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2914 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2914 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2915 @@ -0,0 +1,1 @@
2915 @@ -0,0 +1,1 @@
2916 +third
2916 +third
2917
2917
2918 $ hg log -r 8 -T "{diff('glob:f*')}"
2918 $ hg log -r 8 -T "{diff('glob:f*')}"
2919 diff -r 29114dbae42b -r 95c24699272e fourth
2919 diff -r 29114dbae42b -r 95c24699272e fourth
2920 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2920 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2921 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2921 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2922 @@ -0,0 +1,1 @@
2922 @@ -0,0 +1,1 @@
2923 +second
2923 +second
2924
2924
2925 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
2925 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
2926 diff -r 29114dbae42b -r 95c24699272e second
2926 diff -r 29114dbae42b -r 95c24699272e second
2927 --- a/second Mon Jan 12 13:46:40 1970 +0000
2927 --- a/second Mon Jan 12 13:46:40 1970 +0000
2928 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2928 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2929 @@ -1,1 +0,0 @@
2929 @@ -1,1 +0,0 @@
2930 -second
2930 -second
2931 diff -r 29114dbae42b -r 95c24699272e third
2931 diff -r 29114dbae42b -r 95c24699272e third
2932 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2932 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2933 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2933 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2934 @@ -0,0 +1,1 @@
2934 @@ -0,0 +1,1 @@
2935 +third
2935 +third
2936
2936
2937 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2937 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2938 diff -r 29114dbae42b -r 95c24699272e fourth
2938 diff -r 29114dbae42b -r 95c24699272e fourth
2939 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2939 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2940 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2940 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2941 @@ -0,0 +1,1 @@
2941 @@ -0,0 +1,1 @@
2942 +second
2942 +second
2943
2943
2944 ui verbosity:
2944 ui verbosity:
2945
2945
2946 $ hg log -l1 -T '{verbosity}\n'
2946 $ hg log -l1 -T '{verbosity}\n'
2947
2947
2948 $ hg log -l1 -T '{verbosity}\n' --debug
2948 $ hg log -l1 -T '{verbosity}\n' --debug
2949 debug
2949 debug
2950 $ hg log -l1 -T '{verbosity}\n' --quiet
2950 $ hg log -l1 -T '{verbosity}\n' --quiet
2951 quiet
2951 quiet
2952 $ hg log -l1 -T '{verbosity}\n' --verbose
2952 $ hg log -l1 -T '{verbosity}\n' --verbose
2953 verbose
2953 verbose
2954
2954
2955 $ cd ..
2955 $ cd ..
2956
2956
2957
2957
2958 latesttag:
2958 latesttag:
2959
2959
2960 $ hg init latesttag
2960 $ hg init latesttag
2961 $ cd latesttag
2961 $ cd latesttag
2962
2962
2963 $ echo a > file
2963 $ echo a > file
2964 $ hg ci -Am a -d '0 0'
2964 $ hg ci -Am a -d '0 0'
2965 adding file
2965 adding file
2966
2966
2967 $ echo b >> file
2967 $ echo b >> file
2968 $ hg ci -m b -d '1 0'
2968 $ hg ci -m b -d '1 0'
2969
2969
2970 $ echo c >> head1
2970 $ echo c >> head1
2971 $ hg ci -Am h1c -d '2 0'
2971 $ hg ci -Am h1c -d '2 0'
2972 adding head1
2972 adding head1
2973
2973
2974 $ hg update -q 1
2974 $ hg update -q 1
2975 $ echo d >> head2
2975 $ echo d >> head2
2976 $ hg ci -Am h2d -d '3 0'
2976 $ hg ci -Am h2d -d '3 0'
2977 adding head2
2977 adding head2
2978 created new head
2978 created new head
2979
2979
2980 $ echo e >> head2
2980 $ echo e >> head2
2981 $ hg ci -m h2e -d '4 0'
2981 $ hg ci -m h2e -d '4 0'
2982
2982
2983 $ hg merge -q
2983 $ hg merge -q
2984 $ hg ci -m merge -d '5 -3600'
2984 $ hg ci -m merge -d '5 -3600'
2985
2985
2986 No tag set:
2986 No tag set:
2987
2987
2988 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
2988 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
2989 @ 5: null+5
2989 @ 5: null+5
2990 |\
2990 |\
2991 | o 4: null+4
2991 | o 4: null+4
2992 | |
2992 | |
2993 | o 3: null+3
2993 | o 3: null+3
2994 | |
2994 | |
2995 o | 2: null+3
2995 o | 2: null+3
2996 |/
2996 |/
2997 o 1: null+2
2997 o 1: null+2
2998 |
2998 |
2999 o 0: null+1
2999 o 0: null+1
3000
3000
3001
3001
3002 One common tag: longest path wins for {latesttagdistance}:
3002 One common tag: longest path wins for {latesttagdistance}:
3003
3003
3004 $ hg tag -r 1 -m t1 -d '6 0' t1
3004 $ hg tag -r 1 -m t1 -d '6 0' t1
3005 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3005 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3006 @ 6: t1+4
3006 @ 6: t1+4
3007 |
3007 |
3008 o 5: t1+3
3008 o 5: t1+3
3009 |\
3009 |\
3010 | o 4: t1+2
3010 | o 4: t1+2
3011 | |
3011 | |
3012 | o 3: t1+1
3012 | o 3: t1+1
3013 | |
3013 | |
3014 o | 2: t1+1
3014 o | 2: t1+1
3015 |/
3015 |/
3016 o 1: t1+0
3016 o 1: t1+0
3017 |
3017 |
3018 o 0: null+1
3018 o 0: null+1
3019
3019
3020
3020
3021 One ancestor tag: closest wins:
3021 One ancestor tag: closest wins:
3022
3022
3023 $ hg tag -r 2 -m t2 -d '7 0' t2
3023 $ hg tag -r 2 -m t2 -d '7 0' t2
3024 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3024 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3025 @ 7: t2+3
3025 @ 7: t2+3
3026 |
3026 |
3027 o 6: t2+2
3027 o 6: t2+2
3028 |
3028 |
3029 o 5: t2+1
3029 o 5: t2+1
3030 |\
3030 |\
3031 | o 4: t1+2
3031 | o 4: t1+2
3032 | |
3032 | |
3033 | o 3: t1+1
3033 | o 3: t1+1
3034 | |
3034 | |
3035 o | 2: t2+0
3035 o | 2: t2+0
3036 |/
3036 |/
3037 o 1: t1+0
3037 o 1: t1+0
3038 |
3038 |
3039 o 0: null+1
3039 o 0: null+1
3040
3040
3041
3041
3042 Two branch tags: more recent wins if same number of changes:
3042 Two branch tags: more recent wins if same number of changes:
3043
3043
3044 $ hg tag -r 3 -m t3 -d '8 0' t3
3044 $ hg tag -r 3 -m t3 -d '8 0' t3
3045 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3045 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3046 @ 8: t3+5
3046 @ 8: t3+5
3047 |
3047 |
3048 o 7: t3+4
3048 o 7: t3+4
3049 |
3049 |
3050 o 6: t3+3
3050 o 6: t3+3
3051 |
3051 |
3052 o 5: t3+2
3052 o 5: t3+2
3053 |\
3053 |\
3054 | o 4: t3+1
3054 | o 4: t3+1
3055 | |
3055 | |
3056 | o 3: t3+0
3056 | o 3: t3+0
3057 | |
3057 | |
3058 o | 2: t2+0
3058 o | 2: t2+0
3059 |/
3059 |/
3060 o 1: t1+0
3060 o 1: t1+0
3061 |
3061 |
3062 o 0: null+1
3062 o 0: null+1
3063
3063
3064
3064
3065 Two branch tags: fewest changes wins:
3065 Two branch tags: fewest changes wins:
3066
3066
3067 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter
3067 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter
3068 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3068 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3069 @ 9: t4+5,6
3069 @ 9: t4+5,6
3070 |
3070 |
3071 o 8: t4+4,5
3071 o 8: t4+4,5
3072 |
3072 |
3073 o 7: t4+3,4
3073 o 7: t4+3,4
3074 |
3074 |
3075 o 6: t4+2,3
3075 o 6: t4+2,3
3076 |
3076 |
3077 o 5: t4+1,2
3077 o 5: t4+1,2
3078 |\
3078 |\
3079 | o 4: t4+0,0
3079 | o 4: t4+0,0
3080 | |
3080 | |
3081 | o 3: t3+0,0
3081 | o 3: t3+0,0
3082 | |
3082 | |
3083 o | 2: t2+0,0
3083 o | 2: t2+0,0
3084 |/
3084 |/
3085 o 1: t1+0,0
3085 o 1: t1+0,0
3086 |
3086 |
3087 o 0: null+1,1
3087 o 0: null+1,1
3088
3088
3089
3089
3090 Merged tag overrides:
3090 Merged tag overrides:
3091
3091
3092 $ hg tag -r 5 -m t5 -d '9 0' t5
3092 $ hg tag -r 5 -m t5 -d '9 0' t5
3093 $ hg tag -r 3 -m at3 -d '10 0' at3
3093 $ hg tag -r 3 -m at3 -d '10 0' at3
3094 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3094 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3095 @ 11: t5+6
3095 @ 11: t5+6
3096 |
3096 |
3097 o 10: t5+5
3097 o 10: t5+5
3098 |
3098 |
3099 o 9: t5+4
3099 o 9: t5+4
3100 |
3100 |
3101 o 8: t5+3
3101 o 8: t5+3
3102 |
3102 |
3103 o 7: t5+2
3103 o 7: t5+2
3104 |
3104 |
3105 o 6: t5+1
3105 o 6: t5+1
3106 |
3106 |
3107 o 5: t5+0
3107 o 5: t5+0
3108 |\
3108 |\
3109 | o 4: t4+0
3109 | o 4: t4+0
3110 | |
3110 | |
3111 | o 3: at3:t3+0
3111 | o 3: at3:t3+0
3112 | |
3112 | |
3113 o | 2: t2+0
3113 o | 2: t2+0
3114 |/
3114 |/
3115 o 1: t1+0
3115 o 1: t1+0
3116 |
3116 |
3117 o 0: null+1
3117 o 0: null+1
3118
3118
3119
3119
3120 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3120 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3121 @ 11: t5+6,6
3121 @ 11: t5+6,6
3122 |
3122 |
3123 o 10: t5+5,5
3123 o 10: t5+5,5
3124 |
3124 |
3125 o 9: t5+4,4
3125 o 9: t5+4,4
3126 |
3126 |
3127 o 8: t5+3,3
3127 o 8: t5+3,3
3128 |
3128 |
3129 o 7: t5+2,2
3129 o 7: t5+2,2
3130 |
3130 |
3131 o 6: t5+1,1
3131 o 6: t5+1,1
3132 |
3132 |
3133 o 5: t5+0,0
3133 o 5: t5+0,0
3134 |\
3134 |\
3135 | o 4: t4+0,0
3135 | o 4: t4+0,0
3136 | |
3136 | |
3137 | o 3: at3+0,0 t3+0,0
3137 | o 3: at3+0,0 t3+0,0
3138 | |
3138 | |
3139 o | 2: t2+0,0
3139 o | 2: t2+0,0
3140 |/
3140 |/
3141 o 1: t1+0,0
3141 o 1: t1+0,0
3142 |
3142 |
3143 o 0: null+1,1
3143 o 0: null+1,1
3144
3144
3145
3145
3146 $ hg log -G --template "{rev}: {latesttag('re:^t[13]$') % '{tag}, C: {changes}, D: {distance}'}\n"
3146 $ hg log -G --template "{rev}: {latesttag('re:^t[13]$') % '{tag}, C: {changes}, D: {distance}'}\n"
3147 @ 11: t3, C: 9, D: 8
3147 @ 11: t3, C: 9, D: 8
3148 |
3148 |
3149 o 10: t3, C: 8, D: 7
3149 o 10: t3, C: 8, D: 7
3150 |
3150 |
3151 o 9: t3, C: 7, D: 6
3151 o 9: t3, C: 7, D: 6
3152 |
3152 |
3153 o 8: t3, C: 6, D: 5
3153 o 8: t3, C: 6, D: 5
3154 |
3154 |
3155 o 7: t3, C: 5, D: 4
3155 o 7: t3, C: 5, D: 4
3156 |
3156 |
3157 o 6: t3, C: 4, D: 3
3157 o 6: t3, C: 4, D: 3
3158 |
3158 |
3159 o 5: t3, C: 3, D: 2
3159 o 5: t3, C: 3, D: 2
3160 |\
3160 |\
3161 | o 4: t3, C: 1, D: 1
3161 | o 4: t3, C: 1, D: 1
3162 | |
3162 | |
3163 | o 3: t3, C: 0, D: 0
3163 | o 3: t3, C: 0, D: 0
3164 | |
3164 | |
3165 o | 2: t1, C: 1, D: 1
3165 o | 2: t1, C: 1, D: 1
3166 |/
3166 |/
3167 o 1: t1, C: 0, D: 0
3167 o 1: t1, C: 0, D: 0
3168 |
3168 |
3169 o 0: null, C: 1, D: 1
3169 o 0: null, C: 1, D: 1
3170
3170
3171
3171
3172 $ cd ..
3172 $ cd ..
3173
3173
3174
3174
3175 Style path expansion: issue1948 - ui.style option doesn't work on OSX
3175 Style path expansion: issue1948 - ui.style option doesn't work on OSX
3176 if it is a relative path
3176 if it is a relative path
3177
3177
3178 $ mkdir -p home/styles
3178 $ mkdir -p home/styles
3179
3179
3180 $ cat > home/styles/teststyle <<EOF
3180 $ cat > home/styles/teststyle <<EOF
3181 > changeset = 'test {rev}:{node|short}\n'
3181 > changeset = 'test {rev}:{node|short}\n'
3182 > EOF
3182 > EOF
3183
3183
3184 $ HOME=`pwd`/home; export HOME
3184 $ HOME=`pwd`/home; export HOME
3185
3185
3186 $ cat > latesttag/.hg/hgrc <<EOF
3186 $ cat > latesttag/.hg/hgrc <<EOF
3187 > [ui]
3187 > [ui]
3188 > style = ~/styles/teststyle
3188 > style = ~/styles/teststyle
3189 > EOF
3189 > EOF
3190
3190
3191 $ hg -R latesttag tip
3191 $ hg -R latesttag tip
3192 test 11:97e5943b523a
3192 test 11:97e5943b523a
3193
3193
3194 Test recursive showlist template (issue1989):
3194 Test recursive showlist template (issue1989):
3195
3195
3196 $ cat > style1989 <<EOF
3196 $ cat > style1989 <<EOF
3197 > changeset = '{file_mods}{manifest}{extras}'
3197 > changeset = '{file_mods}{manifest}{extras}'
3198 > file_mod = 'M|{author|person}\n'
3198 > file_mod = 'M|{author|person}\n'
3199 > manifest = '{rev},{author}\n'
3199 > manifest = '{rev},{author}\n'
3200 > extra = '{key}: {author}\n'
3200 > extra = '{key}: {author}\n'
3201 > EOF
3201 > EOF
3202
3202
3203 $ hg -R latesttag log -r tip --style=style1989
3203 $ hg -R latesttag log -r tip --style=style1989
3204 M|test
3204 M|test
3205 11,test
3205 11,test
3206 branch: test
3206 branch: test
3207
3207
3208 Test new-style inline templating:
3208 Test new-style inline templating:
3209
3209
3210 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
3210 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
3211 modified files: .hgtags
3211 modified files: .hgtags
3212
3212
3213
3213
3214 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
3214 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
3215 hg: parse error: 11 is not iterable of mappings
3215 hg: parse error: 11 is not iterable of mappings
3216 (keyword 'rev' does not support map operation)
3216 (keyword 'rev' does not support map operation)
3217 [255]
3217 [255]
3218 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
3218 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
3219 hg: parse error: None is not iterable of mappings
3219 hg: parse error: None is not iterable of mappings
3220 [255]
3220 [255]
3221 $ hg log -R latesttag -r tip -T '{extras % "{key}\n" % "{key}\n"}'
3221 $ hg log -R latesttag -r tip -T '{extras % "{key}\n" % "{key}\n"}'
3222 hg: parse error: list of strings is not mappable
3222 hg: parse error: list of strings is not mappable
3223 [255]
3223 [255]
3224
3224
3225 Test new-style inline templating of non-list/dict type:
3225 Test new-style inline templating of non-list/dict type:
3226
3226
3227 $ hg log -R latesttag -r tip -T '{manifest}\n'
3227 $ hg log -R latesttag -r tip -T '{manifest}\n'
3228 11:2bc6e9006ce2
3228 11:2bc6e9006ce2
3229 $ hg log -R latesttag -r tip -T 'string length: {manifest|count}\n'
3229 $ hg log -R latesttag -r tip -T 'string length: {manifest|count}\n'
3230 string length: 15
3230 string length: 15
3231 $ hg log -R latesttag -r tip -T '{manifest % "{rev}:{node}"}\n'
3231 $ hg log -R latesttag -r tip -T '{manifest % "{rev}:{node}"}\n'
3232 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc
3232 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc
3233
3233
3234 $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}'
3234 $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}'
3235 branch: default
3235 branch: default
3236 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}'
3236 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}'
3237 hg: parse error: None is not iterable of mappings
3237 hg: parse error: None is not iterable of mappings
3238 [255]
3238 [255]
3239 $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}'
3239 $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}'
3240 branch: default
3240 branch: default
3241 $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}'
3241 $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}'
3242 0:ce3cec86e6c2
3242 0:ce3cec86e6c2
3243 $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}'
3243 $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}'
3244 9:fbc7cd862e9c
3244 9:fbc7cd862e9c
3245
3245
3246 Test manifest/get() can be join()-ed as string, though it's silly:
3246 Test manifest/get() can be join()-ed as string, though it's silly:
3247
3247
3248 $ hg log -R latesttag -r tip -T '{join(manifest, ".")}\n'
3248 $ hg log -R latesttag -r tip -T '{join(manifest, ".")}\n'
3249 1.1.:.2.b.c.6.e.9.0.0.6.c.e.2
3249 1.1.:.2.b.c.6.e.9.0.0.6.c.e.2
3250 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), ".")}\n'
3250 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), ".")}\n'
3251 d.e.f.a.u.l.t
3251 d.e.f.a.u.l.t
3252
3252
3253 Test join() over string
3253 Test join() over string
3254
3254
3255 $ hg log -R latesttag -r tip -T '{join(rev|stringify, ".")}\n'
3255 $ hg log -R latesttag -r tip -T '{join(rev|stringify, ".")}\n'
3256 1.1
3256 1.1
3257
3257
3258 Test join() over uniterable
3258 Test join() over uniterable
3259
3259
3260 $ hg log -R latesttag -r tip -T '{join(rev, "")}\n'
3260 $ hg log -R latesttag -r tip -T '{join(rev, "")}\n'
3261 hg: parse error: 11 is not iterable
3261 hg: parse error: 11 is not iterable
3262 [255]
3262 [255]
3263
3263
3264 Test min/max of integers
3264 Test min/max of integers
3265
3265
3266 $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'
3266 $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'
3267 9
3267 9
3268 $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n'
3268 $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n'
3269 10
3269 10
3270
3270
3271 Test min/max over map operation:
3271 Test min/max over map operation:
3272
3272
3273 $ hg log -R latesttag -r3 -T '{min(tags % "{tag}")}\n'
3273 $ hg log -R latesttag -r3 -T '{min(tags % "{tag}")}\n'
3274 at3
3274 at3
3275 $ hg log -R latesttag -r3 -T '{max(tags % "{tag}")}\n'
3275 $ hg log -R latesttag -r3 -T '{max(tags % "{tag}")}\n'
3276 t3
3276 t3
3277
3277
3278 Test min/max of strings:
3278 Test min/max of strings:
3279
3279
3280 $ hg log -R latesttag -l1 -T '{min(desc)}\n'
3280 $ hg log -R latesttag -l1 -T '{min(desc)}\n'
3281 3
3281 3
3282 $ hg log -R latesttag -l1 -T '{max(desc)}\n'
3282 $ hg log -R latesttag -l1 -T '{max(desc)}\n'
3283 t
3283 t
3284
3284
3285 Test min/max of non-iterable:
3285 Test min/max of non-iterable:
3286
3286
3287 $ hg debugtemplate '{min(1)}'
3287 $ hg debugtemplate '{min(1)}'
3288 hg: parse error: 1 is not iterable
3288 hg: parse error: 1 is not iterable
3289 (min first argument should be an iterable)
3289 (min first argument should be an iterable)
3290 [255]
3290 [255]
3291 $ hg debugtemplate '{max(2)}'
3291 $ hg debugtemplate '{max(2)}'
3292 hg: parse error: 2 is not iterable
3292 hg: parse error: 2 is not iterable
3293 (max first argument should be an iterable)
3293 (max first argument should be an iterable)
3294 [255]
3294 [255]
3295
3295
3296 $ hg log -R latesttag -l1 -T '{min(date)}'
3296 $ hg log -R latesttag -l1 -T '{min(date)}'
3297 hg: parse error: date is not iterable
3297 hg: parse error: date is not iterable
3298 (min first argument should be an iterable)
3298 (min first argument should be an iterable)
3299 [255]
3299 [255]
3300 $ hg log -R latesttag -l1 -T '{max(date)}'
3300 $ hg log -R latesttag -l1 -T '{max(date)}'
3301 hg: parse error: date is not iterable
3301 hg: parse error: date is not iterable
3302 (max first argument should be an iterable)
3302 (max first argument should be an iterable)
3303 [255]
3303 [255]
3304
3304
3305 Test min/max of empty sequence:
3305 Test min/max of empty sequence:
3306
3306
3307 $ hg debugtemplate '{min("")}'
3307 $ hg debugtemplate '{min("")}'
3308 hg: parse error: empty string
3308 hg: parse error: empty string
3309 (min first argument should be an iterable)
3309 (min first argument should be an iterable)
3310 [255]
3310 [255]
3311 $ hg debugtemplate '{max("")}'
3311 $ hg debugtemplate '{max("")}'
3312 hg: parse error: empty string
3312 hg: parse error: empty string
3313 (max first argument should be an iterable)
3313 (max first argument should be an iterable)
3314 [255]
3314 [255]
3315 $ hg debugtemplate '{min(dict())}'
3315 $ hg debugtemplate '{min(dict())}'
3316 hg: parse error: empty sequence
3316 hg: parse error: empty sequence
3317 (min first argument should be an iterable)
3317 (min first argument should be an iterable)
3318 [255]
3318 [255]
3319 $ hg debugtemplate '{max(dict())}'
3319 $ hg debugtemplate '{max(dict())}'
3320 hg: parse error: empty sequence
3320 hg: parse error: empty sequence
3321 (max first argument should be an iterable)
3321 (max first argument should be an iterable)
3322 [255]
3322 [255]
3323 $ hg debugtemplate '{min(dict() % "")}'
3323 $ hg debugtemplate '{min(dict() % "")}'
3324 hg: parse error: empty sequence
3324 hg: parse error: empty sequence
3325 (min first argument should be an iterable)
3325 (min first argument should be an iterable)
3326 [255]
3326 [255]
3327 $ hg debugtemplate '{max(dict() % "")}'
3327 $ hg debugtemplate '{max(dict() % "")}'
3328 hg: parse error: empty sequence
3328 hg: parse error: empty sequence
3329 (max first argument should be an iterable)
3329 (max first argument should be an iterable)
3330 [255]
3330 [255]
3331
3331
3332 Test min/max of if() result
3332 Test min/max of if() result
3333
3333
3334 $ cd latesttag
3334 $ cd latesttag
3335 $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
3335 $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
3336 9
3336 9
3337 $ hg log -l1 -T '{max(if(false, "", revset("9:10")))}\n'
3337 $ hg log -l1 -T '{max(if(false, "", revset("9:10")))}\n'
3338 10
3338 10
3339 $ hg log -l1 -T '{min(ifcontains("a", "aa", revset("9:10"), ""))}\n'
3339 $ hg log -l1 -T '{min(ifcontains("a", "aa", revset("9:10"), ""))}\n'
3340 9
3340 9
3341 $ hg log -l1 -T '{max(ifcontains("a", "bb", "", revset("9:10")))}\n'
3341 $ hg log -l1 -T '{max(ifcontains("a", "bb", "", revset("9:10")))}\n'
3342 10
3342 10
3343 $ hg log -l1 -T '{min(ifeq(0, 0, revset("9:10"), ""))}\n'
3343 $ hg log -l1 -T '{min(ifeq(0, 0, revset("9:10"), ""))}\n'
3344 9
3344 9
3345 $ hg log -l1 -T '{max(ifeq(0, 1, "", revset("9:10")))}\n'
3345 $ hg log -l1 -T '{max(ifeq(0, 1, "", revset("9:10")))}\n'
3346 10
3346 10
3347 $ cd ..
3347 $ cd ..
3348
3348
3349 Test laziness of if() then/else clause
3349 Test laziness of if() then/else clause
3350
3350
3351 $ hg debugtemplate '{count(0)}'
3351 $ hg debugtemplate '{count(0)}'
3352 hg: parse error: not countable
3352 hg: parse error: not countable
3353 (incompatible use of template filter 'count')
3353 (incompatible use of template filter 'count')
3354 [255]
3354 [255]
3355 $ hg debugtemplate '{if(true, "", count(0))}'
3355 $ hg debugtemplate '{if(true, "", count(0))}'
3356 $ hg debugtemplate '{if(false, count(0), "")}'
3356 $ hg debugtemplate '{if(false, count(0), "")}'
3357 $ hg debugtemplate '{ifcontains("a", "aa", "", count(0))}'
3357 $ hg debugtemplate '{ifcontains("a", "aa", "", count(0))}'
3358 $ hg debugtemplate '{ifcontains("a", "bb", count(0), "")}'
3358 $ hg debugtemplate '{ifcontains("a", "bb", count(0), "")}'
3359 $ hg debugtemplate '{ifeq(0, 0, "", count(0))}'
3359 $ hg debugtemplate '{ifeq(0, 0, "", count(0))}'
3360 $ hg debugtemplate '{ifeq(0, 1, count(0), "")}'
3360 $ hg debugtemplate '{ifeq(0, 1, count(0), "")}'
3361
3361
3362 Test dot operator precedence:
3362 Test dot operator precedence:
3363
3363
3364 $ hg debugtemplate -R latesttag -r0 -v '{manifest.node|short}\n'
3364 $ hg debugtemplate -R latesttag -r0 -v '{manifest.node|short}\n'
3365 (template
3365 (template
3366 (|
3366 (|
3367 (.
3367 (.
3368 (symbol 'manifest')
3368 (symbol 'manifest')
3369 (symbol 'node'))
3369 (symbol 'node'))
3370 (symbol 'short'))
3370 (symbol 'short'))
3371 (string '\n'))
3371 (string '\n'))
3372 89f4071fec70
3372 89f4071fec70
3373
3373
3374 (the following examples are invalid, but seem natural in parsing POV)
3374 (the following examples are invalid, but seem natural in parsing POV)
3375
3375
3376 $ hg debugtemplate -R latesttag -r0 -v '{foo|bar.baz}\n' 2> /dev/null
3376 $ hg debugtemplate -R latesttag -r0 -v '{foo|bar.baz}\n' 2> /dev/null
3377 (template
3377 (template
3378 (|
3378 (|
3379 (symbol 'foo')
3379 (symbol 'foo')
3380 (.
3380 (.
3381 (symbol 'bar')
3381 (symbol 'bar')
3382 (symbol 'baz')))
3382 (symbol 'baz')))
3383 (string '\n'))
3383 (string '\n'))
3384 [255]
3384 [255]
3385 $ hg debugtemplate -R latesttag -r0 -v '{foo.bar()}\n' 2> /dev/null
3385 $ hg debugtemplate -R latesttag -r0 -v '{foo.bar()}\n' 2> /dev/null
3386 (template
3386 (template
3387 (.
3387 (.
3388 (symbol 'foo')
3388 (symbol 'foo')
3389 (func
3389 (func
3390 (symbol 'bar')
3390 (symbol 'bar')
3391 None))
3391 None))
3392 (string '\n'))
3392 (string '\n'))
3393 [255]
3393 [255]
3394
3394
3395 Test evaluation of dot operator:
3395 Test evaluation of dot operator:
3396
3396
3397 $ hg log -R latesttag -l1 -T '{min(revset("0:9")).node}\n'
3397 $ hg log -R latesttag -l1 -T '{min(revset("0:9")).node}\n'
3398 ce3cec86e6c26bd9bdfc590a6b92abc9680f1796
3398 ce3cec86e6c26bd9bdfc590a6b92abc9680f1796
3399 $ hg log -R latesttag -r0 -T '{extras.branch}\n'
3399 $ hg log -R latesttag -r0 -T '{extras.branch}\n'
3400 default
3400 default
3401 $ hg log -R latesttag -r0 -T '{date.unixtime} {localdate(date, "+0200").tzoffset}\n'
3401 $ hg log -R latesttag -r0 -T '{date.unixtime} {localdate(date, "+0200").tzoffset}\n'
3402 0 -7200
3402 0 -7200
3403
3403
3404 $ hg log -R latesttag -l1 -T '{author.invalid}\n'
3404 $ hg log -R latesttag -l1 -T '{author.invalid}\n'
3405 hg: parse error: 'test' is not a dictionary
3405 hg: parse error: 'test' is not a dictionary
3406 (keyword 'author' does not support member operation)
3406 (keyword 'author' does not support member operation)
3407 [255]
3407 [255]
3408 $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n'
3408 $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n'
3409 hg: parse error: 'a' is not a dictionary
3409 hg: parse error: 'a' is not a dictionary
3410 [255]
3410 [255]
3411
3411
3412 Test the sub function of templating for expansion:
3412 Test the sub function of templating for expansion:
3413
3413
3414 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
3414 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
3415 xx
3415 xx
3416
3416
3417 $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n'
3417 $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n'
3418 hg: parse error: sub got an invalid pattern: [
3418 hg: parse error: sub got an invalid pattern: [
3419 [255]
3419 [255]
3420 $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n'
3420 $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n'
3421 hg: parse error: sub got an invalid replacement: \1
3421 hg: parse error: sub got an invalid replacement: \1
3422 [255]
3422 [255]
3423
3423
3424 Test the strip function with chars specified:
3424 Test the strip function with chars specified:
3425
3425
3426 $ hg log -R latesttag --template '{desc}\n'
3426 $ hg log -R latesttag --template '{desc}\n'
3427 at3
3427 at3
3428 t5
3428 t5
3429 t4
3429 t4
3430 t3
3430 t3
3431 t2
3431 t2
3432 t1
3432 t1
3433 merge
3433 merge
3434 h2e
3434 h2e
3435 h2d
3435 h2d
3436 h1c
3436 h1c
3437 b
3437 b
3438 a
3438 a
3439
3439
3440 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
3440 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
3441 at3
3441 at3
3442 5
3442 5
3443 4
3443 4
3444 3
3444 3
3445 2
3445 2
3446 1
3446 1
3447 merg
3447 merg
3448 h2
3448 h2
3449 h2d
3449 h2d
3450 h1c
3450 h1c
3451 b
3451 b
3452 a
3452 a
3453
3453
3454 Test date format:
3454 Test date format:
3455
3455
3456 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
3456 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
3457 date: 70 01 01 10 +0000
3457 date: 70 01 01 10 +0000
3458 date: 70 01 01 09 +0000
3458 date: 70 01 01 09 +0000
3459 date: 70 01 01 04 +0000
3459 date: 70 01 01 04 +0000
3460 date: 70 01 01 08 +0000
3460 date: 70 01 01 08 +0000
3461 date: 70 01 01 07 +0000
3461 date: 70 01 01 07 +0000
3462 date: 70 01 01 06 +0000
3462 date: 70 01 01 06 +0000
3463 date: 70 01 01 05 +0100
3463 date: 70 01 01 05 +0100
3464 date: 70 01 01 04 +0000
3464 date: 70 01 01 04 +0000
3465 date: 70 01 01 03 +0000
3465 date: 70 01 01 03 +0000
3466 date: 70 01 01 02 +0000
3466 date: 70 01 01 02 +0000
3467 date: 70 01 01 01 +0000
3467 date: 70 01 01 01 +0000
3468 date: 70 01 01 00 +0000
3468 date: 70 01 01 00 +0000
3469
3469
3470 Test invalid date:
3470 Test invalid date:
3471
3471
3472 $ hg log -R latesttag -T '{date(rev)}\n'
3472 $ hg log -R latesttag -T '{date(rev)}\n'
3473 hg: parse error: date expects a date information
3473 hg: parse error: date expects a date information
3474 [255]
3474 [255]
3475
3475
3476 Test integer literal:
3476 Test integer literal:
3477
3477
3478 $ hg debugtemplate -v '{(0)}\n'
3478 $ hg debugtemplate -v '{(0)}\n'
3479 (template
3479 (template
3480 (group
3480 (group
3481 (integer '0'))
3481 (integer '0'))
3482 (string '\n'))
3482 (string '\n'))
3483 0
3483 0
3484 $ hg debugtemplate -v '{(123)}\n'
3484 $ hg debugtemplate -v '{(123)}\n'
3485 (template
3485 (template
3486 (group
3486 (group
3487 (integer '123'))
3487 (integer '123'))
3488 (string '\n'))
3488 (string '\n'))
3489 123
3489 123
3490 $ hg debugtemplate -v '{(-4)}\n'
3490 $ hg debugtemplate -v '{(-4)}\n'
3491 (template
3491 (template
3492 (group
3492 (group
3493 (negate
3493 (negate
3494 (integer '4')))
3494 (integer '4')))
3495 (string '\n'))
3495 (string '\n'))
3496 -4
3496 -4
3497 $ hg debugtemplate '{(-)}\n'
3497 $ hg debugtemplate '{(-)}\n'
3498 hg: parse error at 3: not a prefix: )
3498 hg: parse error at 3: not a prefix: )
3499 ({(-)}\n
3499 ({(-)}\n
3500 ^ here)
3500 ^ here)
3501 [255]
3501 [255]
3502 $ hg debugtemplate '{(-a)}\n'
3502 $ hg debugtemplate '{(-a)}\n'
3503 hg: parse error: negation needs an integer argument
3503 hg: parse error: negation needs an integer argument
3504 [255]
3504 [255]
3505
3505
3506 top-level integer literal is interpreted as symbol (i.e. variable name):
3506 top-level integer literal is interpreted as symbol (i.e. variable name):
3507
3507
3508 $ hg debugtemplate -D 1=one -v '{1}\n'
3508 $ hg debugtemplate -D 1=one -v '{1}\n'
3509 (template
3509 (template
3510 (integer '1')
3510 (integer '1')
3511 (string '\n'))
3511 (string '\n'))
3512 one
3512 one
3513 $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n'
3513 $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n'
3514 (template
3514 (template
3515 (func
3515 (func
3516 (symbol 'if')
3516 (symbol 'if')
3517 (list
3517 (list
3518 (string 't')
3518 (string 't')
3519 (template
3519 (template
3520 (integer '1'))))
3520 (integer '1'))))
3521 (string '\n'))
3521 (string '\n'))
3522 one
3522 one
3523 $ hg debugtemplate -D 1=one -v '{1|stringify}\n'
3523 $ hg debugtemplate -D 1=one -v '{1|stringify}\n'
3524 (template
3524 (template
3525 (|
3525 (|
3526 (integer '1')
3526 (integer '1')
3527 (symbol 'stringify'))
3527 (symbol 'stringify'))
3528 (string '\n'))
3528 (string '\n'))
3529 one
3529 one
3530
3530
3531 unless explicit symbol is expected:
3531 unless explicit symbol is expected:
3532
3532
3533 $ hg log -Ra -r0 -T '{desc|1}\n'
3533 $ hg log -Ra -r0 -T '{desc|1}\n'
3534 hg: parse error: expected a symbol, got 'integer'
3534 hg: parse error: expected a symbol, got 'integer'
3535 [255]
3535 [255]
3536 $ hg log -Ra -r0 -T '{1()}\n'
3536 $ hg log -Ra -r0 -T '{1()}\n'
3537 hg: parse error: expected a symbol, got 'integer'
3537 hg: parse error: expected a symbol, got 'integer'
3538 [255]
3538 [255]
3539
3539
3540 Test string literal:
3540 Test string literal:
3541
3541
3542 $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n'
3542 $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n'
3543 (template
3543 (template
3544 (string 'string with no template fragment')
3544 (string 'string with no template fragment')
3545 (string '\n'))
3545 (string '\n'))
3546 string with no template fragment
3546 string with no template fragment
3547 $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n'
3547 $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n'
3548 (template
3548 (template
3549 (template
3549 (template
3550 (string 'template: ')
3550 (string 'template: ')
3551 (symbol 'rev'))
3551 (symbol 'rev'))
3552 (string '\n'))
3552 (string '\n'))
3553 template: 0
3553 template: 0
3554 $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n'
3554 $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n'
3555 (template
3555 (template
3556 (string 'rawstring: {rev}')
3556 (string 'rawstring: {rev}')
3557 (string '\n'))
3557 (string '\n'))
3558 rawstring: {rev}
3558 rawstring: {rev}
3559 $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n'
3559 $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n'
3560 (template
3560 (template
3561 (%
3561 (%
3562 (symbol 'files')
3562 (symbol 'files')
3563 (string 'rawstring: {file}'))
3563 (string 'rawstring: {file}'))
3564 (string '\n'))
3564 (string '\n'))
3565 rawstring: {file}
3565 rawstring: {file}
3566
3566
3567 Test string escaping:
3567 Test string escaping:
3568
3568
3569 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3569 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3570 >
3570 >
3571 <>\n<[>
3571 <>\n<[>
3572 <>\n<]>
3572 <>\n<]>
3573 <>\n<
3573 <>\n<
3574
3574
3575 $ hg log -R latesttag -r 0 \
3575 $ hg log -R latesttag -r 0 \
3576 > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3576 > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3577 >
3577 >
3578 <>\n<[>
3578 <>\n<[>
3579 <>\n<]>
3579 <>\n<]>
3580 <>\n<
3580 <>\n<
3581
3581
3582 $ hg log -R latesttag -r 0 -T esc \
3582 $ hg log -R latesttag -r 0 -T esc \
3583 > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3583 > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3584 >
3584 >
3585 <>\n<[>
3585 <>\n<[>
3586 <>\n<]>
3586 <>\n<]>
3587 <>\n<
3587 <>\n<
3588
3588
3589 $ cat <<'EOF' > esctmpl
3589 $ cat <<'EOF' > esctmpl
3590 > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3590 > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3591 > EOF
3591 > EOF
3592 $ hg log -R latesttag -r 0 --style ./esctmpl
3592 $ hg log -R latesttag -r 0 --style ./esctmpl
3593 >
3593 >
3594 <>\n<[>
3594 <>\n<[>
3595 <>\n<]>
3595 <>\n<]>
3596 <>\n<
3596 <>\n<
3597
3597
3598 Test string escaping of quotes:
3598 Test string escaping of quotes:
3599
3599
3600 $ hg log -Ra -r0 -T '{"\""}\n'
3600 $ hg log -Ra -r0 -T '{"\""}\n'
3601 "
3601 "
3602 $ hg log -Ra -r0 -T '{"\\\""}\n'
3602 $ hg log -Ra -r0 -T '{"\\\""}\n'
3603 \"
3603 \"
3604 $ hg log -Ra -r0 -T '{r"\""}\n'
3604 $ hg log -Ra -r0 -T '{r"\""}\n'
3605 \"
3605 \"
3606 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3606 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3607 \\\"
3607 \\\"
3608
3608
3609
3609
3610 $ hg log -Ra -r0 -T '{"\""}\n'
3610 $ hg log -Ra -r0 -T '{"\""}\n'
3611 "
3611 "
3612 $ hg log -Ra -r0 -T '{"\\\""}\n'
3612 $ hg log -Ra -r0 -T '{"\\\""}\n'
3613 \"
3613 \"
3614 $ hg log -Ra -r0 -T '{r"\""}\n'
3614 $ hg log -Ra -r0 -T '{r"\""}\n'
3615 \"
3615 \"
3616 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3616 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3617 \\\"
3617 \\\"
3618
3618
3619 Test exception in quoted template. single backslash before quotation mark is
3619 Test exception in quoted template. single backslash before quotation mark is
3620 stripped before parsing:
3620 stripped before parsing:
3621
3621
3622 $ cat <<'EOF' > escquotetmpl
3622 $ cat <<'EOF' > escquotetmpl
3623 > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n"
3623 > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n"
3624 > EOF
3624 > EOF
3625 $ cd latesttag
3625 $ cd latesttag
3626 $ hg log -r 2 --style ../escquotetmpl
3626 $ hg log -r 2 --style ../escquotetmpl
3627 " \" \" \\" head1
3627 " \" \" \\" head1
3628
3628
3629 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"'
3629 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"'
3630 valid
3630 valid
3631 $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'"
3631 $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'"
3632 valid
3632 valid
3633
3633
3634 Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested
3634 Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested
3635 _evalifliteral() templates (issue4733):
3635 _evalifliteral() templates (issue4733):
3636
3636
3637 $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n'
3637 $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n'
3638 "2
3638 "2
3639 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n'
3639 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n'
3640 "2
3640 "2
3641 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n'
3641 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n'
3642 "2
3642 "2
3643
3643
3644 $ hg log -r 2 -T '{if(rev, "\\\"")}\n'
3644 $ hg log -r 2 -T '{if(rev, "\\\"")}\n'
3645 \"
3645 \"
3646 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n'
3646 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n'
3647 \"
3647 \"
3648 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3648 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3649 \"
3649 \"
3650
3650
3651 $ hg log -r 2 -T '{if(rev, r"\\\"")}\n'
3651 $ hg log -r 2 -T '{if(rev, r"\\\"")}\n'
3652 \\\"
3652 \\\"
3653 $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n'
3653 $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n'
3654 \\\"
3654 \\\"
3655 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3655 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3656 \\\"
3656 \\\"
3657
3657
3658 escaped single quotes and errors:
3658 escaped single quotes and errors:
3659
3659
3660 $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n'
3660 $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n'
3661 foo
3661 foo
3662 $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n'
3662 $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n'
3663 foo
3663 foo
3664 $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n'
3664 $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n'
3665 hg: parse error at 21: unterminated string
3665 hg: parse error at 21: unterminated string
3666 ({if(rev, "{if(rev, \")}")}\n
3666 ({if(rev, "{if(rev, \")}")}\n
3667 ^ here)
3667 ^ here)
3668 [255]
3668 [255]
3669 $ hg log -r 2 -T '{if(rev, \"\\"")}\n'
3669 $ hg log -r 2 -T '{if(rev, \"\\"")}\n'
3670 hg: parse error: trailing \ in string
3670 hg: parse error: trailing \ in string
3671 [255]
3671 [255]
3672 $ hg log -r 2 -T '{if(rev, r\"\\"")}\n'
3672 $ hg log -r 2 -T '{if(rev, r\"\\"")}\n'
3673 hg: parse error: trailing \ in string
3673 hg: parse error: trailing \ in string
3674 [255]
3674 [255]
3675
3675
3676 $ cd ..
3676 $ cd ..
3677
3677
3678 Test leading backslashes:
3678 Test leading backslashes:
3679
3679
3680 $ cd latesttag
3680 $ cd latesttag
3681 $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n'
3681 $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n'
3682 {rev} {file}
3682 {rev} {file}
3683 $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n'
3683 $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n'
3684 \2 \head1
3684 \2 \head1
3685 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n'
3685 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n'
3686 \{rev} \{file}
3686 \{rev} \{file}
3687 $ cd ..
3687 $ cd ..
3688
3688
3689 Test leading backslashes in "if" expression (issue4714):
3689 Test leading backslashes in "if" expression (issue4714):
3690
3690
3691 $ cd latesttag
3691 $ cd latesttag
3692 $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n'
3692 $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n'
3693 {rev} \{rev}
3693 {rev} \{rev}
3694 $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n'
3694 $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n'
3695 \2 \\{rev}
3695 \2 \\{rev}
3696 $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n'
3696 $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n'
3697 \{rev} \\\{rev}
3697 \{rev} \\\{rev}
3698 $ cd ..
3698 $ cd ..
3699
3699
3700 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
3700 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
3701
3701
3702 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
3702 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
3703 \x6e
3703 \x6e
3704 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
3704 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
3705 \x5c\x786e
3705 \x5c\x786e
3706 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
3706 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
3707 \x6e
3707 \x6e
3708 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
3708 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
3709 \x5c\x786e
3709 \x5c\x786e
3710
3710
3711 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
3711 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
3712 \x6e
3712 \x6e
3713 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
3713 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
3714 \x5c\x786e
3714 \x5c\x786e
3715 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
3715 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
3716 \x6e
3716 \x6e
3717 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
3717 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
3718 \x5c\x786e
3718 \x5c\x786e
3719
3719
3720 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
3720 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
3721 fourth
3721 fourth
3722 second
3722 second
3723 third
3723 third
3724 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
3724 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
3725 fourth\nsecond\nthird
3725 fourth\nsecond\nthird
3726
3726
3727 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
3727 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
3728 <p>
3728 <p>
3729 1st
3729 1st
3730 </p>
3730 </p>
3731 <p>
3731 <p>
3732 2nd
3732 2nd
3733 </p>
3733 </p>
3734 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
3734 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
3735 <p>
3735 <p>
3736 1st\n\n2nd
3736 1st\n\n2nd
3737 </p>
3737 </p>
3738 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
3738 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
3739 1st
3739 1st
3740
3740
3741 2nd
3741 2nd
3742
3742
3743 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
3743 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
3744 o perso
3744 o perso
3745 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
3745 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
3746 no person
3746 no person
3747 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
3747 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
3748 o perso
3748 o perso
3749 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
3749 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
3750 no perso
3750 no perso
3751
3751
3752 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
3752 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
3753 -o perso-
3753 -o perso-
3754 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
3754 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
3755 no person
3755 no person
3756 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
3756 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
3757 \x2do perso\x2d
3757 \x2do perso\x2d
3758 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
3758 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
3759 -o perso-
3759 -o perso-
3760 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
3760 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
3761 \x2do perso\x6e
3761 \x2do perso\x6e
3762
3762
3763 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
3763 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
3764 fourth
3764 fourth
3765 second
3765 second
3766 third
3766 third
3767
3767
3768 Test string escaping in nested expression:
3768 Test string escaping in nested expression:
3769
3769
3770 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
3770 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
3771 fourth\x6esecond\x6ethird
3771 fourth\x6esecond\x6ethird
3772 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
3772 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
3773 fourth\x6esecond\x6ethird
3773 fourth\x6esecond\x6ethird
3774
3774
3775 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
3775 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
3776 fourth\x6esecond\x6ethird
3776 fourth\x6esecond\x6ethird
3777 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
3777 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
3778 fourth\x5c\x786esecond\x5c\x786ethird
3778 fourth\x5c\x786esecond\x5c\x786ethird
3779
3779
3780 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
3780 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
3781 3:\x6eo user, \x6eo domai\x6e
3781 3:\x6eo user, \x6eo domai\x6e
3782 4:\x5c\x786eew bra\x5c\x786ech
3782 4:\x5c\x786eew bra\x5c\x786ech
3783
3783
3784 Test quotes in nested expression are evaluated just like a $(command)
3784 Test quotes in nested expression are evaluated just like a $(command)
3785 substitution in POSIX shells:
3785 substitution in POSIX shells:
3786
3786
3787 $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n'
3787 $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n'
3788 8:95c24699272e
3788 8:95c24699272e
3789 $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n'
3789 $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n'
3790 {8} "95c24699272e"
3790 {8} "95c24699272e"
3791
3791
3792 Test recursive evaluation:
3792 Test recursive evaluation:
3793
3793
3794 $ hg init r
3794 $ hg init r
3795 $ cd r
3795 $ cd r
3796 $ echo a > a
3796 $ echo a > a
3797 $ hg ci -Am '{rev}'
3797 $ hg ci -Am '{rev}'
3798 adding a
3798 adding a
3799 $ hg log -r 0 --template '{if(rev, desc)}\n'
3799 $ hg log -r 0 --template '{if(rev, desc)}\n'
3800 {rev}
3800 {rev}
3801 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
3801 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
3802 test 0
3802 test 0
3803
3803
3804 $ hg branch -q 'text.{rev}'
3804 $ hg branch -q 'text.{rev}'
3805 $ echo aa >> aa
3805 $ echo aa >> aa
3806 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
3806 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
3807
3807
3808 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
3808 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
3809 {node|short}desc to
3809 {node|short}desc to
3810 text.{rev}be wrapped
3810 text.{rev}be wrapped
3811 text.{rev}desc to be
3811 text.{rev}desc to be
3812 text.{rev}wrapped (no-eol)
3812 text.{rev}wrapped (no-eol)
3813 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
3813 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
3814 bcc7ff960b8e:desc to
3814 bcc7ff960b8e:desc to
3815 text.1:be wrapped
3815 text.1:be wrapped
3816 text.1:desc to be
3816 text.1:desc to be
3817 text.1:wrapped (no-eol)
3817 text.1:wrapped (no-eol)
3818 $ hg log -l1 -T '{fill(desc, date, "", "")}\n'
3818 $ hg log -l1 -T '{fill(desc, date, "", "")}\n'
3819 hg: parse error: fill expects an integer width
3819 hg: parse error: fill expects an integer width
3820 [255]
3820 [255]
3821
3821
3822 $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}'
3822 $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}'
3823 bcc7ff960b8e:desc to be
3823 bcc7ff960b8e:desc to be
3824 termwidth.1:wrapped desc
3824 termwidth.1:wrapped desc
3825 termwidth.1:to be wrapped (no-eol)
3825 termwidth.1:to be wrapped (no-eol)
3826
3826
3827 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3827 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3828 {node|short} (no-eol)
3828 {node|short} (no-eol)
3829 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
3829 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
3830 bcc-ff---b-e (no-eol)
3830 bcc-ff---b-e (no-eol)
3831
3831
3832 $ cat >> .hg/hgrc <<EOF
3832 $ cat >> .hg/hgrc <<EOF
3833 > [extensions]
3833 > [extensions]
3834 > color=
3834 > color=
3835 > [color]
3835 > [color]
3836 > mode=ansi
3836 > mode=ansi
3837 > text.{rev} = red
3837 > text.{rev} = red
3838 > text.1 = green
3838 > text.1 = green
3839 > EOF
3839 > EOF
3840 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
3840 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
3841 \x1b[0;31mtext\x1b[0m (esc)
3841 \x1b[0;31mtext\x1b[0m (esc)
3842 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
3842 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
3843 \x1b[0;32mtext\x1b[0m (esc)
3843 \x1b[0;32mtext\x1b[0m (esc)
3844
3844
3845 color effect can be specified without quoting:
3845 color effect can be specified without quoting:
3846
3846
3847 $ hg log --color=always -l 1 --template '{label(red, "text\n")}'
3847 $ hg log --color=always -l 1 --template '{label(red, "text\n")}'
3848 \x1b[0;31mtext\x1b[0m (esc)
3848 \x1b[0;31mtext\x1b[0m (esc)
3849
3849
3850 color effects can be nested (issue5413)
3850 color effects can be nested (issue5413)
3851
3851
3852 $ hg debugtemplate --color=always \
3852 $ hg debugtemplate --color=always \
3853 > '{label(red, "red{label(magenta, "ma{label(cyan, "cyan")}{label(yellow, "yellow")}genta")}")}\n'
3853 > '{label(red, "red{label(magenta, "ma{label(cyan, "cyan")}{label(yellow, "yellow")}genta")}")}\n'
3854 \x1b[0;31mred\x1b[0;35mma\x1b[0;36mcyan\x1b[0m\x1b[0;31m\x1b[0;35m\x1b[0;33myellow\x1b[0m\x1b[0;31m\x1b[0;35mgenta\x1b[0m (esc)
3854 \x1b[0;31mred\x1b[0;35mma\x1b[0;36mcyan\x1b[0m\x1b[0;31m\x1b[0;35m\x1b[0;33myellow\x1b[0m\x1b[0;31m\x1b[0;35mgenta\x1b[0m (esc)
3855
3855
3856 pad() should interact well with color codes (issue5416)
3856 pad() should interact well with color codes (issue5416)
3857
3857
3858 $ hg debugtemplate --color=always \
3858 $ hg debugtemplate --color=always \
3859 > '{pad(label(red, "red"), 5, label(cyan, "-"))}\n'
3859 > '{pad(label(red, "red"), 5, label(cyan, "-"))}\n'
3860 \x1b[0;31mred\x1b[0m\x1b[0;36m-\x1b[0m\x1b[0;36m-\x1b[0m (esc)
3860 \x1b[0;31mred\x1b[0m\x1b[0;36m-\x1b[0m\x1b[0;36m-\x1b[0m (esc)
3861
3861
3862 label should be no-op if color is disabled:
3862 label should be no-op if color is disabled:
3863
3863
3864 $ hg log --color=never -l 1 --template '{label(red, "text\n")}'
3864 $ hg log --color=never -l 1 --template '{label(red, "text\n")}'
3865 text
3865 text
3866 $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}'
3866 $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}'
3867 text
3867 text
3868
3868
3869 Test branches inside if statement:
3869 Test branches inside if statement:
3870
3870
3871 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
3871 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
3872 no
3872 no
3873
3873
3874 Test dict constructor:
3874 Test dict constructor:
3875
3875
3876 $ hg log -r 0 -T '{dict(y=node|short, x=rev)}\n'
3876 $ hg log -r 0 -T '{dict(y=node|short, x=rev)}\n'
3877 y=f7769ec2ab97 x=0
3877 y=f7769ec2ab97 x=0
3878 $ hg log -r 0 -T '{dict(x=rev, y=node|short) % "{key}={value}\n"}'
3878 $ hg log -r 0 -T '{dict(x=rev, y=node|short) % "{key}={value}\n"}'
3879 x=0
3879 x=0
3880 y=f7769ec2ab97
3880 y=f7769ec2ab97
3881 $ hg log -r 0 -T '{dict(x=rev, y=node|short)|json}\n'
3881 $ hg log -r 0 -T '{dict(x=rev, y=node|short)|json}\n'
3882 {"x": 0, "y": "f7769ec2ab97"}
3882 {"x": 0, "y": "f7769ec2ab97"}
3883 $ hg log -r 0 -T '{dict()|json}\n'
3883 $ hg log -r 0 -T '{dict()|json}\n'
3884 {}
3884 {}
3885
3885
3886 $ hg log -r 0 -T '{dict(rev, node=node|short)}\n'
3886 $ hg log -r 0 -T '{dict(rev, node=node|short)}\n'
3887 rev=0 node=f7769ec2ab97
3887 rev=0 node=f7769ec2ab97
3888 $ hg log -r 0 -T '{dict(rev, node|short)}\n'
3888 $ hg log -r 0 -T '{dict(rev, node|short)}\n'
3889 rev=0 node=f7769ec2ab97
3889 rev=0 node=f7769ec2ab97
3890
3890
3891 $ hg log -r 0 -T '{dict(rev, rev=rev)}\n'
3891 $ hg log -r 0 -T '{dict(rev, rev=rev)}\n'
3892 hg: parse error: duplicated dict key 'rev' inferred
3892 hg: parse error: duplicated dict key 'rev' inferred
3893 [255]
3893 [255]
3894 $ hg log -r 0 -T '{dict(node, node|short)}\n'
3894 $ hg log -r 0 -T '{dict(node, node|short)}\n'
3895 hg: parse error: duplicated dict key 'node' inferred
3895 hg: parse error: duplicated dict key 'node' inferred
3896 [255]
3896 [255]
3897 $ hg log -r 0 -T '{dict(1 + 2)}'
3897 $ hg log -r 0 -T '{dict(1 + 2)}'
3898 hg: parse error: dict key cannot be inferred
3898 hg: parse error: dict key cannot be inferred
3899 [255]
3899 [255]
3900
3900
3901 $ hg log -r 0 -T '{dict(x=rev, x=node)}'
3901 $ hg log -r 0 -T '{dict(x=rev, x=node)}'
3902 hg: parse error: dict got multiple values for keyword argument 'x'
3902 hg: parse error: dict got multiple values for keyword argument 'x'
3903 [255]
3903 [255]
3904
3904
3905 Test get function:
3905 Test get function:
3906
3906
3907 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3907 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3908 default
3908 default
3909 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
3909 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
3910 default
3910 default
3911 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3911 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3912 hg: parse error: not a dictionary
3912 hg: parse error: not a dictionary
3913 (get() expects a dict as first argument)
3913 (get() expects a dict as first argument)
3914 [255]
3914 [255]
3915
3915
3916 Test json filter applied to wrapped object:
3916 Test json filter applied to wrapped object:
3917
3917
3918 $ hg log -r0 -T '{files|json}\n'
3918 $ hg log -r0 -T '{files|json}\n'
3919 ["a"]
3919 ["a"]
3920 $ hg log -r0 -T '{extras|json}\n'
3920 $ hg log -r0 -T '{extras|json}\n'
3921 {"branch": "default"}
3921 {"branch": "default"}
3922 $ hg log -r0 -T '{date|json}\n'
3922 $ hg log -r0 -T '{date|json}\n'
3923 [0, 0]
3923 [0, 0]
3924
3924
3925 Test json filter applied to map result:
3925 Test json filter applied to map result:
3926
3926
3927 $ hg log -r0 -T '{json(extras % "{key}")}\n'
3927 $ hg log -r0 -T '{json(extras % "{key}")}\n'
3928 ["branch"]
3928 ["branch"]
3929
3929
3930 Test localdate(date, tz) function:
3930 Test localdate(date, tz) function:
3931
3931
3932 $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
3932 $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
3933 1970-01-01 09:00 +0900
3933 1970-01-01 09:00 +0900
3934 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n'
3934 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n'
3935 1970-01-01 00:00 +0000
3935 1970-01-01 00:00 +0000
3936 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "blahUTC")|isodate}\n'
3936 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "blahUTC")|isodate}\n'
3937 hg: parse error: localdate expects a timezone
3937 hg: parse error: localdate expects a timezone
3938 [255]
3938 [255]
3939 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n'
3939 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n'
3940 1970-01-01 02:00 +0200
3940 1970-01-01 02:00 +0200
3941 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n'
3941 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n'
3942 1970-01-01 00:00 +0000
3942 1970-01-01 00:00 +0000
3943 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n'
3943 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n'
3944 1970-01-01 00:00 +0000
3944 1970-01-01 00:00 +0000
3945 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n'
3945 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n'
3946 hg: parse error: localdate expects a timezone
3946 hg: parse error: localdate expects a timezone
3947 [255]
3947 [255]
3948 $ hg log -r0 -T '{localdate(date, date)|isodate}\n'
3948 $ hg log -r0 -T '{localdate(date, date)|isodate}\n'
3949 hg: parse error: localdate expects a timezone
3949 hg: parse error: localdate expects a timezone
3950 [255]
3950 [255]
3951
3951
3952 Test shortest(node) function:
3952 Test shortest(node) function:
3953
3953
3954 $ echo b > b
3954 $ echo b > b
3955 $ hg ci -qAm b
3955 $ hg ci -qAm b
3956 $ hg log --template '{shortest(node)}\n'
3956 $ hg log --template '{shortest(node)}\n'
3957 e777
3957 e777
3958 bcc7
3958 bcc7
3959 f776
3959 f776
3960 $ hg log --template '{shortest(node, 10)}\n'
3960 $ hg log --template '{shortest(node, 10)}\n'
3961 e777603221
3961 e777603221
3962 bcc7ff960b
3962 bcc7ff960b
3963 f7769ec2ab
3963 f7769ec2ab
3964 $ hg log --template '{node|shortest}\n' -l1
3964 $ hg log --template '{node|shortest}\n' -l1
3965 e777
3965 e777
3966
3966
3967 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
3967 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
3968 f7769ec2ab
3968 f7769ec2ab
3969 $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
3969 $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
3970 hg: parse error: shortest() expects an integer minlength
3970 hg: parse error: shortest() expects an integer minlength
3971 [255]
3971 [255]
3972
3972
3973 $ hg log -r 'wdir()' -T '{node|shortest}\n'
3973 $ hg log -r 'wdir()' -T '{node|shortest}\n'
3974 ffff
3974 ffff
3975
3975
3976 $ hg log --template '{shortest("f")}\n' -l1
3976 $ hg log --template '{shortest("f")}\n' -l1
3977 f
3977 f
3978
3978
3979 $ hg log --template '{shortest("0123456789012345678901234567890123456789")}\n' -l1
3979 $ hg log --template '{shortest("0123456789012345678901234567890123456789")}\n' -l1
3980 0123456789012345678901234567890123456789
3980 0123456789012345678901234567890123456789
3981
3981
3982 $ hg log --template '{shortest("01234567890123456789012345678901234567890123456789")}\n' -l1
3982 $ hg log --template '{shortest("01234567890123456789012345678901234567890123456789")}\n' -l1
3983 01234567890123456789012345678901234567890123456789
3983 01234567890123456789012345678901234567890123456789
3984
3984
3985 $ hg log --template '{shortest("not a hex string")}\n' -l1
3985 $ hg log --template '{shortest("not a hex string")}\n' -l1
3986 not a hex string
3986 not a hex string
3987
3987
3988 $ hg log --template '{shortest("not a hex string, but it'\''s 40 bytes long")}\n' -l1
3988 $ hg log --template '{shortest("not a hex string, but it'\''s 40 bytes long")}\n' -l1
3989 not a hex string, but it's 40 bytes long
3989 not a hex string, but it's 40 bytes long
3990
3990
3991 $ hg log --template '{shortest("ffffffffffffffffffffffffffffffffffffffff")}\n' -l1
3991 $ hg log --template '{shortest("ffffffffffffffffffffffffffffffffffffffff")}\n' -l1
3992 ffff
3992 ffff
3993
3993
3994 $ hg log --template '{shortest("fffffff")}\n' -l1
3994 $ hg log --template '{shortest("fffffff")}\n' -l1
3995 ffff
3995 ffff
3996
3996
3997 $ hg log --template '{shortest("ff")}\n' -l1
3997 $ hg log --template '{shortest("ff")}\n' -l1
3998 ffff
3998 ffff
3999
3999
4000 $ cd ..
4000 $ cd ..
4001
4001
4002 Test shortest(node) with the repo having short hash collision:
4002 Test shortest(node) with the repo having short hash collision:
4003
4003
4004 $ hg init hashcollision
4004 $ hg init hashcollision
4005 $ cd hashcollision
4005 $ cd hashcollision
4006 $ cat <<EOF >> .hg/hgrc
4006 $ cat <<EOF >> .hg/hgrc
4007 > [experimental]
4007 > [experimental]
4008 > evolution.createmarkers=True
4008 > evolution.createmarkers=True
4009 > EOF
4009 > EOF
4010 $ echo 0 > a
4010 $ echo 0 > a
4011 $ hg ci -qAm 0
4011 $ hg ci -qAm 0
4012 $ for i in 17 129 248 242 480 580 617 1057 2857 4025; do
4012 $ for i in 17 129 248 242 480 580 617 1057 2857 4025; do
4013 > hg up -q 0
4013 > hg up -q 0
4014 > echo $i > a
4014 > echo $i > a
4015 > hg ci -qm $i
4015 > hg ci -qm $i
4016 > done
4016 > done
4017 $ hg up -q null
4017 $ hg up -q null
4018 $ hg log -r0: -T '{rev}:{node}\n'
4018 $ hg log -r0: -T '{rev}:{node}\n'
4019 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
4019 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
4020 1:11424df6dc1dd4ea255eae2b58eaca7831973bbc
4020 1:11424df6dc1dd4ea255eae2b58eaca7831973bbc
4021 2:11407b3f1b9c3e76a79c1ec5373924df096f0499
4021 2:11407b3f1b9c3e76a79c1ec5373924df096f0499
4022 3:11dd92fe0f39dfdaacdaa5f3997edc533875cfc4
4022 3:11dd92fe0f39dfdaacdaa5f3997edc533875cfc4
4023 4:10776689e627b465361ad5c296a20a487e153ca4
4023 4:10776689e627b465361ad5c296a20a487e153ca4
4024 5:a00be79088084cb3aff086ab799f8790e01a976b
4024 5:a00be79088084cb3aff086ab799f8790e01a976b
4025 6:a0b0acd79b4498d0052993d35a6a748dd51d13e6
4025 6:a0b0acd79b4498d0052993d35a6a748dd51d13e6
4026 7:a0457b3450b8e1b778f1163b31a435802987fe5d
4026 7:a0457b3450b8e1b778f1163b31a435802987fe5d
4027 8:c56256a09cd28e5764f32e8e2810d0f01e2e357a
4027 8:c56256a09cd28e5764f32e8e2810d0f01e2e357a
4028 9:c5623987d205cd6d9d8389bfc40fff9dbb670b48
4028 9:c5623987d205cd6d9d8389bfc40fff9dbb670b48
4029 10:c562ddd9c94164376c20b86b0b4991636a3bf84f
4029 10:c562ddd9c94164376c20b86b0b4991636a3bf84f
4030 $ hg debugobsolete a00be79088084cb3aff086ab799f8790e01a976b
4030 $ hg debugobsolete a00be79088084cb3aff086ab799f8790e01a976b
4031 obsoleted 1 changesets
4031 obsoleted 1 changesets
4032 $ hg debugobsolete c5623987d205cd6d9d8389bfc40fff9dbb670b48
4032 $ hg debugobsolete c5623987d205cd6d9d8389bfc40fff9dbb670b48
4033 obsoleted 1 changesets
4033 obsoleted 1 changesets
4034 $ hg debugobsolete c562ddd9c94164376c20b86b0b4991636a3bf84f
4034 $ hg debugobsolete c562ddd9c94164376c20b86b0b4991636a3bf84f
4035 obsoleted 1 changesets
4035 obsoleted 1 changesets
4036
4036
4037 nodes starting with '11' (we don't have the revision number '11' though)
4037 nodes starting with '11' (we don't have the revision number '11' though)
4038
4038
4039 $ hg log -r 1:3 -T '{rev}:{shortest(node, 0)}\n'
4039 $ hg log -r 1:3 -T '{rev}:{shortest(node, 0)}\n'
4040 1:1142
4040 1:1142
4041 2:1140
4041 2:1140
4042 3:11d
4042 3:11d
4043
4043
4044 '5:a00' is hidden, but still we have two nodes starting with 'a0'
4044 '5:a00' is hidden, but still we have two nodes starting with 'a0'
4045
4045
4046 $ hg log -r 6:7 -T '{rev}:{shortest(node, 0)}\n'
4046 $ hg log -r 6:7 -T '{rev}:{shortest(node, 0)}\n'
4047 6:a0b
4047 6:a0b
4048 7:a04
4048 7:a04
4049
4049
4050 node '10' conflicts with the revision number '10' even if it is hidden
4050 node '10' conflicts with the revision number '10' even if it is hidden
4051 (we could exclude hidden revision numbers, but currently we don't)
4051 (we could exclude hidden revision numbers, but currently we don't)
4052
4052
4053 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n'
4053 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n'
4054 4:107
4054 4:107
4055 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
4055 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
4056 4:107
4056 4:107
4057
4057
4058 node 'c562' should be unique if the other 'c562' nodes are hidden
4058 node 'c562' should be unique if the other 'c562' nodes are hidden
4059 (but we don't try the slow path to filter out hidden nodes for now)
4059 (but we don't try the slow path to filter out hidden nodes for now)
4060
4060
4061 $ hg log -r 8 -T '{rev}:{node|shortest}\n'
4061 $ hg log -r 8 -T '{rev}:{node|shortest}\n'
4062 8:c5625
4062 8:c5625
4063 $ hg log -r 8:10 -T '{rev}:{node|shortest}\n' --hidden
4063 $ hg log -r 8:10 -T '{rev}:{node|shortest}\n' --hidden
4064 8:c5625
4064 8:c5625
4065 9:c5623
4065 9:c5623
4066 10:c562d
4066 10:c562d
4067
4067
4068 $ cd ..
4068 $ cd ..
4069
4069
4070 Test pad function
4070 Test pad function
4071
4071
4072 $ cd r
4072 $ cd r
4073
4073
4074 $ hg log --template '{pad(rev, 20)} {author|user}\n'
4074 $ hg log --template '{pad(rev, 20)} {author|user}\n'
4075 2 test
4075 2 test
4076 1 {node|short}
4076 1 {node|short}
4077 0 test
4077 0 test
4078
4078
4079 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
4079 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
4080 2 test
4080 2 test
4081 1 {node|short}
4081 1 {node|short}
4082 0 test
4082 0 test
4083
4083
4084 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
4084 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
4085 2------------------- test
4085 2------------------- test
4086 1------------------- {node|short}
4086 1------------------- {node|short}
4087 0------------------- test
4087 0------------------- test
4088
4088
4089 Test template string in pad function
4089 Test template string in pad function
4090
4090
4091 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
4091 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
4092 {0} test
4092 {0} test
4093
4093
4094 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
4094 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
4095 \{rev} test
4095 \{rev} test
4096
4096
4097 Test width argument passed to pad function
4097 Test width argument passed to pad function
4098
4098
4099 $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n'
4099 $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n'
4100 0 test
4100 0 test
4101 $ hg log -r 0 -T '{pad(rev, "not an int")}\n'
4101 $ hg log -r 0 -T '{pad(rev, "not an int")}\n'
4102 hg: parse error: pad() expects an integer width
4102 hg: parse error: pad() expects an integer width
4103 [255]
4103 [255]
4104
4104
4105 Test invalid fillchar passed to pad function
4105 Test invalid fillchar passed to pad function
4106
4106
4107 $ hg log -r 0 -T '{pad(rev, 10, "")}\n'
4107 $ hg log -r 0 -T '{pad(rev, 10, "")}\n'
4108 hg: parse error: pad() expects a single fill character
4108 hg: parse error: pad() expects a single fill character
4109 [255]
4109 [255]
4110 $ hg log -r 0 -T '{pad(rev, 10, "--")}\n'
4110 $ hg log -r 0 -T '{pad(rev, 10, "--")}\n'
4111 hg: parse error: pad() expects a single fill character
4111 hg: parse error: pad() expects a single fill character
4112 [255]
4112 [255]
4113
4113
4114 Test boolean argument passed to pad function
4114 Test boolean argument passed to pad function
4115
4115
4116 no crash
4116 no crash
4117
4117
4118 $ hg log -r 0 -T '{pad(rev, 10, "-", "f{"oo"}")}\n'
4118 $ hg log -r 0 -T '{pad(rev, 10, "-", "f{"oo"}")}\n'
4119 ---------0
4119 ---------0
4120
4120
4121 string/literal
4121 string/literal
4122
4122
4123 $ hg log -r 0 -T '{pad(rev, 10, "-", "false")}\n'
4123 $ hg log -r 0 -T '{pad(rev, 10, "-", "false")}\n'
4124 ---------0
4124 ---------0
4125 $ hg log -r 0 -T '{pad(rev, 10, "-", false)}\n'
4125 $ hg log -r 0 -T '{pad(rev, 10, "-", false)}\n'
4126 0---------
4126 0---------
4127 $ hg log -r 0 -T '{pad(rev, 10, "-", "")}\n'
4127 $ hg log -r 0 -T '{pad(rev, 10, "-", "")}\n'
4128 0---------
4128 0---------
4129
4129
4130 unknown keyword is evaluated to ''
4130 unknown keyword is evaluated to ''
4131
4131
4132 $ hg log -r 0 -T '{pad(rev, 10, "-", unknownkeyword)}\n'
4132 $ hg log -r 0 -T '{pad(rev, 10, "-", unknownkeyword)}\n'
4133 0---------
4133 0---------
4134
4134
4135 Test separate function
4135 Test separate function
4136
4136
4137 $ hg log -r 0 -T '{separate("-", "", "a", "b", "", "", "c", "")}\n'
4137 $ hg log -r 0 -T '{separate("-", "", "a", "b", "", "", "c", "")}\n'
4138 a-b-c
4138 a-b-c
4139 $ hg log -r 0 -T '{separate(" ", "{rev}:{node|short}", author|user, branch)}\n'
4139 $ hg log -r 0 -T '{separate(" ", "{rev}:{node|short}", author|user, branch)}\n'
4140 0:f7769ec2ab97 test default
4140 0:f7769ec2ab97 test default
4141 $ hg log -r 0 --color=always -T '{separate(" ", "a", label(red, "b"), "c", label(red, ""), "d")}\n'
4141 $ hg log -r 0 --color=always -T '{separate(" ", "a", label(red, "b"), "c", label(red, ""), "d")}\n'
4142 a \x1b[0;31mb\x1b[0m c d (esc)
4142 a \x1b[0;31mb\x1b[0m c d (esc)
4143
4143
4144 Test boolean expression/literal passed to if function
4144 Test boolean expression/literal passed to if function
4145
4145
4146 $ hg log -r 0 -T '{if(rev, "rev 0 is True")}\n'
4146 $ hg log -r 0 -T '{if(rev, "rev 0 is True")}\n'
4147 rev 0 is True
4147 rev 0 is True
4148 $ hg log -r 0 -T '{if(0, "literal 0 is True as well")}\n'
4148 $ hg log -r 0 -T '{if(0, "literal 0 is True as well")}\n'
4149 literal 0 is True as well
4149 literal 0 is True as well
4150 $ hg log -r 0 -T '{if("", "", "empty string is False")}\n'
4150 $ hg log -r 0 -T '{if("", "", "empty string is False")}\n'
4151 empty string is False
4151 empty string is False
4152 $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n'
4152 $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n'
4153 empty list is False
4153 empty list is False
4154 $ hg log -r 0 -T '{if(revset(r"0"), "non-empty list is True")}\n'
4154 $ hg log -r 0 -T '{if(revset(r"0"), "non-empty list is True")}\n'
4155 non-empty list is True
4155 non-empty list is True
4156 $ hg log -r 0 -T '{if(revset(r"0") % "", "list of empty strings is True")}\n'
4156 $ hg log -r 0 -T '{if(revset(r"0") % "", "list of empty strings is True")}\n'
4157 list of empty strings is True
4157 list of empty strings is True
4158 $ hg log -r 0 -T '{if(true, "true is True")}\n'
4158 $ hg log -r 0 -T '{if(true, "true is True")}\n'
4159 true is True
4159 true is True
4160 $ hg log -r 0 -T '{if(false, "", "false is False")}\n'
4160 $ hg log -r 0 -T '{if(false, "", "false is False")}\n'
4161 false is False
4161 false is False
4162 $ hg log -r 0 -T '{if("false", "non-empty string is True")}\n'
4162 $ hg log -r 0 -T '{if("false", "non-empty string is True")}\n'
4163 non-empty string is True
4163 non-empty string is True
4164
4164
4165 Test ifcontains function
4165 Test ifcontains function
4166
4166
4167 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
4167 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
4168 2 is in the string
4168 2 is in the string
4169 1 is not
4169 1 is not
4170 0 is in the string
4170 0 is in the string
4171
4171
4172 $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n'
4172 $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n'
4173 2 is in the string
4173 2 is in the string
4174 1 is not
4174 1 is not
4175 0 is in the string
4175 0 is in the string
4176
4176
4177 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
4177 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
4178 2 did not add a
4178 2 did not add a
4179 1 did not add a
4179 1 did not add a
4180 0 added a
4180 0 added a
4181
4181
4182 $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
4182 $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
4183 2 is parent of 1
4183 2 is parent of 1
4184 1
4184 1
4185 0
4185 0
4186
4186
4187 $ hg log -l1 -T '{ifcontains("branch", extras, "t", "f")}\n'
4187 $ hg log -l1 -T '{ifcontains("branch", extras, "t", "f")}\n'
4188 t
4188 t
4189 $ hg log -l1 -T '{ifcontains("branch", extras % "{key}", "t", "f")}\n'
4189 $ hg log -l1 -T '{ifcontains("branch", extras % "{key}", "t", "f")}\n'
4190 t
4190 t
4191 $ hg log -l1 -T '{ifcontains("branc", extras % "{key}", "t", "f")}\n'
4191 $ hg log -l1 -T '{ifcontains("branc", extras % "{key}", "t", "f")}\n'
4192 f
4192 f
4193 $ hg log -l1 -T '{ifcontains("branc", stringify(extras % "{key}"), "t", "f")}\n'
4193 $ hg log -l1 -T '{ifcontains("branc", stringify(extras % "{key}"), "t", "f")}\n'
4194 t
4194 t
4195
4195
4196 Test revset function
4196 Test revset function
4197
4197
4198 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
4198 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
4199 2 current rev
4199 2 current rev
4200 1 not current rev
4200 1 not current rev
4201 0 not current rev
4201 0 not current rev
4202
4202
4203 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
4203 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
4204 2 match rev
4204 2 match rev
4205 1 match rev
4205 1 match rev
4206 0 not match rev
4206 0 not match rev
4207
4207
4208 $ hg log -T '{ifcontains(desc, revset(":"), "", "type not match")}\n' -l1
4208 $ hg log -T '{ifcontains(desc, revset(":"), "", "type not match")}\n' -l1
4209 type not match
4209 type not match
4210
4210
4211 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
4211 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
4212 2 Parents: 1
4212 2 Parents: 1
4213 1 Parents: 0
4213 1 Parents: 0
4214 0 Parents:
4214 0 Parents:
4215
4215
4216 $ cat >> .hg/hgrc <<EOF
4216 $ cat >> .hg/hgrc <<EOF
4217 > [revsetalias]
4217 > [revsetalias]
4218 > myparents(\$1) = parents(\$1)
4218 > myparents(\$1) = parents(\$1)
4219 > EOF
4219 > EOF
4220 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
4220 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
4221 2 Parents: 1
4221 2 Parents: 1
4222 1 Parents: 0
4222 1 Parents: 0
4223 0 Parents:
4223 0 Parents:
4224
4224
4225 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
4225 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
4226 Rev: 2
4226 Rev: 2
4227 Ancestor: 0
4227 Ancestor: 0
4228 Ancestor: 1
4228 Ancestor: 1
4229 Ancestor: 2
4229 Ancestor: 2
4230
4230
4231 Rev: 1
4231 Rev: 1
4232 Ancestor: 0
4232 Ancestor: 0
4233 Ancestor: 1
4233 Ancestor: 1
4234
4234
4235 Rev: 0
4235 Rev: 0
4236 Ancestor: 0
4236 Ancestor: 0
4237
4237
4238 $ hg log --template '{revset("TIP"|lower)}\n' -l1
4238 $ hg log --template '{revset("TIP"|lower)}\n' -l1
4239 2
4239 2
4240
4240
4241 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1
4241 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1
4242 2
4242 2
4243
4243
4244 a list template is evaluated for each item of revset/parents
4244 a list template is evaluated for each item of revset/parents
4245
4245
4246 $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
4246 $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
4247 2 p: 1:bcc7ff960b8e
4247 2 p: 1:bcc7ff960b8e
4248 1 p: 0:f7769ec2ab97
4248 1 p: 0:f7769ec2ab97
4249 0 p:
4249 0 p:
4250
4250
4251 $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
4251 $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
4252 2 p: 1:bcc7ff960b8e -1:000000000000
4252 2 p: 1:bcc7ff960b8e -1:000000000000
4253 1 p: 0:f7769ec2ab97 -1:000000000000
4253 1 p: 0:f7769ec2ab97 -1:000000000000
4254 0 p: -1:000000000000 -1:000000000000
4254 0 p: -1:000000000000 -1:000000000000
4255
4255
4256 therefore, 'revcache' should be recreated for each rev
4256 therefore, 'revcache' should be recreated for each rev
4257
4257
4258 $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
4258 $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
4259 2 aa b
4259 2 aa b
4260 p
4260 p
4261 1
4261 1
4262 p a
4262 p a
4263 0 a
4263 0 a
4264 p
4264 p
4265
4265
4266 $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
4266 $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
4267 2 aa b
4267 2 aa b
4268 p
4268 p
4269 1
4269 1
4270 p a
4270 p a
4271 0 a
4271 0 a
4272 p
4272 p
4273
4273
4274 a revset item must be evaluated as an integer revision, not an offset from tip
4274 a revset item must be evaluated as an integer revision, not an offset from tip
4275
4275
4276 $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'
4276 $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'
4277 -1:000000000000
4277 -1:000000000000
4278 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n'
4278 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n'
4279 -1:000000000000
4279 -1:000000000000
4280
4280
4281 join() should pick '{rev}' from revset items:
4281 join() should pick '{rev}' from revset items:
4282
4282
4283 $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6
4283 $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6
4284 4, 5
4284 4, 5
4285
4285
4286 on the other hand, parents are formatted as '{rev}:{node|formatnode}' by
4286 on the other hand, parents are formatted as '{rev}:{node|formatnode}' by
4287 default. join() should agree with the default formatting:
4287 default. join() should agree with the default formatting:
4288
4288
4289 $ hg log -R ../a -T '{join(parents, ", ")}\n' -r6
4289 $ hg log -R ../a -T '{join(parents, ", ")}\n' -r6
4290 5:13207e5a10d9, 4:bbe44766e73d
4290 5:13207e5a10d9, 4:bbe44766e73d
4291
4291
4292 $ hg log -R ../a -T '{join(parents, ",\n")}\n' -r6 --debug
4292 $ hg log -R ../a -T '{join(parents, ",\n")}\n' -r6 --debug
4293 5:13207e5a10d9fd28ec424934298e176197f2c67f,
4293 5:13207e5a10d9fd28ec424934298e176197f2c67f,
4294 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
4294 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
4295
4295
4296 Invalid arguments passed to revset()
4296 Invalid arguments passed to revset()
4297
4297
4298 $ hg log -T '{revset("%whatever", 0)}\n'
4298 $ hg log -T '{revset("%whatever", 0)}\n'
4299 hg: parse error: unexpected revspec format character w
4299 hg: parse error: unexpected revspec format character w
4300 [255]
4300 [255]
4301 $ hg log -T '{revset("%lwhatever", files)}\n'
4301 $ hg log -T '{revset("%lwhatever", files)}\n'
4302 hg: parse error: unexpected revspec format character w
4302 hg: parse error: unexpected revspec format character w
4303 [255]
4303 [255]
4304 $ hg log -T '{revset("%s %s", 0)}\n'
4304 $ hg log -T '{revset("%s %s", 0)}\n'
4305 hg: parse error: missing argument for revspec
4305 hg: parse error: missing argument for revspec
4306 [255]
4306 [255]
4307 $ hg log -T '{revset("", 0)}\n'
4307 $ hg log -T '{revset("", 0)}\n'
4308 hg: parse error: too many revspec arguments specified
4308 hg: parse error: too many revspec arguments specified
4309 [255]
4309 [255]
4310 $ hg log -T '{revset("%s", 0, 1)}\n'
4310 $ hg log -T '{revset("%s", 0, 1)}\n'
4311 hg: parse error: too many revspec arguments specified
4311 hg: parse error: too many revspec arguments specified
4312 [255]
4312 [255]
4313 $ hg log -T '{revset("%", 0)}\n'
4313 $ hg log -T '{revset("%", 0)}\n'
4314 hg: parse error: incomplete revspec format character
4314 hg: parse error: incomplete revspec format character
4315 [255]
4315 [255]
4316 $ hg log -T '{revset("%l", 0)}\n'
4316 $ hg log -T '{revset("%l", 0)}\n'
4317 hg: parse error: incomplete revspec format character
4317 hg: parse error: incomplete revspec format character
4318 [255]
4318 [255]
4319 $ hg log -T '{revset("%d", 'foo')}\n'
4319 $ hg log -T '{revset("%d", 'foo')}\n'
4320 hg: parse error: invalid argument for revspec
4320 hg: parse error: invalid argument for revspec
4321 [255]
4321 [255]
4322 $ hg log -T '{revset("%ld", files)}\n'
4322 $ hg log -T '{revset("%ld", files)}\n'
4323 hg: parse error: invalid argument for revspec
4323 hg: parse error: invalid argument for revspec
4324 [255]
4324 [255]
4325 $ hg log -T '{revset("%ls", 0)}\n'
4325 $ hg log -T '{revset("%ls", 0)}\n'
4326 hg: parse error: invalid argument for revspec
4326 hg: parse error: invalid argument for revspec
4327 [255]
4327 [255]
4328 $ hg log -T '{revset("%b", 'foo')}\n'
4328 $ hg log -T '{revset("%b", 'foo')}\n'
4329 hg: parse error: invalid argument for revspec
4329 hg: parse error: invalid argument for revspec
4330 [255]
4330 [255]
4331 $ hg log -T '{revset("%lb", files)}\n'
4331 $ hg log -T '{revset("%lb", files)}\n'
4332 hg: parse error: invalid argument for revspec
4332 hg: parse error: invalid argument for revspec
4333 [255]
4333 [255]
4334 $ hg log -T '{revset("%r", 0)}\n'
4334 $ hg log -T '{revset("%r", 0)}\n'
4335 hg: parse error: invalid argument for revspec
4335 hg: parse error: invalid argument for revspec
4336 [255]
4336 [255]
4337
4337
4338 Test 'originalnode'
4338 Test 'originalnode'
4339
4339
4340 $ hg log -r 1 -T '{revset("null") % "{node|short} {originalnode|short}"}\n'
4340 $ hg log -r 1 -T '{revset("null") % "{node|short} {originalnode|short}"}\n'
4341 000000000000 bcc7ff960b8e
4341 000000000000 bcc7ff960b8e
4342 $ hg log -r 0 -T '{manifest % "{node} {originalnode}"}\n'
4342 $ hg log -r 0 -T '{manifest % "{node} {originalnode}"}\n'
4343 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 f7769ec2ab975ad19684098ad1ffd9b81ecc71a1
4343 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 f7769ec2ab975ad19684098ad1ffd9b81ecc71a1
4344
4344
4345 Test files function
4345 Test files function
4346
4346
4347 $ hg log -T "{rev}\n{join(files('*'), '\n')}\n"
4347 $ hg log -T "{rev}\n{join(files('*'), '\n')}\n"
4348 2
4348 2
4349 a
4349 a
4350 aa
4350 aa
4351 b
4351 b
4352 1
4352 1
4353 a
4353 a
4354 0
4354 0
4355 a
4355 a
4356
4356
4357 $ hg log -T "{rev}\n{join(files('aa'), '\n')}\n"
4357 $ hg log -T "{rev}\n{join(files('aa'), '\n')}\n"
4358 2
4358 2
4359 aa
4359 aa
4360 1
4360 1
4361
4361
4362 0
4362 0
4363
4363
4364 $ hg rm a
4364 $ hg rm a
4365 $ hg log -r "wdir()" -T "{rev}\n{join(files('*'), '\n')}\n"
4365 $ hg log -r "wdir()" -T "{rev}\n{join(files('*'), '\n')}\n"
4366 2147483647
4366 2147483647
4367 aa
4367 aa
4368 b
4368 b
4369 $ hg revert a
4369 $ hg revert a
4370
4370
4371 Test relpath function
4371 Test relpath function
4372
4372
4373 $ hg log -r0 -T '{files % "{file|relpath}\n"}'
4373 $ hg log -r0 -T '{files % "{file|relpath}\n"}'
4374 a
4374 a
4375 $ cd ..
4375 $ cd ..
4376 $ hg log -R r -r0 -T '{files % "{file|relpath}\n"}'
4376 $ hg log -R r -r0 -T '{files % "{file|relpath}\n"}'
4377 r/a
4377 r/a
4378 $ cd r
4378 $ cd r
4379
4379
4380 Test active bookmark templating
4380 Test active bookmark templating
4381
4381
4382 $ hg book foo
4382 $ hg book foo
4383 $ hg book bar
4383 $ hg book bar
4384 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
4384 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
4385 2 bar* foo
4385 2 bar* foo
4386 1
4386 1
4387 0
4387 0
4388 $ hg log --template "{rev} {activebookmark}\n"
4388 $ hg log --template "{rev} {activebookmark}\n"
4389 2 bar
4389 2 bar
4390 1
4390 1
4391 0
4391 0
4392 $ hg bookmarks --inactive bar
4392 $ hg bookmarks --inactive bar
4393 $ hg log --template "{rev} {activebookmark}\n"
4393 $ hg log --template "{rev} {activebookmark}\n"
4394 2
4394 2
4395 1
4395 1
4396 0
4396 0
4397 $ hg book -r1 baz
4397 $ hg book -r1 baz
4398 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
4398 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
4399 2 bar foo
4399 2 bar foo
4400 1 baz
4400 1 baz
4401 0
4401 0
4402 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
4402 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
4403 2 t
4403 2 t
4404 1 f
4404 1 f
4405 0 f
4405 0 f
4406
4406
4407 Test namespaces dict
4407 Test namespaces dict
4408
4408
4409 $ hg --config extensions.revnamesext=$TESTDIR/revnamesext.py log -T '{rev}\n{namespaces % " {namespace} color={colorname} builtin={builtin}\n {join(names, ",")}\n"}\n'
4409 $ hg --config extensions.revnamesext=$TESTDIR/revnamesext.py log -T '{rev}\n{namespaces % " {namespace} color={colorname} builtin={builtin}\n {join(names, ",")}\n"}\n'
4410 2
4410 2
4411 bookmarks color=bookmark builtin=True
4411 bookmarks color=bookmark builtin=True
4412 bar,foo
4412 bar,foo
4413 tags color=tag builtin=True
4413 tags color=tag builtin=True
4414 tip
4414 tip
4415 branches color=branch builtin=True
4415 branches color=branch builtin=True
4416 text.{rev}
4416 text.{rev}
4417 revnames color=revname builtin=False
4417 revnames color=revname builtin=False
4418 r2
4418 r2
4419
4419
4420 1
4420 1
4421 bookmarks color=bookmark builtin=True
4421 bookmarks color=bookmark builtin=True
4422 baz
4422 baz
4423 tags color=tag builtin=True
4423 tags color=tag builtin=True
4424
4424
4425 branches color=branch builtin=True
4425 branches color=branch builtin=True
4426 text.{rev}
4426 text.{rev}
4427 revnames color=revname builtin=False
4427 revnames color=revname builtin=False
4428 r1
4428 r1
4429
4429
4430 0
4430 0
4431 bookmarks color=bookmark builtin=True
4431 bookmarks color=bookmark builtin=True
4432
4432
4433 tags color=tag builtin=True
4433 tags color=tag builtin=True
4434
4434
4435 branches color=branch builtin=True
4435 branches color=branch builtin=True
4436 default
4436 default
4437 revnames color=revname builtin=False
4437 revnames color=revname builtin=False
4438 r0
4438 r0
4439
4439
4440 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}'
4440 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}'
4441 bookmarks: bar foo
4441 bookmarks: bar foo
4442 tags: tip
4442 tags: tip
4443 branches: text.{rev}
4443 branches: text.{rev}
4444 $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}'
4444 $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}'
4445 bookmarks:
4445 bookmarks:
4446 bar
4446 bar
4447 foo
4447 foo
4448 tags:
4448 tags:
4449 tip
4449 tip
4450 branches:
4450 branches:
4451 text.{rev}
4451 text.{rev}
4452 $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}'
4452 $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}'
4453 bar
4453 bar
4454 foo
4454 foo
4455 $ hg log -r2 -T '{namespaces.bookmarks % "{bookmark}\n"}'
4455 $ hg log -r2 -T '{namespaces.bookmarks % "{bookmark}\n"}'
4456 bar
4456 bar
4457 foo
4457 foo
4458
4458
4459 Test stringify on sub expressions
4459 Test stringify on sub expressions
4460
4460
4461 $ cd ..
4461 $ cd ..
4462 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
4462 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
4463 fourth, second, third
4463 fourth, second, third
4464 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
4464 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
4465 abc
4465 abc
4466
4466
4467 Test splitlines
4467 Test splitlines
4468
4468
4469 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
4469 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
4470 @ foo Modify, add, remove, rename
4470 @ foo Modify, add, remove, rename
4471 |
4471 |
4472 o foo future
4472 o foo future
4473 |
4473 |
4474 o foo third
4474 o foo third
4475 |
4475 |
4476 o foo second
4476 o foo second
4477
4477
4478 o foo merge
4478 o foo merge
4479 |\
4479 |\
4480 | o foo new head
4480 | o foo new head
4481 | |
4481 | |
4482 o | foo new branch
4482 o | foo new branch
4483 |/
4483 |/
4484 o foo no user, no domain
4484 o foo no user, no domain
4485 |
4485 |
4486 o foo no person
4486 o foo no person
4487 |
4487 |
4488 o foo other 1
4488 o foo other 1
4489 | foo other 2
4489 | foo other 2
4490 | foo
4490 | foo
4491 | foo other 3
4491 | foo other 3
4492 o foo line 1
4492 o foo line 1
4493 foo line 2
4493 foo line 2
4494
4494
4495 $ hg log -R a -r0 -T '{desc|splitlines}\n'
4495 $ hg log -R a -r0 -T '{desc|splitlines}\n'
4496 line 1 line 2
4496 line 1 line 2
4497 $ hg log -R a -r0 -T '{join(desc|splitlines, "|")}\n'
4497 $ hg log -R a -r0 -T '{join(desc|splitlines, "|")}\n'
4498 line 1|line 2
4498 line 1|line 2
4499
4499
4500 Test startswith
4500 Test startswith
4501 $ hg log -Gv -R a --template "{startswith(desc)}"
4501 $ hg log -Gv -R a --template "{startswith(desc)}"
4502 hg: parse error: startswith expects two arguments
4502 hg: parse error: startswith expects two arguments
4503 [255]
4503 [255]
4504
4504
4505 $ hg log -Gv -R a --template "{startswith('line', desc)}"
4505 $ hg log -Gv -R a --template "{startswith('line', desc)}"
4506 @
4506 @
4507 |
4507 |
4508 o
4508 o
4509 |
4509 |
4510 o
4510 o
4511 |
4511 |
4512 o
4512 o
4513
4513
4514 o
4514 o
4515 |\
4515 |\
4516 | o
4516 | o
4517 | |
4517 | |
4518 o |
4518 o |
4519 |/
4519 |/
4520 o
4520 o
4521 |
4521 |
4522 o
4522 o
4523 |
4523 |
4524 o
4524 o
4525 |
4525 |
4526 o line 1
4526 o line 1
4527 line 2
4527 line 2
4528
4528
4529 Test bad template with better error message
4529 Test bad template with better error message
4530
4530
4531 $ hg log -Gv -R a --template '{desc|user()}'
4531 $ hg log -Gv -R a --template '{desc|user()}'
4532 hg: parse error: expected a symbol, got 'func'
4532 hg: parse error: expected a symbol, got 'func'
4533 [255]
4533 [255]
4534
4534
4535 Test word function (including index out of bounds graceful failure)
4535 Test word function (including index out of bounds graceful failure)
4536
4536
4537 $ hg log -Gv -R a --template "{word('1', desc)}"
4537 $ hg log -Gv -R a --template "{word('1', desc)}"
4538 @ add,
4538 @ add,
4539 |
4539 |
4540 o
4540 o
4541 |
4541 |
4542 o
4542 o
4543 |
4543 |
4544 o
4544 o
4545
4545
4546 o
4546 o
4547 |\
4547 |\
4548 | o head
4548 | o head
4549 | |
4549 | |
4550 o | branch
4550 o | branch
4551 |/
4551 |/
4552 o user,
4552 o user,
4553 |
4553 |
4554 o person
4554 o person
4555 |
4555 |
4556 o 1
4556 o 1
4557 |
4557 |
4558 o 1
4558 o 1
4559
4559
4560
4560
4561 Test word third parameter used as splitter
4561 Test word third parameter used as splitter
4562
4562
4563 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
4563 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
4564 @ M
4564 @ M
4565 |
4565 |
4566 o future
4566 o future
4567 |
4567 |
4568 o third
4568 o third
4569 |
4569 |
4570 o sec
4570 o sec
4571
4571
4572 o merge
4572 o merge
4573 |\
4573 |\
4574 | o new head
4574 | o new head
4575 | |
4575 | |
4576 o | new branch
4576 o | new branch
4577 |/
4577 |/
4578 o n
4578 o n
4579 |
4579 |
4580 o n
4580 o n
4581 |
4581 |
4582 o
4582 o
4583 |
4583 |
4584 o line 1
4584 o line 1
4585 line 2
4585 line 2
4586
4586
4587 Test word error messages for not enough and too many arguments
4587 Test word error messages for not enough and too many arguments
4588
4588
4589 $ hg log -Gv -R a --template "{word('0')}"
4589 $ hg log -Gv -R a --template "{word('0')}"
4590 hg: parse error: word expects two or three arguments, got 1
4590 hg: parse error: word expects two or three arguments, got 1
4591 [255]
4591 [255]
4592
4592
4593 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
4593 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
4594 hg: parse error: word expects two or three arguments, got 7
4594 hg: parse error: word expects two or three arguments, got 7
4595 [255]
4595 [255]
4596
4596
4597 Test word for integer literal
4597 Test word for integer literal
4598
4598
4599 $ hg log -R a --template "{word(2, desc)}\n" -r0
4599 $ hg log -R a --template "{word(2, desc)}\n" -r0
4600 line
4600 line
4601
4601
4602 Test word for invalid numbers
4602 Test word for invalid numbers
4603
4603
4604 $ hg log -Gv -R a --template "{word('a', desc)}"
4604 $ hg log -Gv -R a --template "{word('a', desc)}"
4605 hg: parse error: word expects an integer index
4605 hg: parse error: word expects an integer index
4606 [255]
4606 [255]
4607
4607
4608 Test word for out of range
4608 Test word for out of range
4609
4609
4610 $ hg log -R a --template "{word(10000, desc)}"
4610 $ hg log -R a --template "{word(10000, desc)}"
4611 $ hg log -R a --template "{word(-10000, desc)}"
4611 $ hg log -R a --template "{word(-10000, desc)}"
4612
4612
4613 Test indent and not adding to empty lines
4613 Test indent and not adding to empty lines
4614
4614
4615 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
4615 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
4616 -----
4616 -----
4617 > line 1
4617 > line 1
4618 >> line 2
4618 >> line 2
4619 -----
4619 -----
4620 > other 1
4620 > other 1
4621 >> other 2
4621 >> other 2
4622
4622
4623 >> other 3
4623 >> other 3
4624
4624
4625 Test with non-strings like dates
4625 Test with non-strings like dates
4626
4626
4627 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
4627 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
4628 1200000 0
4628 1200000.00
4629 1300000 0
4629 1300000.00
4630
4630
4631 Test broken string escapes:
4631 Test broken string escapes:
4632
4632
4633 $ hg log -T "bogus\\" -R a
4633 $ hg log -T "bogus\\" -R a
4634 hg: parse error: trailing \ in string
4634 hg: parse error: trailing \ in string
4635 [255]
4635 [255]
4636 $ hg log -T "\\xy" -R a
4636 $ hg log -T "\\xy" -R a
4637 hg: parse error: invalid \x escape* (glob)
4637 hg: parse error: invalid \x escape* (glob)
4638 [255]
4638 [255]
4639
4639
4640 json filter should escape HTML tags so that the output can be embedded in hgweb:
4640 json filter should escape HTML tags so that the output can be embedded in hgweb:
4641
4641
4642 $ hg log -T "{'<foo@example.org>'|json}\n" -R a -l1
4642 $ hg log -T "{'<foo@example.org>'|json}\n" -R a -l1
4643 "\u003cfoo@example.org\u003e"
4643 "\u003cfoo@example.org\u003e"
4644
4644
4645 Templater supports aliases of symbol and func() styles:
4645 Templater supports aliases of symbol and func() styles:
4646
4646
4647 $ hg clone -q a aliases
4647 $ hg clone -q a aliases
4648 $ cd aliases
4648 $ cd aliases
4649 $ cat <<EOF >> .hg/hgrc
4649 $ cat <<EOF >> .hg/hgrc
4650 > [templatealias]
4650 > [templatealias]
4651 > r = rev
4651 > r = rev
4652 > rn = "{r}:{node|short}"
4652 > rn = "{r}:{node|short}"
4653 > status(c, files) = files % "{c} {file}\n"
4653 > status(c, files) = files % "{c} {file}\n"
4654 > utcdate(d) = localdate(d, "UTC")
4654 > utcdate(d) = localdate(d, "UTC")
4655 > EOF
4655 > EOF
4656
4656
4657 $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n'
4657 $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n'
4658 (template
4658 (template
4659 (symbol 'rn')
4659 (symbol 'rn')
4660 (string ' ')
4660 (string ' ')
4661 (|
4661 (|
4662 (func
4662 (func
4663 (symbol 'utcdate')
4663 (symbol 'utcdate')
4664 (symbol 'date'))
4664 (symbol 'date'))
4665 (symbol 'isodate'))
4665 (symbol 'isodate'))
4666 (string '\n'))
4666 (string '\n'))
4667 * expanded:
4667 * expanded:
4668 (template
4668 (template
4669 (template
4669 (template
4670 (symbol 'rev')
4670 (symbol 'rev')
4671 (string ':')
4671 (string ':')
4672 (|
4672 (|
4673 (symbol 'node')
4673 (symbol 'node')
4674 (symbol 'short')))
4674 (symbol 'short')))
4675 (string ' ')
4675 (string ' ')
4676 (|
4676 (|
4677 (func
4677 (func
4678 (symbol 'localdate')
4678 (symbol 'localdate')
4679 (list
4679 (list
4680 (symbol 'date')
4680 (symbol 'date')
4681 (string 'UTC')))
4681 (string 'UTC')))
4682 (symbol 'isodate'))
4682 (symbol 'isodate'))
4683 (string '\n'))
4683 (string '\n'))
4684 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4684 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4685
4685
4686 $ hg debugtemplate -vr0 '{status("A", file_adds)}'
4686 $ hg debugtemplate -vr0 '{status("A", file_adds)}'
4687 (template
4687 (template
4688 (func
4688 (func
4689 (symbol 'status')
4689 (symbol 'status')
4690 (list
4690 (list
4691 (string 'A')
4691 (string 'A')
4692 (symbol 'file_adds'))))
4692 (symbol 'file_adds'))))
4693 * expanded:
4693 * expanded:
4694 (template
4694 (template
4695 (%
4695 (%
4696 (symbol 'file_adds')
4696 (symbol 'file_adds')
4697 (template
4697 (template
4698 (string 'A')
4698 (string 'A')
4699 (string ' ')
4699 (string ' ')
4700 (symbol 'file')
4700 (symbol 'file')
4701 (string '\n'))))
4701 (string '\n'))))
4702 A a
4702 A a
4703
4703
4704 A unary function alias can be called as a filter:
4704 A unary function alias can be called as a filter:
4705
4705
4706 $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n'
4706 $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n'
4707 (template
4707 (template
4708 (|
4708 (|
4709 (|
4709 (|
4710 (symbol 'date')
4710 (symbol 'date')
4711 (symbol 'utcdate'))
4711 (symbol 'utcdate'))
4712 (symbol 'isodate'))
4712 (symbol 'isodate'))
4713 (string '\n'))
4713 (string '\n'))
4714 * expanded:
4714 * expanded:
4715 (template
4715 (template
4716 (|
4716 (|
4717 (func
4717 (func
4718 (symbol 'localdate')
4718 (symbol 'localdate')
4719 (list
4719 (list
4720 (symbol 'date')
4720 (symbol 'date')
4721 (string 'UTC')))
4721 (string 'UTC')))
4722 (symbol 'isodate'))
4722 (symbol 'isodate'))
4723 (string '\n'))
4723 (string '\n'))
4724 1970-01-12 13:46 +0000
4724 1970-01-12 13:46 +0000
4725
4725
4726 Aliases should be applied only to command arguments and templates in hgrc.
4726 Aliases should be applied only to command arguments and templates in hgrc.
4727 Otherwise, our stock styles and web templates could be corrupted:
4727 Otherwise, our stock styles and web templates could be corrupted:
4728
4728
4729 $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n'
4729 $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n'
4730 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4730 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4731
4731
4732 $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"'
4732 $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"'
4733 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4733 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4734
4734
4735 $ cat <<EOF > tmpl
4735 $ cat <<EOF > tmpl
4736 > changeset = 'nothing expanded:{rn}\n'
4736 > changeset = 'nothing expanded:{rn}\n'
4737 > EOF
4737 > EOF
4738 $ hg log -r0 --style ./tmpl
4738 $ hg log -r0 --style ./tmpl
4739 nothing expanded:
4739 nothing expanded:
4740
4740
4741 Aliases in formatter:
4741 Aliases in formatter:
4742
4742
4743 $ hg branches -T '{pad(branch, 7)} {rn}\n'
4743 $ hg branches -T '{pad(branch, 7)} {rn}\n'
4744 default 6:d41e714fe50d
4744 default 6:d41e714fe50d
4745 foo 4:bbe44766e73d
4745 foo 4:bbe44766e73d
4746
4746
4747 Aliases should honor HGPLAIN:
4747 Aliases should honor HGPLAIN:
4748
4748
4749 $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n'
4749 $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n'
4750 nothing expanded:
4750 nothing expanded:
4751 $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n'
4751 $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n'
4752 0:1e4e1b8f71e0
4752 0:1e4e1b8f71e0
4753
4753
4754 Unparsable alias:
4754 Unparsable alias:
4755
4755
4756 $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}'
4756 $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}'
4757 (template
4757 (template
4758 (symbol 'bad'))
4758 (symbol 'bad'))
4759 abort: bad definition of template alias "bad": at 2: not a prefix: end
4759 abort: bad definition of template alias "bad": at 2: not a prefix: end
4760 [255]
4760 [255]
4761 $ hg log --config templatealias.bad='x(' -T '{bad}'
4761 $ hg log --config templatealias.bad='x(' -T '{bad}'
4762 abort: bad definition of template alias "bad": at 2: not a prefix: end
4762 abort: bad definition of template alias "bad": at 2: not a prefix: end
4763 [255]
4763 [255]
4764
4764
4765 $ cd ..
4765 $ cd ..
4766
4766
4767 Set up repository for non-ascii encoding tests:
4767 Set up repository for non-ascii encoding tests:
4768
4768
4769 $ hg init nonascii
4769 $ hg init nonascii
4770 $ cd nonascii
4770 $ cd nonascii
4771 $ $PYTHON <<EOF
4771 $ $PYTHON <<EOF
4772 > open('latin1', 'wb').write(b'\xe9')
4772 > open('latin1', 'wb').write(b'\xe9')
4773 > open('utf-8', 'wb').write(b'\xc3\xa9')
4773 > open('utf-8', 'wb').write(b'\xc3\xa9')
4774 > EOF
4774 > EOF
4775 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
4775 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
4776 $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8
4776 $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8
4777
4777
4778 json filter should try round-trip conversion to utf-8:
4778 json filter should try round-trip conversion to utf-8:
4779
4779
4780 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
4780 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
4781 "\u00e9"
4781 "\u00e9"
4782 $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0
4782 $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0
4783 "non-ascii branch: \u00e9"
4783 "non-ascii branch: \u00e9"
4784
4784
4785 json filter should take input as utf-8 if it was converted from utf-8:
4785 json filter should take input as utf-8 if it was converted from utf-8:
4786
4786
4787 $ HGENCODING=latin-1 hg log -T "{branch|json}\n" -r0
4787 $ HGENCODING=latin-1 hg log -T "{branch|json}\n" -r0
4788 "\u00e9"
4788 "\u00e9"
4789 $ HGENCODING=latin-1 hg log -T "{desc|json}\n" -r0
4789 $ HGENCODING=latin-1 hg log -T "{desc|json}\n" -r0
4790 "non-ascii branch: \u00e9"
4790 "non-ascii branch: \u00e9"
4791
4791
4792 json filter takes input as utf-8b:
4792 json filter takes input as utf-8b:
4793
4793
4794 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
4794 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
4795 "\u00e9"
4795 "\u00e9"
4796 $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1
4796 $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1
4797 "\udce9"
4797 "\udce9"
4798
4798
4799 utf8 filter:
4799 utf8 filter:
4800
4800
4801 $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0
4801 $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0
4802 round-trip: c3a9
4802 round-trip: c3a9
4803 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1
4803 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1
4804 decoded: c3a9
4804 decoded: c3a9
4805 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1
4805 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1
4806 abort: decoding near * (glob)
4806 abort: decoding near * (glob)
4807 [255]
4807 [255]
4808 $ hg log -T "coerced to string: {rev|utf8}\n" -r0
4808 $ hg log -T "coerced to string: {rev|utf8}\n" -r0
4809 coerced to string: 0
4809 coerced to string: 0
4810
4810
4811 pad width:
4811 pad width:
4812
4812
4813 $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n"
4813 $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n"
4814 \xc3\xa9- (esc)
4814 \xc3\xa9- (esc)
4815
4815
4816 $ cd ..
4816 $ cd ..
4817
4817
4818 Test that template function in extension is registered as expected
4818 Test that template function in extension is registered as expected
4819
4819
4820 $ cd a
4820 $ cd a
4821
4821
4822 $ cat <<EOF > $TESTTMP/customfunc.py
4822 $ cat <<EOF > $TESTTMP/customfunc.py
4823 > from mercurial import registrar
4823 > from mercurial import registrar
4824 >
4824 >
4825 > templatefunc = registrar.templatefunc()
4825 > templatefunc = registrar.templatefunc()
4826 >
4826 >
4827 > @templatefunc(b'custom()')
4827 > @templatefunc(b'custom()')
4828 > def custom(context, mapping, args):
4828 > def custom(context, mapping, args):
4829 > return b'custom'
4829 > return b'custom'
4830 > EOF
4830 > EOF
4831 $ cat <<EOF > .hg/hgrc
4831 $ cat <<EOF > .hg/hgrc
4832 > [extensions]
4832 > [extensions]
4833 > customfunc = $TESTTMP/customfunc.py
4833 > customfunc = $TESTTMP/customfunc.py
4834 > EOF
4834 > EOF
4835
4835
4836 $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true
4836 $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true
4837 custom
4837 custom
4838
4838
4839 $ cd ..
4839 $ cd ..
4840
4840
4841 Test 'graphwidth' in 'hg log' on various topologies. The key here is that the
4841 Test 'graphwidth' in 'hg log' on various topologies. The key here is that the
4842 printed graphwidths 3, 5, 7, etc. should all line up in their respective
4842 printed graphwidths 3, 5, 7, etc. should all line up in their respective
4843 columns. We don't care about other aspects of the graph rendering here.
4843 columns. We don't care about other aspects of the graph rendering here.
4844
4844
4845 $ hg init graphwidth
4845 $ hg init graphwidth
4846 $ cd graphwidth
4846 $ cd graphwidth
4847
4847
4848 $ wrappabletext="a a a a a a a a a a a a"
4848 $ wrappabletext="a a a a a a a a a a a a"
4849
4849
4850 $ printf "first\n" > file
4850 $ printf "first\n" > file
4851 $ hg add file
4851 $ hg add file
4852 $ hg commit -m "$wrappabletext"
4852 $ hg commit -m "$wrappabletext"
4853
4853
4854 $ printf "first\nsecond\n" > file
4854 $ printf "first\nsecond\n" > file
4855 $ hg commit -m "$wrappabletext"
4855 $ hg commit -m "$wrappabletext"
4856
4856
4857 $ hg checkout 0
4857 $ hg checkout 0
4858 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4858 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4859 $ printf "third\nfirst\n" > file
4859 $ printf "third\nfirst\n" > file
4860 $ hg commit -m "$wrappabletext"
4860 $ hg commit -m "$wrappabletext"
4861 created new head
4861 created new head
4862
4862
4863 $ hg merge
4863 $ hg merge
4864 merging file
4864 merging file
4865 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
4865 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
4866 (branch merge, don't forget to commit)
4866 (branch merge, don't forget to commit)
4867
4867
4868 $ hg log --graph -T "{graphwidth}"
4868 $ hg log --graph -T "{graphwidth}"
4869 @ 3
4869 @ 3
4870 |
4870 |
4871 | @ 5
4871 | @ 5
4872 |/
4872 |/
4873 o 3
4873 o 3
4874
4874
4875 $ hg commit -m "$wrappabletext"
4875 $ hg commit -m "$wrappabletext"
4876
4876
4877 $ hg log --graph -T "{graphwidth}"
4877 $ hg log --graph -T "{graphwidth}"
4878 @ 5
4878 @ 5
4879 |\
4879 |\
4880 | o 5
4880 | o 5
4881 | |
4881 | |
4882 o | 5
4882 o | 5
4883 |/
4883 |/
4884 o 3
4884 o 3
4885
4885
4886
4886
4887 $ hg checkout 0
4887 $ hg checkout 0
4888 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4888 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4889 $ printf "third\nfirst\nsecond\n" > file
4889 $ printf "third\nfirst\nsecond\n" > file
4890 $ hg commit -m "$wrappabletext"
4890 $ hg commit -m "$wrappabletext"
4891 created new head
4891 created new head
4892
4892
4893 $ hg log --graph -T "{graphwidth}"
4893 $ hg log --graph -T "{graphwidth}"
4894 @ 3
4894 @ 3
4895 |
4895 |
4896 | o 7
4896 | o 7
4897 | |\
4897 | |\
4898 +---o 7
4898 +---o 7
4899 | |
4899 | |
4900 | o 5
4900 | o 5
4901 |/
4901 |/
4902 o 3
4902 o 3
4903
4903
4904
4904
4905 $ hg log --graph -T "{graphwidth}" -r 3
4905 $ hg log --graph -T "{graphwidth}" -r 3
4906 o 5
4906 o 5
4907 |\
4907 |\
4908 ~ ~
4908 ~ ~
4909
4909
4910 $ hg log --graph -T "{graphwidth}" -r 1
4910 $ hg log --graph -T "{graphwidth}" -r 1
4911 o 3
4911 o 3
4912 |
4912 |
4913 ~
4913 ~
4914
4914
4915 $ hg merge
4915 $ hg merge
4916 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4916 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4917 (branch merge, don't forget to commit)
4917 (branch merge, don't forget to commit)
4918 $ hg commit -m "$wrappabletext"
4918 $ hg commit -m "$wrappabletext"
4919
4919
4920 $ printf "seventh\n" >> file
4920 $ printf "seventh\n" >> file
4921 $ hg commit -m "$wrappabletext"
4921 $ hg commit -m "$wrappabletext"
4922
4922
4923 $ hg log --graph -T "{graphwidth}"
4923 $ hg log --graph -T "{graphwidth}"
4924 @ 3
4924 @ 3
4925 |
4925 |
4926 o 5
4926 o 5
4927 |\
4927 |\
4928 | o 5
4928 | o 5
4929 | |
4929 | |
4930 o | 7
4930 o | 7
4931 |\ \
4931 |\ \
4932 | o | 7
4932 | o | 7
4933 | |/
4933 | |/
4934 o / 5
4934 o / 5
4935 |/
4935 |/
4936 o 3
4936 o 3
4937
4937
4938
4938
4939 The point of graphwidth is to allow wrapping that accounts for the space taken
4939 The point of graphwidth is to allow wrapping that accounts for the space taken
4940 by the graph.
4940 by the graph.
4941
4941
4942 $ COLUMNS=10 hg log --graph -T "{fill(desc, termwidth - graphwidth)}"
4942 $ COLUMNS=10 hg log --graph -T "{fill(desc, termwidth - graphwidth)}"
4943 @ a a a a
4943 @ a a a a
4944 | a a a a
4944 | a a a a
4945 | a a a a
4945 | a a a a
4946 o a a a
4946 o a a a
4947 |\ a a a
4947 |\ a a a
4948 | | a a a
4948 | | a a a
4949 | | a a a
4949 | | a a a
4950 | o a a a
4950 | o a a a
4951 | | a a a
4951 | | a a a
4952 | | a a a
4952 | | a a a
4953 | | a a a
4953 | | a a a
4954 o | a a
4954 o | a a
4955 |\ \ a a
4955 |\ \ a a
4956 | | | a a
4956 | | | a a
4957 | | | a a
4957 | | | a a
4958 | | | a a
4958 | | | a a
4959 | | | a a
4959 | | | a a
4960 | o | a a
4960 | o | a a
4961 | |/ a a
4961 | |/ a a
4962 | | a a
4962 | | a a
4963 | | a a
4963 | | a a
4964 | | a a
4964 | | a a
4965 | | a a
4965 | | a a
4966 o | a a a
4966 o | a a a
4967 |/ a a a
4967 |/ a a a
4968 | a a a
4968 | a a a
4969 | a a a
4969 | a a a
4970 o a a a a
4970 o a a a a
4971 a a a a
4971 a a a a
4972 a a a a
4972 a a a a
4973
4973
4974 Something tricky happens when there are elided nodes; the next drawn row of
4974 Something tricky happens when there are elided nodes; the next drawn row of
4975 edges can be more than one column wider, but the graph width only increases by
4975 edges can be more than one column wider, but the graph width only increases by
4976 one column. The remaining columns are added in between the nodes.
4976 one column. The remaining columns are added in between the nodes.
4977
4977
4978 $ hg log --graph -T "{graphwidth}" -r "0|2|4|5"
4978 $ hg log --graph -T "{graphwidth}" -r "0|2|4|5"
4979 o 5
4979 o 5
4980 |\
4980 |\
4981 | \
4981 | \
4982 | :\
4982 | :\
4983 o : : 7
4983 o : : 7
4984 :/ /
4984 :/ /
4985 : o 5
4985 : o 5
4986 :/
4986 :/
4987 o 3
4987 o 3
4988
4988
4989
4989
4990 $ cd ..
4990 $ cd ..
4991
4991
@@ -1,330 +1,330 b''
1
1
2 plain
2 plain
3
3
4 $ hg init
4 $ hg init
5 $ hg debugbuilddag '+2:f +3:p2 @temp <f+4 @default /p2 +2' \
5 $ hg debugbuilddag '+2:f +3:p2 @temp <f+4 @default /p2 +2' \
6 > --config extensions.progress= --config progress.assume-tty=1 \
6 > --config extensions.progress= --config progress.assume-tty=1 \
7 > --config progress.delay=0 --config progress.refresh=0 \
7 > --config progress.delay=0 --config progress.refresh=0 \
8 > --config progress.format=topic,bar,number \
8 > --config progress.format=topic,bar,number \
9 > --config progress.width=60
9 > --config progress.width=60
10 \r (no-eol) (esc)
10 \r (no-eol) (esc)
11 building [ ] 0/12\r (no-eol) (esc)
11 building [ ] 0/12\r (no-eol) (esc)
12 building [ ] 0/12\r (no-eol) (esc)
12 building [ ] 0/12\r (no-eol) (esc)
13 building [==> ] 1/12\r (no-eol) (esc)
13 building [==> ] 1/12\r (no-eol) (esc)
14 building [==> ] 1/12\r (no-eol) (esc)
14 building [==> ] 1/12\r (no-eol) (esc)
15 building [======> ] 2/12\r (no-eol) (esc)
15 building [======> ] 2/12\r (no-eol) (esc)
16 building [=========> ] 3/12\r (no-eol) (esc)
16 building [=========> ] 3/12\r (no-eol) (esc)
17 building [=============> ] 4/12\r (no-eol) (esc)
17 building [=============> ] 4/12\r (no-eol) (esc)
18 building [=============> ] 4/12\r (no-eol) (esc)
18 building [=============> ] 4/12\r (no-eol) (esc)
19 building [=============> ] 4/12\r (no-eol) (esc)
19 building [=============> ] 4/12\r (no-eol) (esc)
20 building [================> ] 5/12\r (no-eol) (esc)
20 building [================> ] 5/12\r (no-eol) (esc)
21 building [====================> ] 6/12\r (no-eol) (esc)
21 building [====================> ] 6/12\r (no-eol) (esc)
22 building [=======================> ] 7/12\r (no-eol) (esc)
22 building [=======================> ] 7/12\r (no-eol) (esc)
23 building [===========================> ] 8/12\r (no-eol) (esc)
23 building [===========================> ] 8/12\r (no-eol) (esc)
24 building [===========================> ] 8/12\r (no-eol) (esc)
24 building [===========================> ] 8/12\r (no-eol) (esc)
25 building [==============================> ] 9/12\r (no-eol) (esc)
25 building [==============================> ] 9/12\r (no-eol) (esc)
26 building [==================================> ] 10/12\r (no-eol) (esc)
26 building [==================================> ] 10/12\r (no-eol) (esc)
27 building [=====================================> ] 11/12\r (no-eol) (esc)
27 building [=====================================> ] 11/12\r (no-eol) (esc)
28 \r (no-eol) (esc)
28 \r (no-eol) (esc)
29
29
30 tags
30 tags
31 $ cat .hg/localtags
31 $ cat .hg/localtags
32 66f7d451a68b85ed82ff5fcc254daf50c74144bd f
32 66f7d451a68b85ed82ff5fcc254daf50c74144bd f
33 bebd167eb94d257ace0e814aeb98e6972ed2970d p2
33 bebd167eb94d257ace0e814aeb98e6972ed2970d p2
34 dag
34 dag
35 $ hg debugdag -t -b
35 $ hg debugdag -t -b
36 +2:f
36 +2:f
37 +3:p2
37 +3:p2
38 @temp*f+3
38 @temp*f+3
39 @default*/p2+2:tip
39 @default*/p2+2:tip
40 tip
40 tip
41 $ hg id
41 $ hg id
42 000000000000
42 000000000000
43 glog
43 glog
44 $ hg log -G --template '{rev}: {desc} [{branches}] @ {date}\n'
44 $ hg log -G --template '{rev}: {desc} [{branches}] @ {date}\n'
45 o 11: r11 [] @ 11 0
45 o 11: r11 [] @ 11.00
46 |
46 |
47 o 10: r10 [] @ 10 0
47 o 10: r10 [] @ 10.00
48 |
48 |
49 o 9: r9 [] @ 9 0
49 o 9: r9 [] @ 9.00
50 |\
50 |\
51 | o 8: r8 [temp] @ 8 0
51 | o 8: r8 [temp] @ 8.00
52 | |
52 | |
53 | o 7: r7 [temp] @ 7 0
53 | o 7: r7 [temp] @ 7.00
54 | |
54 | |
55 | o 6: r6 [temp] @ 6 0
55 | o 6: r6 [temp] @ 6.00
56 | |
56 | |
57 | o 5: r5 [temp] @ 5 0
57 | o 5: r5 [temp] @ 5.00
58 | |
58 | |
59 o | 4: r4 [] @ 4 0
59 o | 4: r4 [] @ 4.00
60 | |
60 | |
61 o | 3: r3 [] @ 3 0
61 o | 3: r3 [] @ 3.00
62 | |
62 | |
63 o | 2: r2 [] @ 2 0
63 o | 2: r2 [] @ 2.00
64 |/
64 |/
65 o 1: r1 [] @ 1 0
65 o 1: r1 [] @ 1.00
66 |
66 |
67 o 0: r0 [] @ 0 0
67 o 0: r0 [] @ 0.00
68
68
69
69
70 overwritten files, starting on a non-default branch
70 overwritten files, starting on a non-default branch
71
71
72 $ rm -r .hg
72 $ rm -r .hg
73 $ hg init
73 $ hg init
74 $ hg debugbuilddag '@start.@default.:f +3:p2 @temp <f+4 @default /p2 +2' -q -o
74 $ hg debugbuilddag '@start.@default.:f +3:p2 @temp <f+4 @default /p2 +2' -q -o
75 tags
75 tags
76 $ cat .hg/localtags
76 $ cat .hg/localtags
77 f778700ebd50fcf282b23a4446bd155da6453eb6 f
77 f778700ebd50fcf282b23a4446bd155da6453eb6 f
78 bbccf169769006e2490efd2a02f11c3d38d462bd p2
78 bbccf169769006e2490efd2a02f11c3d38d462bd p2
79 dag
79 dag
80 $ hg debugdag -t -b
80 $ hg debugdag -t -b
81 @start+1
81 @start+1
82 @default+1:f
82 @default+1:f
83 +3:p2
83 +3:p2
84 @temp*f+3
84 @temp*f+3
85 @default*/p2+2:tip
85 @default*/p2+2:tip
86 tip
86 tip
87 $ hg id
87 $ hg id
88 000000000000
88 000000000000
89 glog
89 glog
90 $ hg log -G --template '{rev}: {desc} [{branches}] @ {date}\n'
90 $ hg log -G --template '{rev}: {desc} [{branches}] @ {date}\n'
91 o 11: r11 [] @ 11 0
91 o 11: r11 [] @ 11.00
92 |
92 |
93 o 10: r10 [] @ 10 0
93 o 10: r10 [] @ 10.00
94 |
94 |
95 o 9: r9 [] @ 9 0
95 o 9: r9 [] @ 9.00
96 |\
96 |\
97 | o 8: r8 [temp] @ 8 0
97 | o 8: r8 [temp] @ 8.00
98 | |
98 | |
99 | o 7: r7 [temp] @ 7 0
99 | o 7: r7 [temp] @ 7.00
100 | |
100 | |
101 | o 6: r6 [temp] @ 6 0
101 | o 6: r6 [temp] @ 6.00
102 | |
102 | |
103 | o 5: r5 [temp] @ 5 0
103 | o 5: r5 [temp] @ 5.00
104 | |
104 | |
105 o | 4: r4 [] @ 4 0
105 o | 4: r4 [] @ 4.00
106 | |
106 | |
107 o | 3: r3 [] @ 3 0
107 o | 3: r3 [] @ 3.00
108 | |
108 | |
109 o | 2: r2 [] @ 2 0
109 o | 2: r2 [] @ 2.00
110 |/
110 |/
111 o 1: r1 [] @ 1 0
111 o 1: r1 [] @ 1.00
112 |
112 |
113 o 0: r0 [start] @ 0 0
113 o 0: r0 [start] @ 0.00
114
114
115 glog of
115 glog of
116 $ hg log -G --template '{rev}: {desc} [{branches}]\n' of
116 $ hg log -G --template '{rev}: {desc} [{branches}]\n' of
117 o 11: r11 []
117 o 11: r11 []
118 |
118 |
119 o 10: r10 []
119 o 10: r10 []
120 |
120 |
121 o 9: r9 []
121 o 9: r9 []
122 |\
122 |\
123 | o 8: r8 [temp]
123 | o 8: r8 [temp]
124 | |
124 | |
125 | o 7: r7 [temp]
125 | o 7: r7 [temp]
126 | |
126 | |
127 | o 6: r6 [temp]
127 | o 6: r6 [temp]
128 | |
128 | |
129 | o 5: r5 [temp]
129 | o 5: r5 [temp]
130 | |
130 | |
131 o | 4: r4 []
131 o | 4: r4 []
132 | |
132 | |
133 o | 3: r3 []
133 o | 3: r3 []
134 | |
134 | |
135 o | 2: r2 []
135 o | 2: r2 []
136 |/
136 |/
137 o 1: r1 []
137 o 1: r1 []
138 |
138 |
139 o 0: r0 [start]
139 o 0: r0 [start]
140
140
141 tags
141 tags
142 $ hg tags -v
142 $ hg tags -v
143 tip 11:9ffe238a67a2
143 tip 11:9ffe238a67a2
144 p2 4:bbccf1697690 local
144 p2 4:bbccf1697690 local
145 f 1:f778700ebd50 local
145 f 1:f778700ebd50 local
146 cat of
146 cat of
147 $ hg cat of --rev tip
147 $ hg cat of --rev tip
148 r11
148 r11
149
149
150
150
151 new and mergeable files
151 new and mergeable files
152
152
153 $ rm -r .hg
153 $ rm -r .hg
154 $ hg init
154 $ hg init
155 $ hg debugbuilddag '+2:f +3:p2 @temp <f+4 @default /p2 +2' -q -mn
155 $ hg debugbuilddag '+2:f +3:p2 @temp <f+4 @default /p2 +2' -q -mn
156 dag
156 dag
157 $ hg debugdag -t -b
157 $ hg debugdag -t -b
158 +2:f
158 +2:f
159 +3:p2
159 +3:p2
160 @temp*f+3
160 @temp*f+3
161 @default*/p2+2:tip
161 @default*/p2+2:tip
162 tip
162 tip
163 $ hg id
163 $ hg id
164 000000000000
164 000000000000
165 glog
165 glog
166 $ hg log -G --template '{rev}: {desc} [{branches}] @ {date}\n'
166 $ hg log -G --template '{rev}: {desc} [{branches}] @ {date}\n'
167 o 11: r11 [] @ 11 0
167 o 11: r11 [] @ 11.00
168 |
168 |
169 o 10: r10 [] @ 10 0
169 o 10: r10 [] @ 10.00
170 |
170 |
171 o 9: r9 [] @ 9 0
171 o 9: r9 [] @ 9.00
172 |\
172 |\
173 | o 8: r8 [temp] @ 8 0
173 | o 8: r8 [temp] @ 8.00
174 | |
174 | |
175 | o 7: r7 [temp] @ 7 0
175 | o 7: r7 [temp] @ 7.00
176 | |
176 | |
177 | o 6: r6 [temp] @ 6 0
177 | o 6: r6 [temp] @ 6.00
178 | |
178 | |
179 | o 5: r5 [temp] @ 5 0
179 | o 5: r5 [temp] @ 5.00
180 | |
180 | |
181 o | 4: r4 [] @ 4 0
181 o | 4: r4 [] @ 4.00
182 | |
182 | |
183 o | 3: r3 [] @ 3 0
183 o | 3: r3 [] @ 3.00
184 | |
184 | |
185 o | 2: r2 [] @ 2 0
185 o | 2: r2 [] @ 2.00
186 |/
186 |/
187 o 1: r1 [] @ 1 0
187 o 1: r1 [] @ 1.00
188 |
188 |
189 o 0: r0 [] @ 0 0
189 o 0: r0 [] @ 0.00
190
190
191 glog mf
191 glog mf
192 $ hg log -G --template '{rev}: {desc} [{branches}]\n' mf
192 $ hg log -G --template '{rev}: {desc} [{branches}]\n' mf
193 o 11: r11 []
193 o 11: r11 []
194 |
194 |
195 o 10: r10 []
195 o 10: r10 []
196 |
196 |
197 o 9: r9 []
197 o 9: r9 []
198 |\
198 |\
199 | o 8: r8 [temp]
199 | o 8: r8 [temp]
200 | |
200 | |
201 | o 7: r7 [temp]
201 | o 7: r7 [temp]
202 | |
202 | |
203 | o 6: r6 [temp]
203 | o 6: r6 [temp]
204 | |
204 | |
205 | o 5: r5 [temp]
205 | o 5: r5 [temp]
206 | |
206 | |
207 o | 4: r4 []
207 o | 4: r4 []
208 | |
208 | |
209 o | 3: r3 []
209 o | 3: r3 []
210 | |
210 | |
211 o | 2: r2 []
211 o | 2: r2 []
212 |/
212 |/
213 o 1: r1 []
213 o 1: r1 []
214 |
214 |
215 o 0: r0 []
215 o 0: r0 []
216
216
217
217
218 man r4
218 man r4
219 $ hg manifest -r4
219 $ hg manifest -r4
220 mf
220 mf
221 nf0
221 nf0
222 nf1
222 nf1
223 nf2
223 nf2
224 nf3
224 nf3
225 nf4
225 nf4
226 cat r4 mf
226 cat r4 mf
227 $ hg cat -r4 mf
227 $ hg cat -r4 mf
228 0 r0
228 0 r0
229 1
229 1
230 2 r1
230 2 r1
231 3
231 3
232 4 r2
232 4 r2
233 5
233 5
234 6 r3
234 6 r3
235 7
235 7
236 8 r4
236 8 r4
237 9
237 9
238 10
238 10
239 11
239 11
240 12
240 12
241 13
241 13
242 14
242 14
243 15
243 15
244 16
244 16
245 17
245 17
246 18
246 18
247 19
247 19
248 20
248 20
249 21
249 21
250 22
250 22
251 23
251 23
252 man r8
252 man r8
253 $ hg manifest -r8
253 $ hg manifest -r8
254 mf
254 mf
255 nf0
255 nf0
256 nf1
256 nf1
257 nf5
257 nf5
258 nf6
258 nf6
259 nf7
259 nf7
260 nf8
260 nf8
261 cat r8 mf
261 cat r8 mf
262 $ hg cat -r8 mf
262 $ hg cat -r8 mf
263 0 r0
263 0 r0
264 1
264 1
265 2 r1
265 2 r1
266 3
266 3
267 4
267 4
268 5
268 5
269 6
269 6
270 7
270 7
271 8
271 8
272 9
272 9
273 10 r5
273 10 r5
274 11
274 11
275 12 r6
275 12 r6
276 13
276 13
277 14 r7
277 14 r7
278 15
278 15
279 16 r8
279 16 r8
280 17
280 17
281 18
281 18
282 19
282 19
283 20
283 20
284 21
284 21
285 22
285 22
286 23
286 23
287 man
287 man
288 $ hg manifest --rev tip
288 $ hg manifest --rev tip
289 mf
289 mf
290 nf0
290 nf0
291 nf1
291 nf1
292 nf10
292 nf10
293 nf11
293 nf11
294 nf2
294 nf2
295 nf3
295 nf3
296 nf4
296 nf4
297 nf5
297 nf5
298 nf6
298 nf6
299 nf7
299 nf7
300 nf8
300 nf8
301 nf9
301 nf9
302 cat mf
302 cat mf
303 $ hg cat mf --rev tip
303 $ hg cat mf --rev tip
304 0 r0
304 0 r0
305 1
305 1
306 2 r1
306 2 r1
307 3
307 3
308 4 r2
308 4 r2
309 5
309 5
310 6 r3
310 6 r3
311 7
311 7
312 8 r4
312 8 r4
313 9
313 9
314 10 r5
314 10 r5
315 11
315 11
316 12 r6
316 12 r6
317 13
317 13
318 14 r7
318 14 r7
319 15
319 15
320 16 r8
320 16 r8
321 17
321 17
322 18 r9
322 18 r9
323 19
323 19
324 20 r10
324 20 r10
325 21
325 21
326 22 r11
326 22 r11
327 23
327 23
328
328
329
329
330
330
@@ -1,901 +1,901 b''
1
1
2 $ cat <<EOF >> $HGRCPATH
2 $ cat <<EOF >> $HGRCPATH
3 > [extensions]
3 > [extensions]
4 > mq =
4 > mq =
5 > [diff]
5 > [diff]
6 > nodates = true
6 > nodates = true
7 > EOF
7 > EOF
8 $ catpatch() {
8 $ catpatch() {
9 > cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
9 > cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
10 > -e "s/^\(# Parent \).*/\1/"
10 > -e "s/^\(# Parent \).*/\1/"
11 > }
11 > }
12 $ catlog() {
12 $ catlog() {
13 > catpatch $1
13 > catpatch $1
14 > hg log --template "{rev}: {node|short} {desc} - {author}\n"
14 > hg log --template "{rev}: {node|short} {desc} - {author}\n"
15 > }
15 > }
16 $ catlogd() {
16 $ catlogd() {
17 > catpatch $1
17 > catpatch $1
18 > hg log --template "{rev}: {node|short} {desc} - {author} - {date}\n"
18 > hg log --template "{rev}: {node|short} {desc} - {author} - {date}\n"
19 > }
19 > }
20 $ drop() {
20 $ drop() {
21 > hg qpop
21 > hg qpop
22 > hg qdel $1.patch
22 > hg qdel $1.patch
23 > }
23 > }
24 $ runtest() {
24 $ runtest() {
25 > echo ==== init
25 > echo ==== init
26 > hg init a
26 > hg init a
27 > cd a
27 > cd a
28 > hg qinit
28 > hg qinit
29 >
29 >
30 >
30 >
31 > echo ==== qnew -d
31 > echo ==== qnew -d
32 > hg qnew -d '3 0' 1.patch
32 > hg qnew -d '3 0' 1.patch
33 > catlogd 1
33 > catlogd 1
34 >
34 >
35 > echo ==== qref
35 > echo ==== qref
36 > echo "1" >1
36 > echo "1" >1
37 > hg add
37 > hg add
38 > hg qref
38 > hg qref
39 > catlogd 1
39 > catlogd 1
40 >
40 >
41 > echo ==== qref -d
41 > echo ==== qref -d
42 > hg qref -d '4 0'
42 > hg qref -d '4 0'
43 > catlogd 1
43 > catlogd 1
44 >
44 >
45 >
45 >
46 > echo ==== qnew
46 > echo ==== qnew
47 > hg qnew 2.patch
47 > hg qnew 2.patch
48 > echo "2" >2
48 > echo "2" >2
49 > hg add
49 > hg add
50 > hg qref
50 > hg qref
51 > catlog 2
51 > catlog 2
52 >
52 >
53 > echo ==== qref -d
53 > echo ==== qref -d
54 > hg qref -d '5 0'
54 > hg qref -d '5 0'
55 > catlog 2
55 > catlog 2
56 >
56 >
57 > drop 2
57 > drop 2
58 >
58 >
59 >
59 >
60 > echo ==== qnew -d -m
60 > echo ==== qnew -d -m
61 > hg qnew -d '6 0' -m "Three" 3.patch
61 > hg qnew -d '6 0' -m "Three" 3.patch
62 > catlogd 3
62 > catlogd 3
63 >
63 >
64 > echo ==== qref
64 > echo ==== qref
65 > echo "3" >3
65 > echo "3" >3
66 > hg add
66 > hg add
67 > hg qref
67 > hg qref
68 > catlogd 3
68 > catlogd 3
69 >
69 >
70 > echo ==== qref -m
70 > echo ==== qref -m
71 > hg qref -m "Drei"
71 > hg qref -m "Drei"
72 > catlogd 3
72 > catlogd 3
73 >
73 >
74 > echo ==== qref -d
74 > echo ==== qref -d
75 > hg qref -d '7 0'
75 > hg qref -d '7 0'
76 > catlogd 3
76 > catlogd 3
77 >
77 >
78 > echo ==== qref -d -m
78 > echo ==== qref -d -m
79 > hg qref -d '8 0' -m "Three (again)"
79 > hg qref -d '8 0' -m "Three (again)"
80 > catlogd 3
80 > catlogd 3
81 >
81 >
82 >
82 >
83 > echo ==== qnew -m
83 > echo ==== qnew -m
84 > hg qnew -m "Four" 4.patch
84 > hg qnew -m "Four" 4.patch
85 > echo "4" >4
85 > echo "4" >4
86 > hg add
86 > hg add
87 > hg qref
87 > hg qref
88 > catlog 4
88 > catlog 4
89 >
89 >
90 > echo ==== qref -d
90 > echo ==== qref -d
91 > hg qref -d '9 0'
91 > hg qref -d '9 0'
92 > catlog 4
92 > catlog 4
93 >
93 >
94 > drop 4
94 > drop 4
95 >
95 >
96 >
96 >
97 > echo ==== qnew with HG header
97 > echo ==== qnew with HG header
98 > hg qnew --config 'mq.plain=true' 5.patch
98 > hg qnew --config 'mq.plain=true' 5.patch
99 > hg qpop
99 > hg qpop
100 > echo "# HG changeset patch" >>.hg/patches/5.patch
100 > echo "# HG changeset patch" >>.hg/patches/5.patch
101 > echo "# Date 10 0" >>.hg/patches/5.patch
101 > echo "# Date 10 0" >>.hg/patches/5.patch
102 > hg qpush 2>&1 | grep 'Now at'
102 > hg qpush 2>&1 | grep 'Now at'
103 > catlogd 5
103 > catlogd 5
104 >
104 >
105 > echo ==== hg qref
105 > echo ==== hg qref
106 > echo "5" >5
106 > echo "5" >5
107 > hg add
107 > hg add
108 > hg qref
108 > hg qref
109 > catlogd 5
109 > catlogd 5
110 >
110 >
111 > echo ==== hg qref -d
111 > echo ==== hg qref -d
112 > hg qref -d '11 0'
112 > hg qref -d '11 0'
113 > catlogd 5
113 > catlogd 5
114 >
114 >
115 >
115 >
116 > echo ==== qnew with plain header
116 > echo ==== qnew with plain header
117 > hg qnew --config 'mq.plain=true' -d '12 0' 6.patch
117 > hg qnew --config 'mq.plain=true' -d '12 0' 6.patch
118 > hg qpop
118 > hg qpop
119 > hg qpush 2>&1 | grep 'now at'
119 > hg qpush 2>&1 | grep 'now at'
120 > catlog 6
120 > catlog 6
121 >
121 >
122 > echo ==== hg qref
122 > echo ==== hg qref
123 > echo "6" >6
123 > echo "6" >6
124 > hg add
124 > hg add
125 > hg qref
125 > hg qref
126 > catlogd 6
126 > catlogd 6
127 >
127 >
128 > echo ==== hg qref -d
128 > echo ==== hg qref -d
129 > hg qref -d '13 0'
129 > hg qref -d '13 0'
130 > catlogd 6
130 > catlogd 6
131 >
131 >
132 > drop 6
132 > drop 6
133 >
133 >
134 >
134 >
135 > echo ==== qnew -u
135 > echo ==== qnew -u
136 > hg qnew -u jane 6.patch
136 > hg qnew -u jane 6.patch
137 > echo "6" >6
137 > echo "6" >6
138 > hg add
138 > hg add
139 > hg qref
139 > hg qref
140 > catlog 6
140 > catlog 6
141 >
141 >
142 > echo ==== qref -d
142 > echo ==== qref -d
143 > hg qref -d '12 0'
143 > hg qref -d '12 0'
144 > catlog 6
144 > catlog 6
145 >
145 >
146 > drop 6
146 > drop 6
147 >
147 >
148 >
148 >
149 > echo ==== qnew -d
149 > echo ==== qnew -d
150 > hg qnew -d '13 0' 7.patch
150 > hg qnew -d '13 0' 7.patch
151 > echo "7" >7
151 > echo "7" >7
152 > hg add
152 > hg add
153 > hg qref
153 > hg qref
154 > catlog 7
154 > catlog 7
155 >
155 >
156 > echo ==== qref -u
156 > echo ==== qref -u
157 > hg qref -u john
157 > hg qref -u john
158 > catlogd 7
158 > catlogd 7
159 >
159 >
160 >
160 >
161 > echo ==== qnew
161 > echo ==== qnew
162 > hg qnew 8.patch
162 > hg qnew 8.patch
163 > echo "8" >8
163 > echo "8" >8
164 > hg add
164 > hg add
165 > hg qref
165 > hg qref
166 > catlog 8
166 > catlog 8
167 >
167 >
168 > echo ==== qref -u -d
168 > echo ==== qref -u -d
169 > hg qref -u john -d '14 0'
169 > hg qref -u john -d '14 0'
170 > catlog 8
170 > catlog 8
171 >
171 >
172 > drop 8
172 > drop 8
173 >
173 >
174 >
174 >
175 > echo ==== qnew -m
175 > echo ==== qnew -m
176 > hg qnew -m "Nine" 9.patch
176 > hg qnew -m "Nine" 9.patch
177 > echo "9" >9
177 > echo "9" >9
178 > hg add
178 > hg add
179 > hg qref
179 > hg qref
180 > catlog 9
180 > catlog 9
181 >
181 >
182 > echo ==== qref -u -d
182 > echo ==== qref -u -d
183 > hg qref -u john -d '15 0'
183 > hg qref -u john -d '15 0'
184 > catlog 9
184 > catlog 9
185 >
185 >
186 > drop 9
186 > drop 9
187 >
187 >
188 >
188 >
189 > echo ==== "qpop -a / qpush -a"
189 > echo ==== "qpop -a / qpush -a"
190 > hg qpop -a
190 > hg qpop -a
191 > hg qpush -a
191 > hg qpush -a
192 > hg log --template "{rev}: {node|short} {desc} - {author} - {date}\n"
192 > hg log --template "{rev}: {node|short} {desc} - {author} - {date}\n"
193 > }
193 > }
194
194
195 ======= plain headers
195 ======= plain headers
196
196
197 $ echo "[mq]" >> $HGRCPATH
197 $ echo "[mq]" >> $HGRCPATH
198 $ echo "plain=true" >> $HGRCPATH
198 $ echo "plain=true" >> $HGRCPATH
199 $ mkdir sandbox
199 $ mkdir sandbox
200 $ (cd sandbox ; runtest)
200 $ (cd sandbox ; runtest)
201 ==== init
201 ==== init
202 ==== qnew -d
202 ==== qnew -d
203 Date: 3 0
203 Date: 3 0
204
204
205 0: 758bd2596a39 [mq]: 1.patch - test - 3 0
205 0: 758bd2596a39 [mq]: 1.patch - test - 3.00
206 ==== qref
206 ==== qref
207 adding 1
207 adding 1
208 Date: 3 0
208 Date: 3 0
209
209
210 diff -r ... 1
210 diff -r ... 1
211 --- /dev/null
211 --- /dev/null
212 +++ b/1
212 +++ b/1
213 @@ -0,0 +1,1 @@
213 @@ -0,0 +1,1 @@
214 +1
214 +1
215 0: 8c640e9949a8 [mq]: 1.patch - test - 3 0
215 0: 8c640e9949a8 [mq]: 1.patch - test - 3.00
216 ==== qref -d
216 ==== qref -d
217 Date: 4 0
217 Date: 4 0
218
218
219 diff -r ... 1
219 diff -r ... 1
220 --- /dev/null
220 --- /dev/null
221 +++ b/1
221 +++ b/1
222 @@ -0,0 +1,1 @@
222 @@ -0,0 +1,1 @@
223 +1
223 +1
224 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
224 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
225 ==== qnew
225 ==== qnew
226 adding 2
226 adding 2
227 diff -r ... 2
227 diff -r ... 2
228 --- /dev/null
228 --- /dev/null
229 +++ b/2
229 +++ b/2
230 @@ -0,0 +1,1 @@
230 @@ -0,0 +1,1 @@
231 +2
231 +2
232 1: fc7e8a2f6499 [mq]: 2.patch - test
232 1: fc7e8a2f6499 [mq]: 2.patch - test
233 0: 4a67dfeea974 [mq]: 1.patch - test
233 0: 4a67dfeea974 [mq]: 1.patch - test
234 ==== qref -d
234 ==== qref -d
235 Date: 5 0
235 Date: 5 0
236
236
237 diff -r ... 2
237 diff -r ... 2
238 --- /dev/null
238 --- /dev/null
239 +++ b/2
239 +++ b/2
240 @@ -0,0 +1,1 @@
240 @@ -0,0 +1,1 @@
241 +2
241 +2
242 1: 1d9a6a118fd1 [mq]: 2.patch - test
242 1: 1d9a6a118fd1 [mq]: 2.patch - test
243 0: 4a67dfeea974 [mq]: 1.patch - test
243 0: 4a67dfeea974 [mq]: 1.patch - test
244 popping 2.patch
244 popping 2.patch
245 now at: 1.patch
245 now at: 1.patch
246 ==== qnew -d -m
246 ==== qnew -d -m
247 Date: 6 0
247 Date: 6 0
248
248
249 Three
249 Three
250
250
251 1: 2a9ef0bdefba Three - test - 6 0
251 1: 2a9ef0bdefba Three - test - 6.00
252 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
252 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
253 ==== qref
253 ==== qref
254 adding 3
254 adding 3
255 Date: 6 0
255 Date: 6 0
256
256
257 Three
257 Three
258
258
259 diff -r ... 3
259 diff -r ... 3
260 --- /dev/null
260 --- /dev/null
261 +++ b/3
261 +++ b/3
262 @@ -0,0 +1,1 @@
262 @@ -0,0 +1,1 @@
263 +3
263 +3
264 1: 7f19ad9eea7b Three - test - 6 0
264 1: 7f19ad9eea7b Three - test - 6.00
265 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
265 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
266 ==== qref -m
266 ==== qref -m
267 Date: 6 0
267 Date: 6 0
268
268
269 Drei
269 Drei
270
270
271 diff -r ... 3
271 diff -r ... 3
272 --- /dev/null
272 --- /dev/null
273 +++ b/3
273 +++ b/3
274 @@ -0,0 +1,1 @@
274 @@ -0,0 +1,1 @@
275 +3
275 +3
276 1: 7ff7377793e3 Drei - test - 6 0
276 1: 7ff7377793e3 Drei - test - 6.00
277 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
277 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
278 ==== qref -d
278 ==== qref -d
279 Date: 7 0
279 Date: 7 0
280
280
281 Drei
281 Drei
282
282
283 diff -r ... 3
283 diff -r ... 3
284 --- /dev/null
284 --- /dev/null
285 +++ b/3
285 +++ b/3
286 @@ -0,0 +1,1 @@
286 @@ -0,0 +1,1 @@
287 +3
287 +3
288 1: d89d3144f518 Drei - test - 7 0
288 1: d89d3144f518 Drei - test - 7.00
289 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
289 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
290 ==== qref -d -m
290 ==== qref -d -m
291 Date: 8 0
291 Date: 8 0
292
292
293 Three (again)
293 Three (again)
294
294
295 diff -r ... 3
295 diff -r ... 3
296 --- /dev/null
296 --- /dev/null
297 +++ b/3
297 +++ b/3
298 @@ -0,0 +1,1 @@
298 @@ -0,0 +1,1 @@
299 +3
299 +3
300 1: b1b6b0fe0e6d Three (again) - test - 8 0
300 1: b1b6b0fe0e6d Three (again) - test - 8.00
301 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
301 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
302 ==== qnew -m
302 ==== qnew -m
303 adding 4
303 adding 4
304 Four
304 Four
305
305
306 diff -r ... 4
306 diff -r ... 4
307 --- /dev/null
307 --- /dev/null
308 +++ b/4
308 +++ b/4
309 @@ -0,0 +1,1 @@
309 @@ -0,0 +1,1 @@
310 +4
310 +4
311 2: 74ded07d166b Four - test
311 2: 74ded07d166b Four - test
312 1: b1b6b0fe0e6d Three (again) - test
312 1: b1b6b0fe0e6d Three (again) - test
313 0: 4a67dfeea974 [mq]: 1.patch - test
313 0: 4a67dfeea974 [mq]: 1.patch - test
314 ==== qref -d
314 ==== qref -d
315 Date: 9 0
315 Date: 9 0
316
316
317 Four
317 Four
318
318
319 diff -r ... 4
319 diff -r ... 4
320 --- /dev/null
320 --- /dev/null
321 +++ b/4
321 +++ b/4
322 @@ -0,0 +1,1 @@
322 @@ -0,0 +1,1 @@
323 +4
323 +4
324 2: 1a651320cf8e Four - test
324 2: 1a651320cf8e Four - test
325 1: b1b6b0fe0e6d Three (again) - test
325 1: b1b6b0fe0e6d Three (again) - test
326 0: 4a67dfeea974 [mq]: 1.patch - test
326 0: 4a67dfeea974 [mq]: 1.patch - test
327 popping 4.patch
327 popping 4.patch
328 now at: 3.patch
328 now at: 3.patch
329 ==== qnew with HG header
329 ==== qnew with HG header
330 popping 5.patch
330 popping 5.patch
331 now at: 3.patch
331 now at: 3.patch
332 # HG changeset patch
332 # HG changeset patch
333 # Date 10 0
333 # Date 10 0
334 2: d16a272220d2 imported patch 5.patch - test - 10 0
334 2: d16a272220d2 imported patch 5.patch - test - 10.00
335 1: b1b6b0fe0e6d Three (again) - test - 8 0
335 1: b1b6b0fe0e6d Three (again) - test - 8.00
336 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
336 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
337 ==== hg qref
337 ==== hg qref
338 adding 5
338 adding 5
339 # HG changeset patch
339 # HG changeset patch
340 # Date 10 0
340 # Date 10 0
341 # Parent
341 # Parent
342
342
343 diff -r ... 5
343 diff -r ... 5
344 --- /dev/null
344 --- /dev/null
345 +++ b/5
345 +++ b/5
346 @@ -0,0 +1,1 @@
346 @@ -0,0 +1,1 @@
347 +5
347 +5
348 2: 5dbf69c07df9 [mq]: 5.patch - test - 10 0
348 2: 5dbf69c07df9 [mq]: 5.patch - test - 10.00
349 1: b1b6b0fe0e6d Three (again) - test - 8 0
349 1: b1b6b0fe0e6d Three (again) - test - 8.00
350 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
350 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
351 ==== hg qref -d
351 ==== hg qref -d
352 # HG changeset patch
352 # HG changeset patch
353 # Date 11 0
353 # Date 11 0
354 # Parent
354 # Parent
355
355
356 diff -r ... 5
356 diff -r ... 5
357 --- /dev/null
357 --- /dev/null
358 +++ b/5
358 +++ b/5
359 @@ -0,0 +1,1 @@
359 @@ -0,0 +1,1 @@
360 +5
360 +5
361 2: 049de6af0c1d [mq]: 5.patch - test - 11 0
361 2: 049de6af0c1d [mq]: 5.patch - test - 11.00
362 1: b1b6b0fe0e6d Three (again) - test - 8 0
362 1: b1b6b0fe0e6d Three (again) - test - 8.00
363 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
363 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
364 ==== qnew with plain header
364 ==== qnew with plain header
365 popping 6.patch
365 popping 6.patch
366 now at: 5.patch
366 now at: 5.patch
367 now at: 6.patch
367 now at: 6.patch
368 Date: 12 0
368 Date: 12 0
369
369
370 3: 8ad9ebc22b96 imported patch 6.patch - test
370 3: 8ad9ebc22b96 imported patch 6.patch - test
371 2: 049de6af0c1d [mq]: 5.patch - test
371 2: 049de6af0c1d [mq]: 5.patch - test
372 1: b1b6b0fe0e6d Three (again) - test
372 1: b1b6b0fe0e6d Three (again) - test
373 0: 4a67dfeea974 [mq]: 1.patch - test
373 0: 4a67dfeea974 [mq]: 1.patch - test
374 ==== hg qref
374 ==== hg qref
375 adding 6
375 adding 6
376 Date: 12 0
376 Date: 12 0
377
377
378 diff -r ... 6
378 diff -r ... 6
379 --- /dev/null
379 --- /dev/null
380 +++ b/6
380 +++ b/6
381 @@ -0,0 +1,1 @@
381 @@ -0,0 +1,1 @@
382 +6
382 +6
383 3: 038c46b02a56 [mq]: 6.patch - test - 12 0
383 3: 038c46b02a56 [mq]: 6.patch - test - 12.00
384 2: 049de6af0c1d [mq]: 5.patch - test - 11 0
384 2: 049de6af0c1d [mq]: 5.patch - test - 11.00
385 1: b1b6b0fe0e6d Three (again) - test - 8 0
385 1: b1b6b0fe0e6d Three (again) - test - 8.00
386 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
386 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
387 ==== hg qref -d
387 ==== hg qref -d
388 Date: 13 0
388 Date: 13 0
389
389
390 diff -r ... 6
390 diff -r ... 6
391 --- /dev/null
391 --- /dev/null
392 +++ b/6
392 +++ b/6
393 @@ -0,0 +1,1 @@
393 @@ -0,0 +1,1 @@
394 +6
394 +6
395 3: 2785642ea4b4 [mq]: 6.patch - test - 13 0
395 3: 2785642ea4b4 [mq]: 6.patch - test - 13.00
396 2: 049de6af0c1d [mq]: 5.patch - test - 11 0
396 2: 049de6af0c1d [mq]: 5.patch - test - 11.00
397 1: b1b6b0fe0e6d Three (again) - test - 8 0
397 1: b1b6b0fe0e6d Three (again) - test - 8.00
398 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
398 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
399 popping 6.patch
399 popping 6.patch
400 now at: 5.patch
400 now at: 5.patch
401 ==== qnew -u
401 ==== qnew -u
402 adding 6
402 adding 6
403 From: jane
403 From: jane
404
404
405 diff -r ... 6
405 diff -r ... 6
406 --- /dev/null
406 --- /dev/null
407 +++ b/6
407 +++ b/6
408 @@ -0,0 +1,1 @@
408 @@ -0,0 +1,1 @@
409 +6
409 +6
410 3: a05a33f187ce [mq]: 6.patch - jane
410 3: a05a33f187ce [mq]: 6.patch - jane
411 2: 049de6af0c1d [mq]: 5.patch - test
411 2: 049de6af0c1d [mq]: 5.patch - test
412 1: b1b6b0fe0e6d Three (again) - test
412 1: b1b6b0fe0e6d Three (again) - test
413 0: 4a67dfeea974 [mq]: 1.patch - test
413 0: 4a67dfeea974 [mq]: 1.patch - test
414 ==== qref -d
414 ==== qref -d
415 From: jane
415 From: jane
416 Date: 12 0
416 Date: 12 0
417
417
418 diff -r ... 6
418 diff -r ... 6
419 --- /dev/null
419 --- /dev/null
420 +++ b/6
420 +++ b/6
421 @@ -0,0 +1,1 @@
421 @@ -0,0 +1,1 @@
422 +6
422 +6
423 3: 5702c529dfe9 [mq]: 6.patch - jane
423 3: 5702c529dfe9 [mq]: 6.patch - jane
424 2: 049de6af0c1d [mq]: 5.patch - test
424 2: 049de6af0c1d [mq]: 5.patch - test
425 1: b1b6b0fe0e6d Three (again) - test
425 1: b1b6b0fe0e6d Three (again) - test
426 0: 4a67dfeea974 [mq]: 1.patch - test
426 0: 4a67dfeea974 [mq]: 1.patch - test
427 popping 6.patch
427 popping 6.patch
428 now at: 5.patch
428 now at: 5.patch
429 ==== qnew -d
429 ==== qnew -d
430 adding 7
430 adding 7
431 Date: 13 0
431 Date: 13 0
432
432
433 diff -r ... 7
433 diff -r ... 7
434 --- /dev/null
434 --- /dev/null
435 +++ b/7
435 +++ b/7
436 @@ -0,0 +1,1 @@
436 @@ -0,0 +1,1 @@
437 +7
437 +7
438 3: 8dd1eb8d4132 [mq]: 7.patch - test
438 3: 8dd1eb8d4132 [mq]: 7.patch - test
439 2: 049de6af0c1d [mq]: 5.patch - test
439 2: 049de6af0c1d [mq]: 5.patch - test
440 1: b1b6b0fe0e6d Three (again) - test
440 1: b1b6b0fe0e6d Three (again) - test
441 0: 4a67dfeea974 [mq]: 1.patch - test
441 0: 4a67dfeea974 [mq]: 1.patch - test
442 ==== qref -u
442 ==== qref -u
443 From: john
443 From: john
444 Date: 13 0
444 Date: 13 0
445
445
446 diff -r ... 7
446 diff -r ... 7
447 --- /dev/null
447 --- /dev/null
448 +++ b/7
448 +++ b/7
449 @@ -0,0 +1,1 @@
449 @@ -0,0 +1,1 @@
450 +7
450 +7
451 3: 4f9d07369cc4 [mq]: 7.patch - john - 13 0
451 3: 4f9d07369cc4 [mq]: 7.patch - john - 13.00
452 2: 049de6af0c1d [mq]: 5.patch - test - 11 0
452 2: 049de6af0c1d [mq]: 5.patch - test - 11.00
453 1: b1b6b0fe0e6d Three (again) - test - 8 0
453 1: b1b6b0fe0e6d Three (again) - test - 8.00
454 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
454 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
455 ==== qnew
455 ==== qnew
456 adding 8
456 adding 8
457 diff -r ... 8
457 diff -r ... 8
458 --- /dev/null
458 --- /dev/null
459 +++ b/8
459 +++ b/8
460 @@ -0,0 +1,1 @@
460 @@ -0,0 +1,1 @@
461 +8
461 +8
462 4: 868b62f09492 [mq]: 8.patch - test
462 4: 868b62f09492 [mq]: 8.patch - test
463 3: 4f9d07369cc4 [mq]: 7.patch - john
463 3: 4f9d07369cc4 [mq]: 7.patch - john
464 2: 049de6af0c1d [mq]: 5.patch - test
464 2: 049de6af0c1d [mq]: 5.patch - test
465 1: b1b6b0fe0e6d Three (again) - test
465 1: b1b6b0fe0e6d Three (again) - test
466 0: 4a67dfeea974 [mq]: 1.patch - test
466 0: 4a67dfeea974 [mq]: 1.patch - test
467 ==== qref -u -d
467 ==== qref -u -d
468 From: john
468 From: john
469 Date: 14 0
469 Date: 14 0
470
470
471 diff -r ... 8
471 diff -r ... 8
472 --- /dev/null
472 --- /dev/null
473 +++ b/8
473 +++ b/8
474 @@ -0,0 +1,1 @@
474 @@ -0,0 +1,1 @@
475 +8
475 +8
476 4: b1e878ae55b9 [mq]: 8.patch - john
476 4: b1e878ae55b9 [mq]: 8.patch - john
477 3: 4f9d07369cc4 [mq]: 7.patch - john
477 3: 4f9d07369cc4 [mq]: 7.patch - john
478 2: 049de6af0c1d [mq]: 5.patch - test
478 2: 049de6af0c1d [mq]: 5.patch - test
479 1: b1b6b0fe0e6d Three (again) - test
479 1: b1b6b0fe0e6d Three (again) - test
480 0: 4a67dfeea974 [mq]: 1.patch - test
480 0: 4a67dfeea974 [mq]: 1.patch - test
481 popping 8.patch
481 popping 8.patch
482 now at: 7.patch
482 now at: 7.patch
483 ==== qnew -m
483 ==== qnew -m
484 adding 9
484 adding 9
485 Nine
485 Nine
486
486
487 diff -r ... 9
487 diff -r ... 9
488 --- /dev/null
488 --- /dev/null
489 +++ b/9
489 +++ b/9
490 @@ -0,0 +1,1 @@
490 @@ -0,0 +1,1 @@
491 +9
491 +9
492 4: 7251936ac2bf Nine - test
492 4: 7251936ac2bf Nine - test
493 3: 4f9d07369cc4 [mq]: 7.patch - john
493 3: 4f9d07369cc4 [mq]: 7.patch - john
494 2: 049de6af0c1d [mq]: 5.patch - test
494 2: 049de6af0c1d [mq]: 5.patch - test
495 1: b1b6b0fe0e6d Three (again) - test
495 1: b1b6b0fe0e6d Three (again) - test
496 0: 4a67dfeea974 [mq]: 1.patch - test
496 0: 4a67dfeea974 [mq]: 1.patch - test
497 ==== qref -u -d
497 ==== qref -u -d
498 From: john
498 From: john
499 Date: 15 0
499 Date: 15 0
500
500
501 Nine
501 Nine
502
502
503 diff -r ... 9
503 diff -r ... 9
504 --- /dev/null
504 --- /dev/null
505 +++ b/9
505 +++ b/9
506 @@ -0,0 +1,1 @@
506 @@ -0,0 +1,1 @@
507 +9
507 +9
508 4: a0de5bf6e9f7 Nine - john
508 4: a0de5bf6e9f7 Nine - john
509 3: 4f9d07369cc4 [mq]: 7.patch - john
509 3: 4f9d07369cc4 [mq]: 7.patch - john
510 2: 049de6af0c1d [mq]: 5.patch - test
510 2: 049de6af0c1d [mq]: 5.patch - test
511 1: b1b6b0fe0e6d Three (again) - test
511 1: b1b6b0fe0e6d Three (again) - test
512 0: 4a67dfeea974 [mq]: 1.patch - test
512 0: 4a67dfeea974 [mq]: 1.patch - test
513 popping 9.patch
513 popping 9.patch
514 now at: 7.patch
514 now at: 7.patch
515 ==== qpop -a / qpush -a
515 ==== qpop -a / qpush -a
516 popping 7.patch
516 popping 7.patch
517 popping 5.patch
517 popping 5.patch
518 popping 3.patch
518 popping 3.patch
519 popping 1.patch
519 popping 1.patch
520 patch queue now empty
520 patch queue now empty
521 applying 1.patch
521 applying 1.patch
522 applying 3.patch
522 applying 3.patch
523 applying 5.patch
523 applying 5.patch
524 applying 7.patch
524 applying 7.patch
525 now at: 7.patch
525 now at: 7.patch
526 3: d26a5b7ffce1 imported patch 7.patch - john - 13 0
526 3: d26a5b7ffce1 imported patch 7.patch - john - 13.00
527 2: dda6cf77060a imported patch 5.patch - test - 11 0
527 2: dda6cf77060a imported patch 5.patch - test - 11.00
528 1: 25e32d66c8c7 Three (again) - test - 8 0
528 1: 25e32d66c8c7 Three (again) - test - 8.00
529 0: e5011c0211fe imported patch 1.patch - test - 4 0
529 0: e5011c0211fe imported patch 1.patch - test - 4.00
530 $ rm -r sandbox
530 $ rm -r sandbox
531
531
532 ======= hg headers
532 ======= hg headers
533
533
534 $ echo "plain=false" >> $HGRCPATH
534 $ echo "plain=false" >> $HGRCPATH
535 $ mkdir sandbox
535 $ mkdir sandbox
536 $ (cd sandbox ; runtest)
536 $ (cd sandbox ; runtest)
537 ==== init
537 ==== init
538 ==== qnew -d
538 ==== qnew -d
539 # HG changeset patch
539 # HG changeset patch
540 # Date 3 0
540 # Date 3 0
541 # Parent
541 # Parent
542
542
543 0: 758bd2596a39 [mq]: 1.patch - test - 3 0
543 0: 758bd2596a39 [mq]: 1.patch - test - 3.00
544 ==== qref
544 ==== qref
545 adding 1
545 adding 1
546 # HG changeset patch
546 # HG changeset patch
547 # Date 3 0
547 # Date 3 0
548 # Parent
548 # Parent
549
549
550 diff -r ... 1
550 diff -r ... 1
551 --- /dev/null
551 --- /dev/null
552 +++ b/1
552 +++ b/1
553 @@ -0,0 +1,1 @@
553 @@ -0,0 +1,1 @@
554 +1
554 +1
555 0: 8c640e9949a8 [mq]: 1.patch - test - 3 0
555 0: 8c640e9949a8 [mq]: 1.patch - test - 3.00
556 ==== qref -d
556 ==== qref -d
557 # HG changeset patch
557 # HG changeset patch
558 # Date 4 0
558 # Date 4 0
559 # Parent
559 # Parent
560
560
561 diff -r ... 1
561 diff -r ... 1
562 --- /dev/null
562 --- /dev/null
563 +++ b/1
563 +++ b/1
564 @@ -0,0 +1,1 @@
564 @@ -0,0 +1,1 @@
565 +1
565 +1
566 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
566 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
567 ==== qnew
567 ==== qnew
568 adding 2
568 adding 2
569 # HG changeset patch
569 # HG changeset patch
570 # Parent
570 # Parent
571
571
572 diff -r ... 2
572 diff -r ... 2
573 --- /dev/null
573 --- /dev/null
574 +++ b/2
574 +++ b/2
575 @@ -0,0 +1,1 @@
575 @@ -0,0 +1,1 @@
576 +2
576 +2
577 1: fc7e8a2f6499 [mq]: 2.patch - test
577 1: fc7e8a2f6499 [mq]: 2.patch - test
578 0: 4a67dfeea974 [mq]: 1.patch - test
578 0: 4a67dfeea974 [mq]: 1.patch - test
579 ==== qref -d
579 ==== qref -d
580 # HG changeset patch
580 # HG changeset patch
581 # Date 5 0
581 # Date 5 0
582 # Parent
582 # Parent
583
583
584 diff -r ... 2
584 diff -r ... 2
585 --- /dev/null
585 --- /dev/null
586 +++ b/2
586 +++ b/2
587 @@ -0,0 +1,1 @@
587 @@ -0,0 +1,1 @@
588 +2
588 +2
589 1: 1d9a6a118fd1 [mq]: 2.patch - test
589 1: 1d9a6a118fd1 [mq]: 2.patch - test
590 0: 4a67dfeea974 [mq]: 1.patch - test
590 0: 4a67dfeea974 [mq]: 1.patch - test
591 popping 2.patch
591 popping 2.patch
592 now at: 1.patch
592 now at: 1.patch
593 ==== qnew -d -m
593 ==== qnew -d -m
594 # HG changeset patch
594 # HG changeset patch
595 # Date 6 0
595 # Date 6 0
596 # Parent
596 # Parent
597 Three
597 Three
598
598
599 1: 2a9ef0bdefba Three - test - 6 0
599 1: 2a9ef0bdefba Three - test - 6.00
600 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
600 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
601 ==== qref
601 ==== qref
602 adding 3
602 adding 3
603 # HG changeset patch
603 # HG changeset patch
604 # Date 6 0
604 # Date 6 0
605 # Parent
605 # Parent
606 Three
606 Three
607
607
608 diff -r ... 3
608 diff -r ... 3
609 --- /dev/null
609 --- /dev/null
610 +++ b/3
610 +++ b/3
611 @@ -0,0 +1,1 @@
611 @@ -0,0 +1,1 @@
612 +3
612 +3
613 1: 7f19ad9eea7b Three - test - 6 0
613 1: 7f19ad9eea7b Three - test - 6.00
614 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
614 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
615 ==== qref -m
615 ==== qref -m
616 # HG changeset patch
616 # HG changeset patch
617 # Date 6 0
617 # Date 6 0
618 # Parent
618 # Parent
619 Drei
619 Drei
620
620
621 diff -r ... 3
621 diff -r ... 3
622 --- /dev/null
622 --- /dev/null
623 +++ b/3
623 +++ b/3
624 @@ -0,0 +1,1 @@
624 @@ -0,0 +1,1 @@
625 +3
625 +3
626 1: 7ff7377793e3 Drei - test - 6 0
626 1: 7ff7377793e3 Drei - test - 6.00
627 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
627 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
628 ==== qref -d
628 ==== qref -d
629 # HG changeset patch
629 # HG changeset patch
630 # Date 7 0
630 # Date 7 0
631 # Parent
631 # Parent
632 Drei
632 Drei
633
633
634 diff -r ... 3
634 diff -r ... 3
635 --- /dev/null
635 --- /dev/null
636 +++ b/3
636 +++ b/3
637 @@ -0,0 +1,1 @@
637 @@ -0,0 +1,1 @@
638 +3
638 +3
639 1: d89d3144f518 Drei - test - 7 0
639 1: d89d3144f518 Drei - test - 7.00
640 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
640 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
641 ==== qref -d -m
641 ==== qref -d -m
642 # HG changeset patch
642 # HG changeset patch
643 # Date 8 0
643 # Date 8 0
644 # Parent
644 # Parent
645 Three (again)
645 Three (again)
646
646
647 diff -r ... 3
647 diff -r ... 3
648 --- /dev/null
648 --- /dev/null
649 +++ b/3
649 +++ b/3
650 @@ -0,0 +1,1 @@
650 @@ -0,0 +1,1 @@
651 +3
651 +3
652 1: b1b6b0fe0e6d Three (again) - test - 8 0
652 1: b1b6b0fe0e6d Three (again) - test - 8.00
653 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
653 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
654 ==== qnew -m
654 ==== qnew -m
655 adding 4
655 adding 4
656 # HG changeset patch
656 # HG changeset patch
657 # Parent
657 # Parent
658 Four
658 Four
659
659
660 diff -r ... 4
660 diff -r ... 4
661 --- /dev/null
661 --- /dev/null
662 +++ b/4
662 +++ b/4
663 @@ -0,0 +1,1 @@
663 @@ -0,0 +1,1 @@
664 +4
664 +4
665 2: 74ded07d166b Four - test
665 2: 74ded07d166b Four - test
666 1: b1b6b0fe0e6d Three (again) - test
666 1: b1b6b0fe0e6d Three (again) - test
667 0: 4a67dfeea974 [mq]: 1.patch - test
667 0: 4a67dfeea974 [mq]: 1.patch - test
668 ==== qref -d
668 ==== qref -d
669 # HG changeset patch
669 # HG changeset patch
670 # Date 9 0
670 # Date 9 0
671 # Parent
671 # Parent
672 Four
672 Four
673
673
674 diff -r ... 4
674 diff -r ... 4
675 --- /dev/null
675 --- /dev/null
676 +++ b/4
676 +++ b/4
677 @@ -0,0 +1,1 @@
677 @@ -0,0 +1,1 @@
678 +4
678 +4
679 2: 1a651320cf8e Four - test
679 2: 1a651320cf8e Four - test
680 1: b1b6b0fe0e6d Three (again) - test
680 1: b1b6b0fe0e6d Three (again) - test
681 0: 4a67dfeea974 [mq]: 1.patch - test
681 0: 4a67dfeea974 [mq]: 1.patch - test
682 popping 4.patch
682 popping 4.patch
683 now at: 3.patch
683 now at: 3.patch
684 ==== qnew with HG header
684 ==== qnew with HG header
685 popping 5.patch
685 popping 5.patch
686 now at: 3.patch
686 now at: 3.patch
687 # HG changeset patch
687 # HG changeset patch
688 # Date 10 0
688 # Date 10 0
689 2: d16a272220d2 imported patch 5.patch - test - 10 0
689 2: d16a272220d2 imported patch 5.patch - test - 10.00
690 1: b1b6b0fe0e6d Three (again) - test - 8 0
690 1: b1b6b0fe0e6d Three (again) - test - 8.00
691 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
691 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
692 ==== hg qref
692 ==== hg qref
693 adding 5
693 adding 5
694 # HG changeset patch
694 # HG changeset patch
695 # Date 10 0
695 # Date 10 0
696 # Parent
696 # Parent
697
697
698 diff -r ... 5
698 diff -r ... 5
699 --- /dev/null
699 --- /dev/null
700 +++ b/5
700 +++ b/5
701 @@ -0,0 +1,1 @@
701 @@ -0,0 +1,1 @@
702 +5
702 +5
703 2: 5dbf69c07df9 [mq]: 5.patch - test - 10 0
703 2: 5dbf69c07df9 [mq]: 5.patch - test - 10.00
704 1: b1b6b0fe0e6d Three (again) - test - 8 0
704 1: b1b6b0fe0e6d Three (again) - test - 8.00
705 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
705 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
706 ==== hg qref -d
706 ==== hg qref -d
707 # HG changeset patch
707 # HG changeset patch
708 # Date 11 0
708 # Date 11 0
709 # Parent
709 # Parent
710
710
711 diff -r ... 5
711 diff -r ... 5
712 --- /dev/null
712 --- /dev/null
713 +++ b/5
713 +++ b/5
714 @@ -0,0 +1,1 @@
714 @@ -0,0 +1,1 @@
715 +5
715 +5
716 2: 049de6af0c1d [mq]: 5.patch - test - 11 0
716 2: 049de6af0c1d [mq]: 5.patch - test - 11.00
717 1: b1b6b0fe0e6d Three (again) - test - 8 0
717 1: b1b6b0fe0e6d Three (again) - test - 8.00
718 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
718 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
719 ==== qnew with plain header
719 ==== qnew with plain header
720 popping 6.patch
720 popping 6.patch
721 now at: 5.patch
721 now at: 5.patch
722 now at: 6.patch
722 now at: 6.patch
723 Date: 12 0
723 Date: 12 0
724
724
725 3: 8ad9ebc22b96 imported patch 6.patch - test
725 3: 8ad9ebc22b96 imported patch 6.patch - test
726 2: 049de6af0c1d [mq]: 5.patch - test
726 2: 049de6af0c1d [mq]: 5.patch - test
727 1: b1b6b0fe0e6d Three (again) - test
727 1: b1b6b0fe0e6d Three (again) - test
728 0: 4a67dfeea974 [mq]: 1.patch - test
728 0: 4a67dfeea974 [mq]: 1.patch - test
729 ==== hg qref
729 ==== hg qref
730 adding 6
730 adding 6
731 Date: 12 0
731 Date: 12 0
732
732
733 diff -r ... 6
733 diff -r ... 6
734 --- /dev/null
734 --- /dev/null
735 +++ b/6
735 +++ b/6
736 @@ -0,0 +1,1 @@
736 @@ -0,0 +1,1 @@
737 +6
737 +6
738 3: 038c46b02a56 [mq]: 6.patch - test - 12 0
738 3: 038c46b02a56 [mq]: 6.patch - test - 12.00
739 2: 049de6af0c1d [mq]: 5.patch - test - 11 0
739 2: 049de6af0c1d [mq]: 5.patch - test - 11.00
740 1: b1b6b0fe0e6d Three (again) - test - 8 0
740 1: b1b6b0fe0e6d Three (again) - test - 8.00
741 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
741 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
742 ==== hg qref -d
742 ==== hg qref -d
743 Date: 13 0
743 Date: 13 0
744
744
745 diff -r ... 6
745 diff -r ... 6
746 --- /dev/null
746 --- /dev/null
747 +++ b/6
747 +++ b/6
748 @@ -0,0 +1,1 @@
748 @@ -0,0 +1,1 @@
749 +6
749 +6
750 3: 2785642ea4b4 [mq]: 6.patch - test - 13 0
750 3: 2785642ea4b4 [mq]: 6.patch - test - 13.00
751 2: 049de6af0c1d [mq]: 5.patch - test - 11 0
751 2: 049de6af0c1d [mq]: 5.patch - test - 11.00
752 1: b1b6b0fe0e6d Three (again) - test - 8 0
752 1: b1b6b0fe0e6d Three (again) - test - 8.00
753 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
753 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
754 popping 6.patch
754 popping 6.patch
755 now at: 5.patch
755 now at: 5.patch
756 ==== qnew -u
756 ==== qnew -u
757 adding 6
757 adding 6
758 # HG changeset patch
758 # HG changeset patch
759 # User jane
759 # User jane
760 # Parent
760 # Parent
761
761
762 diff -r ... 6
762 diff -r ... 6
763 --- /dev/null
763 --- /dev/null
764 +++ b/6
764 +++ b/6
765 @@ -0,0 +1,1 @@
765 @@ -0,0 +1,1 @@
766 +6
766 +6
767 3: a05a33f187ce [mq]: 6.patch - jane
767 3: a05a33f187ce [mq]: 6.patch - jane
768 2: 049de6af0c1d [mq]: 5.patch - test
768 2: 049de6af0c1d [mq]: 5.patch - test
769 1: b1b6b0fe0e6d Three (again) - test
769 1: b1b6b0fe0e6d Three (again) - test
770 0: 4a67dfeea974 [mq]: 1.patch - test
770 0: 4a67dfeea974 [mq]: 1.patch - test
771 ==== qref -d
771 ==== qref -d
772 # HG changeset patch
772 # HG changeset patch
773 # User jane
773 # User jane
774 # Date 12 0
774 # Date 12 0
775 # Parent
775 # Parent
776
776
777 diff -r ... 6
777 diff -r ... 6
778 --- /dev/null
778 --- /dev/null
779 +++ b/6
779 +++ b/6
780 @@ -0,0 +1,1 @@
780 @@ -0,0 +1,1 @@
781 +6
781 +6
782 3: 5702c529dfe9 [mq]: 6.patch - jane
782 3: 5702c529dfe9 [mq]: 6.patch - jane
783 2: 049de6af0c1d [mq]: 5.patch - test
783 2: 049de6af0c1d [mq]: 5.patch - test
784 1: b1b6b0fe0e6d Three (again) - test
784 1: b1b6b0fe0e6d Three (again) - test
785 0: 4a67dfeea974 [mq]: 1.patch - test
785 0: 4a67dfeea974 [mq]: 1.patch - test
786 popping 6.patch
786 popping 6.patch
787 now at: 5.patch
787 now at: 5.patch
788 ==== qnew -d
788 ==== qnew -d
789 adding 7
789 adding 7
790 # HG changeset patch
790 # HG changeset patch
791 # Date 13 0
791 # Date 13 0
792 # Parent
792 # Parent
793
793
794 diff -r ... 7
794 diff -r ... 7
795 --- /dev/null
795 --- /dev/null
796 +++ b/7
796 +++ b/7
797 @@ -0,0 +1,1 @@
797 @@ -0,0 +1,1 @@
798 +7
798 +7
799 3: 8dd1eb8d4132 [mq]: 7.patch - test
799 3: 8dd1eb8d4132 [mq]: 7.patch - test
800 2: 049de6af0c1d [mq]: 5.patch - test
800 2: 049de6af0c1d [mq]: 5.patch - test
801 1: b1b6b0fe0e6d Three (again) - test
801 1: b1b6b0fe0e6d Three (again) - test
802 0: 4a67dfeea974 [mq]: 1.patch - test
802 0: 4a67dfeea974 [mq]: 1.patch - test
803 ==== qref -u
803 ==== qref -u
804 # HG changeset patch
804 # HG changeset patch
805 # User john
805 # User john
806 # Date 13 0
806 # Date 13 0
807 # Parent
807 # Parent
808
808
809 diff -r ... 7
809 diff -r ... 7
810 --- /dev/null
810 --- /dev/null
811 +++ b/7
811 +++ b/7
812 @@ -0,0 +1,1 @@
812 @@ -0,0 +1,1 @@
813 +7
813 +7
814 3: 4f9d07369cc4 [mq]: 7.patch - john - 13 0
814 3: 4f9d07369cc4 [mq]: 7.patch - john - 13.00
815 2: 049de6af0c1d [mq]: 5.patch - test - 11 0
815 2: 049de6af0c1d [mq]: 5.patch - test - 11.00
816 1: b1b6b0fe0e6d Three (again) - test - 8 0
816 1: b1b6b0fe0e6d Three (again) - test - 8.00
817 0: 4a67dfeea974 [mq]: 1.patch - test - 4 0
817 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00
818 ==== qnew
818 ==== qnew
819 adding 8
819 adding 8
820 # HG changeset patch
820 # HG changeset patch
821 # Parent
821 # Parent
822
822
823 diff -r ... 8
823 diff -r ... 8
824 --- /dev/null
824 --- /dev/null
825 +++ b/8
825 +++ b/8
826 @@ -0,0 +1,1 @@
826 @@ -0,0 +1,1 @@
827 +8
827 +8
828 4: 868b62f09492 [mq]: 8.patch - test
828 4: 868b62f09492 [mq]: 8.patch - test
829 3: 4f9d07369cc4 [mq]: 7.patch - john
829 3: 4f9d07369cc4 [mq]: 7.patch - john
830 2: 049de6af0c1d [mq]: 5.patch - test
830 2: 049de6af0c1d [mq]: 5.patch - test
831 1: b1b6b0fe0e6d Three (again) - test
831 1: b1b6b0fe0e6d Three (again) - test
832 0: 4a67dfeea974 [mq]: 1.patch - test
832 0: 4a67dfeea974 [mq]: 1.patch - test
833 ==== qref -u -d
833 ==== qref -u -d
834 # HG changeset patch
834 # HG changeset patch
835 # User john
835 # User john
836 # Date 14 0
836 # Date 14 0
837 # Parent
837 # Parent
838
838
839 diff -r ... 8
839 diff -r ... 8
840 --- /dev/null
840 --- /dev/null
841 +++ b/8
841 +++ b/8
842 @@ -0,0 +1,1 @@
842 @@ -0,0 +1,1 @@
843 +8
843 +8
844 4: b1e878ae55b9 [mq]: 8.patch - john
844 4: b1e878ae55b9 [mq]: 8.patch - john
845 3: 4f9d07369cc4 [mq]: 7.patch - john
845 3: 4f9d07369cc4 [mq]: 7.patch - john
846 2: 049de6af0c1d [mq]: 5.patch - test
846 2: 049de6af0c1d [mq]: 5.patch - test
847 1: b1b6b0fe0e6d Three (again) - test
847 1: b1b6b0fe0e6d Three (again) - test
848 0: 4a67dfeea974 [mq]: 1.patch - test
848 0: 4a67dfeea974 [mq]: 1.patch - test
849 popping 8.patch
849 popping 8.patch
850 now at: 7.patch
850 now at: 7.patch
851 ==== qnew -m
851 ==== qnew -m
852 adding 9
852 adding 9
853 # HG changeset patch
853 # HG changeset patch
854 # Parent
854 # Parent
855 Nine
855 Nine
856
856
857 diff -r ... 9
857 diff -r ... 9
858 --- /dev/null
858 --- /dev/null
859 +++ b/9
859 +++ b/9
860 @@ -0,0 +1,1 @@
860 @@ -0,0 +1,1 @@
861 +9
861 +9
862 4: 7251936ac2bf Nine - test
862 4: 7251936ac2bf Nine - test
863 3: 4f9d07369cc4 [mq]: 7.patch - john
863 3: 4f9d07369cc4 [mq]: 7.patch - john
864 2: 049de6af0c1d [mq]: 5.patch - test
864 2: 049de6af0c1d [mq]: 5.patch - test
865 1: b1b6b0fe0e6d Three (again) - test
865 1: b1b6b0fe0e6d Three (again) - test
866 0: 4a67dfeea974 [mq]: 1.patch - test
866 0: 4a67dfeea974 [mq]: 1.patch - test
867 ==== qref -u -d
867 ==== qref -u -d
868 # HG changeset patch
868 # HG changeset patch
869 # User john
869 # User john
870 # Date 15 0
870 # Date 15 0
871 # Parent
871 # Parent
872 Nine
872 Nine
873
873
874 diff -r ... 9
874 diff -r ... 9
875 --- /dev/null
875 --- /dev/null
876 +++ b/9
876 +++ b/9
877 @@ -0,0 +1,1 @@
877 @@ -0,0 +1,1 @@
878 +9
878 +9
879 4: a0de5bf6e9f7 Nine - john
879 4: a0de5bf6e9f7 Nine - john
880 3: 4f9d07369cc4 [mq]: 7.patch - john
880 3: 4f9d07369cc4 [mq]: 7.patch - john
881 2: 049de6af0c1d [mq]: 5.patch - test
881 2: 049de6af0c1d [mq]: 5.patch - test
882 1: b1b6b0fe0e6d Three (again) - test
882 1: b1b6b0fe0e6d Three (again) - test
883 0: 4a67dfeea974 [mq]: 1.patch - test
883 0: 4a67dfeea974 [mq]: 1.patch - test
884 popping 9.patch
884 popping 9.patch
885 now at: 7.patch
885 now at: 7.patch
886 ==== qpop -a / qpush -a
886 ==== qpop -a / qpush -a
887 popping 7.patch
887 popping 7.patch
888 popping 5.patch
888 popping 5.patch
889 popping 3.patch
889 popping 3.patch
890 popping 1.patch
890 popping 1.patch
891 patch queue now empty
891 patch queue now empty
892 applying 1.patch
892 applying 1.patch
893 applying 3.patch
893 applying 3.patch
894 applying 5.patch
894 applying 5.patch
895 applying 7.patch
895 applying 7.patch
896 now at: 7.patch
896 now at: 7.patch
897 3: d26a5b7ffce1 imported patch 7.patch - john - 13 0
897 3: d26a5b7ffce1 imported patch 7.patch - john - 13.00
898 2: dda6cf77060a imported patch 5.patch - test - 11 0
898 2: dda6cf77060a imported patch 5.patch - test - 11.00
899 1: 25e32d66c8c7 Three (again) - test - 8 0
899 1: 25e32d66c8c7 Three (again) - test - 8.00
900 0: e5011c0211fe imported patch 1.patch - test - 4 0
900 0: e5011c0211fe imported patch 1.patch - test - 4.00
901 $ rm -r sandbox
901 $ rm -r sandbox
General Comments 0
You need to be logged in to leave comments. Login now