##// END OF EJS Templates
logcmdutil: rewrite jsonchangeset printer to be backed by jsonformatter...
Yuya Nishihara -
r38026:814151cd default
parent child Browse files
Show More
@@ -1,940 +1,913 b''
1 # logcmdutil.py - utility for log-like commands
1 # logcmdutil.py - utility for log-like commands
2 #
2 #
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2007 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 itertools
10 import itertools
11 import os
11 import os
12
12
13 from .i18n import _
13 from .i18n import _
14 from .node import (
14 from .node import (
15 hex,
16 nullid,
15 nullid,
17 )
16 )
18
17
19 from . import (
18 from . import (
20 dagop,
19 dagop,
21 encoding,
22 error,
20 error,
23 formatter,
21 formatter,
24 graphmod,
22 graphmod,
25 match as matchmod,
23 match as matchmod,
26 mdiff,
24 mdiff,
27 patch,
25 patch,
28 pathutil,
26 pathutil,
29 pycompat,
27 pycompat,
30 revset,
28 revset,
31 revsetlang,
29 revsetlang,
32 scmutil,
30 scmutil,
33 smartset,
31 smartset,
34 templatekw,
32 templatekw,
35 templater,
33 templater,
36 util,
34 util,
37 )
35 )
38 from .utils import (
36 from .utils import (
39 dateutil,
37 dateutil,
40 stringutil,
38 stringutil,
41 )
39 )
42
40
43 def getlimit(opts):
41 def getlimit(opts):
44 """get the log limit according to option -l/--limit"""
42 """get the log limit according to option -l/--limit"""
45 limit = opts.get('limit')
43 limit = opts.get('limit')
46 if limit:
44 if limit:
47 try:
45 try:
48 limit = int(limit)
46 limit = int(limit)
49 except ValueError:
47 except ValueError:
50 raise error.Abort(_('limit must be a positive integer'))
48 raise error.Abort(_('limit must be a positive integer'))
51 if limit <= 0:
49 if limit <= 0:
52 raise error.Abort(_('limit must be positive'))
50 raise error.Abort(_('limit must be positive'))
53 else:
51 else:
54 limit = None
52 limit = None
55 return limit
53 return limit
56
54
57 def diffordiffstat(ui, repo, diffopts, node1, node2, match,
55 def diffordiffstat(ui, repo, diffopts, node1, node2, match,
58 changes=None, stat=False, fp=None, prefix='',
56 changes=None, stat=False, fp=None, prefix='',
59 root='', listsubrepos=False, hunksfilterfn=None):
57 root='', listsubrepos=False, hunksfilterfn=None):
60 '''show diff or diffstat.'''
58 '''show diff or diffstat.'''
61 if root:
59 if root:
62 relroot = pathutil.canonpath(repo.root, repo.getcwd(), root)
60 relroot = pathutil.canonpath(repo.root, repo.getcwd(), root)
63 else:
61 else:
64 relroot = ''
62 relroot = ''
65 if relroot != '':
63 if relroot != '':
66 # XXX relative roots currently don't work if the root is within a
64 # XXX relative roots currently don't work if the root is within a
67 # subrepo
65 # subrepo
68 uirelroot = match.uipath(relroot)
66 uirelroot = match.uipath(relroot)
69 relroot += '/'
67 relroot += '/'
70 for matchroot in match.files():
68 for matchroot in match.files():
71 if not matchroot.startswith(relroot):
69 if not matchroot.startswith(relroot):
72 ui.warn(_('warning: %s not inside relative root %s\n') % (
70 ui.warn(_('warning: %s not inside relative root %s\n') % (
73 match.uipath(matchroot), uirelroot))
71 match.uipath(matchroot), uirelroot))
74
72
75 if stat:
73 if stat:
76 diffopts = diffopts.copy(context=0, noprefix=False)
74 diffopts = diffopts.copy(context=0, noprefix=False)
77 width = 80
75 width = 80
78 if not ui.plain():
76 if not ui.plain():
79 width = ui.termwidth()
77 width = ui.termwidth()
80
78
81 chunks = patch.diff(repo, node1, node2, match, changes, opts=diffopts,
79 chunks = patch.diff(repo, node1, node2, match, changes, opts=diffopts,
82 prefix=prefix, relroot=relroot,
80 prefix=prefix, relroot=relroot,
83 hunksfilterfn=hunksfilterfn)
81 hunksfilterfn=hunksfilterfn)
84
82
85 if fp is not None or ui.canwritewithoutlabels():
83 if fp is not None or ui.canwritewithoutlabels():
86 out = fp or ui
84 out = fp or ui
87 if stat:
85 if stat:
88 chunks = [patch.diffstat(util.iterlines(chunks), width=width)]
86 chunks = [patch.diffstat(util.iterlines(chunks), width=width)]
89 for chunk in util.filechunkiter(util.chunkbuffer(chunks)):
87 for chunk in util.filechunkiter(util.chunkbuffer(chunks)):
90 out.write(chunk)
88 out.write(chunk)
91 else:
89 else:
92 if stat:
90 if stat:
93 chunks = patch.diffstatui(util.iterlines(chunks), width=width)
91 chunks = patch.diffstatui(util.iterlines(chunks), width=width)
94 else:
92 else:
95 chunks = patch.difflabel(lambda chunks, **kwargs: chunks, chunks,
93 chunks = patch.difflabel(lambda chunks, **kwargs: chunks, chunks,
96 opts=diffopts)
94 opts=diffopts)
97 if ui.canbatchlabeledwrites():
95 if ui.canbatchlabeledwrites():
98 def gen():
96 def gen():
99 for chunk, label in chunks:
97 for chunk, label in chunks:
100 yield ui.label(chunk, label=label)
98 yield ui.label(chunk, label=label)
101 for chunk in util.filechunkiter(util.chunkbuffer(gen())):
99 for chunk in util.filechunkiter(util.chunkbuffer(gen())):
102 ui.write(chunk)
100 ui.write(chunk)
103 else:
101 else:
104 for chunk, label in chunks:
102 for chunk, label in chunks:
105 ui.write(chunk, label=label)
103 ui.write(chunk, label=label)
106
104
107 if listsubrepos:
105 if listsubrepos:
108 ctx1 = repo[node1]
106 ctx1 = repo[node1]
109 ctx2 = repo[node2]
107 ctx2 = repo[node2]
110 for subpath, sub in scmutil.itersubrepos(ctx1, ctx2):
108 for subpath, sub in scmutil.itersubrepos(ctx1, ctx2):
111 tempnode2 = node2
109 tempnode2 = node2
112 try:
110 try:
113 if node2 is not None:
111 if node2 is not None:
114 tempnode2 = ctx2.substate[subpath][1]
112 tempnode2 = ctx2.substate[subpath][1]
115 except KeyError:
113 except KeyError:
116 # A subrepo that existed in node1 was deleted between node1 and
114 # A subrepo that existed in node1 was deleted between node1 and
117 # node2 (inclusive). Thus, ctx2's substate won't contain that
115 # node2 (inclusive). Thus, ctx2's substate won't contain that
118 # subpath. The best we can do is to ignore it.
116 # subpath. The best we can do is to ignore it.
119 tempnode2 = None
117 tempnode2 = None
120 submatch = matchmod.subdirmatcher(subpath, match)
118 submatch = matchmod.subdirmatcher(subpath, match)
121 sub.diff(ui, diffopts, tempnode2, submatch, changes=changes,
119 sub.diff(ui, diffopts, tempnode2, submatch, changes=changes,
122 stat=stat, fp=fp, prefix=prefix)
120 stat=stat, fp=fp, prefix=prefix)
123
121
124 class changesetdiffer(object):
122 class changesetdiffer(object):
125 """Generate diff of changeset with pre-configured filtering functions"""
123 """Generate diff of changeset with pre-configured filtering functions"""
126
124
127 def _makefilematcher(self, ctx):
125 def _makefilematcher(self, ctx):
128 return scmutil.matchall(ctx.repo())
126 return scmutil.matchall(ctx.repo())
129
127
130 def _makehunksfilter(self, ctx):
128 def _makehunksfilter(self, ctx):
131 return None
129 return None
132
130
133 def showdiff(self, ui, ctx, diffopts, stat=False):
131 def showdiff(self, ui, ctx, diffopts, stat=False):
134 repo = ctx.repo()
132 repo = ctx.repo()
135 node = ctx.node()
133 node = ctx.node()
136 prev = ctx.p1().node()
134 prev = ctx.p1().node()
137 diffordiffstat(ui, repo, diffopts, prev, node,
135 diffordiffstat(ui, repo, diffopts, prev, node,
138 match=self._makefilematcher(ctx), stat=stat,
136 match=self._makefilematcher(ctx), stat=stat,
139 hunksfilterfn=self._makehunksfilter(ctx))
137 hunksfilterfn=self._makehunksfilter(ctx))
140
138
141 def changesetlabels(ctx):
139 def changesetlabels(ctx):
142 labels = ['log.changeset', 'changeset.%s' % ctx.phasestr()]
140 labels = ['log.changeset', 'changeset.%s' % ctx.phasestr()]
143 if ctx.obsolete():
141 if ctx.obsolete():
144 labels.append('changeset.obsolete')
142 labels.append('changeset.obsolete')
145 if ctx.isunstable():
143 if ctx.isunstable():
146 labels.append('changeset.unstable')
144 labels.append('changeset.unstable')
147 for instability in ctx.instabilities():
145 for instability in ctx.instabilities():
148 labels.append('instability.%s' % instability)
146 labels.append('instability.%s' % instability)
149 return ' '.join(labels)
147 return ' '.join(labels)
150
148
151 class changesetprinter(object):
149 class changesetprinter(object):
152 '''show changeset information when templating not requested.'''
150 '''show changeset information when templating not requested.'''
153
151
154 def __init__(self, ui, repo, differ=None, diffopts=None, buffered=False):
152 def __init__(self, ui, repo, differ=None, diffopts=None, buffered=False):
155 self.ui = ui
153 self.ui = ui
156 self.repo = repo
154 self.repo = repo
157 self.buffered = buffered
155 self.buffered = buffered
158 self._differ = differ or changesetdiffer()
156 self._differ = differ or changesetdiffer()
159 self.diffopts = diffopts or {}
157 self.diffopts = diffopts or {}
160 self.header = {}
158 self.header = {}
161 self.hunk = {}
159 self.hunk = {}
162 self.lastheader = None
160 self.lastheader = None
163 self.footer = None
161 self.footer = None
164 self._columns = templatekw.getlogcolumns()
162 self._columns = templatekw.getlogcolumns()
165
163
166 def flush(self, ctx):
164 def flush(self, ctx):
167 rev = ctx.rev()
165 rev = ctx.rev()
168 if rev in self.header:
166 if rev in self.header:
169 h = self.header[rev]
167 h = self.header[rev]
170 if h != self.lastheader:
168 if h != self.lastheader:
171 self.lastheader = h
169 self.lastheader = h
172 self.ui.write(h)
170 self.ui.write(h)
173 del self.header[rev]
171 del self.header[rev]
174 if rev in self.hunk:
172 if rev in self.hunk:
175 self.ui.write(self.hunk[rev])
173 self.ui.write(self.hunk[rev])
176 del self.hunk[rev]
174 del self.hunk[rev]
177
175
178 def close(self):
176 def close(self):
179 if self.footer:
177 if self.footer:
180 self.ui.write(self.footer)
178 self.ui.write(self.footer)
181
179
182 def show(self, ctx, copies=None, **props):
180 def show(self, ctx, copies=None, **props):
183 props = pycompat.byteskwargs(props)
181 props = pycompat.byteskwargs(props)
184 if self.buffered:
182 if self.buffered:
185 self.ui.pushbuffer(labeled=True)
183 self.ui.pushbuffer(labeled=True)
186 self._show(ctx, copies, props)
184 self._show(ctx, copies, props)
187 self.hunk[ctx.rev()] = self.ui.popbuffer()
185 self.hunk[ctx.rev()] = self.ui.popbuffer()
188 else:
186 else:
189 self._show(ctx, copies, props)
187 self._show(ctx, copies, props)
190
188
191 def _show(self, ctx, copies, props):
189 def _show(self, ctx, copies, props):
192 '''show a single changeset or file revision'''
190 '''show a single changeset or file revision'''
193 changenode = ctx.node()
191 changenode = ctx.node()
194 rev = ctx.rev()
192 rev = ctx.rev()
195
193
196 if self.ui.quiet:
194 if self.ui.quiet:
197 self.ui.write("%s\n" % scmutil.formatchangeid(ctx),
195 self.ui.write("%s\n" % scmutil.formatchangeid(ctx),
198 label='log.node')
196 label='log.node')
199 return
197 return
200
198
201 columns = self._columns
199 columns = self._columns
202 self.ui.write(columns['changeset'] % scmutil.formatchangeid(ctx),
200 self.ui.write(columns['changeset'] % scmutil.formatchangeid(ctx),
203 label=changesetlabels(ctx))
201 label=changesetlabels(ctx))
204
202
205 # branches are shown first before any other names due to backwards
203 # branches are shown first before any other names due to backwards
206 # compatibility
204 # compatibility
207 branch = ctx.branch()
205 branch = ctx.branch()
208 # don't show the default branch name
206 # don't show the default branch name
209 if branch != 'default':
207 if branch != 'default':
210 self.ui.write(columns['branch'] % branch, label='log.branch')
208 self.ui.write(columns['branch'] % branch, label='log.branch')
211
209
212 for nsname, ns in self.repo.names.iteritems():
210 for nsname, ns in self.repo.names.iteritems():
213 # branches has special logic already handled above, so here we just
211 # branches has special logic already handled above, so here we just
214 # skip it
212 # skip it
215 if nsname == 'branches':
213 if nsname == 'branches':
216 continue
214 continue
217 # we will use the templatename as the color name since those two
215 # we will use the templatename as the color name since those two
218 # should be the same
216 # should be the same
219 for name in ns.names(self.repo, changenode):
217 for name in ns.names(self.repo, changenode):
220 self.ui.write(ns.logfmt % name,
218 self.ui.write(ns.logfmt % name,
221 label='log.%s' % ns.colorname)
219 label='log.%s' % ns.colorname)
222 if self.ui.debugflag:
220 if self.ui.debugflag:
223 self.ui.write(columns['phase'] % ctx.phasestr(), label='log.phase')
221 self.ui.write(columns['phase'] % ctx.phasestr(), label='log.phase')
224 for pctx in scmutil.meaningfulparents(self.repo, ctx):
222 for pctx in scmutil.meaningfulparents(self.repo, ctx):
225 label = 'log.parent changeset.%s' % pctx.phasestr()
223 label = 'log.parent changeset.%s' % pctx.phasestr()
226 self.ui.write(columns['parent'] % scmutil.formatchangeid(pctx),
224 self.ui.write(columns['parent'] % scmutil.formatchangeid(pctx),
227 label=label)
225 label=label)
228
226
229 if self.ui.debugflag and rev is not None:
227 if self.ui.debugflag and rev is not None:
230 mnode = ctx.manifestnode()
228 mnode = ctx.manifestnode()
231 mrev = self.repo.manifestlog._revlog.rev(mnode)
229 mrev = self.repo.manifestlog._revlog.rev(mnode)
232 self.ui.write(columns['manifest']
230 self.ui.write(columns['manifest']
233 % scmutil.formatrevnode(self.ui, mrev, mnode),
231 % scmutil.formatrevnode(self.ui, mrev, mnode),
234 label='ui.debug log.manifest')
232 label='ui.debug log.manifest')
235 self.ui.write(columns['user'] % ctx.user(), label='log.user')
233 self.ui.write(columns['user'] % ctx.user(), label='log.user')
236 self.ui.write(columns['date'] % dateutil.datestr(ctx.date()),
234 self.ui.write(columns['date'] % dateutil.datestr(ctx.date()),
237 label='log.date')
235 label='log.date')
238
236
239 if ctx.isunstable():
237 if ctx.isunstable():
240 instabilities = ctx.instabilities()
238 instabilities = ctx.instabilities()
241 self.ui.write(columns['instability'] % ', '.join(instabilities),
239 self.ui.write(columns['instability'] % ', '.join(instabilities),
242 label='log.instability')
240 label='log.instability')
243
241
244 elif ctx.obsolete():
242 elif ctx.obsolete():
245 self._showobsfate(ctx)
243 self._showobsfate(ctx)
246
244
247 self._exthook(ctx)
245 self._exthook(ctx)
248
246
249 if self.ui.debugflag:
247 if self.ui.debugflag:
250 files = ctx.p1().status(ctx)[:3]
248 files = ctx.p1().status(ctx)[:3]
251 for key, value in zip(['files', 'files+', 'files-'], files):
249 for key, value in zip(['files', 'files+', 'files-'], files):
252 if value:
250 if value:
253 self.ui.write(columns[key] % " ".join(value),
251 self.ui.write(columns[key] % " ".join(value),
254 label='ui.debug log.files')
252 label='ui.debug log.files')
255 elif ctx.files() and self.ui.verbose:
253 elif ctx.files() and self.ui.verbose:
256 self.ui.write(columns['files'] % " ".join(ctx.files()),
254 self.ui.write(columns['files'] % " ".join(ctx.files()),
257 label='ui.note log.files')
255 label='ui.note log.files')
258 if copies and self.ui.verbose:
256 if copies and self.ui.verbose:
259 copies = ['%s (%s)' % c for c in copies]
257 copies = ['%s (%s)' % c for c in copies]
260 self.ui.write(columns['copies'] % ' '.join(copies),
258 self.ui.write(columns['copies'] % ' '.join(copies),
261 label='ui.note log.copies')
259 label='ui.note log.copies')
262
260
263 extra = ctx.extra()
261 extra = ctx.extra()
264 if extra and self.ui.debugflag:
262 if extra and self.ui.debugflag:
265 for key, value in sorted(extra.items()):
263 for key, value in sorted(extra.items()):
266 self.ui.write(columns['extra']
264 self.ui.write(columns['extra']
267 % (key, stringutil.escapestr(value)),
265 % (key, stringutil.escapestr(value)),
268 label='ui.debug log.extra')
266 label='ui.debug log.extra')
269
267
270 description = ctx.description().strip()
268 description = ctx.description().strip()
271 if description:
269 if description:
272 if self.ui.verbose:
270 if self.ui.verbose:
273 self.ui.write(_("description:\n"),
271 self.ui.write(_("description:\n"),
274 label='ui.note log.description')
272 label='ui.note log.description')
275 self.ui.write(description,
273 self.ui.write(description,
276 label='ui.note log.description')
274 label='ui.note log.description')
277 self.ui.write("\n\n")
275 self.ui.write("\n\n")
278 else:
276 else:
279 self.ui.write(columns['summary'] % description.splitlines()[0],
277 self.ui.write(columns['summary'] % description.splitlines()[0],
280 label='log.summary')
278 label='log.summary')
281 self.ui.write("\n")
279 self.ui.write("\n")
282
280
283 self._showpatch(ctx)
281 self._showpatch(ctx)
284
282
285 def _showobsfate(self, ctx):
283 def _showobsfate(self, ctx):
286 # TODO: do not depend on templater
284 # TODO: do not depend on templater
287 tres = formatter.templateresources(self.repo.ui, self.repo)
285 tres = formatter.templateresources(self.repo.ui, self.repo)
288 t = formatter.maketemplater(self.repo.ui, '{join(obsfate, "\n")}',
286 t = formatter.maketemplater(self.repo.ui, '{join(obsfate, "\n")}',
289 defaults=templatekw.keywords,
287 defaults=templatekw.keywords,
290 resources=tres)
288 resources=tres)
291 obsfate = t.renderdefault({'ctx': ctx}).splitlines()
289 obsfate = t.renderdefault({'ctx': ctx}).splitlines()
292
290
293 if obsfate:
291 if obsfate:
294 for obsfateline in obsfate:
292 for obsfateline in obsfate:
295 self.ui.write(self._columns['obsolete'] % obsfateline,
293 self.ui.write(self._columns['obsolete'] % obsfateline,
296 label='log.obsfate')
294 label='log.obsfate')
297
295
298 def _exthook(self, ctx):
296 def _exthook(self, ctx):
299 '''empty method used by extension as a hook point
297 '''empty method used by extension as a hook point
300 '''
298 '''
301
299
302 def _showpatch(self, ctx):
300 def _showpatch(self, ctx):
303 stat = self.diffopts.get('stat')
301 stat = self.diffopts.get('stat')
304 diff = self.diffopts.get('patch')
302 diff = self.diffopts.get('patch')
305 diffopts = patch.diffallopts(self.ui, self.diffopts)
303 diffopts = patch.diffallopts(self.ui, self.diffopts)
306 if stat:
304 if stat:
307 self._differ.showdiff(self.ui, ctx, diffopts, stat=True)
305 self._differ.showdiff(self.ui, ctx, diffopts, stat=True)
308 if stat and diff:
306 if stat and diff:
309 self.ui.write("\n")
307 self.ui.write("\n")
310 if diff:
308 if diff:
311 self._differ.showdiff(self.ui, ctx, diffopts, stat=False)
309 self._differ.showdiff(self.ui, ctx, diffopts, stat=False)
312 if stat or diff:
310 if stat or diff:
313 self.ui.write("\n")
311 self.ui.write("\n")
314
312
315 class jsonchangeset(changesetprinter):
313 class jsonchangeset(changesetprinter):
316 '''format changeset information.'''
314 '''format changeset information.'''
317
315
318 def __init__(self, ui, repo, differ=None, diffopts=None, buffered=False):
316 def __init__(self, ui, repo, differ=None, diffopts=None, buffered=False):
319 changesetprinter.__init__(self, ui, repo, differ, diffopts, buffered)
317 changesetprinter.__init__(self, ui, repo, differ, diffopts, buffered)
320 self._first = True
318 self._fm = formatter.jsonformatter(ui, ui, 'log', {})
321
319
322 def close(self):
320 def close(self):
323 if not self._first:
321 self._fm.end()
324 self.ui.write("\n]\n")
325 else:
326 self.ui.write("[]\n")
327
322
328 def _show(self, ctx, copies, props):
323 def _show(self, ctx, copies, props):
329 '''show a single changeset or file revision'''
324 '''show a single changeset or file revision'''
325 fm = self._fm
326 fm.startitem()
327
328 # TODO: maybe this should be wdirrev/wdirnode?
330 rev = ctx.rev()
329 rev = ctx.rev()
331 if rev is None:
330 if rev is None:
332 jrev = jnode = 'null'
331 hexnode = None
333 else:
332 else:
334 jrev = '%d' % rev
333 hexnode = fm.hexfunc(ctx.node())
335 jnode = '"%s"' % hex(ctx.node())
334 fm.data(rev=rev,
336 j = encoding.jsonescape
335 node=hexnode)
337
338 if self._first:
339 self.ui.write("[\n {")
340 self._first = False
341 else:
342 self.ui.write(",\n {")
343
336
344 if self.ui.quiet:
337 if self.ui.quiet:
345 self.ui.write(('\n "rev": %s') % jrev)
346 self.ui.write((',\n "node": %s') % jnode)
347 self.ui.write('\n }')
348 return
338 return
349
339
350 self.ui.write(('\n "rev": %s') % jrev)
340 fm.data(branch=ctx.branch(),
351 self.ui.write((',\n "node": %s') % jnode)
341 phase=ctx.phasestr(),
352 self.ui.write((',\n "branch": "%s"') % j(ctx.branch()))
342 user=ctx.user(),
353 self.ui.write((',\n "phase": "%s"') % ctx.phasestr())
343 date=fm.formatdate(ctx.date()),
354 self.ui.write((',\n "user": "%s"') % j(ctx.user()))
344 desc=ctx.description(),
355 self.ui.write((',\n "date": [%d, %d]') % ctx.date())
345 bookmarks=fm.formatlist(ctx.bookmarks(), name='bookmark'),
356 self.ui.write((',\n "desc": "%s"') % j(ctx.description()))
346 tags=fm.formatlist(ctx.tags(), name='tag'),
357
347 parents=fm.formatlist([fm.hexfunc(c.node())
358 self.ui.write((',\n "bookmarks": [%s]') %
348 for c in ctx.parents()], name='node'))
359 ", ".join('"%s"' % j(b) for b in ctx.bookmarks()))
360 self.ui.write((',\n "tags": [%s]') %
361 ", ".join('"%s"' % j(t) for t in ctx.tags()))
362 self.ui.write((',\n "parents": [%s]') %
363 ", ".join('"%s"' % c.hex() for c in ctx.parents()))
364
349
365 if self.ui.debugflag:
350 if self.ui.debugflag:
366 if rev is None:
351 if rev is None:
367 jmanifestnode = 'null'
352 hexnode = None
368 else:
353 else:
369 jmanifestnode = '"%s"' % hex(ctx.manifestnode())
354 hexnode = fm.hexfunc(ctx.manifestnode())
370 self.ui.write((',\n "manifest": %s') % jmanifestnode)
355 fm.data(manifest=hexnode,
371
356 extra=fm.formatdict(ctx.extra()))
372 self.ui.write((',\n "extra": {%s}') %
373 ", ".join('"%s": "%s"' % (j(k), j(v))
374 for k, v in ctx.extra().items()))
375
357
376 files = ctx.p1().status(ctx)
358 files = ctx.p1().status(ctx)
377 self.ui.write((',\n "modified": [%s]') %
359 fm.data(modified=fm.formatlist(files[0], name='file'),
378 ", ".join('"%s"' % j(f) for f in files[0]))
360 added=fm.formatlist(files[1], name='file'),
379 self.ui.write((',\n "added": [%s]') %
361 removed=fm.formatlist(files[2], name='file'))
380 ", ".join('"%s"' % j(f) for f in files[1]))
381 self.ui.write((',\n "removed": [%s]') %
382 ", ".join('"%s"' % j(f) for f in files[2]))
383
362
384 elif self.ui.verbose:
363 elif self.ui.verbose:
385 self.ui.write((',\n "files": [%s]') %
364 fm.data(files=fm.formatlist(ctx.files(), name='file'))
386 ", ".join('"%s"' % j(f) for f in ctx.files()))
387
388 if copies:
365 if copies:
389 self.ui.write((',\n "copies": {%s}') %
366 fm.data(copies=fm.formatdict(copies,
390 ", ".join('"%s": "%s"' % (j(k), j(v))
367 key='name', value='source'))
391 for k, v in copies))
392
368
393 stat = self.diffopts.get('stat')
369 stat = self.diffopts.get('stat')
394 diff = self.diffopts.get('patch')
370 diff = self.diffopts.get('patch')
395 diffopts = patch.difffeatureopts(self.ui, self.diffopts, git=True)
371 diffopts = patch.difffeatureopts(self.ui, self.diffopts, git=True)
396 if stat:
372 if stat:
397 self.ui.pushbuffer()
373 self.ui.pushbuffer()
398 self._differ.showdiff(self.ui, ctx, diffopts, stat=True)
374 self._differ.showdiff(self.ui, ctx, diffopts, stat=True)
399 self.ui.write((',\n "diffstat": "%s"')
375 fm.data(diffstat=self.ui.popbuffer())
400 % j(self.ui.popbuffer()))
401 if diff:
376 if diff:
402 self.ui.pushbuffer()
377 self.ui.pushbuffer()
403 self._differ.showdiff(self.ui, ctx, diffopts, stat=False)
378 self._differ.showdiff(self.ui, ctx, diffopts, stat=False)
404 self.ui.write((',\n "diff": "%s"') % j(self.ui.popbuffer()))
379 fm.data(diff=self.ui.popbuffer())
405
406 self.ui.write("\n }")
407
380
408 class changesettemplater(changesetprinter):
381 class changesettemplater(changesetprinter):
409 '''format changeset information.
382 '''format changeset information.
410
383
411 Note: there are a variety of convenience functions to build a
384 Note: there are a variety of convenience functions to build a
412 changesettemplater for common cases. See functions such as:
385 changesettemplater for common cases. See functions such as:
413 maketemplater, changesetdisplayer, buildcommittemplate, or other
386 maketemplater, changesetdisplayer, buildcommittemplate, or other
414 functions that use changesest_templater.
387 functions that use changesest_templater.
415 '''
388 '''
416
389
417 # Arguments before "buffered" used to be positional. Consider not
390 # Arguments before "buffered" used to be positional. Consider not
418 # adding/removing arguments before "buffered" to not break callers.
391 # adding/removing arguments before "buffered" to not break callers.
419 def __init__(self, ui, repo, tmplspec, differ=None, diffopts=None,
392 def __init__(self, ui, repo, tmplspec, differ=None, diffopts=None,
420 buffered=False):
393 buffered=False):
421 changesetprinter.__init__(self, ui, repo, differ, diffopts, buffered)
394 changesetprinter.__init__(self, ui, repo, differ, diffopts, buffered)
422 # tres is shared with _graphnodeformatter()
395 # tres is shared with _graphnodeformatter()
423 self._tresources = tres = formatter.templateresources(ui, repo)
396 self._tresources = tres = formatter.templateresources(ui, repo)
424 self.t = formatter.loadtemplater(ui, tmplspec,
397 self.t = formatter.loadtemplater(ui, tmplspec,
425 defaults=templatekw.keywords,
398 defaults=templatekw.keywords,
426 resources=tres,
399 resources=tres,
427 cache=templatekw.defaulttempl)
400 cache=templatekw.defaulttempl)
428 self._counter = itertools.count()
401 self._counter = itertools.count()
429
402
430 self._tref = tmplspec.ref
403 self._tref = tmplspec.ref
431 self._parts = {'header': '', 'footer': '',
404 self._parts = {'header': '', 'footer': '',
432 tmplspec.ref: tmplspec.ref,
405 tmplspec.ref: tmplspec.ref,
433 'docheader': '', 'docfooter': '',
406 'docheader': '', 'docfooter': '',
434 'separator': ''}
407 'separator': ''}
435 if tmplspec.mapfile:
408 if tmplspec.mapfile:
436 # find correct templates for current mode, for backward
409 # find correct templates for current mode, for backward
437 # compatibility with 'log -v/-q/--debug' using a mapfile
410 # compatibility with 'log -v/-q/--debug' using a mapfile
438 tmplmodes = [
411 tmplmodes = [
439 (True, ''),
412 (True, ''),
440 (self.ui.verbose, '_verbose'),
413 (self.ui.verbose, '_verbose'),
441 (self.ui.quiet, '_quiet'),
414 (self.ui.quiet, '_quiet'),
442 (self.ui.debugflag, '_debug'),
415 (self.ui.debugflag, '_debug'),
443 ]
416 ]
444 for mode, postfix in tmplmodes:
417 for mode, postfix in tmplmodes:
445 for t in self._parts:
418 for t in self._parts:
446 cur = t + postfix
419 cur = t + postfix
447 if mode and cur in self.t:
420 if mode and cur in self.t:
448 self._parts[t] = cur
421 self._parts[t] = cur
449 else:
422 else:
450 partnames = [p for p in self._parts.keys() if p != tmplspec.ref]
423 partnames = [p for p in self._parts.keys() if p != tmplspec.ref]
451 m = formatter.templatepartsmap(tmplspec, self.t, partnames)
424 m = formatter.templatepartsmap(tmplspec, self.t, partnames)
452 self._parts.update(m)
425 self._parts.update(m)
453
426
454 if self._parts['docheader']:
427 if self._parts['docheader']:
455 self.ui.write(self.t.render(self._parts['docheader'], {}))
428 self.ui.write(self.t.render(self._parts['docheader'], {}))
456
429
457 def close(self):
430 def close(self):
458 if self._parts['docfooter']:
431 if self._parts['docfooter']:
459 if not self.footer:
432 if not self.footer:
460 self.footer = ""
433 self.footer = ""
461 self.footer += self.t.render(self._parts['docfooter'], {})
434 self.footer += self.t.render(self._parts['docfooter'], {})
462 return super(changesettemplater, self).close()
435 return super(changesettemplater, self).close()
463
436
464 def _show(self, ctx, copies, props):
437 def _show(self, ctx, copies, props):
465 '''show a single changeset or file revision'''
438 '''show a single changeset or file revision'''
466 props = props.copy()
439 props = props.copy()
467 props['ctx'] = ctx
440 props['ctx'] = ctx
468 props['index'] = index = next(self._counter)
441 props['index'] = index = next(self._counter)
469 props['revcache'] = {'copies': copies}
442 props['revcache'] = {'copies': copies}
470
443
471 # write separator, which wouldn't work well with the header part below
444 # write separator, which wouldn't work well with the header part below
472 # since there's inherently a conflict between header (across items) and
445 # since there's inherently a conflict between header (across items) and
473 # separator (per item)
446 # separator (per item)
474 if self._parts['separator'] and index > 0:
447 if self._parts['separator'] and index > 0:
475 self.ui.write(self.t.render(self._parts['separator'], {}))
448 self.ui.write(self.t.render(self._parts['separator'], {}))
476
449
477 # write header
450 # write header
478 if self._parts['header']:
451 if self._parts['header']:
479 h = self.t.render(self._parts['header'], props)
452 h = self.t.render(self._parts['header'], props)
480 if self.buffered:
453 if self.buffered:
481 self.header[ctx.rev()] = h
454 self.header[ctx.rev()] = h
482 else:
455 else:
483 if self.lastheader != h:
456 if self.lastheader != h:
484 self.lastheader = h
457 self.lastheader = h
485 self.ui.write(h)
458 self.ui.write(h)
486
459
487 # write changeset metadata, then patch if requested
460 # write changeset metadata, then patch if requested
488 key = self._parts[self._tref]
461 key = self._parts[self._tref]
489 self.ui.write(self.t.render(key, props))
462 self.ui.write(self.t.render(key, props))
490 self._showpatch(ctx)
463 self._showpatch(ctx)
491
464
492 if self._parts['footer']:
465 if self._parts['footer']:
493 if not self.footer:
466 if not self.footer:
494 self.footer = self.t.render(self._parts['footer'], props)
467 self.footer = self.t.render(self._parts['footer'], props)
495
468
496 def templatespec(tmpl, mapfile):
469 def templatespec(tmpl, mapfile):
497 if mapfile:
470 if mapfile:
498 return formatter.templatespec('changeset', tmpl, mapfile)
471 return formatter.templatespec('changeset', tmpl, mapfile)
499 else:
472 else:
500 return formatter.templatespec('', tmpl, None)
473 return formatter.templatespec('', tmpl, None)
501
474
502 def _lookuptemplate(ui, tmpl, style):
475 def _lookuptemplate(ui, tmpl, style):
503 """Find the template matching the given template spec or style
476 """Find the template matching the given template spec or style
504
477
505 See formatter.lookuptemplate() for details.
478 See formatter.lookuptemplate() for details.
506 """
479 """
507
480
508 # ui settings
481 # ui settings
509 if not tmpl and not style: # template are stronger than style
482 if not tmpl and not style: # template are stronger than style
510 tmpl = ui.config('ui', 'logtemplate')
483 tmpl = ui.config('ui', 'logtemplate')
511 if tmpl:
484 if tmpl:
512 return templatespec(templater.unquotestring(tmpl), None)
485 return templatespec(templater.unquotestring(tmpl), None)
513 else:
486 else:
514 style = util.expandpath(ui.config('ui', 'style'))
487 style = util.expandpath(ui.config('ui', 'style'))
515
488
516 if not tmpl and style:
489 if not tmpl and style:
517 mapfile = style
490 mapfile = style
518 if not os.path.split(mapfile)[0]:
491 if not os.path.split(mapfile)[0]:
519 mapname = (templater.templatepath('map-cmdline.' + mapfile)
492 mapname = (templater.templatepath('map-cmdline.' + mapfile)
520 or templater.templatepath(mapfile))
493 or templater.templatepath(mapfile))
521 if mapname:
494 if mapname:
522 mapfile = mapname
495 mapfile = mapname
523 return templatespec(None, mapfile)
496 return templatespec(None, mapfile)
524
497
525 if not tmpl:
498 if not tmpl:
526 return templatespec(None, None)
499 return templatespec(None, None)
527
500
528 return formatter.lookuptemplate(ui, 'changeset', tmpl)
501 return formatter.lookuptemplate(ui, 'changeset', tmpl)
529
502
530 def maketemplater(ui, repo, tmpl, buffered=False):
503 def maketemplater(ui, repo, tmpl, buffered=False):
531 """Create a changesettemplater from a literal template 'tmpl'
504 """Create a changesettemplater from a literal template 'tmpl'
532 byte-string."""
505 byte-string."""
533 spec = templatespec(tmpl, None)
506 spec = templatespec(tmpl, None)
534 return changesettemplater(ui, repo, spec, buffered=buffered)
507 return changesettemplater(ui, repo, spec, buffered=buffered)
535
508
536 def changesetdisplayer(ui, repo, opts, differ=None, buffered=False):
509 def changesetdisplayer(ui, repo, opts, differ=None, buffered=False):
537 """show one changeset using template or regular display.
510 """show one changeset using template or regular display.
538
511
539 Display format will be the first non-empty hit of:
512 Display format will be the first non-empty hit of:
540 1. option 'template'
513 1. option 'template'
541 2. option 'style'
514 2. option 'style'
542 3. [ui] setting 'logtemplate'
515 3. [ui] setting 'logtemplate'
543 4. [ui] setting 'style'
516 4. [ui] setting 'style'
544 If all of these values are either the unset or the empty string,
517 If all of these values are either the unset or the empty string,
545 regular display via changesetprinter() is done.
518 regular display via changesetprinter() is done.
546 """
519 """
547 postargs = (differ, opts, buffered)
520 postargs = (differ, opts, buffered)
548 if opts.get('template') == 'json':
521 if opts.get('template') == 'json':
549 return jsonchangeset(ui, repo, *postargs)
522 return jsonchangeset(ui, repo, *postargs)
550
523
551 spec = _lookuptemplate(ui, opts.get('template'), opts.get('style'))
524 spec = _lookuptemplate(ui, opts.get('template'), opts.get('style'))
552
525
553 if not spec.ref and not spec.tmpl and not spec.mapfile:
526 if not spec.ref and not spec.tmpl and not spec.mapfile:
554 return changesetprinter(ui, repo, *postargs)
527 return changesetprinter(ui, repo, *postargs)
555
528
556 return changesettemplater(ui, repo, spec, *postargs)
529 return changesettemplater(ui, repo, spec, *postargs)
557
530
558 def _makematcher(repo, revs, pats, opts):
531 def _makematcher(repo, revs, pats, opts):
559 """Build matcher and expanded patterns from log options
532 """Build matcher and expanded patterns from log options
560
533
561 If --follow, revs are the revisions to follow from.
534 If --follow, revs are the revisions to follow from.
562
535
563 Returns (match, pats, slowpath) where
536 Returns (match, pats, slowpath) where
564 - match: a matcher built from the given pats and -I/-X opts
537 - match: a matcher built from the given pats and -I/-X opts
565 - pats: patterns used (globs are expanded on Windows)
538 - pats: patterns used (globs are expanded on Windows)
566 - slowpath: True if patterns aren't as simple as scanning filelogs
539 - slowpath: True if patterns aren't as simple as scanning filelogs
567 """
540 """
568 # pats/include/exclude are passed to match.match() directly in
541 # pats/include/exclude are passed to match.match() directly in
569 # _matchfiles() revset but walkchangerevs() builds its matcher with
542 # _matchfiles() revset but walkchangerevs() builds its matcher with
570 # scmutil.match(). The difference is input pats are globbed on
543 # scmutil.match(). The difference is input pats are globbed on
571 # platforms without shell expansion (windows).
544 # platforms without shell expansion (windows).
572 wctx = repo[None]
545 wctx = repo[None]
573 match, pats = scmutil.matchandpats(wctx, pats, opts)
546 match, pats = scmutil.matchandpats(wctx, pats, opts)
574 slowpath = match.anypats() or (not match.always() and opts.get('removed'))
547 slowpath = match.anypats() or (not match.always() and opts.get('removed'))
575 if not slowpath:
548 if not slowpath:
576 follow = opts.get('follow') or opts.get('follow_first')
549 follow = opts.get('follow') or opts.get('follow_first')
577 startctxs = []
550 startctxs = []
578 if follow and opts.get('rev'):
551 if follow and opts.get('rev'):
579 startctxs = [repo[r] for r in revs]
552 startctxs = [repo[r] for r in revs]
580 for f in match.files():
553 for f in match.files():
581 if follow and startctxs:
554 if follow and startctxs:
582 # No idea if the path was a directory at that revision, so
555 # No idea if the path was a directory at that revision, so
583 # take the slow path.
556 # take the slow path.
584 if any(f not in c for c in startctxs):
557 if any(f not in c for c in startctxs):
585 slowpath = True
558 slowpath = True
586 continue
559 continue
587 elif follow and f not in wctx:
560 elif follow and f not in wctx:
588 # If the file exists, it may be a directory, so let it
561 # If the file exists, it may be a directory, so let it
589 # take the slow path.
562 # take the slow path.
590 if os.path.exists(repo.wjoin(f)):
563 if os.path.exists(repo.wjoin(f)):
591 slowpath = True
564 slowpath = True
592 continue
565 continue
593 else:
566 else:
594 raise error.Abort(_('cannot follow file not in parent '
567 raise error.Abort(_('cannot follow file not in parent '
595 'revision: "%s"') % f)
568 'revision: "%s"') % f)
596 filelog = repo.file(f)
569 filelog = repo.file(f)
597 if not filelog:
570 if not filelog:
598 # A zero count may be a directory or deleted file, so
571 # A zero count may be a directory or deleted file, so
599 # try to find matching entries on the slow path.
572 # try to find matching entries on the slow path.
600 if follow:
573 if follow:
601 raise error.Abort(
574 raise error.Abort(
602 _('cannot follow nonexistent file: "%s"') % f)
575 _('cannot follow nonexistent file: "%s"') % f)
603 slowpath = True
576 slowpath = True
604
577
605 # We decided to fall back to the slowpath because at least one
578 # We decided to fall back to the slowpath because at least one
606 # of the paths was not a file. Check to see if at least one of them
579 # of the paths was not a file. Check to see if at least one of them
607 # existed in history - in that case, we'll continue down the
580 # existed in history - in that case, we'll continue down the
608 # slowpath; otherwise, we can turn off the slowpath
581 # slowpath; otherwise, we can turn off the slowpath
609 if slowpath:
582 if slowpath:
610 for path in match.files():
583 for path in match.files():
611 if path == '.' or path in repo.store:
584 if path == '.' or path in repo.store:
612 break
585 break
613 else:
586 else:
614 slowpath = False
587 slowpath = False
615
588
616 return match, pats, slowpath
589 return match, pats, slowpath
617
590
618 def _fileancestors(repo, revs, match, followfirst):
591 def _fileancestors(repo, revs, match, followfirst):
619 fctxs = []
592 fctxs = []
620 for r in revs:
593 for r in revs:
621 ctx = repo[r]
594 ctx = repo[r]
622 fctxs.extend(ctx[f].introfilectx() for f in ctx.walk(match))
595 fctxs.extend(ctx[f].introfilectx() for f in ctx.walk(match))
623
596
624 # When displaying a revision with --patch --follow FILE, we have
597 # When displaying a revision with --patch --follow FILE, we have
625 # to know which file of the revision must be diffed. With
598 # to know which file of the revision must be diffed. With
626 # --follow, we want the names of the ancestors of FILE in the
599 # --follow, we want the names of the ancestors of FILE in the
627 # revision, stored in "fcache". "fcache" is populated as a side effect
600 # revision, stored in "fcache". "fcache" is populated as a side effect
628 # of the graph traversal.
601 # of the graph traversal.
629 fcache = {}
602 fcache = {}
630 def filematcher(ctx):
603 def filematcher(ctx):
631 return scmutil.matchfiles(repo, fcache.get(ctx.rev(), []))
604 return scmutil.matchfiles(repo, fcache.get(ctx.rev(), []))
632
605
633 def revgen():
606 def revgen():
634 for rev, cs in dagop.filectxancestors(fctxs, followfirst=followfirst):
607 for rev, cs in dagop.filectxancestors(fctxs, followfirst=followfirst):
635 fcache[rev] = [c.path() for c in cs]
608 fcache[rev] = [c.path() for c in cs]
636 yield rev
609 yield rev
637 return smartset.generatorset(revgen(), iterasc=False), filematcher
610 return smartset.generatorset(revgen(), iterasc=False), filematcher
638
611
639 def _makenofollowfilematcher(repo, pats, opts):
612 def _makenofollowfilematcher(repo, pats, opts):
640 '''hook for extensions to override the filematcher for non-follow cases'''
613 '''hook for extensions to override the filematcher for non-follow cases'''
641 return None
614 return None
642
615
643 _opt2logrevset = {
616 _opt2logrevset = {
644 'no_merges': ('not merge()', None),
617 'no_merges': ('not merge()', None),
645 'only_merges': ('merge()', None),
618 'only_merges': ('merge()', None),
646 '_matchfiles': (None, '_matchfiles(%ps)'),
619 '_matchfiles': (None, '_matchfiles(%ps)'),
647 'date': ('date(%s)', None),
620 'date': ('date(%s)', None),
648 'branch': ('branch(%s)', '%lr'),
621 'branch': ('branch(%s)', '%lr'),
649 '_patslog': ('filelog(%s)', '%lr'),
622 '_patslog': ('filelog(%s)', '%lr'),
650 'keyword': ('keyword(%s)', '%lr'),
623 'keyword': ('keyword(%s)', '%lr'),
651 'prune': ('ancestors(%s)', 'not %lr'),
624 'prune': ('ancestors(%s)', 'not %lr'),
652 'user': ('user(%s)', '%lr'),
625 'user': ('user(%s)', '%lr'),
653 }
626 }
654
627
655 def _makerevset(repo, match, pats, slowpath, opts):
628 def _makerevset(repo, match, pats, slowpath, opts):
656 """Return a revset string built from log options and file patterns"""
629 """Return a revset string built from log options and file patterns"""
657 opts = dict(opts)
630 opts = dict(opts)
658 # follow or not follow?
631 # follow or not follow?
659 follow = opts.get('follow') or opts.get('follow_first')
632 follow = opts.get('follow') or opts.get('follow_first')
660
633
661 # branch and only_branch are really aliases and must be handled at
634 # branch and only_branch are really aliases and must be handled at
662 # the same time
635 # the same time
663 opts['branch'] = opts.get('branch', []) + opts.get('only_branch', [])
636 opts['branch'] = opts.get('branch', []) + opts.get('only_branch', [])
664 opts['branch'] = [repo.lookupbranch(b) for b in opts['branch']]
637 opts['branch'] = [repo.lookupbranch(b) for b in opts['branch']]
665
638
666 if slowpath:
639 if slowpath:
667 # See walkchangerevs() slow path.
640 # See walkchangerevs() slow path.
668 #
641 #
669 # pats/include/exclude cannot be represented as separate
642 # pats/include/exclude cannot be represented as separate
670 # revset expressions as their filtering logic applies at file
643 # revset expressions as their filtering logic applies at file
671 # level. For instance "-I a -X b" matches a revision touching
644 # level. For instance "-I a -X b" matches a revision touching
672 # "a" and "b" while "file(a) and not file(b)" does
645 # "a" and "b" while "file(a) and not file(b)" does
673 # not. Besides, filesets are evaluated against the working
646 # not. Besides, filesets are evaluated against the working
674 # directory.
647 # directory.
675 matchargs = ['r:', 'd:relpath']
648 matchargs = ['r:', 'd:relpath']
676 for p in pats:
649 for p in pats:
677 matchargs.append('p:' + p)
650 matchargs.append('p:' + p)
678 for p in opts.get('include', []):
651 for p in opts.get('include', []):
679 matchargs.append('i:' + p)
652 matchargs.append('i:' + p)
680 for p in opts.get('exclude', []):
653 for p in opts.get('exclude', []):
681 matchargs.append('x:' + p)
654 matchargs.append('x:' + p)
682 opts['_matchfiles'] = matchargs
655 opts['_matchfiles'] = matchargs
683 elif not follow:
656 elif not follow:
684 opts['_patslog'] = list(pats)
657 opts['_patslog'] = list(pats)
685
658
686 expr = []
659 expr = []
687 for op, val in sorted(opts.iteritems()):
660 for op, val in sorted(opts.iteritems()):
688 if not val:
661 if not val:
689 continue
662 continue
690 if op not in _opt2logrevset:
663 if op not in _opt2logrevset:
691 continue
664 continue
692 revop, listop = _opt2logrevset[op]
665 revop, listop = _opt2logrevset[op]
693 if revop and '%' not in revop:
666 if revop and '%' not in revop:
694 expr.append(revop)
667 expr.append(revop)
695 elif not listop:
668 elif not listop:
696 expr.append(revsetlang.formatspec(revop, val))
669 expr.append(revsetlang.formatspec(revop, val))
697 else:
670 else:
698 if revop:
671 if revop:
699 val = [revsetlang.formatspec(revop, v) for v in val]
672 val = [revsetlang.formatspec(revop, v) for v in val]
700 expr.append(revsetlang.formatspec(listop, val))
673 expr.append(revsetlang.formatspec(listop, val))
701
674
702 if expr:
675 if expr:
703 expr = '(' + ' and '.join(expr) + ')'
676 expr = '(' + ' and '.join(expr) + ')'
704 else:
677 else:
705 expr = None
678 expr = None
706 return expr
679 return expr
707
680
708 def _initialrevs(repo, opts):
681 def _initialrevs(repo, opts):
709 """Return the initial set of revisions to be filtered or followed"""
682 """Return the initial set of revisions to be filtered or followed"""
710 follow = opts.get('follow') or opts.get('follow_first')
683 follow = opts.get('follow') or opts.get('follow_first')
711 if opts.get('rev'):
684 if opts.get('rev'):
712 revs = scmutil.revrange(repo, opts['rev'])
685 revs = scmutil.revrange(repo, opts['rev'])
713 elif follow and repo.dirstate.p1() == nullid:
686 elif follow and repo.dirstate.p1() == nullid:
714 revs = smartset.baseset()
687 revs = smartset.baseset()
715 elif follow:
688 elif follow:
716 revs = repo.revs('.')
689 revs = repo.revs('.')
717 else:
690 else:
718 revs = smartset.spanset(repo)
691 revs = smartset.spanset(repo)
719 revs.reverse()
692 revs.reverse()
720 return revs
693 return revs
721
694
722 def getrevs(repo, pats, opts):
695 def getrevs(repo, pats, opts):
723 """Return (revs, differ) where revs is a smartset
696 """Return (revs, differ) where revs is a smartset
724
697
725 differ is a changesetdiffer with pre-configured file matcher.
698 differ is a changesetdiffer with pre-configured file matcher.
726 """
699 """
727 follow = opts.get('follow') or opts.get('follow_first')
700 follow = opts.get('follow') or opts.get('follow_first')
728 followfirst = opts.get('follow_first')
701 followfirst = opts.get('follow_first')
729 limit = getlimit(opts)
702 limit = getlimit(opts)
730 revs = _initialrevs(repo, opts)
703 revs = _initialrevs(repo, opts)
731 if not revs:
704 if not revs:
732 return smartset.baseset(), None
705 return smartset.baseset(), None
733 match, pats, slowpath = _makematcher(repo, revs, pats, opts)
706 match, pats, slowpath = _makematcher(repo, revs, pats, opts)
734 filematcher = None
707 filematcher = None
735 if follow:
708 if follow:
736 if slowpath or match.always():
709 if slowpath or match.always():
737 revs = dagop.revancestors(repo, revs, followfirst=followfirst)
710 revs = dagop.revancestors(repo, revs, followfirst=followfirst)
738 else:
711 else:
739 revs, filematcher = _fileancestors(repo, revs, match, followfirst)
712 revs, filematcher = _fileancestors(repo, revs, match, followfirst)
740 revs.reverse()
713 revs.reverse()
741 if filematcher is None:
714 if filematcher is None:
742 filematcher = _makenofollowfilematcher(repo, pats, opts)
715 filematcher = _makenofollowfilematcher(repo, pats, opts)
743 if filematcher is None:
716 if filematcher is None:
744 def filematcher(ctx):
717 def filematcher(ctx):
745 return match
718 return match
746
719
747 expr = _makerevset(repo, match, pats, slowpath, opts)
720 expr = _makerevset(repo, match, pats, slowpath, opts)
748 if opts.get('graph') and opts.get('rev'):
721 if opts.get('graph') and opts.get('rev'):
749 # User-specified revs might be unsorted, but don't sort before
722 # User-specified revs might be unsorted, but don't sort before
750 # _makerevset because it might depend on the order of revs
723 # _makerevset because it might depend on the order of revs
751 if not (revs.isdescending() or revs.istopo()):
724 if not (revs.isdescending() or revs.istopo()):
752 revs.sort(reverse=True)
725 revs.sort(reverse=True)
753 if expr:
726 if expr:
754 matcher = revset.match(None, expr)
727 matcher = revset.match(None, expr)
755 revs = matcher(repo, revs)
728 revs = matcher(repo, revs)
756 if limit is not None:
729 if limit is not None:
757 revs = revs.slice(0, limit)
730 revs = revs.slice(0, limit)
758
731
759 differ = changesetdiffer()
732 differ = changesetdiffer()
760 differ._makefilematcher = filematcher
733 differ._makefilematcher = filematcher
761 return revs, differ
734 return revs, differ
762
735
763 def _parselinerangeopt(repo, opts):
736 def _parselinerangeopt(repo, opts):
764 """Parse --line-range log option and return a list of tuples (filename,
737 """Parse --line-range log option and return a list of tuples (filename,
765 (fromline, toline)).
738 (fromline, toline)).
766 """
739 """
767 linerangebyfname = []
740 linerangebyfname = []
768 for pat in opts.get('line_range', []):
741 for pat in opts.get('line_range', []):
769 try:
742 try:
770 pat, linerange = pat.rsplit(',', 1)
743 pat, linerange = pat.rsplit(',', 1)
771 except ValueError:
744 except ValueError:
772 raise error.Abort(_('malformatted line-range pattern %s') % pat)
745 raise error.Abort(_('malformatted line-range pattern %s') % pat)
773 try:
746 try:
774 fromline, toline = map(int, linerange.split(':'))
747 fromline, toline = map(int, linerange.split(':'))
775 except ValueError:
748 except ValueError:
776 raise error.Abort(_("invalid line range for %s") % pat)
749 raise error.Abort(_("invalid line range for %s") % pat)
777 msg = _("line range pattern '%s' must match exactly one file") % pat
750 msg = _("line range pattern '%s' must match exactly one file") % pat
778 fname = scmutil.parsefollowlinespattern(repo, None, pat, msg)
751 fname = scmutil.parsefollowlinespattern(repo, None, pat, msg)
779 linerangebyfname.append(
752 linerangebyfname.append(
780 (fname, util.processlinerange(fromline, toline)))
753 (fname, util.processlinerange(fromline, toline)))
781 return linerangebyfname
754 return linerangebyfname
782
755
783 def getlinerangerevs(repo, userrevs, opts):
756 def getlinerangerevs(repo, userrevs, opts):
784 """Return (revs, differ).
757 """Return (revs, differ).
785
758
786 "revs" are revisions obtained by processing "line-range" log options and
759 "revs" are revisions obtained by processing "line-range" log options and
787 walking block ancestors of each specified file/line-range.
760 walking block ancestors of each specified file/line-range.
788
761
789 "differ" is a changesetdiffer with pre-configured file matcher and hunks
762 "differ" is a changesetdiffer with pre-configured file matcher and hunks
790 filter.
763 filter.
791 """
764 """
792 wctx = repo[None]
765 wctx = repo[None]
793
766
794 # Two-levels map of "rev -> file ctx -> [line range]".
767 # Two-levels map of "rev -> file ctx -> [line range]".
795 linerangesbyrev = {}
768 linerangesbyrev = {}
796 for fname, (fromline, toline) in _parselinerangeopt(repo, opts):
769 for fname, (fromline, toline) in _parselinerangeopt(repo, opts):
797 if fname not in wctx:
770 if fname not in wctx:
798 raise error.Abort(_('cannot follow file not in parent '
771 raise error.Abort(_('cannot follow file not in parent '
799 'revision: "%s"') % fname)
772 'revision: "%s"') % fname)
800 fctx = wctx.filectx(fname)
773 fctx = wctx.filectx(fname)
801 for fctx, linerange in dagop.blockancestors(fctx, fromline, toline):
774 for fctx, linerange in dagop.blockancestors(fctx, fromline, toline):
802 rev = fctx.introrev()
775 rev = fctx.introrev()
803 if rev not in userrevs:
776 if rev not in userrevs:
804 continue
777 continue
805 linerangesbyrev.setdefault(
778 linerangesbyrev.setdefault(
806 rev, {}).setdefault(
779 rev, {}).setdefault(
807 fctx.path(), []).append(linerange)
780 fctx.path(), []).append(linerange)
808
781
809 def nofilterhunksfn(fctx, hunks):
782 def nofilterhunksfn(fctx, hunks):
810 return hunks
783 return hunks
811
784
812 def hunksfilter(ctx):
785 def hunksfilter(ctx):
813 fctxlineranges = linerangesbyrev.get(ctx.rev())
786 fctxlineranges = linerangesbyrev.get(ctx.rev())
814 if fctxlineranges is None:
787 if fctxlineranges is None:
815 return nofilterhunksfn
788 return nofilterhunksfn
816
789
817 def filterfn(fctx, hunks):
790 def filterfn(fctx, hunks):
818 lineranges = fctxlineranges.get(fctx.path())
791 lineranges = fctxlineranges.get(fctx.path())
819 if lineranges is not None:
792 if lineranges is not None:
820 for hr, lines in hunks:
793 for hr, lines in hunks:
821 if hr is None: # binary
794 if hr is None: # binary
822 yield hr, lines
795 yield hr, lines
823 continue
796 continue
824 if any(mdiff.hunkinrange(hr[2:], lr)
797 if any(mdiff.hunkinrange(hr[2:], lr)
825 for lr in lineranges):
798 for lr in lineranges):
826 yield hr, lines
799 yield hr, lines
827 else:
800 else:
828 for hunk in hunks:
801 for hunk in hunks:
829 yield hunk
802 yield hunk
830
803
831 return filterfn
804 return filterfn
832
805
833 def filematcher(ctx):
806 def filematcher(ctx):
834 files = list(linerangesbyrev.get(ctx.rev(), []))
807 files = list(linerangesbyrev.get(ctx.rev(), []))
835 return scmutil.matchfiles(repo, files)
808 return scmutil.matchfiles(repo, files)
836
809
837 revs = sorted(linerangesbyrev, reverse=True)
810 revs = sorted(linerangesbyrev, reverse=True)
838
811
839 differ = changesetdiffer()
812 differ = changesetdiffer()
840 differ._makefilematcher = filematcher
813 differ._makefilematcher = filematcher
841 differ._makehunksfilter = hunksfilter
814 differ._makehunksfilter = hunksfilter
842 return revs, differ
815 return revs, differ
843
816
844 def _graphnodeformatter(ui, displayer):
817 def _graphnodeformatter(ui, displayer):
845 spec = ui.config('ui', 'graphnodetemplate')
818 spec = ui.config('ui', 'graphnodetemplate')
846 if not spec:
819 if not spec:
847 return templatekw.getgraphnode # fast path for "{graphnode}"
820 return templatekw.getgraphnode # fast path for "{graphnode}"
848
821
849 spec = templater.unquotestring(spec)
822 spec = templater.unquotestring(spec)
850 if isinstance(displayer, changesettemplater):
823 if isinstance(displayer, changesettemplater):
851 # reuse cache of slow templates
824 # reuse cache of slow templates
852 tres = displayer._tresources
825 tres = displayer._tresources
853 else:
826 else:
854 tres = formatter.templateresources(ui)
827 tres = formatter.templateresources(ui)
855 templ = formatter.maketemplater(ui, spec, defaults=templatekw.keywords,
828 templ = formatter.maketemplater(ui, spec, defaults=templatekw.keywords,
856 resources=tres)
829 resources=tres)
857 def formatnode(repo, ctx):
830 def formatnode(repo, ctx):
858 props = {'ctx': ctx, 'repo': repo}
831 props = {'ctx': ctx, 'repo': repo}
859 return templ.renderdefault(props)
832 return templ.renderdefault(props)
860 return formatnode
833 return formatnode
861
834
862 def displaygraph(ui, repo, dag, displayer, edgefn, getrenamed=None, props=None):
835 def displaygraph(ui, repo, dag, displayer, edgefn, getrenamed=None, props=None):
863 props = props or {}
836 props = props or {}
864 formatnode = _graphnodeformatter(ui, displayer)
837 formatnode = _graphnodeformatter(ui, displayer)
865 state = graphmod.asciistate()
838 state = graphmod.asciistate()
866 styles = state['styles']
839 styles = state['styles']
867
840
868 # only set graph styling if HGPLAIN is not set.
841 # only set graph styling if HGPLAIN is not set.
869 if ui.plain('graph'):
842 if ui.plain('graph'):
870 # set all edge styles to |, the default pre-3.8 behaviour
843 # set all edge styles to |, the default pre-3.8 behaviour
871 styles.update(dict.fromkeys(styles, '|'))
844 styles.update(dict.fromkeys(styles, '|'))
872 else:
845 else:
873 edgetypes = {
846 edgetypes = {
874 'parent': graphmod.PARENT,
847 'parent': graphmod.PARENT,
875 'grandparent': graphmod.GRANDPARENT,
848 'grandparent': graphmod.GRANDPARENT,
876 'missing': graphmod.MISSINGPARENT
849 'missing': graphmod.MISSINGPARENT
877 }
850 }
878 for name, key in edgetypes.items():
851 for name, key in edgetypes.items():
879 # experimental config: experimental.graphstyle.*
852 # experimental config: experimental.graphstyle.*
880 styles[key] = ui.config('experimental', 'graphstyle.%s' % name,
853 styles[key] = ui.config('experimental', 'graphstyle.%s' % name,
881 styles[key])
854 styles[key])
882 if not styles[key]:
855 if not styles[key]:
883 styles[key] = None
856 styles[key] = None
884
857
885 # experimental config: experimental.graphshorten
858 # experimental config: experimental.graphshorten
886 state['graphshorten'] = ui.configbool('experimental', 'graphshorten')
859 state['graphshorten'] = ui.configbool('experimental', 'graphshorten')
887
860
888 for rev, type, ctx, parents in dag:
861 for rev, type, ctx, parents in dag:
889 char = formatnode(repo, ctx)
862 char = formatnode(repo, ctx)
890 copies = None
863 copies = None
891 if getrenamed and ctx.rev():
864 if getrenamed and ctx.rev():
892 copies = []
865 copies = []
893 for fn in ctx.files():
866 for fn in ctx.files():
894 rename = getrenamed(fn, ctx.rev())
867 rename = getrenamed(fn, ctx.rev())
895 if rename:
868 if rename:
896 copies.append((fn, rename[0]))
869 copies.append((fn, rename[0]))
897 edges = edgefn(type, char, state, rev, parents)
870 edges = edgefn(type, char, state, rev, parents)
898 firstedge = next(edges)
871 firstedge = next(edges)
899 width = firstedge[2]
872 width = firstedge[2]
900 displayer.show(ctx, copies=copies,
873 displayer.show(ctx, copies=copies,
901 graphwidth=width, **pycompat.strkwargs(props))
874 graphwidth=width, **pycompat.strkwargs(props))
902 lines = displayer.hunk.pop(rev).split('\n')
875 lines = displayer.hunk.pop(rev).split('\n')
903 if not lines[-1]:
876 if not lines[-1]:
904 del lines[-1]
877 del lines[-1]
905 displayer.flush(ctx)
878 displayer.flush(ctx)
906 for type, char, width, coldata in itertools.chain([firstedge], edges):
879 for type, char, width, coldata in itertools.chain([firstedge], edges):
907 graphmod.ascii(ui, state, type, char, lines, coldata)
880 graphmod.ascii(ui, state, type, char, lines, coldata)
908 lines = []
881 lines = []
909 displayer.close()
882 displayer.close()
910
883
911 def displaygraphrevs(ui, repo, revs, displayer, getrenamed):
884 def displaygraphrevs(ui, repo, revs, displayer, getrenamed):
912 revdag = graphmod.dagwalker(repo, revs)
885 revdag = graphmod.dagwalker(repo, revs)
913 displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, getrenamed)
886 displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, getrenamed)
914
887
915 def displayrevs(ui, repo, revs, displayer, getrenamed):
888 def displayrevs(ui, repo, revs, displayer, getrenamed):
916 for rev in revs:
889 for rev in revs:
917 ctx = repo[rev]
890 ctx = repo[rev]
918 copies = None
891 copies = None
919 if getrenamed is not None and rev:
892 if getrenamed is not None and rev:
920 copies = []
893 copies = []
921 for fn in ctx.files():
894 for fn in ctx.files():
922 rename = getrenamed(fn, rev)
895 rename = getrenamed(fn, rev)
923 if rename:
896 if rename:
924 copies.append((fn, rename[0]))
897 copies.append((fn, rename[0]))
925 displayer.show(ctx, copies=copies)
898 displayer.show(ctx, copies=copies)
926 displayer.flush(ctx)
899 displayer.flush(ctx)
927 displayer.close()
900 displayer.close()
928
901
929 def checkunsupportedgraphflags(pats, opts):
902 def checkunsupportedgraphflags(pats, opts):
930 for op in ["newest_first"]:
903 for op in ["newest_first"]:
931 if op in opts and opts[op]:
904 if op in opts and opts[op]:
932 raise error.Abort(_("-G/--graph option is incompatible with --%s")
905 raise error.Abort(_("-G/--graph option is incompatible with --%s")
933 % op.replace("_", "-"))
906 % op.replace("_", "-"))
934
907
935 def graphrevs(repo, nodes, opts):
908 def graphrevs(repo, nodes, opts):
936 limit = getlimit(opts)
909 limit = getlimit(opts)
937 nodes.reverse()
910 nodes.reverse()
938 if limit is not None:
911 if limit is not None:
939 nodes = nodes[:limit]
912 nodes = nodes[:limit]
940 return graphmod.nodes(repo, nodes)
913 return graphmod.nodes(repo, nodes)
@@ -1,4883 +1,4884 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 $ hg log -qr . -Tjson
859 $ hg log -qr . -Tjson
859 [
860 [
860 {
861 {
861 "rev": 8,
862 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
862 "node": "95c24699272ef57d062b8bccc32c878bf841784a"
863 "rev": 8
863 }
864 }
864 ]
865 ]
865
866
866 $ hg log -vpr . -Tjson --stat
867 $ hg log -vpr . -Tjson --stat
867 [
868 [
868 {
869 {
869 "rev": 8,
870 "bookmarks": [],
870 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
871 "branch": "default",
871 "branch": "default",
872 "phase": "draft",
873 "user": "test",
874 "date": [1577872860, 0],
872 "date": [1577872860, 0],
875 "desc": "third",
873 "desc": "third",
876 "bookmarks": [],
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",
877 "tags": ["tip"],
875 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
876 "files": ["fourth", "second", "third"],
877 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
878 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
878 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
879 "files": ["fourth", "second", "third"],
879 "phase": "draft",
880 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
880 "rev": 8,
881 "diff": "diff -r 29114dbae42b -r 95c24699272e fourth\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/fourth\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+second\ndiff -r 29114dbae42b -r 95c24699272e second\n--- a/second\tMon Jan 12 13:46:40 1970 +0000\n+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +0,0 @@\n-second\ndiff -r 29114dbae42b -r 95c24699272e third\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/third\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+third\n"
881 "tags": ["tip"],
882 "user": "test"
882 }
883 }
883 ]
884 ]
884
885
885 honor --git but not format-breaking diffopts
886 honor --git but not format-breaking diffopts
886 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
887 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
887 [
888 [
888 {
889 {
889 "rev": 8,
890 "bookmarks": [],
890 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
891 "branch": "default",
891 "branch": "default",
892 "phase": "draft",
893 "user": "test",
894 "date": [1577872860, 0],
892 "date": [1577872860, 0],
895 "desc": "third",
893 "desc": "third",
896 "bookmarks": [],
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",
897 "tags": ["tip"],
895 "files": ["fourth", "second", "third"],
896 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
898 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
897 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
899 "files": ["fourth", "second", "third"],
898 "phase": "draft",
900 "diff": "diff --git a/second b/fourth\nrename from second\nrename to fourth\ndiff --git a/third b/third\nnew file mode 100644\n--- /dev/null\n+++ b/third\n@@ -0,0 +1,1 @@\n+third\n"
899 "rev": 8,
900 "tags": ["tip"],
901 "user": "test"
901 }
902 }
902 ]
903 ]
903
904
904 $ hg log -T json
905 $ hg log -T json
905 [
906 [
906 {
907 {
907 "rev": 8,
908 "bookmarks": [],
908 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
909 "branch": "default",
909 "branch": "default",
910 "phase": "draft",
911 "user": "test",
912 "date": [1577872860, 0],
910 "date": [1577872860, 0],
913 "desc": "third",
911 "desc": "third",
914 "bookmarks": [],
912 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
913 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
914 "phase": "draft",
915 "rev": 8,
915 "tags": ["tip"],
916 "tags": ["tip"],
916 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"]
917 "user": "test"
917 },
918 },
918 {
919 {
919 "rev": 7,
920 "bookmarks": [],
920 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
921 "branch": "default",
921 "branch": "default",
922 "phase": "draft",
923 "user": "User Name <user@hostname>",
924 "date": [1000000, 0],
922 "date": [1000000, 0],
925 "desc": "second",
923 "desc": "second",
926 "bookmarks": [],
924 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
925 "parents": ["0000000000000000000000000000000000000000"],
926 "phase": "draft",
927 "rev": 7,
927 "tags": [],
928 "tags": [],
928 "parents": ["0000000000000000000000000000000000000000"]
929 "user": "User Name <user@hostname>"
929 },
930 },
930 {
931 {
931 "rev": 6,
932 "bookmarks": [],
932 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
933 "branch": "default",
933 "branch": "default",
934 "phase": "draft",
935 "user": "person",
936 "date": [1500001, 0],
934 "date": [1500001, 0],
937 "desc": "merge",
935 "desc": "merge",
938 "bookmarks": [],
936 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
937 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
938 "phase": "draft",
939 "rev": 6,
939 "tags": [],
940 "tags": [],
940 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"]
941 "user": "person"
941 },
942 },
942 {
943 {
943 "rev": 5,
944 "bookmarks": [],
944 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
945 "branch": "default",
945 "branch": "default",
946 "phase": "draft",
947 "user": "person",
948 "date": [1500000, 0],
946 "date": [1500000, 0],
949 "desc": "new head",
947 "desc": "new head",
950 "bookmarks": [],
948 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
949 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
950 "phase": "draft",
951 "rev": 5,
951 "tags": [],
952 "tags": [],
952 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
953 "user": "person"
953 },
954 },
954 {
955 {
955 "rev": 4,
956 "bookmarks": [],
956 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
957 "branch": "foo",
957 "branch": "foo",
958 "phase": "draft",
959 "user": "person",
960 "date": [1400000, 0],
958 "date": [1400000, 0],
961 "desc": "new branch",
959 "desc": "new branch",
962 "bookmarks": [],
960 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
961 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
962 "phase": "draft",
963 "rev": 4,
963 "tags": [],
964 "tags": [],
964 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
965 "user": "person"
965 },
966 },
966 {
967 {
967 "rev": 3,
968 "bookmarks": [],
968 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
969 "branch": "default",
969 "branch": "default",
970 "phase": "draft",
971 "user": "person",
972 "date": [1300000, 0],
970 "date": [1300000, 0],
973 "desc": "no user, no domain",
971 "desc": "no user, no domain",
974 "bookmarks": [],
972 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
973 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
974 "phase": "draft",
975 "rev": 3,
975 "tags": [],
976 "tags": [],
976 "parents": ["97054abb4ab824450e9164180baf491ae0078465"]
977 "user": "person"
977 },
978 },
978 {
979 {
979 "rev": 2,
980 "bookmarks": [],
980 "node": "97054abb4ab824450e9164180baf491ae0078465",
981 "branch": "default",
981 "branch": "default",
982 "phase": "draft",
983 "user": "other@place",
984 "date": [1200000, 0],
982 "date": [1200000, 0],
985 "desc": "no person",
983 "desc": "no person",
986 "bookmarks": [],
984 "node": "97054abb4ab824450e9164180baf491ae0078465",
985 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
986 "phase": "draft",
987 "rev": 2,
987 "tags": [],
988 "tags": [],
988 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"]
989 "user": "other@place"
989 },
990 },
990 {
991 {
991 "rev": 1,
992 "bookmarks": [],
992 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
993 "branch": "default",
993 "branch": "default",
994 "phase": "draft",
995 "user": "A. N. Other <other@place>",
996 "date": [1100000, 0],
994 "date": [1100000, 0],
997 "desc": "other 1\nother 2\n\nother 3",
995 "desc": "other 1\nother 2\n\nother 3",
998 "bookmarks": [],
996 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
997 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
998 "phase": "draft",
999 "rev": 1,
999 "tags": [],
1000 "tags": [],
1000 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"]
1001 "user": "A. N. Other <other@place>"
1001 },
1002 },
1002 {
1003 {
1003 "rev": 0,
1004 "bookmarks": [],
1004 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1005 "branch": "default",
1005 "branch": "default",
1006 "phase": "draft",
1007 "user": "User Name <user@hostname>",
1008 "date": [1000000, 0],
1006 "date": [1000000, 0],
1009 "desc": "line 1\nline 2",
1007 "desc": "line 1\nline 2",
1010 "bookmarks": [],
1008 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1009 "parents": ["0000000000000000000000000000000000000000"],
1010 "phase": "draft",
1011 "rev": 0,
1011 "tags": [],
1012 "tags": [],
1012 "parents": ["0000000000000000000000000000000000000000"]
1013 "user": "User Name <user@hostname>"
1013 }
1014 }
1014 ]
1015 ]
1015
1016
1016 $ hg heads -v -Tjson
1017 $ hg heads -v -Tjson
1017 [
1018 [
1018 {
1019 {
1019 "rev": 8,
1020 "bookmarks": [],
1020 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1021 "branch": "default",
1021 "branch": "default",
1022 "phase": "draft",
1023 "user": "test",
1024 "date": [1577872860, 0],
1022 "date": [1577872860, 0],
1025 "desc": "third",
1023 "desc": "third",
1026 "bookmarks": [],
1024 "files": ["fourth", "second", "third"],
1025 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1026 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1027 "phase": "draft",
1028 "rev": 8,
1027 "tags": ["tip"],
1029 "tags": ["tip"],
1028 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1030 "user": "test"
1029 "files": ["fourth", "second", "third"]
1030 },
1031 },
1031 {
1032 {
1032 "rev": 6,
1033 "bookmarks": [],
1033 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1034 "branch": "default",
1034 "branch": "default",
1035 "phase": "draft",
1036 "user": "person",
1037 "date": [1500001, 0],
1035 "date": [1500001, 0],
1038 "desc": "merge",
1036 "desc": "merge",
1039 "bookmarks": [],
1037 "files": [],
1038 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1039 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1040 "phase": "draft",
1041 "rev": 6,
1040 "tags": [],
1042 "tags": [],
1041 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1043 "user": "person"
1042 "files": []
1043 },
1044 },
1044 {
1045 {
1045 "rev": 4,
1046 "bookmarks": [],
1046 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1047 "branch": "foo",
1047 "branch": "foo",
1048 "phase": "draft",
1049 "user": "person",
1050 "date": [1400000, 0],
1048 "date": [1400000, 0],
1051 "desc": "new branch",
1049 "desc": "new branch",
1052 "bookmarks": [],
1050 "files": [],
1051 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1052 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1053 "phase": "draft",
1054 "rev": 4,
1053 "tags": [],
1055 "tags": [],
1054 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1056 "user": "person"
1055 "files": []
1056 }
1057 }
1057 ]
1058 ]
1058
1059
1059 $ hg log --debug -Tjson
1060 $ hg log --debug -Tjson
1060 [
1061 [
1061 {
1062 {
1062 "rev": 8,
1063 "added": ["fourth", "third"],
1063 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1064 "bookmarks": [],
1064 "branch": "default",
1065 "branch": "default",
1065 "phase": "draft",
1066 "user": "test",
1067 "date": [1577872860, 0],
1066 "date": [1577872860, 0],
1068 "desc": "third",
1067 "desc": "third",
1069 "bookmarks": [],
1068 "extra": {"branch": "default"},
1070 "tags": ["tip"],
1071 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1072 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
1069 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
1073 "extra": {"branch": "default"},
1074 "modified": [],
1070 "modified": [],
1075 "added": ["fourth", "third"],
1071 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1076 "removed": ["second"]
1072 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1073 "phase": "draft",
1074 "removed": ["second"],
1075 "rev": 8,
1076 "tags": ["tip"],
1077 "user": "test"
1077 },
1078 },
1078 {
1079 {
1079 "rev": 7,
1080 "added": ["second"],
1080 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
1081 "bookmarks": [],
1081 "branch": "default",
1082 "branch": "default",
1082 "phase": "draft",
1083 "user": "User Name <user@hostname>",
1084 "date": [1000000, 0],
1083 "date": [1000000, 0],
1085 "desc": "second",
1084 "desc": "second",
1086 "bookmarks": [],
1085 "extra": {"branch": "default"},
1087 "tags": [],
1088 "parents": ["0000000000000000000000000000000000000000"],
1089 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
1086 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
1090 "extra": {"branch": "default"},
1091 "modified": [],
1087 "modified": [],
1092 "added": ["second"],
1088 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
1093 "removed": []
1089 "parents": ["0000000000000000000000000000000000000000"],
1090 "phase": "draft",
1091 "removed": [],
1092 "rev": 7,
1093 "tags": [],
1094 "user": "User Name <user@hostname>"
1094 },
1095 },
1095 {
1096 {
1096 "rev": 6,
1097 "added": [],
1097 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1098 "bookmarks": [],
1098 "branch": "default",
1099 "branch": "default",
1099 "phase": "draft",
1100 "user": "person",
1101 "date": [1500001, 0],
1100 "date": [1500001, 0],
1102 "desc": "merge",
1101 "desc": "merge",
1103 "bookmarks": [],
1102 "extra": {"branch": "default"},
1104 "tags": [],
1105 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1106 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1103 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1107 "extra": {"branch": "default"},
1108 "modified": [],
1104 "modified": [],
1109 "added": [],
1105 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1110 "removed": []
1106 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1107 "phase": "draft",
1108 "removed": [],
1109 "rev": 6,
1110 "tags": [],
1111 "user": "person"
1111 },
1112 },
1112 {
1113 {
1113 "rev": 5,
1114 "added": ["d"],
1114 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
1115 "bookmarks": [],
1115 "branch": "default",
1116 "branch": "default",
1116 "phase": "draft",
1117 "user": "person",
1118 "date": [1500000, 0],
1117 "date": [1500000, 0],
1119 "desc": "new head",
1118 "desc": "new head",
1120 "bookmarks": [],
1119 "extra": {"branch": "default"},
1121 "tags": [],
1122 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1123 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1120 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1124 "extra": {"branch": "default"},
1125 "modified": [],
1121 "modified": [],
1126 "added": ["d"],
1122 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
1127 "removed": []
1123 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1124 "phase": "draft",
1125 "removed": [],
1126 "rev": 5,
1127 "tags": [],
1128 "user": "person"
1128 },
1129 },
1129 {
1130 {
1130 "rev": 4,
1131 "added": [],
1131 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1132 "bookmarks": [],
1132 "branch": "foo",
1133 "branch": "foo",
1133 "phase": "draft",
1134 "user": "person",
1135 "date": [1400000, 0],
1134 "date": [1400000, 0],
1136 "desc": "new branch",
1135 "desc": "new branch",
1137 "bookmarks": [],
1136 "extra": {"branch": "foo"},
1138 "tags": [],
1139 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1140 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1137 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1141 "extra": {"branch": "foo"},
1142 "modified": [],
1138 "modified": [],
1143 "added": [],
1139 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1144 "removed": []
1140 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1141 "phase": "draft",
1142 "removed": [],
1143 "rev": 4,
1144 "tags": [],
1145 "user": "person"
1145 },
1146 },
1146 {
1147 {
1147 "rev": 3,
1148 "added": [],
1148 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
1149 "bookmarks": [],
1149 "branch": "default",
1150 "branch": "default",
1150 "phase": "draft",
1151 "user": "person",
1152 "date": [1300000, 0],
1151 "date": [1300000, 0],
1153 "desc": "no user, no domain",
1152 "desc": "no user, no domain",
1154 "bookmarks": [],
1153 "extra": {"branch": "default"},
1155 "tags": [],
1156 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
1157 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1154 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1158 "extra": {"branch": "default"},
1159 "modified": ["c"],
1155 "modified": ["c"],
1160 "added": [],
1156 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
1161 "removed": []
1157 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
1158 "phase": "draft",
1159 "removed": [],
1160 "rev": 3,
1161 "tags": [],
1162 "user": "person"
1162 },
1163 },
1163 {
1164 {
1164 "rev": 2,
1165 "added": ["c"],
1165 "node": "97054abb4ab824450e9164180baf491ae0078465",
1166 "bookmarks": [],
1166 "branch": "default",
1167 "branch": "default",
1167 "phase": "draft",
1168 "user": "other@place",
1169 "date": [1200000, 0],
1168 "date": [1200000, 0],
1170 "desc": "no person",
1169 "desc": "no person",
1171 "bookmarks": [],
1170 "extra": {"branch": "default"},
1172 "tags": [],
1173 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
1174 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
1171 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
1175 "extra": {"branch": "default"},
1176 "modified": [],
1172 "modified": [],
1177 "added": ["c"],
1173 "node": "97054abb4ab824450e9164180baf491ae0078465",
1178 "removed": []
1174 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
1175 "phase": "draft",
1176 "removed": [],
1177 "rev": 2,
1178 "tags": [],
1179 "user": "other@place"
1179 },
1180 },
1180 {
1181 {
1181 "rev": 1,
1182 "added": ["b"],
1182 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
1183 "bookmarks": [],
1183 "branch": "default",
1184 "branch": "default",
1184 "phase": "draft",
1185 "user": "A. N. Other <other@place>",
1186 "date": [1100000, 0],
1185 "date": [1100000, 0],
1187 "desc": "other 1\nother 2\n\nother 3",
1186 "desc": "other 1\nother 2\n\nother 3",
1188 "bookmarks": [],
1187 "extra": {"branch": "default"},
1189 "tags": [],
1190 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
1191 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
1188 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
1192 "extra": {"branch": "default"},
1193 "modified": [],
1189 "modified": [],
1194 "added": ["b"],
1190 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
1195 "removed": []
1191 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
1192 "phase": "draft",
1193 "removed": [],
1194 "rev": 1,
1195 "tags": [],
1196 "user": "A. N. Other <other@place>"
1196 },
1197 },
1197 {
1198 {
1198 "rev": 0,
1199 "added": ["a"],
1199 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1200 "bookmarks": [],
1200 "branch": "default",
1201 "branch": "default",
1201 "phase": "draft",
1202 "user": "User Name <user@hostname>",
1203 "date": [1000000, 0],
1202 "date": [1000000, 0],
1204 "desc": "line 1\nline 2",
1203 "desc": "line 1\nline 2",
1205 "bookmarks": [],
1204 "extra": {"branch": "default"},
1206 "tags": [],
1207 "parents": ["0000000000000000000000000000000000000000"],
1208 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
1205 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
1209 "extra": {"branch": "default"},
1210 "modified": [],
1206 "modified": [],
1211 "added": ["a"],
1207 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1212 "removed": []
1208 "parents": ["0000000000000000000000000000000000000000"],
1209 "phase": "draft",
1210 "removed": [],
1211 "rev": 0,
1212 "tags": [],
1213 "user": "User Name <user@hostname>"
1213 }
1214 }
1214 ]
1215 ]
1215
1216
1216 Error if style not readable:
1217 Error if style not readable:
1217
1218
1218 #if unix-permissions no-root
1219 #if unix-permissions no-root
1219 $ touch q
1220 $ touch q
1220 $ chmod 0 q
1221 $ chmod 0 q
1221 $ hg log --style ./q
1222 $ hg log --style ./q
1222 abort: Permission denied: ./q
1223 abort: Permission denied: ./q
1223 [255]
1224 [255]
1224 #endif
1225 #endif
1225
1226
1226 Error if no style:
1227 Error if no style:
1227
1228
1228 $ hg log --style notexist
1229 $ hg log --style notexist
1229 abort: style 'notexist' not found
1230 abort: style 'notexist' not found
1230 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
1231 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
1231 [255]
1232 [255]
1232
1233
1233 $ hg log -T list
1234 $ hg log -T list
1234 available styles: bisect, changelog, compact, default, phases, show, status, xml
1235 available styles: bisect, changelog, compact, default, phases, show, status, xml
1235 abort: specify a template
1236 abort: specify a template
1236 [255]
1237 [255]
1237
1238
1238 Error if style missing key:
1239 Error if style missing key:
1239
1240
1240 $ echo 'q = q' > t
1241 $ echo 'q = q' > t
1241 $ hg log --style ./t
1242 $ hg log --style ./t
1242 abort: "changeset" not in template map
1243 abort: "changeset" not in template map
1243 [255]
1244 [255]
1244
1245
1245 Error if style missing value:
1246 Error if style missing value:
1246
1247
1247 $ echo 'changeset =' > t
1248 $ echo 'changeset =' > t
1248 $ hg log --style t
1249 $ hg log --style t
1249 hg: parse error at t:1: missing value
1250 hg: parse error at t:1: missing value
1250 [255]
1251 [255]
1251
1252
1252 Error if include fails:
1253 Error if include fails:
1253
1254
1254 $ echo 'changeset = q' >> t
1255 $ echo 'changeset = q' >> t
1255 #if unix-permissions no-root
1256 #if unix-permissions no-root
1256 $ hg log --style ./t
1257 $ hg log --style ./t
1257 abort: template file ./q: Permission denied
1258 abort: template file ./q: Permission denied
1258 [255]
1259 [255]
1259 $ rm -f q
1260 $ rm -f q
1260 #endif
1261 #endif
1261
1262
1262 Include works:
1263 Include works:
1263
1264
1264 $ echo '{rev}' > q
1265 $ echo '{rev}' > q
1265 $ hg log --style ./t
1266 $ hg log --style ./t
1266 8
1267 8
1267 7
1268 7
1268 6
1269 6
1269 5
1270 5
1270 4
1271 4
1271 3
1272 3
1272 2
1273 2
1273 1
1274 1
1274 0
1275 0
1275
1276
1276 Check that recursive reference does not fall into RuntimeError (issue4758):
1277 Check that recursive reference does not fall into RuntimeError (issue4758):
1277
1278
1278 common mistake:
1279 common mistake:
1279
1280
1280 $ cat << EOF > issue4758
1281 $ cat << EOF > issue4758
1281 > changeset = '{changeset}\n'
1282 > changeset = '{changeset}\n'
1282 > EOF
1283 > EOF
1283 $ hg log --style ./issue4758
1284 $ hg log --style ./issue4758
1284 abort: recursive reference 'changeset' in template
1285 abort: recursive reference 'changeset' in template
1285 [255]
1286 [255]
1286
1287
1287 circular reference:
1288 circular reference:
1288
1289
1289 $ cat << EOF > issue4758
1290 $ cat << EOF > issue4758
1290 > changeset = '{foo}'
1291 > changeset = '{foo}'
1291 > foo = '{changeset}'
1292 > foo = '{changeset}'
1292 > EOF
1293 > EOF
1293 $ hg log --style ./issue4758
1294 $ hg log --style ./issue4758
1294 abort: recursive reference 'foo' in template
1295 abort: recursive reference 'foo' in template
1295 [255]
1296 [255]
1296
1297
1297 buildmap() -> gettemplate(), where no thunk was made:
1298 buildmap() -> gettemplate(), where no thunk was made:
1298
1299
1299 $ cat << EOF > issue4758
1300 $ cat << EOF > issue4758
1300 > changeset = '{files % changeset}\n'
1301 > changeset = '{files % changeset}\n'
1301 > EOF
1302 > EOF
1302 $ hg log --style ./issue4758
1303 $ hg log --style ./issue4758
1303 abort: recursive reference 'changeset' in template
1304 abort: recursive reference 'changeset' in template
1304 [255]
1305 [255]
1305
1306
1306 not a recursion if a keyword of the same name exists:
1307 not a recursion if a keyword of the same name exists:
1307
1308
1308 $ cat << EOF > issue4758
1309 $ cat << EOF > issue4758
1309 > changeset = '{tags % rev}'
1310 > changeset = '{tags % rev}'
1310 > rev = '{rev} {tag}\n'
1311 > rev = '{rev} {tag}\n'
1311 > EOF
1312 > EOF
1312 $ hg log --style ./issue4758 -r tip
1313 $ hg log --style ./issue4758 -r tip
1313 8 tip
1314 8 tip
1314
1315
1315 Check that {phase} works correctly on parents:
1316 Check that {phase} works correctly on parents:
1316
1317
1317 $ cat << EOF > parentphase
1318 $ cat << EOF > parentphase
1318 > changeset_debug = '{rev} ({phase}):{parents}\n'
1319 > changeset_debug = '{rev} ({phase}):{parents}\n'
1319 > parent = ' {rev} ({phase})'
1320 > parent = ' {rev} ({phase})'
1320 > EOF
1321 > EOF
1321 $ hg phase -r 5 --public
1322 $ hg phase -r 5 --public
1322 $ hg phase -r 7 --secret --force
1323 $ hg phase -r 7 --secret --force
1323 $ hg log --debug -G --style ./parentphase
1324 $ hg log --debug -G --style ./parentphase
1324 @ 8 (secret): 7 (secret) -1 (public)
1325 @ 8 (secret): 7 (secret) -1 (public)
1325 |
1326 |
1326 o 7 (secret): -1 (public) -1 (public)
1327 o 7 (secret): -1 (public) -1 (public)
1327
1328
1328 o 6 (draft): 5 (public) 4 (draft)
1329 o 6 (draft): 5 (public) 4 (draft)
1329 |\
1330 |\
1330 | o 5 (public): 3 (public) -1 (public)
1331 | o 5 (public): 3 (public) -1 (public)
1331 | |
1332 | |
1332 o | 4 (draft): 3 (public) -1 (public)
1333 o | 4 (draft): 3 (public) -1 (public)
1333 |/
1334 |/
1334 o 3 (public): 2 (public) -1 (public)
1335 o 3 (public): 2 (public) -1 (public)
1335 |
1336 |
1336 o 2 (public): 1 (public) -1 (public)
1337 o 2 (public): 1 (public) -1 (public)
1337 |
1338 |
1338 o 1 (public): 0 (public) -1 (public)
1339 o 1 (public): 0 (public) -1 (public)
1339 |
1340 |
1340 o 0 (public): -1 (public) -1 (public)
1341 o 0 (public): -1 (public) -1 (public)
1341
1342
1342
1343
1343 Missing non-standard names give no error (backward compatibility):
1344 Missing non-standard names give no error (backward compatibility):
1344
1345
1345 $ echo "changeset = '{c}'" > t
1346 $ echo "changeset = '{c}'" > t
1346 $ hg log --style ./t
1347 $ hg log --style ./t
1347
1348
1348 Defining non-standard name works:
1349 Defining non-standard name works:
1349
1350
1350 $ cat <<EOF > t
1351 $ cat <<EOF > t
1351 > changeset = '{c}'
1352 > changeset = '{c}'
1352 > c = q
1353 > c = q
1353 > EOF
1354 > EOF
1354 $ hg log --style ./t
1355 $ hg log --style ./t
1355 8
1356 8
1356 7
1357 7
1357 6
1358 6
1358 5
1359 5
1359 4
1360 4
1360 3
1361 3
1361 2
1362 2
1362 1
1363 1
1363 0
1364 0
1364
1365
1365 ui.style works:
1366 ui.style works:
1366
1367
1367 $ echo '[ui]' > .hg/hgrc
1368 $ echo '[ui]' > .hg/hgrc
1368 $ echo 'style = t' >> .hg/hgrc
1369 $ echo 'style = t' >> .hg/hgrc
1369 $ hg log
1370 $ hg log
1370 8
1371 8
1371 7
1372 7
1372 6
1373 6
1373 5
1374 5
1374 4
1375 4
1375 3
1376 3
1376 2
1377 2
1377 1
1378 1
1378 0
1379 0
1379
1380
1380
1381
1381 Issue338:
1382 Issue338:
1382
1383
1383 $ hg log --style=changelog > changelog
1384 $ hg log --style=changelog > changelog
1384
1385
1385 $ cat changelog
1386 $ cat changelog
1386 2020-01-01 test <test>
1387 2020-01-01 test <test>
1387
1388
1388 * fourth, second, third:
1389 * fourth, second, third:
1389 third
1390 third
1390 [95c24699272e] [tip]
1391 [95c24699272e] [tip]
1391
1392
1392 1970-01-12 User Name <user@hostname>
1393 1970-01-12 User Name <user@hostname>
1393
1394
1394 * second:
1395 * second:
1395 second
1396 second
1396 [29114dbae42b]
1397 [29114dbae42b]
1397
1398
1398 1970-01-18 person <person>
1399 1970-01-18 person <person>
1399
1400
1400 * merge
1401 * merge
1401 [d41e714fe50d]
1402 [d41e714fe50d]
1402
1403
1403 * d:
1404 * d:
1404 new head
1405 new head
1405 [13207e5a10d9]
1406 [13207e5a10d9]
1406
1407
1407 1970-01-17 person <person>
1408 1970-01-17 person <person>
1408
1409
1409 * new branch
1410 * new branch
1410 [bbe44766e73d] <foo>
1411 [bbe44766e73d] <foo>
1411
1412
1412 1970-01-16 person <person>
1413 1970-01-16 person <person>
1413
1414
1414 * c:
1415 * c:
1415 no user, no domain
1416 no user, no domain
1416 [10e46f2dcbf4]
1417 [10e46f2dcbf4]
1417
1418
1418 1970-01-14 other <other@place>
1419 1970-01-14 other <other@place>
1419
1420
1420 * c:
1421 * c:
1421 no person
1422 no person
1422 [97054abb4ab8]
1423 [97054abb4ab8]
1423
1424
1424 1970-01-13 A. N. Other <other@place>
1425 1970-01-13 A. N. Other <other@place>
1425
1426
1426 * b:
1427 * b:
1427 other 1 other 2
1428 other 1 other 2
1428
1429
1429 other 3
1430 other 3
1430 [b608e9d1a3f0]
1431 [b608e9d1a3f0]
1431
1432
1432 1970-01-12 User Name <user@hostname>
1433 1970-01-12 User Name <user@hostname>
1433
1434
1434 * a:
1435 * a:
1435 line 1 line 2
1436 line 1 line 2
1436 [1e4e1b8f71e0]
1437 [1e4e1b8f71e0]
1437
1438
1438
1439
1439 Issue2130: xml output for 'hg heads' is malformed
1440 Issue2130: xml output for 'hg heads' is malformed
1440
1441
1441 $ hg heads --style changelog
1442 $ hg heads --style changelog
1442 2020-01-01 test <test>
1443 2020-01-01 test <test>
1443
1444
1444 * fourth, second, third:
1445 * fourth, second, third:
1445 third
1446 third
1446 [95c24699272e] [tip]
1447 [95c24699272e] [tip]
1447
1448
1448 1970-01-18 person <person>
1449 1970-01-18 person <person>
1449
1450
1450 * merge
1451 * merge
1451 [d41e714fe50d]
1452 [d41e714fe50d]
1452
1453
1453 1970-01-17 person <person>
1454 1970-01-17 person <person>
1454
1455
1455 * new branch
1456 * new branch
1456 [bbe44766e73d] <foo>
1457 [bbe44766e73d] <foo>
1457
1458
1458
1459
1459 Keys work:
1460 Keys work:
1460
1461
1461 $ 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 \
1462 > file_copies file_copies_switch files \
1463 > file_copies file_copies_switch files \
1463 > manifest node parents rev tags diffstat extras \
1464 > manifest node parents rev tags diffstat extras \
1464 > p1rev p2rev p1node p2node; do
1465 > p1rev p2rev p1node p2node; do
1465 > for mode in '' --verbose --debug; do
1466 > for mode in '' --verbose --debug; do
1466 > hg log $mode --template "$key$mode: {$key}\n"
1467 > hg log $mode --template "$key$mode: {$key}\n"
1467 > done
1468 > done
1468 > done
1469 > done
1469 author: test
1470 author: test
1470 author: User Name <user@hostname>
1471 author: User Name <user@hostname>
1471 author: person
1472 author: person
1472 author: person
1473 author: person
1473 author: person
1474 author: person
1474 author: person
1475 author: person
1475 author: other@place
1476 author: other@place
1476 author: A. N. Other <other@place>
1477 author: A. N. Other <other@place>
1477 author: User Name <user@hostname>
1478 author: User Name <user@hostname>
1478 author--verbose: test
1479 author--verbose: test
1479 author--verbose: User Name <user@hostname>
1480 author--verbose: User Name <user@hostname>
1480 author--verbose: person
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: other@place
1485 author--verbose: other@place
1485 author--verbose: A. N. Other <other@place>
1486 author--verbose: A. N. Other <other@place>
1486 author--verbose: User Name <user@hostname>
1487 author--verbose: User Name <user@hostname>
1487 author--debug: test
1488 author--debug: test
1488 author--debug: User Name <user@hostname>
1489 author--debug: User Name <user@hostname>
1489 author--debug: person
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: other@place
1494 author--debug: other@place
1494 author--debug: A. N. Other <other@place>
1495 author--debug: A. N. Other <other@place>
1495 author--debug: User Name <user@hostname>
1496 author--debug: User Name <user@hostname>
1496 branch: default
1497 branch: default
1497 branch: default
1498 branch: default
1498 branch: default
1499 branch: default
1499 branch: default
1500 branch: default
1500 branch: foo
1501 branch: foo
1501 branch: default
1502 branch: default
1502 branch: default
1503 branch: default
1503 branch: default
1504 branch: default
1504 branch: default
1505 branch: default
1505 branch--verbose: 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: foo
1510 branch--verbose: foo
1510 branch--verbose: default
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--debug: 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: foo
1519 branch--debug: foo
1519 branch--debug: default
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 branches:
1524 branches:
1524 branches:
1525 branches:
1525 branches:
1526 branches:
1526 branches:
1527 branches:
1527 branches: foo
1528 branches: foo
1528 branches:
1529 branches:
1529 branches:
1530 branches:
1530 branches:
1531 branches:
1531 branches:
1532 branches:
1532 branches--verbose:
1533 branches--verbose:
1533 branches--verbose:
1534 branches--verbose:
1534 branches--verbose:
1535 branches--verbose:
1535 branches--verbose:
1536 branches--verbose:
1536 branches--verbose: foo
1537 branches--verbose: foo
1537 branches--verbose:
1538 branches--verbose:
1538 branches--verbose:
1539 branches--verbose:
1539 branches--verbose:
1540 branches--verbose:
1540 branches--verbose:
1541 branches--verbose:
1541 branches--debug:
1542 branches--debug:
1542 branches--debug:
1543 branches--debug:
1543 branches--debug:
1544 branches--debug:
1544 branches--debug:
1545 branches--debug:
1545 branches--debug: foo
1546 branches--debug: foo
1546 branches--debug:
1547 branches--debug:
1547 branches--debug:
1548 branches--debug:
1548 branches--debug:
1549 branches--debug:
1549 branches--debug:
1550 branches--debug:
1550 date: 1577872860.00
1551 date: 1577872860.00
1551 date: 1000000.00
1552 date: 1000000.00
1552 date: 1500001.00
1553 date: 1500001.00
1553 date: 1500000.00
1554 date: 1500000.00
1554 date: 1400000.00
1555 date: 1400000.00
1555 date: 1300000.00
1556 date: 1300000.00
1556 date: 1200000.00
1557 date: 1200000.00
1557 date: 1100000.00
1558 date: 1100000.00
1558 date: 1000000.00
1559 date: 1000000.00
1559 date--verbose: 1577872860.00
1560 date--verbose: 1577872860.00
1560 date--verbose: 1000000.00
1561 date--verbose: 1000000.00
1561 date--verbose: 1500001.00
1562 date--verbose: 1500001.00
1562 date--verbose: 1500000.00
1563 date--verbose: 1500000.00
1563 date--verbose: 1400000.00
1564 date--verbose: 1400000.00
1564 date--verbose: 1300000.00
1565 date--verbose: 1300000.00
1565 date--verbose: 1200000.00
1566 date--verbose: 1200000.00
1566 date--verbose: 1100000.00
1567 date--verbose: 1100000.00
1567 date--verbose: 1000000.00
1568 date--verbose: 1000000.00
1568 date--debug: 1577872860.00
1569 date--debug: 1577872860.00
1569 date--debug: 1000000.00
1570 date--debug: 1000000.00
1570 date--debug: 1500001.00
1571 date--debug: 1500001.00
1571 date--debug: 1500000.00
1572 date--debug: 1500000.00
1572 date--debug: 1400000.00
1573 date--debug: 1400000.00
1573 date--debug: 1300000.00
1574 date--debug: 1300000.00
1574 date--debug: 1200000.00
1575 date--debug: 1200000.00
1575 date--debug: 1100000.00
1576 date--debug: 1100000.00
1576 date--debug: 1000000.00
1577 date--debug: 1000000.00
1577 desc: third
1578 desc: third
1578 desc: second
1579 desc: second
1579 desc: merge
1580 desc: merge
1580 desc: new head
1581 desc: new head
1581 desc: new branch
1582 desc: new branch
1582 desc: no user, no domain
1583 desc: no user, no domain
1583 desc: no person
1584 desc: no person
1584 desc: other 1
1585 desc: other 1
1585 other 2
1586 other 2
1586
1587
1587 other 3
1588 other 3
1588 desc: line 1
1589 desc: line 1
1589 line 2
1590 line 2
1590 desc--verbose: third
1591 desc--verbose: third
1591 desc--verbose: second
1592 desc--verbose: second
1592 desc--verbose: merge
1593 desc--verbose: merge
1593 desc--verbose: new head
1594 desc--verbose: new head
1594 desc--verbose: new branch
1595 desc--verbose: new branch
1595 desc--verbose: no user, no domain
1596 desc--verbose: no user, no domain
1596 desc--verbose: no person
1597 desc--verbose: no person
1597 desc--verbose: other 1
1598 desc--verbose: other 1
1598 other 2
1599 other 2
1599
1600
1600 other 3
1601 other 3
1601 desc--verbose: line 1
1602 desc--verbose: line 1
1602 line 2
1603 line 2
1603 desc--debug: third
1604 desc--debug: third
1604 desc--debug: second
1605 desc--debug: second
1605 desc--debug: merge
1606 desc--debug: merge
1606 desc--debug: new head
1607 desc--debug: new head
1607 desc--debug: new branch
1608 desc--debug: new branch
1608 desc--debug: no user, no domain
1609 desc--debug: no user, no domain
1609 desc--debug: no person
1610 desc--debug: no person
1610 desc--debug: other 1
1611 desc--debug: other 1
1611 other 2
1612 other 2
1612
1613
1613 other 3
1614 other 3
1614 desc--debug: line 1
1615 desc--debug: line 1
1615 line 2
1616 line 2
1616 file_adds: fourth third
1617 file_adds: fourth third
1617 file_adds: second
1618 file_adds: second
1618 file_adds:
1619 file_adds:
1619 file_adds: d
1620 file_adds: d
1620 file_adds:
1621 file_adds:
1621 file_adds:
1622 file_adds:
1622 file_adds: c
1623 file_adds: c
1623 file_adds: b
1624 file_adds: b
1624 file_adds: a
1625 file_adds: a
1625 file_adds--verbose: fourth third
1626 file_adds--verbose: fourth third
1626 file_adds--verbose: second
1627 file_adds--verbose: second
1627 file_adds--verbose:
1628 file_adds--verbose:
1628 file_adds--verbose: d
1629 file_adds--verbose: d
1629 file_adds--verbose:
1630 file_adds--verbose:
1630 file_adds--verbose:
1631 file_adds--verbose:
1631 file_adds--verbose: c
1632 file_adds--verbose: c
1632 file_adds--verbose: b
1633 file_adds--verbose: b
1633 file_adds--verbose: a
1634 file_adds--verbose: a
1634 file_adds--debug: fourth third
1635 file_adds--debug: fourth third
1635 file_adds--debug: second
1636 file_adds--debug: second
1636 file_adds--debug:
1637 file_adds--debug:
1637 file_adds--debug: d
1638 file_adds--debug: d
1638 file_adds--debug:
1639 file_adds--debug:
1639 file_adds--debug:
1640 file_adds--debug:
1640 file_adds--debug: c
1641 file_adds--debug: c
1641 file_adds--debug: b
1642 file_adds--debug: b
1642 file_adds--debug: a
1643 file_adds--debug: a
1643 file_dels: second
1644 file_dels: second
1644 file_dels:
1645 file_dels:
1645 file_dels:
1646 file_dels:
1646 file_dels:
1647 file_dels:
1647 file_dels:
1648 file_dels:
1648 file_dels:
1649 file_dels:
1649 file_dels:
1650 file_dels:
1650 file_dels:
1651 file_dels:
1651 file_dels:
1652 file_dels:
1652 file_dels--verbose: second
1653 file_dels--verbose: second
1653 file_dels--verbose:
1654 file_dels--verbose:
1654 file_dels--verbose:
1655 file_dels--verbose:
1655 file_dels--verbose:
1656 file_dels--verbose:
1656 file_dels--verbose:
1657 file_dels--verbose:
1657 file_dels--verbose:
1658 file_dels--verbose:
1658 file_dels--verbose:
1659 file_dels--verbose:
1659 file_dels--verbose:
1660 file_dels--verbose:
1660 file_dels--verbose:
1661 file_dels--verbose:
1661 file_dels--debug: second
1662 file_dels--debug: second
1662 file_dels--debug:
1663 file_dels--debug:
1663 file_dels--debug:
1664 file_dels--debug:
1664 file_dels--debug:
1665 file_dels--debug:
1665 file_dels--debug:
1666 file_dels--debug:
1666 file_dels--debug:
1667 file_dels--debug:
1667 file_dels--debug:
1668 file_dels--debug:
1668 file_dels--debug:
1669 file_dels--debug:
1669 file_dels--debug:
1670 file_dels--debug:
1670 file_mods:
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: c
1676 file_mods: c
1676 file_mods:
1677 file_mods:
1677 file_mods:
1678 file_mods:
1678 file_mods:
1679 file_mods:
1679 file_mods--verbose:
1680 file_mods--verbose:
1680 file_mods--verbose:
1681 file_mods--verbose:
1681 file_mods--verbose:
1682 file_mods--verbose:
1682 file_mods--verbose:
1683 file_mods--verbose:
1683 file_mods--verbose:
1684 file_mods--verbose:
1684 file_mods--verbose: c
1685 file_mods--verbose: c
1685 file_mods--verbose:
1686 file_mods--verbose:
1686 file_mods--verbose:
1687 file_mods--verbose:
1687 file_mods--verbose:
1688 file_mods--verbose:
1688 file_mods--debug:
1689 file_mods--debug:
1689 file_mods--debug:
1690 file_mods--debug:
1690 file_mods--debug:
1691 file_mods--debug:
1691 file_mods--debug:
1692 file_mods--debug:
1692 file_mods--debug:
1693 file_mods--debug:
1693 file_mods--debug: c
1694 file_mods--debug: c
1694 file_mods--debug:
1695 file_mods--debug:
1695 file_mods--debug:
1696 file_mods--debug:
1696 file_mods--debug:
1697 file_mods--debug:
1697 file_copies: fourth (second)
1698 file_copies: fourth (second)
1698 file_copies:
1699 file_copies:
1699 file_copies:
1700 file_copies:
1700 file_copies:
1701 file_copies:
1701 file_copies:
1702 file_copies:
1702 file_copies:
1703 file_copies:
1703 file_copies:
1704 file_copies:
1704 file_copies:
1705 file_copies:
1705 file_copies:
1706 file_copies:
1706 file_copies--verbose: fourth (second)
1707 file_copies--verbose: fourth (second)
1707 file_copies--verbose:
1708 file_copies--verbose:
1708 file_copies--verbose:
1709 file_copies--verbose:
1709 file_copies--verbose:
1710 file_copies--verbose:
1710 file_copies--verbose:
1711 file_copies--verbose:
1711 file_copies--verbose:
1712 file_copies--verbose:
1712 file_copies--verbose:
1713 file_copies--verbose:
1713 file_copies--verbose:
1714 file_copies--verbose:
1714 file_copies--verbose:
1715 file_copies--verbose:
1715 file_copies--debug: fourth (second)
1716 file_copies--debug: fourth (second)
1716 file_copies--debug:
1717 file_copies--debug:
1717 file_copies--debug:
1718 file_copies--debug:
1718 file_copies--debug:
1719 file_copies--debug:
1719 file_copies--debug:
1720 file_copies--debug:
1720 file_copies--debug:
1721 file_copies--debug:
1721 file_copies--debug:
1722 file_copies--debug:
1722 file_copies--debug:
1723 file_copies--debug:
1723 file_copies--debug:
1724 file_copies--debug:
1724 file_copies_switch:
1725 file_copies_switch:
1725 file_copies_switch:
1726 file_copies_switch:
1726 file_copies_switch:
1727 file_copies_switch:
1727 file_copies_switch:
1728 file_copies_switch:
1728 file_copies_switch:
1729 file_copies_switch:
1729 file_copies_switch:
1730 file_copies_switch:
1730 file_copies_switch:
1731 file_copies_switch:
1731 file_copies_switch:
1732 file_copies_switch:
1732 file_copies_switch:
1733 file_copies_switch:
1733 file_copies_switch--verbose:
1734 file_copies_switch--verbose:
1734 file_copies_switch--verbose:
1735 file_copies_switch--verbose:
1735 file_copies_switch--verbose:
1736 file_copies_switch--verbose:
1736 file_copies_switch--verbose:
1737 file_copies_switch--verbose:
1737 file_copies_switch--verbose:
1738 file_copies_switch--verbose:
1738 file_copies_switch--verbose:
1739 file_copies_switch--verbose:
1739 file_copies_switch--verbose:
1740 file_copies_switch--verbose:
1740 file_copies_switch--verbose:
1741 file_copies_switch--verbose:
1741 file_copies_switch--verbose:
1742 file_copies_switch--verbose:
1742 file_copies_switch--debug:
1743 file_copies_switch--debug:
1743 file_copies_switch--debug:
1744 file_copies_switch--debug:
1744 file_copies_switch--debug:
1745 file_copies_switch--debug:
1745 file_copies_switch--debug:
1746 file_copies_switch--debug:
1746 file_copies_switch--debug:
1747 file_copies_switch--debug:
1747 file_copies_switch--debug:
1748 file_copies_switch--debug:
1748 file_copies_switch--debug:
1749 file_copies_switch--debug:
1749 file_copies_switch--debug:
1750 file_copies_switch--debug:
1750 file_copies_switch--debug:
1751 file_copies_switch--debug:
1751 files: fourth second third
1752 files: fourth second third
1752 files: second
1753 files: second
1753 files:
1754 files:
1754 files: d
1755 files: d
1755 files:
1756 files:
1756 files: c
1757 files: c
1757 files: c
1758 files: c
1758 files: b
1759 files: b
1759 files: a
1760 files: a
1760 files--verbose: fourth second third
1761 files--verbose: fourth second third
1761 files--verbose: second
1762 files--verbose: second
1762 files--verbose:
1763 files--verbose:
1763 files--verbose: d
1764 files--verbose: d
1764 files--verbose:
1765 files--verbose:
1765 files--verbose: c
1766 files--verbose: c
1766 files--verbose: c
1767 files--verbose: c
1767 files--verbose: b
1768 files--verbose: b
1768 files--verbose: a
1769 files--verbose: a
1769 files--debug: fourth second third
1770 files--debug: fourth second third
1770 files--debug: second
1771 files--debug: second
1771 files--debug:
1772 files--debug:
1772 files--debug: d
1773 files--debug: d
1773 files--debug:
1774 files--debug:
1774 files--debug: c
1775 files--debug: c
1775 files--debug: c
1776 files--debug: c
1776 files--debug: b
1777 files--debug: b
1777 files--debug: a
1778 files--debug: a
1778 manifest: 6:94961b75a2da
1779 manifest: 6:94961b75a2da
1779 manifest: 5:f2dbc354b94e
1780 manifest: 5:f2dbc354b94e
1780 manifest: 4:4dc3def4f9b4
1781 manifest: 4:4dc3def4f9b4
1781 manifest: 4:4dc3def4f9b4
1782 manifest: 4:4dc3def4f9b4
1782 manifest: 3:cb5a1327723b
1783 manifest: 3:cb5a1327723b
1783 manifest: 3:cb5a1327723b
1784 manifest: 3:cb5a1327723b
1784 manifest: 2:6e0e82995c35
1785 manifest: 2:6e0e82995c35
1785 manifest: 1:4e8d705b1e53
1786 manifest: 1:4e8d705b1e53
1786 manifest: 0:a0c8bcbbb45c
1787 manifest: 0:a0c8bcbbb45c
1787 manifest--verbose: 6:94961b75a2da
1788 manifest--verbose: 6:94961b75a2da
1788 manifest--verbose: 5:f2dbc354b94e
1789 manifest--verbose: 5:f2dbc354b94e
1789 manifest--verbose: 4:4dc3def4f9b4
1790 manifest--verbose: 4:4dc3def4f9b4
1790 manifest--verbose: 4:4dc3def4f9b4
1791 manifest--verbose: 4:4dc3def4f9b4
1791 manifest--verbose: 3:cb5a1327723b
1792 manifest--verbose: 3:cb5a1327723b
1792 manifest--verbose: 3:cb5a1327723b
1793 manifest--verbose: 3:cb5a1327723b
1793 manifest--verbose: 2:6e0e82995c35
1794 manifest--verbose: 2:6e0e82995c35
1794 manifest--verbose: 1:4e8d705b1e53
1795 manifest--verbose: 1:4e8d705b1e53
1795 manifest--verbose: 0:a0c8bcbbb45c
1796 manifest--verbose: 0:a0c8bcbbb45c
1796 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
1797 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
1797 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
1798 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
1798 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1799 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1799 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1800 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1800 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1801 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1801 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1802 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1802 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1803 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1803 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1804 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1804 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1805 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1805 node: 95c24699272ef57d062b8bccc32c878bf841784a
1806 node: 95c24699272ef57d062b8bccc32c878bf841784a
1806 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1807 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1807 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1808 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1808 node: 13207e5a10d9fd28ec424934298e176197f2c67f
1809 node: 13207e5a10d9fd28ec424934298e176197f2c67f
1809 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1810 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1810 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1811 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1811 node: 97054abb4ab824450e9164180baf491ae0078465
1812 node: 97054abb4ab824450e9164180baf491ae0078465
1812 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1813 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1813 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1814 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1814 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
1815 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
1815 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1816 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1816 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1817 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1817 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1818 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1818 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1819 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1819 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1820 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1820 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1821 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1821 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1822 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1822 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1823 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1823 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
1824 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
1824 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1825 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1825 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1826 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1826 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1827 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1827 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1828 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1828 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1829 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1829 node--debug: 97054abb4ab824450e9164180baf491ae0078465
1830 node--debug: 97054abb4ab824450e9164180baf491ae0078465
1830 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1831 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1831 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1832 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1832 parents:
1833 parents:
1833 parents: -1:000000000000
1834 parents: -1:000000000000
1834 parents: 5:13207e5a10d9 4:bbe44766e73d
1835 parents: 5:13207e5a10d9 4:bbe44766e73d
1835 parents: 3:10e46f2dcbf4
1836 parents: 3:10e46f2dcbf4
1836 parents:
1837 parents:
1837 parents:
1838 parents:
1838 parents:
1839 parents:
1839 parents:
1840 parents:
1840 parents:
1841 parents:
1841 parents--verbose:
1842 parents--verbose:
1842 parents--verbose: -1:000000000000
1843 parents--verbose: -1:000000000000
1843 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
1844 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
1844 parents--verbose: 3:10e46f2dcbf4
1845 parents--verbose: 3:10e46f2dcbf4
1845 parents--verbose:
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--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
1851 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
1851 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1852 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1852 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1853 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1853 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1854 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1854 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1855 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1855 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
1856 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
1856 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
1857 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
1857 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
1858 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
1858 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1859 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1859 rev: 8
1860 rev: 8
1860 rev: 7
1861 rev: 7
1861 rev: 6
1862 rev: 6
1862 rev: 5
1863 rev: 5
1863 rev: 4
1864 rev: 4
1864 rev: 3
1865 rev: 3
1865 rev: 2
1866 rev: 2
1866 rev: 1
1867 rev: 1
1867 rev: 0
1868 rev: 0
1868 rev--verbose: 8
1869 rev--verbose: 8
1869 rev--verbose: 7
1870 rev--verbose: 7
1870 rev--verbose: 6
1871 rev--verbose: 6
1871 rev--verbose: 5
1872 rev--verbose: 5
1872 rev--verbose: 4
1873 rev--verbose: 4
1873 rev--verbose: 3
1874 rev--verbose: 3
1874 rev--verbose: 2
1875 rev--verbose: 2
1875 rev--verbose: 1
1876 rev--verbose: 1
1876 rev--verbose: 0
1877 rev--verbose: 0
1877 rev--debug: 8
1878 rev--debug: 8
1878 rev--debug: 7
1879 rev--debug: 7
1879 rev--debug: 6
1880 rev--debug: 6
1880 rev--debug: 5
1881 rev--debug: 5
1881 rev--debug: 4
1882 rev--debug: 4
1882 rev--debug: 3
1883 rev--debug: 3
1883 rev--debug: 2
1884 rev--debug: 2
1884 rev--debug: 1
1885 rev--debug: 1
1885 rev--debug: 0
1886 rev--debug: 0
1886 tags: tip
1887 tags: tip
1887 tags:
1888 tags:
1888 tags:
1889 tags:
1889 tags:
1890 tags:
1890 tags:
1891 tags:
1891 tags:
1892 tags:
1892 tags:
1893 tags:
1893 tags:
1894 tags:
1894 tags:
1895 tags:
1895 tags--verbose: tip
1896 tags--verbose: tip
1896 tags--verbose:
1897 tags--verbose:
1897 tags--verbose:
1898 tags--verbose:
1898 tags--verbose:
1899 tags--verbose:
1899 tags--verbose:
1900 tags--verbose:
1900 tags--verbose:
1901 tags--verbose:
1901 tags--verbose:
1902 tags--verbose:
1902 tags--verbose:
1903 tags--verbose:
1903 tags--verbose:
1904 tags--verbose:
1904 tags--debug: tip
1905 tags--debug: tip
1905 tags--debug:
1906 tags--debug:
1906 tags--debug:
1907 tags--debug:
1907 tags--debug:
1908 tags--debug:
1908 tags--debug:
1909 tags--debug:
1909 tags--debug:
1910 tags--debug:
1910 tags--debug:
1911 tags--debug:
1911 tags--debug:
1912 tags--debug:
1912 tags--debug:
1913 tags--debug:
1913 diffstat: 3: +2/-1
1914 diffstat: 3: +2/-1
1914 diffstat: 1: +1/-0
1915 diffstat: 1: +1/-0
1915 diffstat: 0: +0/-0
1916 diffstat: 0: +0/-0
1916 diffstat: 1: +1/-0
1917 diffstat: 1: +1/-0
1917 diffstat: 0: +0/-0
1918 diffstat: 0: +0/-0
1918 diffstat: 1: +1/-0
1919 diffstat: 1: +1/-0
1919 diffstat: 1: +4/-0
1920 diffstat: 1: +4/-0
1920 diffstat: 1: +2/-0
1921 diffstat: 1: +2/-0
1921 diffstat: 1: +1/-0
1922 diffstat: 1: +1/-0
1922 diffstat--verbose: 3: +2/-1
1923 diffstat--verbose: 3: +2/-1
1923 diffstat--verbose: 1: +1/-0
1924 diffstat--verbose: 1: +1/-0
1924 diffstat--verbose: 0: +0/-0
1925 diffstat--verbose: 0: +0/-0
1925 diffstat--verbose: 1: +1/-0
1926 diffstat--verbose: 1: +1/-0
1926 diffstat--verbose: 0: +0/-0
1927 diffstat--verbose: 0: +0/-0
1927 diffstat--verbose: 1: +1/-0
1928 diffstat--verbose: 1: +1/-0
1928 diffstat--verbose: 1: +4/-0
1929 diffstat--verbose: 1: +4/-0
1929 diffstat--verbose: 1: +2/-0
1930 diffstat--verbose: 1: +2/-0
1930 diffstat--verbose: 1: +1/-0
1931 diffstat--verbose: 1: +1/-0
1931 diffstat--debug: 3: +2/-1
1932 diffstat--debug: 3: +2/-1
1932 diffstat--debug: 1: +1/-0
1933 diffstat--debug: 1: +1/-0
1933 diffstat--debug: 0: +0/-0
1934 diffstat--debug: 0: +0/-0
1934 diffstat--debug: 1: +1/-0
1935 diffstat--debug: 1: +1/-0
1935 diffstat--debug: 0: +0/-0
1936 diffstat--debug: 0: +0/-0
1936 diffstat--debug: 1: +1/-0
1937 diffstat--debug: 1: +1/-0
1937 diffstat--debug: 1: +4/-0
1938 diffstat--debug: 1: +4/-0
1938 diffstat--debug: 1: +2/-0
1939 diffstat--debug: 1: +2/-0
1939 diffstat--debug: 1: +1/-0
1940 diffstat--debug: 1: +1/-0
1940 extras: branch=default
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=foo
1945 extras: branch=foo
1945 extras: branch=default
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--verbose: branch=default
1950 extras--verbose: branch=default
1950 extras--verbose: branch=default
1951 extras--verbose: branch=default
1951 extras--verbose: branch=default
1952 extras--verbose: branch=default
1952 extras--verbose: branch=default
1953 extras--verbose: branch=default
1953 extras--verbose: branch=foo
1954 extras--verbose: branch=foo
1954 extras--verbose: branch=default
1955 extras--verbose: branch=default
1955 extras--verbose: branch=default
1956 extras--verbose: branch=default
1956 extras--verbose: branch=default
1957 extras--verbose: branch=default
1957 extras--verbose: branch=default
1958 extras--verbose: branch=default
1958 extras--debug: branch=default
1959 extras--debug: branch=default
1959 extras--debug: branch=default
1960 extras--debug: branch=default
1960 extras--debug: branch=default
1961 extras--debug: branch=default
1961 extras--debug: branch=default
1962 extras--debug: branch=default
1962 extras--debug: branch=foo
1963 extras--debug: branch=foo
1963 extras--debug: branch=default
1964 extras--debug: branch=default
1964 extras--debug: branch=default
1965 extras--debug: branch=default
1965 extras--debug: branch=default
1966 extras--debug: branch=default
1966 extras--debug: branch=default
1967 extras--debug: branch=default
1967 p1rev: 7
1968 p1rev: 7
1968 p1rev: -1
1969 p1rev: -1
1969 p1rev: 5
1970 p1rev: 5
1970 p1rev: 3
1971 p1rev: 3
1971 p1rev: 3
1972 p1rev: 3
1972 p1rev: 2
1973 p1rev: 2
1973 p1rev: 1
1974 p1rev: 1
1974 p1rev: 0
1975 p1rev: 0
1975 p1rev: -1
1976 p1rev: -1
1976 p1rev--verbose: 7
1977 p1rev--verbose: 7
1977 p1rev--verbose: -1
1978 p1rev--verbose: -1
1978 p1rev--verbose: 5
1979 p1rev--verbose: 5
1979 p1rev--verbose: 3
1980 p1rev--verbose: 3
1980 p1rev--verbose: 3
1981 p1rev--verbose: 3
1981 p1rev--verbose: 2
1982 p1rev--verbose: 2
1982 p1rev--verbose: 1
1983 p1rev--verbose: 1
1983 p1rev--verbose: 0
1984 p1rev--verbose: 0
1984 p1rev--verbose: -1
1985 p1rev--verbose: -1
1985 p1rev--debug: 7
1986 p1rev--debug: 7
1986 p1rev--debug: -1
1987 p1rev--debug: -1
1987 p1rev--debug: 5
1988 p1rev--debug: 5
1988 p1rev--debug: 3
1989 p1rev--debug: 3
1989 p1rev--debug: 3
1990 p1rev--debug: 3
1990 p1rev--debug: 2
1991 p1rev--debug: 2
1991 p1rev--debug: 1
1992 p1rev--debug: 1
1992 p1rev--debug: 0
1993 p1rev--debug: 0
1993 p1rev--debug: -1
1994 p1rev--debug: -1
1994 p2rev: -1
1995 p2rev: -1
1995 p2rev: -1
1996 p2rev: -1
1996 p2rev: 4
1997 p2rev: 4
1997 p2rev: -1
1998 p2rev: -1
1998 p2rev: -1
1999 p2rev: -1
1999 p2rev: -1
2000 p2rev: -1
2000 p2rev: -1
2001 p2rev: -1
2001 p2rev: -1
2002 p2rev: -1
2002 p2rev: -1
2003 p2rev: -1
2003 p2rev--verbose: -1
2004 p2rev--verbose: -1
2004 p2rev--verbose: -1
2005 p2rev--verbose: -1
2005 p2rev--verbose: 4
2006 p2rev--verbose: 4
2006 p2rev--verbose: -1
2007 p2rev--verbose: -1
2007 p2rev--verbose: -1
2008 p2rev--verbose: -1
2008 p2rev--verbose: -1
2009 p2rev--verbose: -1
2009 p2rev--verbose: -1
2010 p2rev--verbose: -1
2010 p2rev--verbose: -1
2011 p2rev--verbose: -1
2011 p2rev--verbose: -1
2012 p2rev--verbose: -1
2012 p2rev--debug: -1
2013 p2rev--debug: -1
2013 p2rev--debug: -1
2014 p2rev--debug: -1
2014 p2rev--debug: 4
2015 p2rev--debug: 4
2015 p2rev--debug: -1
2016 p2rev--debug: -1
2016 p2rev--debug: -1
2017 p2rev--debug: -1
2017 p2rev--debug: -1
2018 p2rev--debug: -1
2018 p2rev--debug: -1
2019 p2rev--debug: -1
2019 p2rev--debug: -1
2020 p2rev--debug: -1
2020 p2rev--debug: -1
2021 p2rev--debug: -1
2021 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2022 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2022 p1node: 0000000000000000000000000000000000000000
2023 p1node: 0000000000000000000000000000000000000000
2023 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
2024 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
2024 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2025 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2025 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2026 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2026 p1node: 97054abb4ab824450e9164180baf491ae0078465
2027 p1node: 97054abb4ab824450e9164180baf491ae0078465
2027 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2028 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2028 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
2029 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
2029 p1node: 0000000000000000000000000000000000000000
2030 p1node: 0000000000000000000000000000000000000000
2030 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2031 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2031 p1node--verbose: 0000000000000000000000000000000000000000
2032 p1node--verbose: 0000000000000000000000000000000000000000
2032 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
2033 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
2033 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2034 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2034 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2035 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2035 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
2036 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
2036 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2037 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2037 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
2038 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
2038 p1node--verbose: 0000000000000000000000000000000000000000
2039 p1node--verbose: 0000000000000000000000000000000000000000
2039 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2040 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
2040 p1node--debug: 0000000000000000000000000000000000000000
2041 p1node--debug: 0000000000000000000000000000000000000000
2041 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
2042 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
2042 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2043 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2043 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2044 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
2044 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
2045 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
2045 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2046 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2046 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
2047 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
2047 p1node--debug: 0000000000000000000000000000000000000000
2048 p1node--debug: 0000000000000000000000000000000000000000
2048 p2node: 0000000000000000000000000000000000000000
2049 p2node: 0000000000000000000000000000000000000000
2049 p2node: 0000000000000000000000000000000000000000
2050 p2node: 0000000000000000000000000000000000000000
2050 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2051 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2051 p2node: 0000000000000000000000000000000000000000
2052 p2node: 0000000000000000000000000000000000000000
2052 p2node: 0000000000000000000000000000000000000000
2053 p2node: 0000000000000000000000000000000000000000
2053 p2node: 0000000000000000000000000000000000000000
2054 p2node: 0000000000000000000000000000000000000000
2054 p2node: 0000000000000000000000000000000000000000
2055 p2node: 0000000000000000000000000000000000000000
2055 p2node: 0000000000000000000000000000000000000000
2056 p2node: 0000000000000000000000000000000000000000
2056 p2node: 0000000000000000000000000000000000000000
2057 p2node: 0000000000000000000000000000000000000000
2057 p2node--verbose: 0000000000000000000000000000000000000000
2058 p2node--verbose: 0000000000000000000000000000000000000000
2058 p2node--verbose: 0000000000000000000000000000000000000000
2059 p2node--verbose: 0000000000000000000000000000000000000000
2059 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2060 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2060 p2node--verbose: 0000000000000000000000000000000000000000
2061 p2node--verbose: 0000000000000000000000000000000000000000
2061 p2node--verbose: 0000000000000000000000000000000000000000
2062 p2node--verbose: 0000000000000000000000000000000000000000
2062 p2node--verbose: 0000000000000000000000000000000000000000
2063 p2node--verbose: 0000000000000000000000000000000000000000
2063 p2node--verbose: 0000000000000000000000000000000000000000
2064 p2node--verbose: 0000000000000000000000000000000000000000
2064 p2node--verbose: 0000000000000000000000000000000000000000
2065 p2node--verbose: 0000000000000000000000000000000000000000
2065 p2node--verbose: 0000000000000000000000000000000000000000
2066 p2node--verbose: 0000000000000000000000000000000000000000
2066 p2node--debug: 0000000000000000000000000000000000000000
2067 p2node--debug: 0000000000000000000000000000000000000000
2067 p2node--debug: 0000000000000000000000000000000000000000
2068 p2node--debug: 0000000000000000000000000000000000000000
2068 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2069 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
2069 p2node--debug: 0000000000000000000000000000000000000000
2070 p2node--debug: 0000000000000000000000000000000000000000
2070 p2node--debug: 0000000000000000000000000000000000000000
2071 p2node--debug: 0000000000000000000000000000000000000000
2071 p2node--debug: 0000000000000000000000000000000000000000
2072 p2node--debug: 0000000000000000000000000000000000000000
2072 p2node--debug: 0000000000000000000000000000000000000000
2073 p2node--debug: 0000000000000000000000000000000000000000
2073 p2node--debug: 0000000000000000000000000000000000000000
2074 p2node--debug: 0000000000000000000000000000000000000000
2074 p2node--debug: 0000000000000000000000000000000000000000
2075 p2node--debug: 0000000000000000000000000000000000000000
2075
2076
2076 Filters work:
2077 Filters work:
2077
2078
2078 $ hg log --template '{author|domain}\n'
2079 $ hg log --template '{author|domain}\n'
2079
2080
2080 hostname
2081 hostname
2081
2082
2082
2083
2083
2084
2084
2085
2085 place
2086 place
2086 place
2087 place
2087 hostname
2088 hostname
2088
2089
2089 $ hg log --template '{author|person}\n'
2090 $ hg log --template '{author|person}\n'
2090 test
2091 test
2091 User Name
2092 User Name
2092 person
2093 person
2093 person
2094 person
2094 person
2095 person
2095 person
2096 person
2096 other
2097 other
2097 A. N. Other
2098 A. N. Other
2098 User Name
2099 User Name
2099
2100
2100 $ hg log --template '{author|user}\n'
2101 $ hg log --template '{author|user}\n'
2101 test
2102 test
2102 user
2103 user
2103 person
2104 person
2104 person
2105 person
2105 person
2106 person
2106 person
2107 person
2107 other
2108 other
2108 other
2109 other
2109 user
2110 user
2110
2111
2111 $ hg log --template '{date|date}\n'
2112 $ hg log --template '{date|date}\n'
2112 Wed Jan 01 10:01:00 2020 +0000
2113 Wed Jan 01 10:01:00 2020 +0000
2113 Mon Jan 12 13:46:40 1970 +0000
2114 Mon Jan 12 13:46:40 1970 +0000
2114 Sun Jan 18 08:40:01 1970 +0000
2115 Sun Jan 18 08:40:01 1970 +0000
2115 Sun Jan 18 08:40:00 1970 +0000
2116 Sun Jan 18 08:40:00 1970 +0000
2116 Sat Jan 17 04:53:20 1970 +0000
2117 Sat Jan 17 04:53:20 1970 +0000
2117 Fri Jan 16 01:06:40 1970 +0000
2118 Fri Jan 16 01:06:40 1970 +0000
2118 Wed Jan 14 21:20:00 1970 +0000
2119 Wed Jan 14 21:20:00 1970 +0000
2119 Tue Jan 13 17:33:20 1970 +0000
2120 Tue Jan 13 17:33:20 1970 +0000
2120 Mon Jan 12 13:46:40 1970 +0000
2121 Mon Jan 12 13:46:40 1970 +0000
2121
2122
2122 $ hg log --template '{date|isodate}\n'
2123 $ hg log --template '{date|isodate}\n'
2123 2020-01-01 10:01 +0000
2124 2020-01-01 10:01 +0000
2124 1970-01-12 13:46 +0000
2125 1970-01-12 13:46 +0000
2125 1970-01-18 08:40 +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-17 04:53 +0000
2128 1970-01-17 04:53 +0000
2128 1970-01-16 01:06 +0000
2129 1970-01-16 01:06 +0000
2129 1970-01-14 21:20 +0000
2130 1970-01-14 21:20 +0000
2130 1970-01-13 17:33 +0000
2131 1970-01-13 17:33 +0000
2131 1970-01-12 13:46 +0000
2132 1970-01-12 13:46 +0000
2132
2133
2133 $ hg log --template '{date|isodatesec}\n'
2134 $ hg log --template '{date|isodatesec}\n'
2134 2020-01-01 10:01:00 +0000
2135 2020-01-01 10:01:00 +0000
2135 1970-01-12 13:46:40 +0000
2136 1970-01-12 13:46:40 +0000
2136 1970-01-18 08:40:01 +0000
2137 1970-01-18 08:40:01 +0000
2137 1970-01-18 08:40:00 +0000
2138 1970-01-18 08:40:00 +0000
2138 1970-01-17 04:53:20 +0000
2139 1970-01-17 04:53:20 +0000
2139 1970-01-16 01:06:40 +0000
2140 1970-01-16 01:06:40 +0000
2140 1970-01-14 21:20:00 +0000
2141 1970-01-14 21:20:00 +0000
2141 1970-01-13 17:33:20 +0000
2142 1970-01-13 17:33:20 +0000
2142 1970-01-12 13:46:40 +0000
2143 1970-01-12 13:46:40 +0000
2143
2144
2144 $ hg log --template '{date|rfc822date}\n'
2145 $ hg log --template '{date|rfc822date}\n'
2145 Wed, 01 Jan 2020 10:01:00 +0000
2146 Wed, 01 Jan 2020 10:01:00 +0000
2146 Mon, 12 Jan 1970 13:46:40 +0000
2147 Mon, 12 Jan 1970 13:46:40 +0000
2147 Sun, 18 Jan 1970 08:40:01 +0000
2148 Sun, 18 Jan 1970 08:40:01 +0000
2148 Sun, 18 Jan 1970 08:40:00 +0000
2149 Sun, 18 Jan 1970 08:40:00 +0000
2149 Sat, 17 Jan 1970 04:53:20 +0000
2150 Sat, 17 Jan 1970 04:53:20 +0000
2150 Fri, 16 Jan 1970 01:06:40 +0000
2151 Fri, 16 Jan 1970 01:06:40 +0000
2151 Wed, 14 Jan 1970 21:20:00 +0000
2152 Wed, 14 Jan 1970 21:20:00 +0000
2152 Tue, 13 Jan 1970 17:33:20 +0000
2153 Tue, 13 Jan 1970 17:33:20 +0000
2153 Mon, 12 Jan 1970 13:46:40 +0000
2154 Mon, 12 Jan 1970 13:46:40 +0000
2154
2155
2155 $ hg log --template '{desc|firstline}\n'
2156 $ hg log --template '{desc|firstline}\n'
2156 third
2157 third
2157 second
2158 second
2158 merge
2159 merge
2159 new head
2160 new head
2160 new branch
2161 new branch
2161 no user, no domain
2162 no user, no domain
2162 no person
2163 no person
2163 other 1
2164 other 1
2164 line 1
2165 line 1
2165
2166
2166 $ hg log --template '{node|short}\n'
2167 $ hg log --template '{node|short}\n'
2167 95c24699272e
2168 95c24699272e
2168 29114dbae42b
2169 29114dbae42b
2169 d41e714fe50d
2170 d41e714fe50d
2170 13207e5a10d9
2171 13207e5a10d9
2171 bbe44766e73d
2172 bbe44766e73d
2172 10e46f2dcbf4
2173 10e46f2dcbf4
2173 97054abb4ab8
2174 97054abb4ab8
2174 b608e9d1a3f0
2175 b608e9d1a3f0
2175 1e4e1b8f71e0
2176 1e4e1b8f71e0
2176
2177
2177 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
2178 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
2178 <changeset author="test"/>
2179 <changeset author="test"/>
2179 <changeset author="User Name &lt;user@hostname&gt;"/>
2180 <changeset author="User Name &lt;user@hostname&gt;"/>
2180 <changeset author="person"/>
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="other@place"/>
2185 <changeset author="other@place"/>
2185 <changeset author="A. N. Other &lt;other@place&gt;"/>
2186 <changeset author="A. N. Other &lt;other@place&gt;"/>
2186 <changeset author="User Name &lt;user@hostname&gt;"/>
2187 <changeset author="User Name &lt;user@hostname&gt;"/>
2187
2188
2188 $ hg log --template '{rev}: {children}\n'
2189 $ hg log --template '{rev}: {children}\n'
2189 8:
2190 8:
2190 7: 8:95c24699272e
2191 7: 8:95c24699272e
2191 6:
2192 6:
2192 5: 6:d41e714fe50d
2193 5: 6:d41e714fe50d
2193 4: 6:d41e714fe50d
2194 4: 6:d41e714fe50d
2194 3: 4:bbe44766e73d 5:13207e5a10d9
2195 3: 4:bbe44766e73d 5:13207e5a10d9
2195 2: 3:10e46f2dcbf4
2196 2: 3:10e46f2dcbf4
2196 1: 2:97054abb4ab8
2197 1: 2:97054abb4ab8
2197 0: 1:b608e9d1a3f0
2198 0: 1:b608e9d1a3f0
2198
2199
2199 Formatnode filter works:
2200 Formatnode filter works:
2200
2201
2201 $ hg -q log -r 0 --template '{node|formatnode}\n'
2202 $ hg -q log -r 0 --template '{node|formatnode}\n'
2202 1e4e1b8f71e0
2203 1e4e1b8f71e0
2203
2204
2204 $ hg log -r 0 --template '{node|formatnode}\n'
2205 $ hg log -r 0 --template '{node|formatnode}\n'
2205 1e4e1b8f71e0
2206 1e4e1b8f71e0
2206
2207
2207 $ hg -v log -r 0 --template '{node|formatnode}\n'
2208 $ hg -v log -r 0 --template '{node|formatnode}\n'
2208 1e4e1b8f71e0
2209 1e4e1b8f71e0
2209
2210
2210 $ hg --debug log -r 0 --template '{node|formatnode}\n'
2211 $ hg --debug log -r 0 --template '{node|formatnode}\n'
2211 1e4e1b8f71e05681d422154f5421e385fec3454f
2212 1e4e1b8f71e05681d422154f5421e385fec3454f
2212
2213
2213 Age filter:
2214 Age filter:
2214
2215
2215 $ hg init unstable-hash
2216 $ hg init unstable-hash
2216 $ cd unstable-hash
2217 $ cd unstable-hash
2217 $ hg log --template '{date|age}\n' > /dev/null || exit 1
2218 $ hg log --template '{date|age}\n' > /dev/null || exit 1
2218
2219
2219 >>> from __future__ import absolute_import
2220 >>> from __future__ import absolute_import
2220 >>> import datetime
2221 >>> import datetime
2221 >>> fp = open('a', 'wb')
2222 >>> fp = open('a', 'wb')
2222 >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
2223 >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
2223 >>> 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
2224 >>> fp.close()
2225 >>> fp.close()
2225 $ hg add a
2226 $ hg add a
2226 $ hg commit -m future -d "`cat a`"
2227 $ hg commit -m future -d "`cat a`"
2227
2228
2228 $ hg log -l1 --template '{date|age}\n'
2229 $ hg log -l1 --template '{date|age}\n'
2229 7 years from now
2230 7 years from now
2230
2231
2231 $ cd ..
2232 $ cd ..
2232 $ rm -rf unstable-hash
2233 $ rm -rf unstable-hash
2233
2234
2234 Filename filters:
2235 Filename filters:
2235
2236
2236 $ hg debugtemplate '{"foo/bar"|basename}|{"foo/"|basename}|{"foo"|basename}|\n'
2237 $ hg debugtemplate '{"foo/bar"|basename}|{"foo/"|basename}|{"foo"|basename}|\n'
2237 bar||foo|
2238 bar||foo|
2238 $ hg debugtemplate '{"foo/bar"|dirname}|{"foo/"|dirname}|{"foo"|dirname}|\n'
2239 $ hg debugtemplate '{"foo/bar"|dirname}|{"foo/"|dirname}|{"foo"|dirname}|\n'
2239 foo|foo||
2240 foo|foo||
2240 $ hg debugtemplate '{"foo/bar"|stripdir}|{"foo/"|stripdir}|{"foo"|stripdir}|\n'
2241 $ hg debugtemplate '{"foo/bar"|stripdir}|{"foo/"|stripdir}|{"foo"|stripdir}|\n'
2241 foo|foo|foo|
2242 foo|foo|foo|
2242
2243
2243 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:
2244
2245
2245 $ echo a > a
2246 $ echo a > a
2246 $ hg add a
2247 $ hg add a
2247 $ hg ci -m future
2248 $ hg ci -m future
2248
2249
2249 Count filter:
2250 Count filter:
2250
2251
2251 $ hg log -l1 --template '{node|count} {node|short|count}\n'
2252 $ hg log -l1 --template '{node|count} {node|short|count}\n'
2252 40 12
2253 40 12
2253
2254
2254 $ 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'
2255 0 1 4
2256 0 1 4
2256
2257
2257 $ hg log -G --template '{rev}: children: {children|count}, \
2258 $ hg log -G --template '{rev}: children: {children|count}, \
2258 > tags: {tags|count}, file_adds: {file_adds|count}, \
2259 > tags: {tags|count}, file_adds: {file_adds|count}, \
2259 > ancestors: {revset("ancestors(%s)", rev)|count}'
2260 > ancestors: {revset("ancestors(%s)", rev)|count}'
2260 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
2261 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
2261 |
2262 |
2262 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
2263 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
2263 |
2264 |
2264 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
2265 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
2265
2266
2266 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
2267 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
2267 |\
2268 |\
2268 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
2269 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
2269 | |
2270 | |
2270 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
2271 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
2271 |/
2272 |/
2272 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
2273 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
2273 |
2274 |
2274 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
2275 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
2275 |
2276 |
2276 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
2277 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
2277 |
2278 |
2278 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
2279 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
2279
2280
2280
2281
2281 $ hg log -l1 -T '{termwidth|count}\n'
2282 $ hg log -l1 -T '{termwidth|count}\n'
2282 hg: parse error: not countable
2283 hg: parse error: not countable
2283 (template filter 'count' is not compatible with keyword 'termwidth')
2284 (template filter 'count' is not compatible with keyword 'termwidth')
2284 [255]
2285 [255]
2285
2286
2286 Upper/lower filters:
2287 Upper/lower filters:
2287
2288
2288 $ hg log -r0 --template '{branch|upper}\n'
2289 $ hg log -r0 --template '{branch|upper}\n'
2289 DEFAULT
2290 DEFAULT
2290 $ hg log -r0 --template '{author|lower}\n'
2291 $ hg log -r0 --template '{author|lower}\n'
2291 user name <user@hostname>
2292 user name <user@hostname>
2292 $ hg log -r0 --template '{date|upper}\n'
2293 $ hg log -r0 --template '{date|upper}\n'
2293 1000000.00
2294 1000000.00
2294
2295
2295 Add a commit that does all possible modifications at once
2296 Add a commit that does all possible modifications at once
2296
2297
2297 $ echo modify >> third
2298 $ echo modify >> third
2298 $ touch b
2299 $ touch b
2299 $ hg add b
2300 $ hg add b
2300 $ hg mv fourth fifth
2301 $ hg mv fourth fifth
2301 $ hg rm a
2302 $ hg rm a
2302 $ hg ci -m "Modify, add, remove, rename"
2303 $ hg ci -m "Modify, add, remove, rename"
2303
2304
2304 Check the status template
2305 Check the status template
2305
2306
2306 $ cat <<EOF >> $HGRCPATH
2307 $ cat <<EOF >> $HGRCPATH
2307 > [extensions]
2308 > [extensions]
2308 > color=
2309 > color=
2309 > EOF
2310 > EOF
2310
2311
2311 $ hg log -T status -r 10
2312 $ hg log -T status -r 10
2312 changeset: 10:0f9759ec227a
2313 changeset: 10:0f9759ec227a
2313 tag: tip
2314 tag: tip
2314 user: test
2315 user: test
2315 date: Thu Jan 01 00:00:00 1970 +0000
2316 date: Thu Jan 01 00:00:00 1970 +0000
2316 summary: Modify, add, remove, rename
2317 summary: Modify, add, remove, rename
2317 files:
2318 files:
2318 M third
2319 M third
2319 A b
2320 A b
2320 A fifth
2321 A fifth
2321 R a
2322 R a
2322 R fourth
2323 R fourth
2323
2324
2324 $ hg log -T status -C -r 10
2325 $ hg log -T status -C -r 10
2325 changeset: 10:0f9759ec227a
2326 changeset: 10:0f9759ec227a
2326 tag: tip
2327 tag: tip
2327 user: test
2328 user: test
2328 date: Thu Jan 01 00:00:00 1970 +0000
2329 date: Thu Jan 01 00:00:00 1970 +0000
2329 summary: Modify, add, remove, rename
2330 summary: Modify, add, remove, rename
2330 files:
2331 files:
2331 M third
2332 M third
2332 A b
2333 A b
2333 A fifth
2334 A fifth
2334 fourth
2335 fourth
2335 R a
2336 R a
2336 R fourth
2337 R fourth
2337
2338
2338 $ hg log -T status -C -r 10 -v
2339 $ hg log -T status -C -r 10 -v
2339 changeset: 10:0f9759ec227a
2340 changeset: 10:0f9759ec227a
2340 tag: tip
2341 tag: tip
2341 user: test
2342 user: test
2342 date: Thu Jan 01 00:00:00 1970 +0000
2343 date: Thu Jan 01 00:00:00 1970 +0000
2343 description:
2344 description:
2344 Modify, add, remove, rename
2345 Modify, add, remove, rename
2345
2346
2346 files:
2347 files:
2347 M third
2348 M third
2348 A b
2349 A b
2349 A fifth
2350 A fifth
2350 fourth
2351 fourth
2351 R a
2352 R a
2352 R fourth
2353 R fourth
2353
2354
2354 $ hg log -T status -C -r 10 --debug
2355 $ hg log -T status -C -r 10 --debug
2355 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2356 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2356 tag: tip
2357 tag: tip
2357 phase: secret
2358 phase: secret
2358 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2359 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2359 parent: -1:0000000000000000000000000000000000000000
2360 parent: -1:0000000000000000000000000000000000000000
2360 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2361 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2361 user: test
2362 user: test
2362 date: Thu Jan 01 00:00:00 1970 +0000
2363 date: Thu Jan 01 00:00:00 1970 +0000
2363 extra: branch=default
2364 extra: branch=default
2364 description:
2365 description:
2365 Modify, add, remove, rename
2366 Modify, add, remove, rename
2366
2367
2367 files:
2368 files:
2368 M third
2369 M third
2369 A b
2370 A b
2370 A fifth
2371 A fifth
2371 fourth
2372 fourth
2372 R a
2373 R a
2373 R fourth
2374 R fourth
2374
2375
2375 $ hg log -T status -C -r 10 --quiet
2376 $ hg log -T status -C -r 10 --quiet
2376 10:0f9759ec227a
2377 10:0f9759ec227a
2377 $ hg --color=debug log -T status -r 10
2378 $ hg --color=debug log -T status -r 10
2378 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2379 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2379 [log.tag|tag: tip]
2380 [log.tag|tag: tip]
2380 [log.user|user: test]
2381 [log.user|user: test]
2381 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2382 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2382 [log.summary|summary: Modify, add, remove, rename]
2383 [log.summary|summary: Modify, add, remove, rename]
2383 [ui.note log.files|files:]
2384 [ui.note log.files|files:]
2384 [status.modified|M third]
2385 [status.modified|M third]
2385 [status.added|A b]
2386 [status.added|A b]
2386 [status.added|A fifth]
2387 [status.added|A fifth]
2387 [status.removed|R a]
2388 [status.removed|R a]
2388 [status.removed|R fourth]
2389 [status.removed|R fourth]
2389
2390
2390 $ hg --color=debug log -T status -C -r 10
2391 $ hg --color=debug log -T status -C -r 10
2391 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2392 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2392 [log.tag|tag: tip]
2393 [log.tag|tag: tip]
2393 [log.user|user: test]
2394 [log.user|user: test]
2394 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2395 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2395 [log.summary|summary: Modify, add, remove, rename]
2396 [log.summary|summary: Modify, add, remove, rename]
2396 [ui.note log.files|files:]
2397 [ui.note log.files|files:]
2397 [status.modified|M third]
2398 [status.modified|M third]
2398 [status.added|A b]
2399 [status.added|A b]
2399 [status.added|A fifth]
2400 [status.added|A fifth]
2400 [status.copied| fourth]
2401 [status.copied| fourth]
2401 [status.removed|R a]
2402 [status.removed|R a]
2402 [status.removed|R fourth]
2403 [status.removed|R fourth]
2403
2404
2404 $ hg --color=debug log -T status -C -r 10 -v
2405 $ hg --color=debug log -T status -C -r 10 -v
2405 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2406 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2406 [log.tag|tag: tip]
2407 [log.tag|tag: tip]
2407 [log.user|user: test]
2408 [log.user|user: test]
2408 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2409 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2409 [ui.note log.description|description:]
2410 [ui.note log.description|description:]
2410 [ui.note log.description|Modify, add, remove, rename]
2411 [ui.note log.description|Modify, add, remove, rename]
2411
2412
2412 [ui.note log.files|files:]
2413 [ui.note log.files|files:]
2413 [status.modified|M third]
2414 [status.modified|M third]
2414 [status.added|A b]
2415 [status.added|A b]
2415 [status.added|A fifth]
2416 [status.added|A fifth]
2416 [status.copied| fourth]
2417 [status.copied| fourth]
2417 [status.removed|R a]
2418 [status.removed|R a]
2418 [status.removed|R fourth]
2419 [status.removed|R fourth]
2419
2420
2420 $ hg --color=debug log -T status -C -r 10 --debug
2421 $ hg --color=debug log -T status -C -r 10 --debug
2421 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2422 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2422 [log.tag|tag: tip]
2423 [log.tag|tag: tip]
2423 [log.phase|phase: secret]
2424 [log.phase|phase: secret]
2424 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2425 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2425 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2426 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2426 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2427 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2427 [log.user|user: test]
2428 [log.user|user: test]
2428 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2429 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2429 [ui.debug log.extra|extra: branch=default]
2430 [ui.debug log.extra|extra: branch=default]
2430 [ui.note log.description|description:]
2431 [ui.note log.description|description:]
2431 [ui.note log.description|Modify, add, remove, rename]
2432 [ui.note log.description|Modify, add, remove, rename]
2432
2433
2433 [ui.note log.files|files:]
2434 [ui.note log.files|files:]
2434 [status.modified|M third]
2435 [status.modified|M third]
2435 [status.added|A b]
2436 [status.added|A b]
2436 [status.added|A fifth]
2437 [status.added|A fifth]
2437 [status.copied| fourth]
2438 [status.copied| fourth]
2438 [status.removed|R a]
2439 [status.removed|R a]
2439 [status.removed|R fourth]
2440 [status.removed|R fourth]
2440
2441
2441 $ hg --color=debug log -T status -C -r 10 --quiet
2442 $ hg --color=debug log -T status -C -r 10 --quiet
2442 [log.node|10:0f9759ec227a]
2443 [log.node|10:0f9759ec227a]
2443
2444
2444 Check the bisect template
2445 Check the bisect template
2445
2446
2446 $ hg bisect -g 1
2447 $ hg bisect -g 1
2447 $ hg bisect -b 3 --noupdate
2448 $ hg bisect -b 3 --noupdate
2448 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2449 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2449 $ hg log -T bisect -r 0:4
2450 $ hg log -T bisect -r 0:4
2450 changeset: 0:1e4e1b8f71e0
2451 changeset: 0:1e4e1b8f71e0
2451 bisect: good (implicit)
2452 bisect: good (implicit)
2452 user: User Name <user@hostname>
2453 user: User Name <user@hostname>
2453 date: Mon Jan 12 13:46:40 1970 +0000
2454 date: Mon Jan 12 13:46:40 1970 +0000
2454 summary: line 1
2455 summary: line 1
2455
2456
2456 changeset: 1:b608e9d1a3f0
2457 changeset: 1:b608e9d1a3f0
2457 bisect: good
2458 bisect: good
2458 user: A. N. Other <other@place>
2459 user: A. N. Other <other@place>
2459 date: Tue Jan 13 17:33:20 1970 +0000
2460 date: Tue Jan 13 17:33:20 1970 +0000
2460 summary: other 1
2461 summary: other 1
2461
2462
2462 changeset: 2:97054abb4ab8
2463 changeset: 2:97054abb4ab8
2463 bisect: untested
2464 bisect: untested
2464 user: other@place
2465 user: other@place
2465 date: Wed Jan 14 21:20:00 1970 +0000
2466 date: Wed Jan 14 21:20:00 1970 +0000
2466 summary: no person
2467 summary: no person
2467
2468
2468 changeset: 3:10e46f2dcbf4
2469 changeset: 3:10e46f2dcbf4
2469 bisect: bad
2470 bisect: bad
2470 user: person
2471 user: person
2471 date: Fri Jan 16 01:06:40 1970 +0000
2472 date: Fri Jan 16 01:06:40 1970 +0000
2472 summary: no user, no domain
2473 summary: no user, no domain
2473
2474
2474 changeset: 4:bbe44766e73d
2475 changeset: 4:bbe44766e73d
2475 bisect: bad (implicit)
2476 bisect: bad (implicit)
2476 branch: foo
2477 branch: foo
2477 user: person
2478 user: person
2478 date: Sat Jan 17 04:53:20 1970 +0000
2479 date: Sat Jan 17 04:53:20 1970 +0000
2479 summary: new branch
2480 summary: new branch
2480
2481
2481 $ hg log --debug -T bisect -r 0:4
2482 $ hg log --debug -T bisect -r 0:4
2482 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2483 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2483 bisect: good (implicit)
2484 bisect: good (implicit)
2484 phase: public
2485 phase: public
2485 parent: -1:0000000000000000000000000000000000000000
2486 parent: -1:0000000000000000000000000000000000000000
2486 parent: -1:0000000000000000000000000000000000000000
2487 parent: -1:0000000000000000000000000000000000000000
2487 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2488 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2488 user: User Name <user@hostname>
2489 user: User Name <user@hostname>
2489 date: Mon Jan 12 13:46:40 1970 +0000
2490 date: Mon Jan 12 13:46:40 1970 +0000
2490 files+: a
2491 files+: a
2491 extra: branch=default
2492 extra: branch=default
2492 description:
2493 description:
2493 line 1
2494 line 1
2494 line 2
2495 line 2
2495
2496
2496
2497
2497 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2498 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2498 bisect: good
2499 bisect: good
2499 phase: public
2500 phase: public
2500 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2501 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2501 parent: -1:0000000000000000000000000000000000000000
2502 parent: -1:0000000000000000000000000000000000000000
2502 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2503 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2503 user: A. N. Other <other@place>
2504 user: A. N. Other <other@place>
2504 date: Tue Jan 13 17:33:20 1970 +0000
2505 date: Tue Jan 13 17:33:20 1970 +0000
2505 files+: b
2506 files+: b
2506 extra: branch=default
2507 extra: branch=default
2507 description:
2508 description:
2508 other 1
2509 other 1
2509 other 2
2510 other 2
2510
2511
2511 other 3
2512 other 3
2512
2513
2513
2514
2514 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2515 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2515 bisect: untested
2516 bisect: untested
2516 phase: public
2517 phase: public
2517 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2518 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2518 parent: -1:0000000000000000000000000000000000000000
2519 parent: -1:0000000000000000000000000000000000000000
2519 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2520 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2520 user: other@place
2521 user: other@place
2521 date: Wed Jan 14 21:20:00 1970 +0000
2522 date: Wed Jan 14 21:20:00 1970 +0000
2522 files+: c
2523 files+: c
2523 extra: branch=default
2524 extra: branch=default
2524 description:
2525 description:
2525 no person
2526 no person
2526
2527
2527
2528
2528 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2529 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2529 bisect: bad
2530 bisect: bad
2530 phase: public
2531 phase: public
2531 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2532 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2532 parent: -1:0000000000000000000000000000000000000000
2533 parent: -1:0000000000000000000000000000000000000000
2533 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2534 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2534 user: person
2535 user: person
2535 date: Fri Jan 16 01:06:40 1970 +0000
2536 date: Fri Jan 16 01:06:40 1970 +0000
2536 files: c
2537 files: c
2537 extra: branch=default
2538 extra: branch=default
2538 description:
2539 description:
2539 no user, no domain
2540 no user, no domain
2540
2541
2541
2542
2542 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2543 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2543 bisect: bad (implicit)
2544 bisect: bad (implicit)
2544 branch: foo
2545 branch: foo
2545 phase: draft
2546 phase: draft
2546 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2547 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2547 parent: -1:0000000000000000000000000000000000000000
2548 parent: -1:0000000000000000000000000000000000000000
2548 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2549 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2549 user: person
2550 user: person
2550 date: Sat Jan 17 04:53:20 1970 +0000
2551 date: Sat Jan 17 04:53:20 1970 +0000
2551 extra: branch=foo
2552 extra: branch=foo
2552 description:
2553 description:
2553 new branch
2554 new branch
2554
2555
2555
2556
2556 $ hg log -v -T bisect -r 0:4
2557 $ hg log -v -T bisect -r 0:4
2557 changeset: 0:1e4e1b8f71e0
2558 changeset: 0:1e4e1b8f71e0
2558 bisect: good (implicit)
2559 bisect: good (implicit)
2559 user: User Name <user@hostname>
2560 user: User Name <user@hostname>
2560 date: Mon Jan 12 13:46:40 1970 +0000
2561 date: Mon Jan 12 13:46:40 1970 +0000
2561 files: a
2562 files: a
2562 description:
2563 description:
2563 line 1
2564 line 1
2564 line 2
2565 line 2
2565
2566
2566
2567
2567 changeset: 1:b608e9d1a3f0
2568 changeset: 1:b608e9d1a3f0
2568 bisect: good
2569 bisect: good
2569 user: A. N. Other <other@place>
2570 user: A. N. Other <other@place>
2570 date: Tue Jan 13 17:33:20 1970 +0000
2571 date: Tue Jan 13 17:33:20 1970 +0000
2571 files: b
2572 files: b
2572 description:
2573 description:
2573 other 1
2574 other 1
2574 other 2
2575 other 2
2575
2576
2576 other 3
2577 other 3
2577
2578
2578
2579
2579 changeset: 2:97054abb4ab8
2580 changeset: 2:97054abb4ab8
2580 bisect: untested
2581 bisect: untested
2581 user: other@place
2582 user: other@place
2582 date: Wed Jan 14 21:20:00 1970 +0000
2583 date: Wed Jan 14 21:20:00 1970 +0000
2583 files: c
2584 files: c
2584 description:
2585 description:
2585 no person
2586 no person
2586
2587
2587
2588
2588 changeset: 3:10e46f2dcbf4
2589 changeset: 3:10e46f2dcbf4
2589 bisect: bad
2590 bisect: bad
2590 user: person
2591 user: person
2591 date: Fri Jan 16 01:06:40 1970 +0000
2592 date: Fri Jan 16 01:06:40 1970 +0000
2592 files: c
2593 files: c
2593 description:
2594 description:
2594 no user, no domain
2595 no user, no domain
2595
2596
2596
2597
2597 changeset: 4:bbe44766e73d
2598 changeset: 4:bbe44766e73d
2598 bisect: bad (implicit)
2599 bisect: bad (implicit)
2599 branch: foo
2600 branch: foo
2600 user: person
2601 user: person
2601 date: Sat Jan 17 04:53:20 1970 +0000
2602 date: Sat Jan 17 04:53:20 1970 +0000
2602 description:
2603 description:
2603 new branch
2604 new branch
2604
2605
2605
2606
2606 $ hg --color=debug log -T bisect -r 0:4
2607 $ hg --color=debug log -T bisect -r 0:4
2607 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2608 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2608 [log.bisect bisect.good|bisect: good (implicit)]
2609 [log.bisect bisect.good|bisect: good (implicit)]
2609 [log.user|user: User Name <user@hostname>]
2610 [log.user|user: User Name <user@hostname>]
2610 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2611 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2611 [log.summary|summary: line 1]
2612 [log.summary|summary: line 1]
2612
2613
2613 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2614 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2614 [log.bisect bisect.good|bisect: good]
2615 [log.bisect bisect.good|bisect: good]
2615 [log.user|user: A. N. Other <other@place>]
2616 [log.user|user: A. N. Other <other@place>]
2616 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2617 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2617 [log.summary|summary: other 1]
2618 [log.summary|summary: other 1]
2618
2619
2619 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2620 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2620 [log.bisect bisect.untested|bisect: untested]
2621 [log.bisect bisect.untested|bisect: untested]
2621 [log.user|user: other@place]
2622 [log.user|user: other@place]
2622 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2623 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2623 [log.summary|summary: no person]
2624 [log.summary|summary: no person]
2624
2625
2625 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2626 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2626 [log.bisect bisect.bad|bisect: bad]
2627 [log.bisect bisect.bad|bisect: bad]
2627 [log.user|user: person]
2628 [log.user|user: person]
2628 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2629 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2629 [log.summary|summary: no user, no domain]
2630 [log.summary|summary: no user, no domain]
2630
2631
2631 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2632 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2632 [log.bisect bisect.bad|bisect: bad (implicit)]
2633 [log.bisect bisect.bad|bisect: bad (implicit)]
2633 [log.branch|branch: foo]
2634 [log.branch|branch: foo]
2634 [log.user|user: person]
2635 [log.user|user: person]
2635 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2636 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2636 [log.summary|summary: new branch]
2637 [log.summary|summary: new branch]
2637
2638
2638 $ hg --color=debug log --debug -T bisect -r 0:4
2639 $ hg --color=debug log --debug -T bisect -r 0:4
2639 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2640 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2640 [log.bisect bisect.good|bisect: good (implicit)]
2641 [log.bisect bisect.good|bisect: good (implicit)]
2641 [log.phase|phase: public]
2642 [log.phase|phase: public]
2642 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
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 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2645 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2645 [log.user|user: User Name <user@hostname>]
2646 [log.user|user: User Name <user@hostname>]
2646 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2647 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2647 [ui.debug log.files|files+: a]
2648 [ui.debug log.files|files+: a]
2648 [ui.debug log.extra|extra: branch=default]
2649 [ui.debug log.extra|extra: branch=default]
2649 [ui.note log.description|description:]
2650 [ui.note log.description|description:]
2650 [ui.note log.description|line 1
2651 [ui.note log.description|line 1
2651 line 2]
2652 line 2]
2652
2653
2653
2654
2654 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2655 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2655 [log.bisect bisect.good|bisect: good]
2656 [log.bisect bisect.good|bisect: good]
2656 [log.phase|phase: public]
2657 [log.phase|phase: public]
2657 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2658 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2658 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2659 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2659 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2660 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2660 [log.user|user: A. N. Other <other@place>]
2661 [log.user|user: A. N. Other <other@place>]
2661 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2662 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2662 [ui.debug log.files|files+: b]
2663 [ui.debug log.files|files+: b]
2663 [ui.debug log.extra|extra: branch=default]
2664 [ui.debug log.extra|extra: branch=default]
2664 [ui.note log.description|description:]
2665 [ui.note log.description|description:]
2665 [ui.note log.description|other 1
2666 [ui.note log.description|other 1
2666 other 2
2667 other 2
2667
2668
2668 other 3]
2669 other 3]
2669
2670
2670
2671
2671 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2672 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2672 [log.bisect bisect.untested|bisect: untested]
2673 [log.bisect bisect.untested|bisect: untested]
2673 [log.phase|phase: public]
2674 [log.phase|phase: public]
2674 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2675 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2675 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2676 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2676 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2677 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2677 [log.user|user: other@place]
2678 [log.user|user: other@place]
2678 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2679 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2679 [ui.debug log.files|files+: c]
2680 [ui.debug log.files|files+: c]
2680 [ui.debug log.extra|extra: branch=default]
2681 [ui.debug log.extra|extra: branch=default]
2681 [ui.note log.description|description:]
2682 [ui.note log.description|description:]
2682 [ui.note log.description|no person]
2683 [ui.note log.description|no person]
2683
2684
2684
2685
2685 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2686 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2686 [log.bisect bisect.bad|bisect: bad]
2687 [log.bisect bisect.bad|bisect: bad]
2687 [log.phase|phase: public]
2688 [log.phase|phase: public]
2688 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2689 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2689 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2690 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2690 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2691 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2691 [log.user|user: person]
2692 [log.user|user: person]
2692 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2693 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2693 [ui.debug log.files|files: c]
2694 [ui.debug log.files|files: c]
2694 [ui.debug log.extra|extra: branch=default]
2695 [ui.debug log.extra|extra: branch=default]
2695 [ui.note log.description|description:]
2696 [ui.note log.description|description:]
2696 [ui.note log.description|no user, no domain]
2697 [ui.note log.description|no user, no domain]
2697
2698
2698
2699
2699 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2700 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2700 [log.bisect bisect.bad|bisect: bad (implicit)]
2701 [log.bisect bisect.bad|bisect: bad (implicit)]
2701 [log.branch|branch: foo]
2702 [log.branch|branch: foo]
2702 [log.phase|phase: draft]
2703 [log.phase|phase: draft]
2703 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2704 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2704 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2705 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2705 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2706 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2706 [log.user|user: person]
2707 [log.user|user: person]
2707 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2708 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2708 [ui.debug log.extra|extra: branch=foo]
2709 [ui.debug log.extra|extra: branch=foo]
2709 [ui.note log.description|description:]
2710 [ui.note log.description|description:]
2710 [ui.note log.description|new branch]
2711 [ui.note log.description|new branch]
2711
2712
2712
2713
2713 $ hg --color=debug log -v -T bisect -r 0:4
2714 $ hg --color=debug log -v -T bisect -r 0:4
2714 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2715 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2715 [log.bisect bisect.good|bisect: good (implicit)]
2716 [log.bisect bisect.good|bisect: good (implicit)]
2716 [log.user|user: User Name <user@hostname>]
2717 [log.user|user: User Name <user@hostname>]
2717 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2718 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2718 [ui.note log.files|files: a]
2719 [ui.note log.files|files: a]
2719 [ui.note log.description|description:]
2720 [ui.note log.description|description:]
2720 [ui.note log.description|line 1
2721 [ui.note log.description|line 1
2721 line 2]
2722 line 2]
2722
2723
2723
2724
2724 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2725 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2725 [log.bisect bisect.good|bisect: good]
2726 [log.bisect bisect.good|bisect: good]
2726 [log.user|user: A. N. Other <other@place>]
2727 [log.user|user: A. N. Other <other@place>]
2727 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2728 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2728 [ui.note log.files|files: b]
2729 [ui.note log.files|files: b]
2729 [ui.note log.description|description:]
2730 [ui.note log.description|description:]
2730 [ui.note log.description|other 1
2731 [ui.note log.description|other 1
2731 other 2
2732 other 2
2732
2733
2733 other 3]
2734 other 3]
2734
2735
2735
2736
2736 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2737 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2737 [log.bisect bisect.untested|bisect: untested]
2738 [log.bisect bisect.untested|bisect: untested]
2738 [log.user|user: other@place]
2739 [log.user|user: other@place]
2739 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2740 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2740 [ui.note log.files|files: c]
2741 [ui.note log.files|files: c]
2741 [ui.note log.description|description:]
2742 [ui.note log.description|description:]
2742 [ui.note log.description|no person]
2743 [ui.note log.description|no person]
2743
2744
2744
2745
2745 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2746 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2746 [log.bisect bisect.bad|bisect: bad]
2747 [log.bisect bisect.bad|bisect: bad]
2747 [log.user|user: person]
2748 [log.user|user: person]
2748 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2749 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2749 [ui.note log.files|files: c]
2750 [ui.note log.files|files: c]
2750 [ui.note log.description|description:]
2751 [ui.note log.description|description:]
2751 [ui.note log.description|no user, no domain]
2752 [ui.note log.description|no user, no domain]
2752
2753
2753
2754
2754 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2755 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2755 [log.bisect bisect.bad|bisect: bad (implicit)]
2756 [log.bisect bisect.bad|bisect: bad (implicit)]
2756 [log.branch|branch: foo]
2757 [log.branch|branch: foo]
2757 [log.user|user: person]
2758 [log.user|user: person]
2758 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2759 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2759 [ui.note log.description|description:]
2760 [ui.note log.description|description:]
2760 [ui.note log.description|new branch]
2761 [ui.note log.description|new branch]
2761
2762
2762
2763
2763 $ hg bisect --reset
2764 $ hg bisect --reset
2764
2765
2765 Error on syntax:
2766 Error on syntax:
2766
2767
2767 $ echo 'x = "f' >> t
2768 $ echo 'x = "f' >> t
2768 $ hg log
2769 $ hg log
2769 hg: parse error at t:3: unmatched quotes
2770 hg: parse error at t:3: unmatched quotes
2770 [255]
2771 [255]
2771
2772
2772 $ hg log -T '{date'
2773 $ hg log -T '{date'
2773 hg: parse error at 1: unterminated template expansion
2774 hg: parse error at 1: unterminated template expansion
2774 ({date
2775 ({date
2775 ^ here)
2776 ^ here)
2776 [255]
2777 [255]
2777 $ hg log -T '{date(}'
2778 $ hg log -T '{date(}'
2778 hg: parse error at 6: not a prefix: end
2779 hg: parse error at 6: not a prefix: end
2779 ({date(}
2780 ({date(}
2780 ^ here)
2781 ^ here)
2781 [255]
2782 [255]
2782 $ hg log -T '{date)}'
2783 $ hg log -T '{date)}'
2783 hg: parse error at 5: invalid token
2784 hg: parse error at 5: invalid token
2784 ({date)}
2785 ({date)}
2785 ^ here)
2786 ^ here)
2786 [255]
2787 [255]
2787 $ hg log -T '{date date}'
2788 $ hg log -T '{date date}'
2788 hg: parse error at 6: invalid token
2789 hg: parse error at 6: invalid token
2789 ({date date}
2790 ({date date}
2790 ^ here)
2791 ^ here)
2791 [255]
2792 [255]
2792
2793
2793 $ hg log -T '{}'
2794 $ hg log -T '{}'
2794 hg: parse error at 1: not a prefix: end
2795 hg: parse error at 1: not a prefix: end
2795 ({}
2796 ({}
2796 ^ here)
2797 ^ here)
2797 [255]
2798 [255]
2798 $ hg debugtemplate -v '{()}'
2799 $ hg debugtemplate -v '{()}'
2799 (template
2800 (template
2800 (group
2801 (group
2801 None))
2802 None))
2802 hg: parse error: missing argument
2803 hg: parse error: missing argument
2803 [255]
2804 [255]
2804
2805
2805 Behind the scenes, this would throw TypeError without intype=bytes
2806 Behind the scenes, this would throw TypeError without intype=bytes
2806
2807
2807 $ hg log -l 3 --template '{date|obfuscate}\n'
2808 $ hg log -l 3 --template '{date|obfuscate}\n'
2808 &#48;&#46;&#48;&#48;
2809 &#48;&#46;&#48;&#48;
2809 &#48;&#46;&#48;&#48;
2810 &#48;&#46;&#48;&#48;
2810 &#49;&#53;&#55;&#55;&#56;&#55;&#50;&#56;&#54;&#48;&#46;&#48;&#48;
2811 &#49;&#53;&#55;&#55;&#56;&#55;&#50;&#56;&#54;&#48;&#46;&#48;&#48;
2811
2812
2812 Behind the scenes, this will throw a ValueError
2813 Behind the scenes, this will throw a ValueError
2813
2814
2814 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
2815 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
2815 hg: parse error: invalid date: 'Modify, add, remove, rename'
2816 hg: parse error: invalid date: 'Modify, add, remove, rename'
2816 (template filter 'shortdate' is not compatible with keyword 'desc')
2817 (template filter 'shortdate' is not compatible with keyword 'desc')
2817 [255]
2818 [255]
2818
2819
2819 Behind the scenes, this would throw AttributeError without intype=bytes
2820 Behind the scenes, this would throw AttributeError without intype=bytes
2820
2821
2821 $ hg log -l 3 --template 'line: {date|escape}\n'
2822 $ hg log -l 3 --template 'line: {date|escape}\n'
2822 line: 0.00
2823 line: 0.00
2823 line: 0.00
2824 line: 0.00
2824 line: 1577872860.00
2825 line: 1577872860.00
2825
2826
2826 $ hg log -l 3 --template 'line: {extras|localdate}\n'
2827 $ hg log -l 3 --template 'line: {extras|localdate}\n'
2827 hg: parse error: localdate expects a date information
2828 hg: parse error: localdate expects a date information
2828 [255]
2829 [255]
2829
2830
2830 Behind the scenes, this will throw ValueError
2831 Behind the scenes, this will throw ValueError
2831
2832
2832 $ hg tip --template '{author|email|date}\n'
2833 $ hg tip --template '{author|email|date}\n'
2833 hg: parse error: date expects a date information
2834 hg: parse error: date expects a date information
2834 [255]
2835 [255]
2835
2836
2836 $ hg tip -T '{author|email|shortdate}\n'
2837 $ hg tip -T '{author|email|shortdate}\n'
2837 hg: parse error: invalid date: 'test'
2838 hg: parse error: invalid date: 'test'
2838 (template filter 'shortdate' is not compatible with keyword 'author')
2839 (template filter 'shortdate' is not compatible with keyword 'author')
2839 [255]
2840 [255]
2840
2841
2841 $ hg tip -T '{get(extras, "branch")|shortdate}\n'
2842 $ hg tip -T '{get(extras, "branch")|shortdate}\n'
2842 hg: parse error: invalid date: 'default'
2843 hg: parse error: invalid date: 'default'
2843 (incompatible use of template filter 'shortdate')
2844 (incompatible use of template filter 'shortdate')
2844 [255]
2845 [255]
2845
2846
2846 Error in nested template:
2847 Error in nested template:
2847
2848
2848 $ hg log -T '{"date'
2849 $ hg log -T '{"date'
2849 hg: parse error at 2: unterminated string
2850 hg: parse error at 2: unterminated string
2850 ({"date
2851 ({"date
2851 ^ here)
2852 ^ here)
2852 [255]
2853 [255]
2853
2854
2854 $ hg log -T '{"foo{date|?}"}'
2855 $ hg log -T '{"foo{date|?}"}'
2855 hg: parse error at 11: syntax error
2856 hg: parse error at 11: syntax error
2856 ({"foo{date|?}"}
2857 ({"foo{date|?}"}
2857 ^ here)
2858 ^ here)
2858 [255]
2859 [255]
2859
2860
2860 Thrown an error if a template function doesn't exist
2861 Thrown an error if a template function doesn't exist
2861
2862
2862 $ hg tip --template '{foo()}\n'
2863 $ hg tip --template '{foo()}\n'
2863 hg: parse error: unknown function 'foo'
2864 hg: parse error: unknown function 'foo'
2864 [255]
2865 [255]
2865
2866
2866 Pass generator object created by template function to filter
2867 Pass generator object created by template function to filter
2867
2868
2868 $ hg log -l 1 --template '{if(author, author)|user}\n'
2869 $ hg log -l 1 --template '{if(author, author)|user}\n'
2869 test
2870 test
2870
2871
2871 Test index keyword:
2872 Test index keyword:
2872
2873
2873 $ hg log -l 2 -T '{index + 10}{files % " {index}:{file}"}\n'
2874 $ hg log -l 2 -T '{index + 10}{files % " {index}:{file}"}\n'
2874 10 0:a 1:b 2:fifth 3:fourth 4:third
2875 10 0:a 1:b 2:fifth 3:fourth 4:third
2875 11 0:a
2876 11 0:a
2876
2877
2877 $ hg branches -T '{index} {branch}\n'
2878 $ hg branches -T '{index} {branch}\n'
2878 0 default
2879 0 default
2879 1 foo
2880 1 foo
2880
2881
2881 Test diff function:
2882 Test diff function:
2882
2883
2883 $ hg diff -c 8
2884 $ hg diff -c 8
2884 diff -r 29114dbae42b -r 95c24699272e fourth
2885 diff -r 29114dbae42b -r 95c24699272e fourth
2885 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2886 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2886 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2887 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2887 @@ -0,0 +1,1 @@
2888 @@ -0,0 +1,1 @@
2888 +second
2889 +second
2889 diff -r 29114dbae42b -r 95c24699272e second
2890 diff -r 29114dbae42b -r 95c24699272e second
2890 --- a/second Mon Jan 12 13:46:40 1970 +0000
2891 --- a/second Mon Jan 12 13:46:40 1970 +0000
2891 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2892 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2892 @@ -1,1 +0,0 @@
2893 @@ -1,1 +0,0 @@
2893 -second
2894 -second
2894 diff -r 29114dbae42b -r 95c24699272e third
2895 diff -r 29114dbae42b -r 95c24699272e third
2895 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2896 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2896 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2897 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2897 @@ -0,0 +1,1 @@
2898 @@ -0,0 +1,1 @@
2898 +third
2899 +third
2899
2900
2900 $ hg log -r 8 -T "{diff()}"
2901 $ hg log -r 8 -T "{diff()}"
2901 diff -r 29114dbae42b -r 95c24699272e fourth
2902 diff -r 29114dbae42b -r 95c24699272e fourth
2902 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2903 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2903 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2904 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2904 @@ -0,0 +1,1 @@
2905 @@ -0,0 +1,1 @@
2905 +second
2906 +second
2906 diff -r 29114dbae42b -r 95c24699272e second
2907 diff -r 29114dbae42b -r 95c24699272e second
2907 --- a/second Mon Jan 12 13:46:40 1970 +0000
2908 --- a/second Mon Jan 12 13:46:40 1970 +0000
2908 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2909 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2909 @@ -1,1 +0,0 @@
2910 @@ -1,1 +0,0 @@
2910 -second
2911 -second
2911 diff -r 29114dbae42b -r 95c24699272e third
2912 diff -r 29114dbae42b -r 95c24699272e third
2912 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2913 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2913 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2914 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2914 @@ -0,0 +1,1 @@
2915 @@ -0,0 +1,1 @@
2915 +third
2916 +third
2916
2917
2917 $ hg log -r 8 -T "{diff('glob:f*')}"
2918 $ hg log -r 8 -T "{diff('glob:f*')}"
2918 diff -r 29114dbae42b -r 95c24699272e fourth
2919 diff -r 29114dbae42b -r 95c24699272e fourth
2919 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2920 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2920 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2921 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2921 @@ -0,0 +1,1 @@
2922 @@ -0,0 +1,1 @@
2922 +second
2923 +second
2923
2924
2924 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
2925 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
2925 diff -r 29114dbae42b -r 95c24699272e second
2926 diff -r 29114dbae42b -r 95c24699272e second
2926 --- a/second Mon Jan 12 13:46:40 1970 +0000
2927 --- a/second Mon Jan 12 13:46:40 1970 +0000
2927 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2928 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2928 @@ -1,1 +0,0 @@
2929 @@ -1,1 +0,0 @@
2929 -second
2930 -second
2930 diff -r 29114dbae42b -r 95c24699272e third
2931 diff -r 29114dbae42b -r 95c24699272e third
2931 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2932 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2932 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2933 +++ b/third Wed Jan 01 10:01:00 2020 +0000
2933 @@ -0,0 +1,1 @@
2934 @@ -0,0 +1,1 @@
2934 +third
2935 +third
2935
2936
2936 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2937 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2937 diff -r 29114dbae42b -r 95c24699272e fourth
2938 diff -r 29114dbae42b -r 95c24699272e fourth
2938 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2939 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2939 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2940 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2940 @@ -0,0 +1,1 @@
2941 @@ -0,0 +1,1 @@
2941 +second
2942 +second
2942
2943
2943 ui verbosity:
2944 ui verbosity:
2944
2945
2945 $ hg log -l1 -T '{verbosity}\n'
2946 $ hg log -l1 -T '{verbosity}\n'
2946
2947
2947 $ hg log -l1 -T '{verbosity}\n' --debug
2948 $ hg log -l1 -T '{verbosity}\n' --debug
2948 debug
2949 debug
2949 $ hg log -l1 -T '{verbosity}\n' --quiet
2950 $ hg log -l1 -T '{verbosity}\n' --quiet
2950 quiet
2951 quiet
2951 $ hg log -l1 -T '{verbosity}\n' --verbose
2952 $ hg log -l1 -T '{verbosity}\n' --verbose
2952 verbose
2953 verbose
2953
2954
2954 $ cd ..
2955 $ cd ..
2955
2956
2956
2957
2957 latesttag:
2958 latesttag:
2958
2959
2959 $ hg init latesttag
2960 $ hg init latesttag
2960 $ cd latesttag
2961 $ cd latesttag
2961
2962
2962 $ echo a > file
2963 $ echo a > file
2963 $ hg ci -Am a -d '0 0'
2964 $ hg ci -Am a -d '0 0'
2964 adding file
2965 adding file
2965
2966
2966 $ echo b >> file
2967 $ echo b >> file
2967 $ hg ci -m b -d '1 0'
2968 $ hg ci -m b -d '1 0'
2968
2969
2969 $ echo c >> head1
2970 $ echo c >> head1
2970 $ hg ci -Am h1c -d '2 0'
2971 $ hg ci -Am h1c -d '2 0'
2971 adding head1
2972 adding head1
2972
2973
2973 $ hg update -q 1
2974 $ hg update -q 1
2974 $ echo d >> head2
2975 $ echo d >> head2
2975 $ hg ci -Am h2d -d '3 0'
2976 $ hg ci -Am h2d -d '3 0'
2976 adding head2
2977 adding head2
2977 created new head
2978 created new head
2978
2979
2979 $ echo e >> head2
2980 $ echo e >> head2
2980 $ hg ci -m h2e -d '4 0'
2981 $ hg ci -m h2e -d '4 0'
2981
2982
2982 $ hg merge -q
2983 $ hg merge -q
2983 $ hg ci -m merge -d '5 -3600'
2984 $ hg ci -m merge -d '5 -3600'
2984
2985
2985 No tag set:
2986 No tag set:
2986
2987
2987 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
2988 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
2988 @ 5: null+5
2989 @ 5: null+5
2989 |\
2990 |\
2990 | o 4: null+4
2991 | o 4: null+4
2991 | |
2992 | |
2992 | o 3: null+3
2993 | o 3: null+3
2993 | |
2994 | |
2994 o | 2: null+3
2995 o | 2: null+3
2995 |/
2996 |/
2996 o 1: null+2
2997 o 1: null+2
2997 |
2998 |
2998 o 0: null+1
2999 o 0: null+1
2999
3000
3000
3001
3001 One common tag: longest path wins for {latesttagdistance}:
3002 One common tag: longest path wins for {latesttagdistance}:
3002
3003
3003 $ hg tag -r 1 -m t1 -d '6 0' t1
3004 $ hg tag -r 1 -m t1 -d '6 0' t1
3004 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3005 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3005 @ 6: t1+4
3006 @ 6: t1+4
3006 |
3007 |
3007 o 5: t1+3
3008 o 5: t1+3
3008 |\
3009 |\
3009 | o 4: t1+2
3010 | o 4: t1+2
3010 | |
3011 | |
3011 | o 3: t1+1
3012 | o 3: t1+1
3012 | |
3013 | |
3013 o | 2: t1+1
3014 o | 2: t1+1
3014 |/
3015 |/
3015 o 1: t1+0
3016 o 1: t1+0
3016 |
3017 |
3017 o 0: null+1
3018 o 0: null+1
3018
3019
3019
3020
3020 One ancestor tag: closest wins:
3021 One ancestor tag: closest wins:
3021
3022
3022 $ hg tag -r 2 -m t2 -d '7 0' t2
3023 $ hg tag -r 2 -m t2 -d '7 0' t2
3023 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3024 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3024 @ 7: t2+3
3025 @ 7: t2+3
3025 |
3026 |
3026 o 6: t2+2
3027 o 6: t2+2
3027 |
3028 |
3028 o 5: t2+1
3029 o 5: t2+1
3029 |\
3030 |\
3030 | o 4: t1+2
3031 | o 4: t1+2
3031 | |
3032 | |
3032 | o 3: t1+1
3033 | o 3: t1+1
3033 | |
3034 | |
3034 o | 2: t2+0
3035 o | 2: t2+0
3035 |/
3036 |/
3036 o 1: t1+0
3037 o 1: t1+0
3037 |
3038 |
3038 o 0: null+1
3039 o 0: null+1
3039
3040
3040
3041
3041 Two branch tags: more recent wins if same number of changes:
3042 Two branch tags: more recent wins if same number of changes:
3042
3043
3043 $ hg tag -r 3 -m t3 -d '8 0' t3
3044 $ hg tag -r 3 -m t3 -d '8 0' t3
3044 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3045 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3045 @ 8: t3+5
3046 @ 8: t3+5
3046 |
3047 |
3047 o 7: t3+4
3048 o 7: t3+4
3048 |
3049 |
3049 o 6: t3+3
3050 o 6: t3+3
3050 |
3051 |
3051 o 5: t3+2
3052 o 5: t3+2
3052 |\
3053 |\
3053 | o 4: t3+1
3054 | o 4: t3+1
3054 | |
3055 | |
3055 | o 3: t3+0
3056 | o 3: t3+0
3056 | |
3057 | |
3057 o | 2: t2+0
3058 o | 2: t2+0
3058 |/
3059 |/
3059 o 1: t1+0
3060 o 1: t1+0
3060 |
3061 |
3061 o 0: null+1
3062 o 0: null+1
3062
3063
3063
3064
3064 Two branch tags: fewest changes wins:
3065 Two branch tags: fewest changes wins:
3065
3066
3066 $ 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
3067 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3068 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3068 @ 9: t4+5,6
3069 @ 9: t4+5,6
3069 |
3070 |
3070 o 8: t4+4,5
3071 o 8: t4+4,5
3071 |
3072 |
3072 o 7: t4+3,4
3073 o 7: t4+3,4
3073 |
3074 |
3074 o 6: t4+2,3
3075 o 6: t4+2,3
3075 |
3076 |
3076 o 5: t4+1,2
3077 o 5: t4+1,2
3077 |\
3078 |\
3078 | o 4: t4+0,0
3079 | o 4: t4+0,0
3079 | |
3080 | |
3080 | o 3: t3+0,0
3081 | o 3: t3+0,0
3081 | |
3082 | |
3082 o | 2: t2+0,0
3083 o | 2: t2+0,0
3083 |/
3084 |/
3084 o 1: t1+0,0
3085 o 1: t1+0,0
3085 |
3086 |
3086 o 0: null+1,1
3087 o 0: null+1,1
3087
3088
3088
3089
3089 Merged tag overrides:
3090 Merged tag overrides:
3090
3091
3091 $ hg tag -r 5 -m t5 -d '9 0' t5
3092 $ hg tag -r 5 -m t5 -d '9 0' t5
3092 $ hg tag -r 3 -m at3 -d '10 0' at3
3093 $ hg tag -r 3 -m at3 -d '10 0' at3
3093 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3094 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
3094 @ 11: t5+6
3095 @ 11: t5+6
3095 |
3096 |
3096 o 10: t5+5
3097 o 10: t5+5
3097 |
3098 |
3098 o 9: t5+4
3099 o 9: t5+4
3099 |
3100 |
3100 o 8: t5+3
3101 o 8: t5+3
3101 |
3102 |
3102 o 7: t5+2
3103 o 7: t5+2
3103 |
3104 |
3104 o 6: t5+1
3105 o 6: t5+1
3105 |
3106 |
3106 o 5: t5+0
3107 o 5: t5+0
3107 |\
3108 |\
3108 | o 4: t4+0
3109 | o 4: t4+0
3109 | |
3110 | |
3110 | o 3: at3:t3+0
3111 | o 3: at3:t3+0
3111 | |
3112 | |
3112 o | 2: t2+0
3113 o | 2: t2+0
3113 |/
3114 |/
3114 o 1: t1+0
3115 o 1: t1+0
3115 |
3116 |
3116 o 0: null+1
3117 o 0: null+1
3117
3118
3118
3119
3119 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3120 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
3120 @ 11: t5+6,6
3121 @ 11: t5+6,6
3121 |
3122 |
3122 o 10: t5+5,5
3123 o 10: t5+5,5
3123 |
3124 |
3124 o 9: t5+4,4
3125 o 9: t5+4,4
3125 |
3126 |
3126 o 8: t5+3,3
3127 o 8: t5+3,3
3127 |
3128 |
3128 o 7: t5+2,2
3129 o 7: t5+2,2
3129 |
3130 |
3130 o 6: t5+1,1
3131 o 6: t5+1,1
3131 |
3132 |
3132 o 5: t5+0,0
3133 o 5: t5+0,0
3133 |\
3134 |\
3134 | o 4: t4+0,0
3135 | o 4: t4+0,0
3135 | |
3136 | |
3136 | o 3: at3+0,0 t3+0,0
3137 | o 3: at3+0,0 t3+0,0
3137 | |
3138 | |
3138 o | 2: t2+0,0
3139 o | 2: t2+0,0
3139 |/
3140 |/
3140 o 1: t1+0,0
3141 o 1: t1+0,0
3141 |
3142 |
3142 o 0: null+1,1
3143 o 0: null+1,1
3143
3144
3144
3145
3145 $ 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"
3146 @ 11: t3, C: 9, D: 8
3147 @ 11: t3, C: 9, D: 8
3147 |
3148 |
3148 o 10: t3, C: 8, D: 7
3149 o 10: t3, C: 8, D: 7
3149 |
3150 |
3150 o 9: t3, C: 7, D: 6
3151 o 9: t3, C: 7, D: 6
3151 |
3152 |
3152 o 8: t3, C: 6, D: 5
3153 o 8: t3, C: 6, D: 5
3153 |
3154 |
3154 o 7: t3, C: 5, D: 4
3155 o 7: t3, C: 5, D: 4
3155 |
3156 |
3156 o 6: t3, C: 4, D: 3
3157 o 6: t3, C: 4, D: 3
3157 |
3158 |
3158 o 5: t3, C: 3, D: 2
3159 o 5: t3, C: 3, D: 2
3159 |\
3160 |\
3160 | o 4: t3, C: 1, D: 1
3161 | o 4: t3, C: 1, D: 1
3161 | |
3162 | |
3162 | o 3: t3, C: 0, D: 0
3163 | o 3: t3, C: 0, D: 0
3163 | |
3164 | |
3164 o | 2: t1, C: 1, D: 1
3165 o | 2: t1, C: 1, D: 1
3165 |/
3166 |/
3166 o 1: t1, C: 0, D: 0
3167 o 1: t1, C: 0, D: 0
3167 |
3168 |
3168 o 0: null, C: 1, D: 1
3169 o 0: null, C: 1, D: 1
3169
3170
3170
3171
3171 $ cd ..
3172 $ cd ..
3172
3173
3173
3174
3174 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
3175 if it is a relative path
3176 if it is a relative path
3176
3177
3177 $ mkdir -p home/styles
3178 $ mkdir -p home/styles
3178
3179
3179 $ cat > home/styles/teststyle <<EOF
3180 $ cat > home/styles/teststyle <<EOF
3180 > changeset = 'test {rev}:{node|short}\n'
3181 > changeset = 'test {rev}:{node|short}\n'
3181 > EOF
3182 > EOF
3182
3183
3183 $ HOME=`pwd`/home; export HOME
3184 $ HOME=`pwd`/home; export HOME
3184
3185
3185 $ cat > latesttag/.hg/hgrc <<EOF
3186 $ cat > latesttag/.hg/hgrc <<EOF
3186 > [ui]
3187 > [ui]
3187 > style = ~/styles/teststyle
3188 > style = ~/styles/teststyle
3188 > EOF
3189 > EOF
3189
3190
3190 $ hg -R latesttag tip
3191 $ hg -R latesttag tip
3191 test 11:97e5943b523a
3192 test 11:97e5943b523a
3192
3193
3193 Test recursive showlist template (issue1989):
3194 Test recursive showlist template (issue1989):
3194
3195
3195 $ cat > style1989 <<EOF
3196 $ cat > style1989 <<EOF
3196 > changeset = '{file_mods}{manifest}{extras}'
3197 > changeset = '{file_mods}{manifest}{extras}'
3197 > file_mod = 'M|{author|person}\n'
3198 > file_mod = 'M|{author|person}\n'
3198 > manifest = '{rev},{author}\n'
3199 > manifest = '{rev},{author}\n'
3199 > extra = '{key}: {author}\n'
3200 > extra = '{key}: {author}\n'
3200 > EOF
3201 > EOF
3201
3202
3202 $ hg -R latesttag log -r tip --style=style1989
3203 $ hg -R latesttag log -r tip --style=style1989
3203 M|test
3204 M|test
3204 11,test
3205 11,test
3205 branch: test
3206 branch: test
3206
3207
3207 Test new-style inline templating:
3208 Test new-style inline templating:
3208
3209
3209 $ 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'
3210 modified files: .hgtags
3211 modified files: .hgtags
3211
3212
3212
3213
3213 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
3214 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
3214 hg: parse error: keyword 'rev' is not iterable of mappings
3215 hg: parse error: keyword 'rev' is not iterable of mappings
3215 [255]
3216 [255]
3216 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
3217 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
3217 hg: parse error: None is not iterable of mappings
3218 hg: parse error: None is not iterable of mappings
3218 [255]
3219 [255]
3219 $ hg log -R latesttag -r tip -T '{extras % "{key}\n" % "{key}\n"}'
3220 $ hg log -R latesttag -r tip -T '{extras % "{key}\n" % "{key}\n"}'
3220 hg: parse error: list of strings is not mappable
3221 hg: parse error: list of strings is not mappable
3221 [255]
3222 [255]
3222
3223
3223 Test new-style inline templating of non-list/dict type:
3224 Test new-style inline templating of non-list/dict type:
3224
3225
3225 $ hg log -R latesttag -r tip -T '{manifest}\n'
3226 $ hg log -R latesttag -r tip -T '{manifest}\n'
3226 11:2bc6e9006ce2
3227 11:2bc6e9006ce2
3227 $ hg log -R latesttag -r tip -T 'string length: {manifest|count}\n'
3228 $ hg log -R latesttag -r tip -T 'string length: {manifest|count}\n'
3228 string length: 15
3229 string length: 15
3229 $ hg log -R latesttag -r tip -T '{manifest % "{rev}:{node}"}\n'
3230 $ hg log -R latesttag -r tip -T '{manifest % "{rev}:{node}"}\n'
3230 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc
3231 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc
3231
3232
3232 $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}'
3233 $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}'
3233 branch: default
3234 branch: default
3234 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}'
3235 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}'
3235 hg: parse error: None is not iterable of mappings
3236 hg: parse error: None is not iterable of mappings
3236 [255]
3237 [255]
3237 $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}'
3238 $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}'
3238 branch: default
3239 branch: default
3239 $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}'
3240 $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}'
3240 0:ce3cec86e6c2
3241 0:ce3cec86e6c2
3241 $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}'
3242 $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}'
3242 9:fbc7cd862e9c
3243 9:fbc7cd862e9c
3243
3244
3244 Test manifest/get() can be join()-ed as before, though it's silly:
3245 Test manifest/get() can be join()-ed as before, though it's silly:
3245
3246
3246 $ hg log -R latesttag -r tip -T '{join(manifest, "")}\n'
3247 $ hg log -R latesttag -r tip -T '{join(manifest, "")}\n'
3247 11:2bc6e9006ce2
3248 11:2bc6e9006ce2
3248 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), "")}\n'
3249 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), "")}\n'
3249 default
3250 default
3250
3251
3251 Test min/max of integers
3252 Test min/max of integers
3252
3253
3253 $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'
3254 $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'
3254 9
3255 9
3255 $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n'
3256 $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n'
3256 10
3257 10
3257
3258
3258 Test min/max over map operation:
3259 Test min/max over map operation:
3259
3260
3260 $ hg log -R latesttag -r3 -T '{min(tags % "{tag}")}\n'
3261 $ hg log -R latesttag -r3 -T '{min(tags % "{tag}")}\n'
3261 at3
3262 at3
3262 $ hg log -R latesttag -r3 -T '{max(tags % "{tag}")}\n'
3263 $ hg log -R latesttag -r3 -T '{max(tags % "{tag}")}\n'
3263 t3
3264 t3
3264
3265
3265 Test min/max of if() result
3266 Test min/max of if() result
3266
3267
3267 $ cd latesttag
3268 $ cd latesttag
3268 $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
3269 $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
3269 9
3270 9
3270 $ hg log -l1 -T '{max(if(false, "", revset("9:10")))}\n'
3271 $ hg log -l1 -T '{max(if(false, "", revset("9:10")))}\n'
3271 10
3272 10
3272 $ hg log -l1 -T '{min(ifcontains("a", "aa", revset("9:10"), ""))}\n'
3273 $ hg log -l1 -T '{min(ifcontains("a", "aa", revset("9:10"), ""))}\n'
3273 9
3274 9
3274 $ hg log -l1 -T '{max(ifcontains("a", "bb", "", revset("9:10")))}\n'
3275 $ hg log -l1 -T '{max(ifcontains("a", "bb", "", revset("9:10")))}\n'
3275 10
3276 10
3276 $ hg log -l1 -T '{min(ifeq(0, 0, revset("9:10"), ""))}\n'
3277 $ hg log -l1 -T '{min(ifeq(0, 0, revset("9:10"), ""))}\n'
3277 9
3278 9
3278 $ hg log -l1 -T '{max(ifeq(0, 1, "", revset("9:10")))}\n'
3279 $ hg log -l1 -T '{max(ifeq(0, 1, "", revset("9:10")))}\n'
3279 10
3280 10
3280 $ cd ..
3281 $ cd ..
3281
3282
3282 Test laziness of if() then/else clause
3283 Test laziness of if() then/else clause
3283
3284
3284 $ hg debugtemplate '{count(0)}'
3285 $ hg debugtemplate '{count(0)}'
3285 hg: parse error: not countable
3286 hg: parse error: not countable
3286 (incompatible use of template filter 'count')
3287 (incompatible use of template filter 'count')
3287 [255]
3288 [255]
3288 $ hg debugtemplate '{if(true, "", count(0))}'
3289 $ hg debugtemplate '{if(true, "", count(0))}'
3289 $ hg debugtemplate '{if(false, count(0), "")}'
3290 $ hg debugtemplate '{if(false, count(0), "")}'
3290 $ hg debugtemplate '{ifcontains("a", "aa", "", count(0))}'
3291 $ hg debugtemplate '{ifcontains("a", "aa", "", count(0))}'
3291 $ hg debugtemplate '{ifcontains("a", "bb", count(0), "")}'
3292 $ hg debugtemplate '{ifcontains("a", "bb", count(0), "")}'
3292 $ hg debugtemplate '{ifeq(0, 0, "", count(0))}'
3293 $ hg debugtemplate '{ifeq(0, 0, "", count(0))}'
3293 $ hg debugtemplate '{ifeq(0, 1, count(0), "")}'
3294 $ hg debugtemplate '{ifeq(0, 1, count(0), "")}'
3294
3295
3295 Test dot operator precedence:
3296 Test dot operator precedence:
3296
3297
3297 $ hg debugtemplate -R latesttag -r0 -v '{manifest.node|short}\n'
3298 $ hg debugtemplate -R latesttag -r0 -v '{manifest.node|short}\n'
3298 (template
3299 (template
3299 (|
3300 (|
3300 (.
3301 (.
3301 (symbol 'manifest')
3302 (symbol 'manifest')
3302 (symbol 'node'))
3303 (symbol 'node'))
3303 (symbol 'short'))
3304 (symbol 'short'))
3304 (string '\n'))
3305 (string '\n'))
3305 89f4071fec70
3306 89f4071fec70
3306
3307
3307 (the following examples are invalid, but seem natural in parsing POV)
3308 (the following examples are invalid, but seem natural in parsing POV)
3308
3309
3309 $ hg debugtemplate -R latesttag -r0 -v '{foo|bar.baz}\n' 2> /dev/null
3310 $ hg debugtemplate -R latesttag -r0 -v '{foo|bar.baz}\n' 2> /dev/null
3310 (template
3311 (template
3311 (|
3312 (|
3312 (symbol 'foo')
3313 (symbol 'foo')
3313 (.
3314 (.
3314 (symbol 'bar')
3315 (symbol 'bar')
3315 (symbol 'baz')))
3316 (symbol 'baz')))
3316 (string '\n'))
3317 (string '\n'))
3317 [255]
3318 [255]
3318 $ hg debugtemplate -R latesttag -r0 -v '{foo.bar()}\n' 2> /dev/null
3319 $ hg debugtemplate -R latesttag -r0 -v '{foo.bar()}\n' 2> /dev/null
3319 (template
3320 (template
3320 (.
3321 (.
3321 (symbol 'foo')
3322 (symbol 'foo')
3322 (func
3323 (func
3323 (symbol 'bar')
3324 (symbol 'bar')
3324 None))
3325 None))
3325 (string '\n'))
3326 (string '\n'))
3326 [255]
3327 [255]
3327
3328
3328 Test evaluation of dot operator:
3329 Test evaluation of dot operator:
3329
3330
3330 $ hg log -R latesttag -l1 -T '{min(revset("0:9")).node}\n'
3331 $ hg log -R latesttag -l1 -T '{min(revset("0:9")).node}\n'
3331 ce3cec86e6c26bd9bdfc590a6b92abc9680f1796
3332 ce3cec86e6c26bd9bdfc590a6b92abc9680f1796
3332 $ hg log -R latesttag -r0 -T '{extras.branch}\n'
3333 $ hg log -R latesttag -r0 -T '{extras.branch}\n'
3333 default
3334 default
3334
3335
3335 $ hg log -R latesttag -l1 -T '{author.invalid}\n'
3336 $ hg log -R latesttag -l1 -T '{author.invalid}\n'
3336 hg: parse error: keyword 'author' has no member
3337 hg: parse error: keyword 'author' has no member
3337 [255]
3338 [255]
3338 $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n'
3339 $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n'
3339 hg: parse error: 'a' has no member
3340 hg: parse error: 'a' has no member
3340 [255]
3341 [255]
3341
3342
3342 Test the sub function of templating for expansion:
3343 Test the sub function of templating for expansion:
3343
3344
3344 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
3345 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
3345 xx
3346 xx
3346
3347
3347 $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n'
3348 $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n'
3348 hg: parse error: sub got an invalid pattern: [
3349 hg: parse error: sub got an invalid pattern: [
3349 [255]
3350 [255]
3350 $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n'
3351 $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n'
3351 hg: parse error: sub got an invalid replacement: \1
3352 hg: parse error: sub got an invalid replacement: \1
3352 [255]
3353 [255]
3353
3354
3354 Test the strip function with chars specified:
3355 Test the strip function with chars specified:
3355
3356
3356 $ hg log -R latesttag --template '{desc}\n'
3357 $ hg log -R latesttag --template '{desc}\n'
3357 at3
3358 at3
3358 t5
3359 t5
3359 t4
3360 t4
3360 t3
3361 t3
3361 t2
3362 t2
3362 t1
3363 t1
3363 merge
3364 merge
3364 h2e
3365 h2e
3365 h2d
3366 h2d
3366 h1c
3367 h1c
3367 b
3368 b
3368 a
3369 a
3369
3370
3370 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
3371 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
3371 at3
3372 at3
3372 5
3373 5
3373 4
3374 4
3374 3
3375 3
3375 2
3376 2
3376 1
3377 1
3377 merg
3378 merg
3378 h2
3379 h2
3379 h2d
3380 h2d
3380 h1c
3381 h1c
3381 b
3382 b
3382 a
3383 a
3383
3384
3384 Test date format:
3385 Test date format:
3385
3386
3386 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
3387 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
3387 date: 70 01 01 10 +0000
3388 date: 70 01 01 10 +0000
3388 date: 70 01 01 09 +0000
3389 date: 70 01 01 09 +0000
3389 date: 70 01 01 04 +0000
3390 date: 70 01 01 04 +0000
3390 date: 70 01 01 08 +0000
3391 date: 70 01 01 08 +0000
3391 date: 70 01 01 07 +0000
3392 date: 70 01 01 07 +0000
3392 date: 70 01 01 06 +0000
3393 date: 70 01 01 06 +0000
3393 date: 70 01 01 05 +0100
3394 date: 70 01 01 05 +0100
3394 date: 70 01 01 04 +0000
3395 date: 70 01 01 04 +0000
3395 date: 70 01 01 03 +0000
3396 date: 70 01 01 03 +0000
3396 date: 70 01 01 02 +0000
3397 date: 70 01 01 02 +0000
3397 date: 70 01 01 01 +0000
3398 date: 70 01 01 01 +0000
3398 date: 70 01 01 00 +0000
3399 date: 70 01 01 00 +0000
3399
3400
3400 Test invalid date:
3401 Test invalid date:
3401
3402
3402 $ hg log -R latesttag -T '{date(rev)}\n'
3403 $ hg log -R latesttag -T '{date(rev)}\n'
3403 hg: parse error: date expects a date information
3404 hg: parse error: date expects a date information
3404 [255]
3405 [255]
3405
3406
3406 Test integer literal:
3407 Test integer literal:
3407
3408
3408 $ hg debugtemplate -v '{(0)}\n'
3409 $ hg debugtemplate -v '{(0)}\n'
3409 (template
3410 (template
3410 (group
3411 (group
3411 (integer '0'))
3412 (integer '0'))
3412 (string '\n'))
3413 (string '\n'))
3413 0
3414 0
3414 $ hg debugtemplate -v '{(123)}\n'
3415 $ hg debugtemplate -v '{(123)}\n'
3415 (template
3416 (template
3416 (group
3417 (group
3417 (integer '123'))
3418 (integer '123'))
3418 (string '\n'))
3419 (string '\n'))
3419 123
3420 123
3420 $ hg debugtemplate -v '{(-4)}\n'
3421 $ hg debugtemplate -v '{(-4)}\n'
3421 (template
3422 (template
3422 (group
3423 (group
3423 (negate
3424 (negate
3424 (integer '4')))
3425 (integer '4')))
3425 (string '\n'))
3426 (string '\n'))
3426 -4
3427 -4
3427 $ hg debugtemplate '{(-)}\n'
3428 $ hg debugtemplate '{(-)}\n'
3428 hg: parse error at 3: not a prefix: )
3429 hg: parse error at 3: not a prefix: )
3429 ({(-)}\n
3430 ({(-)}\n
3430 ^ here)
3431 ^ here)
3431 [255]
3432 [255]
3432 $ hg debugtemplate '{(-a)}\n'
3433 $ hg debugtemplate '{(-a)}\n'
3433 hg: parse error: negation needs an integer argument
3434 hg: parse error: negation needs an integer argument
3434 [255]
3435 [255]
3435
3436
3436 top-level integer literal is interpreted as symbol (i.e. variable name):
3437 top-level integer literal is interpreted as symbol (i.e. variable name):
3437
3438
3438 $ hg debugtemplate -D 1=one -v '{1}\n'
3439 $ hg debugtemplate -D 1=one -v '{1}\n'
3439 (template
3440 (template
3440 (integer '1')
3441 (integer '1')
3441 (string '\n'))
3442 (string '\n'))
3442 one
3443 one
3443 $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n'
3444 $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n'
3444 (template
3445 (template
3445 (func
3446 (func
3446 (symbol 'if')
3447 (symbol 'if')
3447 (list
3448 (list
3448 (string 't')
3449 (string 't')
3449 (template
3450 (template
3450 (integer '1'))))
3451 (integer '1'))))
3451 (string '\n'))
3452 (string '\n'))
3452 one
3453 one
3453 $ hg debugtemplate -D 1=one -v '{1|stringify}\n'
3454 $ hg debugtemplate -D 1=one -v '{1|stringify}\n'
3454 (template
3455 (template
3455 (|
3456 (|
3456 (integer '1')
3457 (integer '1')
3457 (symbol 'stringify'))
3458 (symbol 'stringify'))
3458 (string '\n'))
3459 (string '\n'))
3459 one
3460 one
3460
3461
3461 unless explicit symbol is expected:
3462 unless explicit symbol is expected:
3462
3463
3463 $ hg log -Ra -r0 -T '{desc|1}\n'
3464 $ hg log -Ra -r0 -T '{desc|1}\n'
3464 hg: parse error: expected a symbol, got 'integer'
3465 hg: parse error: expected a symbol, got 'integer'
3465 [255]
3466 [255]
3466 $ hg log -Ra -r0 -T '{1()}\n'
3467 $ hg log -Ra -r0 -T '{1()}\n'
3467 hg: parse error: expected a symbol, got 'integer'
3468 hg: parse error: expected a symbol, got 'integer'
3468 [255]
3469 [255]
3469
3470
3470 Test string literal:
3471 Test string literal:
3471
3472
3472 $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n'
3473 $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n'
3473 (template
3474 (template
3474 (string 'string with no template fragment')
3475 (string 'string with no template fragment')
3475 (string '\n'))
3476 (string '\n'))
3476 string with no template fragment
3477 string with no template fragment
3477 $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n'
3478 $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n'
3478 (template
3479 (template
3479 (template
3480 (template
3480 (string 'template: ')
3481 (string 'template: ')
3481 (symbol 'rev'))
3482 (symbol 'rev'))
3482 (string '\n'))
3483 (string '\n'))
3483 template: 0
3484 template: 0
3484 $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n'
3485 $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n'
3485 (template
3486 (template
3486 (string 'rawstring: {rev}')
3487 (string 'rawstring: {rev}')
3487 (string '\n'))
3488 (string '\n'))
3488 rawstring: {rev}
3489 rawstring: {rev}
3489 $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n'
3490 $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n'
3490 (template
3491 (template
3491 (%
3492 (%
3492 (symbol 'files')
3493 (symbol 'files')
3493 (string 'rawstring: {file}'))
3494 (string 'rawstring: {file}'))
3494 (string '\n'))
3495 (string '\n'))
3495 rawstring: {file}
3496 rawstring: {file}
3496
3497
3497 Test string escaping:
3498 Test string escaping:
3498
3499
3499 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3500 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3500 >
3501 >
3501 <>\n<[>
3502 <>\n<[>
3502 <>\n<]>
3503 <>\n<]>
3503 <>\n<
3504 <>\n<
3504
3505
3505 $ hg log -R latesttag -r 0 \
3506 $ hg log -R latesttag -r 0 \
3506 > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3507 > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3507 >
3508 >
3508 <>\n<[>
3509 <>\n<[>
3509 <>\n<]>
3510 <>\n<]>
3510 <>\n<
3511 <>\n<
3511
3512
3512 $ hg log -R latesttag -r 0 -T esc \
3513 $ hg log -R latesttag -r 0 -T esc \
3513 > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3514 > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3514 >
3515 >
3515 <>\n<[>
3516 <>\n<[>
3516 <>\n<]>
3517 <>\n<]>
3517 <>\n<
3518 <>\n<
3518
3519
3519 $ cat <<'EOF' > esctmpl
3520 $ cat <<'EOF' > esctmpl
3520 > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3521 > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
3521 > EOF
3522 > EOF
3522 $ hg log -R latesttag -r 0 --style ./esctmpl
3523 $ hg log -R latesttag -r 0 --style ./esctmpl
3523 >
3524 >
3524 <>\n<[>
3525 <>\n<[>
3525 <>\n<]>
3526 <>\n<]>
3526 <>\n<
3527 <>\n<
3527
3528
3528 Test string escaping of quotes:
3529 Test string escaping of quotes:
3529
3530
3530 $ hg log -Ra -r0 -T '{"\""}\n'
3531 $ hg log -Ra -r0 -T '{"\""}\n'
3531 "
3532 "
3532 $ hg log -Ra -r0 -T '{"\\\""}\n'
3533 $ hg log -Ra -r0 -T '{"\\\""}\n'
3533 \"
3534 \"
3534 $ hg log -Ra -r0 -T '{r"\""}\n'
3535 $ hg log -Ra -r0 -T '{r"\""}\n'
3535 \"
3536 \"
3536 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3537 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3537 \\\"
3538 \\\"
3538
3539
3539
3540
3540 $ hg log -Ra -r0 -T '{"\""}\n'
3541 $ hg log -Ra -r0 -T '{"\""}\n'
3541 "
3542 "
3542 $ hg log -Ra -r0 -T '{"\\\""}\n'
3543 $ hg log -Ra -r0 -T '{"\\\""}\n'
3543 \"
3544 \"
3544 $ hg log -Ra -r0 -T '{r"\""}\n'
3545 $ hg log -Ra -r0 -T '{r"\""}\n'
3545 \"
3546 \"
3546 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3547 $ hg log -Ra -r0 -T '{r"\\\""}\n'
3547 \\\"
3548 \\\"
3548
3549
3549 Test exception in quoted template. single backslash before quotation mark is
3550 Test exception in quoted template. single backslash before quotation mark is
3550 stripped before parsing:
3551 stripped before parsing:
3551
3552
3552 $ cat <<'EOF' > escquotetmpl
3553 $ cat <<'EOF' > escquotetmpl
3553 > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n"
3554 > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n"
3554 > EOF
3555 > EOF
3555 $ cd latesttag
3556 $ cd latesttag
3556 $ hg log -r 2 --style ../escquotetmpl
3557 $ hg log -r 2 --style ../escquotetmpl
3557 " \" \" \\" head1
3558 " \" \" \\" head1
3558
3559
3559 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"'
3560 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"'
3560 valid
3561 valid
3561 $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'"
3562 $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'"
3562 valid
3563 valid
3563
3564
3564 Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested
3565 Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested
3565 _evalifliteral() templates (issue4733):
3566 _evalifliteral() templates (issue4733):
3566
3567
3567 $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n'
3568 $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n'
3568 "2
3569 "2
3569 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n'
3570 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n'
3570 "2
3571 "2
3571 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n'
3572 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n'
3572 "2
3573 "2
3573
3574
3574 $ hg log -r 2 -T '{if(rev, "\\\"")}\n'
3575 $ hg log -r 2 -T '{if(rev, "\\\"")}\n'
3575 \"
3576 \"
3576 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n'
3577 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n'
3577 \"
3578 \"
3578 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3579 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3579 \"
3580 \"
3580
3581
3581 $ hg log -r 2 -T '{if(rev, r"\\\"")}\n'
3582 $ hg log -r 2 -T '{if(rev, r"\\\"")}\n'
3582 \\\"
3583 \\\"
3583 $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n'
3584 $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n'
3584 \\\"
3585 \\\"
3585 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3586 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n'
3586 \\\"
3587 \\\"
3587
3588
3588 escaped single quotes and errors:
3589 escaped single quotes and errors:
3589
3590
3590 $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n'
3591 $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n'
3591 foo
3592 foo
3592 $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n'
3593 $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n'
3593 foo
3594 foo
3594 $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n'
3595 $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n'
3595 hg: parse error at 21: unterminated string
3596 hg: parse error at 21: unterminated string
3596 ({if(rev, "{if(rev, \")}")}\n
3597 ({if(rev, "{if(rev, \")}")}\n
3597 ^ here)
3598 ^ here)
3598 [255]
3599 [255]
3599 $ hg log -r 2 -T '{if(rev, \"\\"")}\n'
3600 $ hg log -r 2 -T '{if(rev, \"\\"")}\n'
3600 hg: parse error: trailing \ in string
3601 hg: parse error: trailing \ in string
3601 [255]
3602 [255]
3602 $ hg log -r 2 -T '{if(rev, r\"\\"")}\n'
3603 $ hg log -r 2 -T '{if(rev, r\"\\"")}\n'
3603 hg: parse error: trailing \ in string
3604 hg: parse error: trailing \ in string
3604 [255]
3605 [255]
3605
3606
3606 $ cd ..
3607 $ cd ..
3607
3608
3608 Test leading backslashes:
3609 Test leading backslashes:
3609
3610
3610 $ cd latesttag
3611 $ cd latesttag
3611 $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n'
3612 $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n'
3612 {rev} {file}
3613 {rev} {file}
3613 $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n'
3614 $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n'
3614 \2 \head1
3615 \2 \head1
3615 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n'
3616 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n'
3616 \{rev} \{file}
3617 \{rev} \{file}
3617 $ cd ..
3618 $ cd ..
3618
3619
3619 Test leading backslashes in "if" expression (issue4714):
3620 Test leading backslashes in "if" expression (issue4714):
3620
3621
3621 $ cd latesttag
3622 $ cd latesttag
3622 $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n'
3623 $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n'
3623 {rev} \{rev}
3624 {rev} \{rev}
3624 $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n'
3625 $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n'
3625 \2 \\{rev}
3626 \2 \\{rev}
3626 $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n'
3627 $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n'
3627 \{rev} \\\{rev}
3628 \{rev} \\\{rev}
3628 $ cd ..
3629 $ cd ..
3629
3630
3630 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
3631 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
3631
3632
3632 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
3633 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
3633 \x6e
3634 \x6e
3634 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
3635 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
3635 \x5c\x786e
3636 \x5c\x786e
3636 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
3637 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
3637 \x6e
3638 \x6e
3638 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
3639 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
3639 \x5c\x786e
3640 \x5c\x786e
3640
3641
3641 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
3642 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
3642 \x6e
3643 \x6e
3643 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
3644 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
3644 \x5c\x786e
3645 \x5c\x786e
3645 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
3646 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
3646 \x6e
3647 \x6e
3647 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
3648 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
3648 \x5c\x786e
3649 \x5c\x786e
3649
3650
3650 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
3651 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
3651 fourth
3652 fourth
3652 second
3653 second
3653 third
3654 third
3654 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
3655 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
3655 fourth\nsecond\nthird
3656 fourth\nsecond\nthird
3656
3657
3657 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
3658 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
3658 <p>
3659 <p>
3659 1st
3660 1st
3660 </p>
3661 </p>
3661 <p>
3662 <p>
3662 2nd
3663 2nd
3663 </p>
3664 </p>
3664 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
3665 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
3665 <p>
3666 <p>
3666 1st\n\n2nd
3667 1st\n\n2nd
3667 </p>
3668 </p>
3668 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
3669 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
3669 1st
3670 1st
3670
3671
3671 2nd
3672 2nd
3672
3673
3673 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
3674 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
3674 o perso
3675 o perso
3675 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
3676 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
3676 no person
3677 no person
3677 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
3678 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
3678 o perso
3679 o perso
3679 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
3680 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
3680 no perso
3681 no perso
3681
3682
3682 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
3683 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
3683 -o perso-
3684 -o perso-
3684 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
3685 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
3685 no person
3686 no person
3686 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
3687 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
3687 \x2do perso\x2d
3688 \x2do perso\x2d
3688 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
3689 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
3689 -o perso-
3690 -o perso-
3690 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
3691 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
3691 \x2do perso\x6e
3692 \x2do perso\x6e
3692
3693
3693 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
3694 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
3694 fourth
3695 fourth
3695 second
3696 second
3696 third
3697 third
3697
3698
3698 Test string escaping in nested expression:
3699 Test string escaping in nested expression:
3699
3700
3700 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
3701 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
3701 fourth\x6esecond\x6ethird
3702 fourth\x6esecond\x6ethird
3702 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
3703 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
3703 fourth\x6esecond\x6ethird
3704 fourth\x6esecond\x6ethird
3704
3705
3705 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
3706 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
3706 fourth\x6esecond\x6ethird
3707 fourth\x6esecond\x6ethird
3707 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
3708 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
3708 fourth\x5c\x786esecond\x5c\x786ethird
3709 fourth\x5c\x786esecond\x5c\x786ethird
3709
3710
3710 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
3711 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
3711 3:\x6eo user, \x6eo domai\x6e
3712 3:\x6eo user, \x6eo domai\x6e
3712 4:\x5c\x786eew bra\x5c\x786ech
3713 4:\x5c\x786eew bra\x5c\x786ech
3713
3714
3714 Test quotes in nested expression are evaluated just like a $(command)
3715 Test quotes in nested expression are evaluated just like a $(command)
3715 substitution in POSIX shells:
3716 substitution in POSIX shells:
3716
3717
3717 $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n'
3718 $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n'
3718 8:95c24699272e
3719 8:95c24699272e
3719 $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n'
3720 $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n'
3720 {8} "95c24699272e"
3721 {8} "95c24699272e"
3721
3722
3722 Test recursive evaluation:
3723 Test recursive evaluation:
3723
3724
3724 $ hg init r
3725 $ hg init r
3725 $ cd r
3726 $ cd r
3726 $ echo a > a
3727 $ echo a > a
3727 $ hg ci -Am '{rev}'
3728 $ hg ci -Am '{rev}'
3728 adding a
3729 adding a
3729 $ hg log -r 0 --template '{if(rev, desc)}\n'
3730 $ hg log -r 0 --template '{if(rev, desc)}\n'
3730 {rev}
3731 {rev}
3731 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
3732 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
3732 test 0
3733 test 0
3733
3734
3734 $ hg branch -q 'text.{rev}'
3735 $ hg branch -q 'text.{rev}'
3735 $ echo aa >> aa
3736 $ echo aa >> aa
3736 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
3737 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
3737
3738
3738 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
3739 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
3739 {node|short}desc to
3740 {node|short}desc to
3740 text.{rev}be wrapped
3741 text.{rev}be wrapped
3741 text.{rev}desc to be
3742 text.{rev}desc to be
3742 text.{rev}wrapped (no-eol)
3743 text.{rev}wrapped (no-eol)
3743 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
3744 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
3744 bcc7ff960b8e:desc to
3745 bcc7ff960b8e:desc to
3745 text.1:be wrapped
3746 text.1:be wrapped
3746 text.1:desc to be
3747 text.1:desc to be
3747 text.1:wrapped (no-eol)
3748 text.1:wrapped (no-eol)
3748 $ hg log -l1 -T '{fill(desc, date, "", "")}\n'
3749 $ hg log -l1 -T '{fill(desc, date, "", "")}\n'
3749 hg: parse error: fill expects an integer width
3750 hg: parse error: fill expects an integer width
3750 [255]
3751 [255]
3751
3752
3752 $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}'
3753 $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}'
3753 bcc7ff960b8e:desc to be
3754 bcc7ff960b8e:desc to be
3754 termwidth.1:wrapped desc
3755 termwidth.1:wrapped desc
3755 termwidth.1:to be wrapped (no-eol)
3756 termwidth.1:to be wrapped (no-eol)
3756
3757
3757 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3758 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3758 {node|short} (no-eol)
3759 {node|short} (no-eol)
3759 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
3760 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
3760 bcc-ff---b-e (no-eol)
3761 bcc-ff---b-e (no-eol)
3761
3762
3762 $ cat >> .hg/hgrc <<EOF
3763 $ cat >> .hg/hgrc <<EOF
3763 > [extensions]
3764 > [extensions]
3764 > color=
3765 > color=
3765 > [color]
3766 > [color]
3766 > mode=ansi
3767 > mode=ansi
3767 > text.{rev} = red
3768 > text.{rev} = red
3768 > text.1 = green
3769 > text.1 = green
3769 > EOF
3770 > EOF
3770 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
3771 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
3771 \x1b[0;31mtext\x1b[0m (esc)
3772 \x1b[0;31mtext\x1b[0m (esc)
3772 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
3773 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
3773 \x1b[0;32mtext\x1b[0m (esc)
3774 \x1b[0;32mtext\x1b[0m (esc)
3774
3775
3775 color effect can be specified without quoting:
3776 color effect can be specified without quoting:
3776
3777
3777 $ hg log --color=always -l 1 --template '{label(red, "text\n")}'
3778 $ hg log --color=always -l 1 --template '{label(red, "text\n")}'
3778 \x1b[0;31mtext\x1b[0m (esc)
3779 \x1b[0;31mtext\x1b[0m (esc)
3779
3780
3780 color effects can be nested (issue5413)
3781 color effects can be nested (issue5413)
3781
3782
3782 $ hg debugtemplate --color=always \
3783 $ hg debugtemplate --color=always \
3783 > '{label(red, "red{label(magenta, "ma{label(cyan, "cyan")}{label(yellow, "yellow")}genta")}")}\n'
3784 > '{label(red, "red{label(magenta, "ma{label(cyan, "cyan")}{label(yellow, "yellow")}genta")}")}\n'
3784 \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)
3785 \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)
3785
3786
3786 pad() should interact well with color codes (issue5416)
3787 pad() should interact well with color codes (issue5416)
3787
3788
3788 $ hg debugtemplate --color=always \
3789 $ hg debugtemplate --color=always \
3789 > '{pad(label(red, "red"), 5, label(cyan, "-"))}\n'
3790 > '{pad(label(red, "red"), 5, label(cyan, "-"))}\n'
3790 \x1b[0;31mred\x1b[0m\x1b[0;36m-\x1b[0m\x1b[0;36m-\x1b[0m (esc)
3791 \x1b[0;31mred\x1b[0m\x1b[0;36m-\x1b[0m\x1b[0;36m-\x1b[0m (esc)
3791
3792
3792 label should be no-op if color is disabled:
3793 label should be no-op if color is disabled:
3793
3794
3794 $ hg log --color=never -l 1 --template '{label(red, "text\n")}'
3795 $ hg log --color=never -l 1 --template '{label(red, "text\n")}'
3795 text
3796 text
3796 $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}'
3797 $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}'
3797 text
3798 text
3798
3799
3799 Test branches inside if statement:
3800 Test branches inside if statement:
3800
3801
3801 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
3802 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
3802 no
3803 no
3803
3804
3804 Test dict constructor:
3805 Test dict constructor:
3805
3806
3806 $ hg log -r 0 -T '{dict(y=node|short, x=rev)}\n'
3807 $ hg log -r 0 -T '{dict(y=node|short, x=rev)}\n'
3807 y=f7769ec2ab97 x=0
3808 y=f7769ec2ab97 x=0
3808 $ hg log -r 0 -T '{dict(x=rev, y=node|short) % "{key}={value}\n"}'
3809 $ hg log -r 0 -T '{dict(x=rev, y=node|short) % "{key}={value}\n"}'
3809 x=0
3810 x=0
3810 y=f7769ec2ab97
3811 y=f7769ec2ab97
3811 $ hg log -r 0 -T '{dict(x=rev, y=node|short)|json}\n'
3812 $ hg log -r 0 -T '{dict(x=rev, y=node|short)|json}\n'
3812 {"x": 0, "y": "f7769ec2ab97"}
3813 {"x": 0, "y": "f7769ec2ab97"}
3813 $ hg log -r 0 -T '{dict()|json}\n'
3814 $ hg log -r 0 -T '{dict()|json}\n'
3814 {}
3815 {}
3815
3816
3816 $ hg log -r 0 -T '{dict(rev, node=node|short)}\n'
3817 $ hg log -r 0 -T '{dict(rev, node=node|short)}\n'
3817 rev=0 node=f7769ec2ab97
3818 rev=0 node=f7769ec2ab97
3818 $ hg log -r 0 -T '{dict(rev, node|short)}\n'
3819 $ hg log -r 0 -T '{dict(rev, node|short)}\n'
3819 rev=0 node=f7769ec2ab97
3820 rev=0 node=f7769ec2ab97
3820
3821
3821 $ hg log -r 0 -T '{dict(rev, rev=rev)}\n'
3822 $ hg log -r 0 -T '{dict(rev, rev=rev)}\n'
3822 hg: parse error: duplicated dict key 'rev' inferred
3823 hg: parse error: duplicated dict key 'rev' inferred
3823 [255]
3824 [255]
3824 $ hg log -r 0 -T '{dict(node, node|short)}\n'
3825 $ hg log -r 0 -T '{dict(node, node|short)}\n'
3825 hg: parse error: duplicated dict key 'node' inferred
3826 hg: parse error: duplicated dict key 'node' inferred
3826 [255]
3827 [255]
3827 $ hg log -r 0 -T '{dict(1 + 2)}'
3828 $ hg log -r 0 -T '{dict(1 + 2)}'
3828 hg: parse error: dict key cannot be inferred
3829 hg: parse error: dict key cannot be inferred
3829 [255]
3830 [255]
3830
3831
3831 $ hg log -r 0 -T '{dict(x=rev, x=node)}'
3832 $ hg log -r 0 -T '{dict(x=rev, x=node)}'
3832 hg: parse error: dict got multiple values for keyword argument 'x'
3833 hg: parse error: dict got multiple values for keyword argument 'x'
3833 [255]
3834 [255]
3834
3835
3835 Test get function:
3836 Test get function:
3836
3837
3837 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3838 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3838 default
3839 default
3839 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
3840 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
3840 default
3841 default
3841 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3842 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3842 hg: parse error: get() expects a dict as first argument
3843 hg: parse error: get() expects a dict as first argument
3843 [255]
3844 [255]
3844
3845
3845 Test json filter applied to hybrid object:
3846 Test json filter applied to hybrid object:
3846
3847
3847 $ hg log -r0 -T '{files|json}\n'
3848 $ hg log -r0 -T '{files|json}\n'
3848 ["a"]
3849 ["a"]
3849 $ hg log -r0 -T '{extras|json}\n'
3850 $ hg log -r0 -T '{extras|json}\n'
3850 {"branch": "default"}
3851 {"branch": "default"}
3851
3852
3852 Test json filter applied to map result:
3853 Test json filter applied to map result:
3853
3854
3854 $ hg log -r0 -T '{json(extras % "{key}")}\n'
3855 $ hg log -r0 -T '{json(extras % "{key}")}\n'
3855 ["branch"]
3856 ["branch"]
3856
3857
3857 Test localdate(date, tz) function:
3858 Test localdate(date, tz) function:
3858
3859
3859 $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
3860 $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
3860 1970-01-01 09:00 +0900
3861 1970-01-01 09:00 +0900
3861 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n'
3862 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n'
3862 1970-01-01 00:00 +0000
3863 1970-01-01 00:00 +0000
3863 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "blahUTC")|isodate}\n'
3864 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "blahUTC")|isodate}\n'
3864 hg: parse error: localdate expects a timezone
3865 hg: parse error: localdate expects a timezone
3865 [255]
3866 [255]
3866 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n'
3867 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n'
3867 1970-01-01 02:00 +0200
3868 1970-01-01 02:00 +0200
3868 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n'
3869 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n'
3869 1970-01-01 00:00 +0000
3870 1970-01-01 00:00 +0000
3870 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n'
3871 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n'
3871 1970-01-01 00:00 +0000
3872 1970-01-01 00:00 +0000
3872 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n'
3873 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n'
3873 hg: parse error: localdate expects a timezone
3874 hg: parse error: localdate expects a timezone
3874 [255]
3875 [255]
3875 $ hg log -r0 -T '{localdate(date, date)|isodate}\n'
3876 $ hg log -r0 -T '{localdate(date, date)|isodate}\n'
3876 hg: parse error: localdate expects a timezone
3877 hg: parse error: localdate expects a timezone
3877 [255]
3878 [255]
3878
3879
3879 Test shortest(node) function:
3880 Test shortest(node) function:
3880
3881
3881 $ echo b > b
3882 $ echo b > b
3882 $ hg ci -qAm b
3883 $ hg ci -qAm b
3883 $ hg log --template '{shortest(node)}\n'
3884 $ hg log --template '{shortest(node)}\n'
3884 e777
3885 e777
3885 bcc7
3886 bcc7
3886 f776
3887 f776
3887 $ hg log --template '{shortest(node, 10)}\n'
3888 $ hg log --template '{shortest(node, 10)}\n'
3888 e777603221
3889 e777603221
3889 bcc7ff960b
3890 bcc7ff960b
3890 f7769ec2ab
3891 f7769ec2ab
3891 $ hg log --template '{node|shortest}\n' -l1
3892 $ hg log --template '{node|shortest}\n' -l1
3892 e777
3893 e777
3893
3894
3894 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
3895 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
3895 f7769ec2ab
3896 f7769ec2ab
3896 $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
3897 $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
3897 hg: parse error: shortest() expects an integer minlength
3898 hg: parse error: shortest() expects an integer minlength
3898 [255]
3899 [255]
3899
3900
3900 $ hg log -r 'wdir()' -T '{node|shortest}\n'
3901 $ hg log -r 'wdir()' -T '{node|shortest}\n'
3901 ffff
3902 ffff
3902
3903
3903 $ hg log --template '{shortest("f")}\n' -l1
3904 $ hg log --template '{shortest("f")}\n' -l1
3904 f
3905 f
3905
3906
3906 $ hg log --template '{shortest("0123456789012345678901234567890123456789")}\n' -l1
3907 $ hg log --template '{shortest("0123456789012345678901234567890123456789")}\n' -l1
3907 0123456789012345678901234567890123456789
3908 0123456789012345678901234567890123456789
3908
3909
3909 $ hg log --template '{shortest("01234567890123456789012345678901234567890123456789")}\n' -l1
3910 $ hg log --template '{shortest("01234567890123456789012345678901234567890123456789")}\n' -l1
3910 01234567890123456789012345678901234567890123456789
3911 01234567890123456789012345678901234567890123456789
3911
3912
3912 $ hg log --template '{shortest("not a hex string")}\n' -l1
3913 $ hg log --template '{shortest("not a hex string")}\n' -l1
3913 not a hex string
3914 not a hex string
3914
3915
3915 $ hg log --template '{shortest("not a hex string, but it'\''s 40 bytes long")}\n' -l1
3916 $ hg log --template '{shortest("not a hex string, but it'\''s 40 bytes long")}\n' -l1
3916 not a hex string, but it's 40 bytes long
3917 not a hex string, but it's 40 bytes long
3917
3918
3918 $ cd ..
3919 $ cd ..
3919
3920
3920 Test shortest(node) with the repo having short hash collision:
3921 Test shortest(node) with the repo having short hash collision:
3921
3922
3922 $ hg init hashcollision
3923 $ hg init hashcollision
3923 $ cd hashcollision
3924 $ cd hashcollision
3924 $ cat <<EOF >> .hg/hgrc
3925 $ cat <<EOF >> .hg/hgrc
3925 > [experimental]
3926 > [experimental]
3926 > evolution.createmarkers=True
3927 > evolution.createmarkers=True
3927 > EOF
3928 > EOF
3928 $ echo 0 > a
3929 $ echo 0 > a
3929 $ hg ci -qAm 0
3930 $ hg ci -qAm 0
3930 $ for i in 17 129 248 242 480 580 617 1057 2857 4025; do
3931 $ for i in 17 129 248 242 480 580 617 1057 2857 4025; do
3931 > hg up -q 0
3932 > hg up -q 0
3932 > echo $i > a
3933 > echo $i > a
3933 > hg ci -qm $i
3934 > hg ci -qm $i
3934 > done
3935 > done
3935 $ hg up -q null
3936 $ hg up -q null
3936 $ hg log -r0: -T '{rev}:{node}\n'
3937 $ hg log -r0: -T '{rev}:{node}\n'
3937 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
3938 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
3938 1:11424df6dc1dd4ea255eae2b58eaca7831973bbc
3939 1:11424df6dc1dd4ea255eae2b58eaca7831973bbc
3939 2:11407b3f1b9c3e76a79c1ec5373924df096f0499
3940 2:11407b3f1b9c3e76a79c1ec5373924df096f0499
3940 3:11dd92fe0f39dfdaacdaa5f3997edc533875cfc4
3941 3:11dd92fe0f39dfdaacdaa5f3997edc533875cfc4
3941 4:10776689e627b465361ad5c296a20a487e153ca4
3942 4:10776689e627b465361ad5c296a20a487e153ca4
3942 5:a00be79088084cb3aff086ab799f8790e01a976b
3943 5:a00be79088084cb3aff086ab799f8790e01a976b
3943 6:a0b0acd79b4498d0052993d35a6a748dd51d13e6
3944 6:a0b0acd79b4498d0052993d35a6a748dd51d13e6
3944 7:a0457b3450b8e1b778f1163b31a435802987fe5d
3945 7:a0457b3450b8e1b778f1163b31a435802987fe5d
3945 8:c56256a09cd28e5764f32e8e2810d0f01e2e357a
3946 8:c56256a09cd28e5764f32e8e2810d0f01e2e357a
3946 9:c5623987d205cd6d9d8389bfc40fff9dbb670b48
3947 9:c5623987d205cd6d9d8389bfc40fff9dbb670b48
3947 10:c562ddd9c94164376c20b86b0b4991636a3bf84f
3948 10:c562ddd9c94164376c20b86b0b4991636a3bf84f
3948 $ hg debugobsolete a00be79088084cb3aff086ab799f8790e01a976b
3949 $ hg debugobsolete a00be79088084cb3aff086ab799f8790e01a976b
3949 obsoleted 1 changesets
3950 obsoleted 1 changesets
3950 $ hg debugobsolete c5623987d205cd6d9d8389bfc40fff9dbb670b48
3951 $ hg debugobsolete c5623987d205cd6d9d8389bfc40fff9dbb670b48
3951 obsoleted 1 changesets
3952 obsoleted 1 changesets
3952 $ hg debugobsolete c562ddd9c94164376c20b86b0b4991636a3bf84f
3953 $ hg debugobsolete c562ddd9c94164376c20b86b0b4991636a3bf84f
3953 obsoleted 1 changesets
3954 obsoleted 1 changesets
3954
3955
3955 nodes starting with '11' (we don't have the revision number '11' though)
3956 nodes starting with '11' (we don't have the revision number '11' though)
3956
3957
3957 $ hg log -r 1:3 -T '{rev}:{shortest(node, 0)}\n'
3958 $ hg log -r 1:3 -T '{rev}:{shortest(node, 0)}\n'
3958 1:1142
3959 1:1142
3959 2:1140
3960 2:1140
3960 3:11d
3961 3:11d
3961
3962
3962 '5:a00' is hidden, but still we have two nodes starting with 'a0'
3963 '5:a00' is hidden, but still we have two nodes starting with 'a0'
3963
3964
3964 $ hg log -r 6:7 -T '{rev}:{shortest(node, 0)}\n'
3965 $ hg log -r 6:7 -T '{rev}:{shortest(node, 0)}\n'
3965 6:a0b
3966 6:a0b
3966 7:a04
3967 7:a04
3967
3968
3968 node '10' conflicts with the revision number '10' even if it is hidden
3969 node '10' conflicts with the revision number '10' even if it is hidden
3969 (we could exclude hidden revision numbers, but currently we don't)
3970 (we could exclude hidden revision numbers, but currently we don't)
3970
3971
3971 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n'
3972 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n'
3972 4:107
3973 4:107
3973 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
3974 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
3974 4:107
3975 4:107
3975
3976
3976 node 'c562' should be unique if the other 'c562' nodes are hidden
3977 node 'c562' should be unique if the other 'c562' nodes are hidden
3977 (but we don't try the slow path to filter out hidden nodes for now)
3978 (but we don't try the slow path to filter out hidden nodes for now)
3978
3979
3979 $ hg log -r 8 -T '{rev}:{node|shortest}\n'
3980 $ hg log -r 8 -T '{rev}:{node|shortest}\n'
3980 8:c5625
3981 8:c5625
3981 $ hg log -r 8:10 -T '{rev}:{node|shortest}\n' --hidden
3982 $ hg log -r 8:10 -T '{rev}:{node|shortest}\n' --hidden
3982 8:c5625
3983 8:c5625
3983 9:c5623
3984 9:c5623
3984 10:c562d
3985 10:c562d
3985
3986
3986 $ cd ..
3987 $ cd ..
3987
3988
3988 Test pad function
3989 Test pad function
3989
3990
3990 $ cd r
3991 $ cd r
3991
3992
3992 $ hg log --template '{pad(rev, 20)} {author|user}\n'
3993 $ hg log --template '{pad(rev, 20)} {author|user}\n'
3993 2 test
3994 2 test
3994 1 {node|short}
3995 1 {node|short}
3995 0 test
3996 0 test
3996
3997
3997 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
3998 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
3998 2 test
3999 2 test
3999 1 {node|short}
4000 1 {node|short}
4000 0 test
4001 0 test
4001
4002
4002 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
4003 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
4003 2------------------- test
4004 2------------------- test
4004 1------------------- {node|short}
4005 1------------------- {node|short}
4005 0------------------- test
4006 0------------------- test
4006
4007
4007 Test template string in pad function
4008 Test template string in pad function
4008
4009
4009 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
4010 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
4010 {0} test
4011 {0} test
4011
4012
4012 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
4013 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
4013 \{rev} test
4014 \{rev} test
4014
4015
4015 Test width argument passed to pad function
4016 Test width argument passed to pad function
4016
4017
4017 $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n'
4018 $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n'
4018 0 test
4019 0 test
4019 $ hg log -r 0 -T '{pad(rev, "not an int")}\n'
4020 $ hg log -r 0 -T '{pad(rev, "not an int")}\n'
4020 hg: parse error: pad() expects an integer width
4021 hg: parse error: pad() expects an integer width
4021 [255]
4022 [255]
4022
4023
4023 Test invalid fillchar passed to pad function
4024 Test invalid fillchar passed to pad function
4024
4025
4025 $ hg log -r 0 -T '{pad(rev, 10, "")}\n'
4026 $ hg log -r 0 -T '{pad(rev, 10, "")}\n'
4026 hg: parse error: pad() expects a single fill character
4027 hg: parse error: pad() expects a single fill character
4027 [255]
4028 [255]
4028 $ hg log -r 0 -T '{pad(rev, 10, "--")}\n'
4029 $ hg log -r 0 -T '{pad(rev, 10, "--")}\n'
4029 hg: parse error: pad() expects a single fill character
4030 hg: parse error: pad() expects a single fill character
4030 [255]
4031 [255]
4031
4032
4032 Test boolean argument passed to pad function
4033 Test boolean argument passed to pad function
4033
4034
4034 no crash
4035 no crash
4035
4036
4036 $ hg log -r 0 -T '{pad(rev, 10, "-", "f{"oo"}")}\n'
4037 $ hg log -r 0 -T '{pad(rev, 10, "-", "f{"oo"}")}\n'
4037 ---------0
4038 ---------0
4038
4039
4039 string/literal
4040 string/literal
4040
4041
4041 $ hg log -r 0 -T '{pad(rev, 10, "-", "false")}\n'
4042 $ hg log -r 0 -T '{pad(rev, 10, "-", "false")}\n'
4042 ---------0
4043 ---------0
4043 $ hg log -r 0 -T '{pad(rev, 10, "-", false)}\n'
4044 $ hg log -r 0 -T '{pad(rev, 10, "-", false)}\n'
4044 0---------
4045 0---------
4045 $ hg log -r 0 -T '{pad(rev, 10, "-", "")}\n'
4046 $ hg log -r 0 -T '{pad(rev, 10, "-", "")}\n'
4046 0---------
4047 0---------
4047
4048
4048 unknown keyword is evaluated to ''
4049 unknown keyword is evaluated to ''
4049
4050
4050 $ hg log -r 0 -T '{pad(rev, 10, "-", unknownkeyword)}\n'
4051 $ hg log -r 0 -T '{pad(rev, 10, "-", unknownkeyword)}\n'
4051 0---------
4052 0---------
4052
4053
4053 Test separate function
4054 Test separate function
4054
4055
4055 $ hg log -r 0 -T '{separate("-", "", "a", "b", "", "", "c", "")}\n'
4056 $ hg log -r 0 -T '{separate("-", "", "a", "b", "", "", "c", "")}\n'
4056 a-b-c
4057 a-b-c
4057 $ hg log -r 0 -T '{separate(" ", "{rev}:{node|short}", author|user, branch)}\n'
4058 $ hg log -r 0 -T '{separate(" ", "{rev}:{node|short}", author|user, branch)}\n'
4058 0:f7769ec2ab97 test default
4059 0:f7769ec2ab97 test default
4059 $ hg log -r 0 --color=always -T '{separate(" ", "a", label(red, "b"), "c", label(red, ""), "d")}\n'
4060 $ hg log -r 0 --color=always -T '{separate(" ", "a", label(red, "b"), "c", label(red, ""), "d")}\n'
4060 a \x1b[0;31mb\x1b[0m c d (esc)
4061 a \x1b[0;31mb\x1b[0m c d (esc)
4061
4062
4062 Test boolean expression/literal passed to if function
4063 Test boolean expression/literal passed to if function
4063
4064
4064 $ hg log -r 0 -T '{if(rev, "rev 0 is True")}\n'
4065 $ hg log -r 0 -T '{if(rev, "rev 0 is True")}\n'
4065 rev 0 is True
4066 rev 0 is True
4066 $ hg log -r 0 -T '{if(0, "literal 0 is True as well")}\n'
4067 $ hg log -r 0 -T '{if(0, "literal 0 is True as well")}\n'
4067 literal 0 is True as well
4068 literal 0 is True as well
4068 $ hg log -r 0 -T '{if("", "", "empty string is False")}\n'
4069 $ hg log -r 0 -T '{if("", "", "empty string is False")}\n'
4069 empty string is False
4070 empty string is False
4070 $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n'
4071 $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n'
4071 empty list is False
4072 empty list is False
4072 $ hg log -r 0 -T '{if(true, "true is True")}\n'
4073 $ hg log -r 0 -T '{if(true, "true is True")}\n'
4073 true is True
4074 true is True
4074 $ hg log -r 0 -T '{if(false, "", "false is False")}\n'
4075 $ hg log -r 0 -T '{if(false, "", "false is False")}\n'
4075 false is False
4076 false is False
4076 $ hg log -r 0 -T '{if("false", "non-empty string is True")}\n'
4077 $ hg log -r 0 -T '{if("false", "non-empty string is True")}\n'
4077 non-empty string is True
4078 non-empty string is True
4078
4079
4079 Test ifcontains function
4080 Test ifcontains function
4080
4081
4081 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
4082 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
4082 2 is in the string
4083 2 is in the string
4083 1 is not
4084 1 is not
4084 0 is in the string
4085 0 is in the string
4085
4086
4086 $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n'
4087 $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n'
4087 2 is in the string
4088 2 is in the string
4088 1 is not
4089 1 is not
4089 0 is in the string
4090 0 is in the string
4090
4091
4091 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
4092 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
4092 2 did not add a
4093 2 did not add a
4093 1 did not add a
4094 1 did not add a
4094 0 added a
4095 0 added a
4095
4096
4096 $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
4097 $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
4097 2 is parent of 1
4098 2 is parent of 1
4098 1
4099 1
4099 0
4100 0
4100
4101
4101 Test revset function
4102 Test revset function
4102
4103
4103 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
4104 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
4104 2 current rev
4105 2 current rev
4105 1 not current rev
4106 1 not current rev
4106 0 not current rev
4107 0 not current rev
4107
4108
4108 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
4109 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
4109 2 match rev
4110 2 match rev
4110 1 match rev
4111 1 match rev
4111 0 not match rev
4112 0 not match rev
4112
4113
4113 $ hg log -T '{ifcontains(desc, revset(":"), "", "type not match")}\n' -l1
4114 $ hg log -T '{ifcontains(desc, revset(":"), "", "type not match")}\n' -l1
4114 type not match
4115 type not match
4115
4116
4116 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
4117 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
4117 2 Parents: 1
4118 2 Parents: 1
4118 1 Parents: 0
4119 1 Parents: 0
4119 0 Parents:
4120 0 Parents:
4120
4121
4121 $ cat >> .hg/hgrc <<EOF
4122 $ cat >> .hg/hgrc <<EOF
4122 > [revsetalias]
4123 > [revsetalias]
4123 > myparents(\$1) = parents(\$1)
4124 > myparents(\$1) = parents(\$1)
4124 > EOF
4125 > EOF
4125 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
4126 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
4126 2 Parents: 1
4127 2 Parents: 1
4127 1 Parents: 0
4128 1 Parents: 0
4128 0 Parents:
4129 0 Parents:
4129
4130
4130 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
4131 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
4131 Rev: 2
4132 Rev: 2
4132 Ancestor: 0
4133 Ancestor: 0
4133 Ancestor: 1
4134 Ancestor: 1
4134 Ancestor: 2
4135 Ancestor: 2
4135
4136
4136 Rev: 1
4137 Rev: 1
4137 Ancestor: 0
4138 Ancestor: 0
4138 Ancestor: 1
4139 Ancestor: 1
4139
4140
4140 Rev: 0
4141 Rev: 0
4141 Ancestor: 0
4142 Ancestor: 0
4142
4143
4143 $ hg log --template '{revset("TIP"|lower)}\n' -l1
4144 $ hg log --template '{revset("TIP"|lower)}\n' -l1
4144 2
4145 2
4145
4146
4146 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1
4147 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1
4147 2
4148 2
4148
4149
4149 a list template is evaluated for each item of revset/parents
4150 a list template is evaluated for each item of revset/parents
4150
4151
4151 $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
4152 $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
4152 2 p: 1:bcc7ff960b8e
4153 2 p: 1:bcc7ff960b8e
4153 1 p: 0:f7769ec2ab97
4154 1 p: 0:f7769ec2ab97
4154 0 p:
4155 0 p:
4155
4156
4156 $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
4157 $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
4157 2 p: 1:bcc7ff960b8e -1:000000000000
4158 2 p: 1:bcc7ff960b8e -1:000000000000
4158 1 p: 0:f7769ec2ab97 -1:000000000000
4159 1 p: 0:f7769ec2ab97 -1:000000000000
4159 0 p: -1:000000000000 -1:000000000000
4160 0 p: -1:000000000000 -1:000000000000
4160
4161
4161 therefore, 'revcache' should be recreated for each rev
4162 therefore, 'revcache' should be recreated for each rev
4162
4163
4163 $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
4164 $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
4164 2 aa b
4165 2 aa b
4165 p
4166 p
4166 1
4167 1
4167 p a
4168 p a
4168 0 a
4169 0 a
4169 p
4170 p
4170
4171
4171 $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
4172 $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
4172 2 aa b
4173 2 aa b
4173 p
4174 p
4174 1
4175 1
4175 p a
4176 p a
4176 0 a
4177 0 a
4177 p
4178 p
4178
4179
4179 a revset item must be evaluated as an integer revision, not an offset from tip
4180 a revset item must be evaluated as an integer revision, not an offset from tip
4180
4181
4181 $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'
4182 $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'
4182 -1:000000000000
4183 -1:000000000000
4183 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n'
4184 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n'
4184 -1:000000000000
4185 -1:000000000000
4185
4186
4186 join() should pick '{rev}' from revset items:
4187 join() should pick '{rev}' from revset items:
4187
4188
4188 $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6
4189 $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6
4189 4, 5
4190 4, 5
4190
4191
4191 on the other hand, parents are formatted as '{rev}:{node|formatnode}' by
4192 on the other hand, parents are formatted as '{rev}:{node|formatnode}' by
4192 default. join() should agree with the default formatting:
4193 default. join() should agree with the default formatting:
4193
4194
4194 $ hg log -R ../a -T '{join(parents, ", ")}\n' -r6
4195 $ hg log -R ../a -T '{join(parents, ", ")}\n' -r6
4195 5:13207e5a10d9, 4:bbe44766e73d
4196 5:13207e5a10d9, 4:bbe44766e73d
4196
4197
4197 $ hg log -R ../a -T '{join(parents, ",\n")}\n' -r6 --debug
4198 $ hg log -R ../a -T '{join(parents, ",\n")}\n' -r6 --debug
4198 5:13207e5a10d9fd28ec424934298e176197f2c67f,
4199 5:13207e5a10d9fd28ec424934298e176197f2c67f,
4199 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
4200 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
4200
4201
4201 Invalid arguments passed to revset()
4202 Invalid arguments passed to revset()
4202
4203
4203 $ hg log -T '{revset("%whatever", 0)}\n'
4204 $ hg log -T '{revset("%whatever", 0)}\n'
4204 hg: parse error: unexpected revspec format character w
4205 hg: parse error: unexpected revspec format character w
4205 [255]
4206 [255]
4206 $ hg log -T '{revset("%lwhatever", files)}\n'
4207 $ hg log -T '{revset("%lwhatever", files)}\n'
4207 hg: parse error: unexpected revspec format character w
4208 hg: parse error: unexpected revspec format character w
4208 [255]
4209 [255]
4209 $ hg log -T '{revset("%s %s", 0)}\n'
4210 $ hg log -T '{revset("%s %s", 0)}\n'
4210 hg: parse error: missing argument for revspec
4211 hg: parse error: missing argument for revspec
4211 [255]
4212 [255]
4212 $ hg log -T '{revset("", 0)}\n'
4213 $ hg log -T '{revset("", 0)}\n'
4213 hg: parse error: too many revspec arguments specified
4214 hg: parse error: too many revspec arguments specified
4214 [255]
4215 [255]
4215 $ hg log -T '{revset("%s", 0, 1)}\n'
4216 $ hg log -T '{revset("%s", 0, 1)}\n'
4216 hg: parse error: too many revspec arguments specified
4217 hg: parse error: too many revspec arguments specified
4217 [255]
4218 [255]
4218 $ hg log -T '{revset("%", 0)}\n'
4219 $ hg log -T '{revset("%", 0)}\n'
4219 hg: parse error: incomplete revspec format character
4220 hg: parse error: incomplete revspec format character
4220 [255]
4221 [255]
4221 $ hg log -T '{revset("%l", 0)}\n'
4222 $ hg log -T '{revset("%l", 0)}\n'
4222 hg: parse error: incomplete revspec format character
4223 hg: parse error: incomplete revspec format character
4223 [255]
4224 [255]
4224 $ hg log -T '{revset("%d", 'foo')}\n'
4225 $ hg log -T '{revset("%d", 'foo')}\n'
4225 hg: parse error: invalid argument for revspec
4226 hg: parse error: invalid argument for revspec
4226 [255]
4227 [255]
4227 $ hg log -T '{revset("%ld", files)}\n'
4228 $ hg log -T '{revset("%ld", files)}\n'
4228 hg: parse error: invalid argument for revspec
4229 hg: parse error: invalid argument for revspec
4229 [255]
4230 [255]
4230 $ hg log -T '{revset("%ls", 0)}\n'
4231 $ hg log -T '{revset("%ls", 0)}\n'
4231 hg: parse error: invalid argument for revspec
4232 hg: parse error: invalid argument for revspec
4232 [255]
4233 [255]
4233 $ hg log -T '{revset("%b", 'foo')}\n'
4234 $ hg log -T '{revset("%b", 'foo')}\n'
4234 hg: parse error: invalid argument for revspec
4235 hg: parse error: invalid argument for revspec
4235 [255]
4236 [255]
4236 $ hg log -T '{revset("%lb", files)}\n'
4237 $ hg log -T '{revset("%lb", files)}\n'
4237 hg: parse error: invalid argument for revspec
4238 hg: parse error: invalid argument for revspec
4238 [255]
4239 [255]
4239 $ hg log -T '{revset("%r", 0)}\n'
4240 $ hg log -T '{revset("%r", 0)}\n'
4240 hg: parse error: invalid argument for revspec
4241 hg: parse error: invalid argument for revspec
4241 [255]
4242 [255]
4242
4243
4243 Test 'originalnode'
4244 Test 'originalnode'
4244
4245
4245 $ hg log -r 1 -T '{revset("null") % "{node|short} {originalnode|short}"}\n'
4246 $ hg log -r 1 -T '{revset("null") % "{node|short} {originalnode|short}"}\n'
4246 000000000000 bcc7ff960b8e
4247 000000000000 bcc7ff960b8e
4247 $ hg log -r 0 -T '{manifest % "{node} {originalnode}"}\n'
4248 $ hg log -r 0 -T '{manifest % "{node} {originalnode}"}\n'
4248 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 f7769ec2ab975ad19684098ad1ffd9b81ecc71a1
4249 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 f7769ec2ab975ad19684098ad1ffd9b81ecc71a1
4249
4250
4250 Test files function
4251 Test files function
4251
4252
4252 $ hg log -T "{rev}\n{join(files('*'), '\n')}\n"
4253 $ hg log -T "{rev}\n{join(files('*'), '\n')}\n"
4253 2
4254 2
4254 a
4255 a
4255 aa
4256 aa
4256 b
4257 b
4257 1
4258 1
4258 a
4259 a
4259 0
4260 0
4260 a
4261 a
4261
4262
4262 $ hg log -T "{rev}\n{join(files('aa'), '\n')}\n"
4263 $ hg log -T "{rev}\n{join(files('aa'), '\n')}\n"
4263 2
4264 2
4264 aa
4265 aa
4265 1
4266 1
4266
4267
4267 0
4268 0
4268
4269
4269
4270
4270 Test relpath function
4271 Test relpath function
4271
4272
4272 $ hg log -r0 -T '{files % "{file|relpath}\n"}'
4273 $ hg log -r0 -T '{files % "{file|relpath}\n"}'
4273 a
4274 a
4274 $ cd ..
4275 $ cd ..
4275 $ hg log -R r -r0 -T '{files % "{file|relpath}\n"}'
4276 $ hg log -R r -r0 -T '{files % "{file|relpath}\n"}'
4276 r/a
4277 r/a
4277 $ cd r
4278 $ cd r
4278
4279
4279 Test active bookmark templating
4280 Test active bookmark templating
4280
4281
4281 $ hg book foo
4282 $ hg book foo
4282 $ hg book bar
4283 $ hg book bar
4283 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
4284 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
4284 2 bar* foo
4285 2 bar* foo
4285 1
4286 1
4286 0
4287 0
4287 $ hg log --template "{rev} {activebookmark}\n"
4288 $ hg log --template "{rev} {activebookmark}\n"
4288 2 bar
4289 2 bar
4289 1
4290 1
4290 0
4291 0
4291 $ hg bookmarks --inactive bar
4292 $ hg bookmarks --inactive bar
4292 $ hg log --template "{rev} {activebookmark}\n"
4293 $ hg log --template "{rev} {activebookmark}\n"
4293 2
4294 2
4294 1
4295 1
4295 0
4296 0
4296 $ hg book -r1 baz
4297 $ hg book -r1 baz
4297 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
4298 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
4298 2 bar foo
4299 2 bar foo
4299 1 baz
4300 1 baz
4300 0
4301 0
4301 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
4302 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
4302 2 t
4303 2 t
4303 1 f
4304 1 f
4304 0 f
4305 0 f
4305
4306
4306 Test namespaces dict
4307 Test namespaces dict
4307
4308
4308 $ hg --config extensions.revnamesext=$TESTDIR/revnamesext.py log -T '{rev}\n{namespaces % " {namespace} color={colorname} builtin={builtin}\n {join(names, ",")}\n"}\n'
4309 $ hg --config extensions.revnamesext=$TESTDIR/revnamesext.py log -T '{rev}\n{namespaces % " {namespace} color={colorname} builtin={builtin}\n {join(names, ",")}\n"}\n'
4309 2
4310 2
4310 bookmarks color=bookmark builtin=True
4311 bookmarks color=bookmark builtin=True
4311 bar,foo
4312 bar,foo
4312 tags color=tag builtin=True
4313 tags color=tag builtin=True
4313 tip
4314 tip
4314 branches color=branch builtin=True
4315 branches color=branch builtin=True
4315 text.{rev}
4316 text.{rev}
4316 revnames color=revname builtin=False
4317 revnames color=revname builtin=False
4317 r2
4318 r2
4318
4319
4319 1
4320 1
4320 bookmarks color=bookmark builtin=True
4321 bookmarks color=bookmark builtin=True
4321 baz
4322 baz
4322 tags color=tag builtin=True
4323 tags color=tag builtin=True
4323
4324
4324 branches color=branch builtin=True
4325 branches color=branch builtin=True
4325 text.{rev}
4326 text.{rev}
4326 revnames color=revname builtin=False
4327 revnames color=revname builtin=False
4327 r1
4328 r1
4328
4329
4329 0
4330 0
4330 bookmarks color=bookmark builtin=True
4331 bookmarks color=bookmark builtin=True
4331
4332
4332 tags color=tag builtin=True
4333 tags color=tag builtin=True
4333
4334
4334 branches color=branch builtin=True
4335 branches color=branch builtin=True
4335 default
4336 default
4336 revnames color=revname builtin=False
4337 revnames color=revname builtin=False
4337 r0
4338 r0
4338
4339
4339 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}'
4340 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}'
4340 bookmarks: bar foo
4341 bookmarks: bar foo
4341 tags: tip
4342 tags: tip
4342 branches: text.{rev}
4343 branches: text.{rev}
4343 $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}'
4344 $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}'
4344 bookmarks:
4345 bookmarks:
4345 bar
4346 bar
4346 foo
4347 foo
4347 tags:
4348 tags:
4348 tip
4349 tip
4349 branches:
4350 branches:
4350 text.{rev}
4351 text.{rev}
4351 $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}'
4352 $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}'
4352 bar
4353 bar
4353 foo
4354 foo
4354 $ hg log -r2 -T '{namespaces.bookmarks % "{bookmark}\n"}'
4355 $ hg log -r2 -T '{namespaces.bookmarks % "{bookmark}\n"}'
4355 bar
4356 bar
4356 foo
4357 foo
4357
4358
4358 Test stringify on sub expressions
4359 Test stringify on sub expressions
4359
4360
4360 $ cd ..
4361 $ cd ..
4361 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
4362 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
4362 fourth, second, third
4363 fourth, second, third
4363 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
4364 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
4364 abc
4365 abc
4365
4366
4366 Test splitlines
4367 Test splitlines
4367
4368
4368 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
4369 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
4369 @ foo Modify, add, remove, rename
4370 @ foo Modify, add, remove, rename
4370 |
4371 |
4371 o foo future
4372 o foo future
4372 |
4373 |
4373 o foo third
4374 o foo third
4374 |
4375 |
4375 o foo second
4376 o foo second
4376
4377
4377 o foo merge
4378 o foo merge
4378 |\
4379 |\
4379 | o foo new head
4380 | o foo new head
4380 | |
4381 | |
4381 o | foo new branch
4382 o | foo new branch
4382 |/
4383 |/
4383 o foo no user, no domain
4384 o foo no user, no domain
4384 |
4385 |
4385 o foo no person
4386 o foo no person
4386 |
4387 |
4387 o foo other 1
4388 o foo other 1
4388 | foo other 2
4389 | foo other 2
4389 | foo
4390 | foo
4390 | foo other 3
4391 | foo other 3
4391 o foo line 1
4392 o foo line 1
4392 foo line 2
4393 foo line 2
4393
4394
4394 $ hg log -R a -r0 -T '{desc|splitlines}\n'
4395 $ hg log -R a -r0 -T '{desc|splitlines}\n'
4395 line 1 line 2
4396 line 1 line 2
4396 $ hg log -R a -r0 -T '{join(desc|splitlines, "|")}\n'
4397 $ hg log -R a -r0 -T '{join(desc|splitlines, "|")}\n'
4397 line 1|line 2
4398 line 1|line 2
4398
4399
4399 Test startswith
4400 Test startswith
4400 $ hg log -Gv -R a --template "{startswith(desc)}"
4401 $ hg log -Gv -R a --template "{startswith(desc)}"
4401 hg: parse error: startswith expects two arguments
4402 hg: parse error: startswith expects two arguments
4402 [255]
4403 [255]
4403
4404
4404 $ hg log -Gv -R a --template "{startswith('line', desc)}"
4405 $ hg log -Gv -R a --template "{startswith('line', desc)}"
4405 @
4406 @
4406 |
4407 |
4407 o
4408 o
4408 |
4409 |
4409 o
4410 o
4410 |
4411 |
4411 o
4412 o
4412
4413
4413 o
4414 o
4414 |\
4415 |\
4415 | o
4416 | o
4416 | |
4417 | |
4417 o |
4418 o |
4418 |/
4419 |/
4419 o
4420 o
4420 |
4421 |
4421 o
4422 o
4422 |
4423 |
4423 o
4424 o
4424 |
4425 |
4425 o line 1
4426 o line 1
4426 line 2
4427 line 2
4427
4428
4428 Test bad template with better error message
4429 Test bad template with better error message
4429
4430
4430 $ hg log -Gv -R a --template '{desc|user()}'
4431 $ hg log -Gv -R a --template '{desc|user()}'
4431 hg: parse error: expected a symbol, got 'func'
4432 hg: parse error: expected a symbol, got 'func'
4432 [255]
4433 [255]
4433
4434
4434 Test word function (including index out of bounds graceful failure)
4435 Test word function (including index out of bounds graceful failure)
4435
4436
4436 $ hg log -Gv -R a --template "{word('1', desc)}"
4437 $ hg log -Gv -R a --template "{word('1', desc)}"
4437 @ add,
4438 @ add,
4438 |
4439 |
4439 o
4440 o
4440 |
4441 |
4441 o
4442 o
4442 |
4443 |
4443 o
4444 o
4444
4445
4445 o
4446 o
4446 |\
4447 |\
4447 | o head
4448 | o head
4448 | |
4449 | |
4449 o | branch
4450 o | branch
4450 |/
4451 |/
4451 o user,
4452 o user,
4452 |
4453 |
4453 o person
4454 o person
4454 |
4455 |
4455 o 1
4456 o 1
4456 |
4457 |
4457 o 1
4458 o 1
4458
4459
4459
4460
4460 Test word third parameter used as splitter
4461 Test word third parameter used as splitter
4461
4462
4462 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
4463 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
4463 @ M
4464 @ M
4464 |
4465 |
4465 o future
4466 o future
4466 |
4467 |
4467 o third
4468 o third
4468 |
4469 |
4469 o sec
4470 o sec
4470
4471
4471 o merge
4472 o merge
4472 |\
4473 |\
4473 | o new head
4474 | o new head
4474 | |
4475 | |
4475 o | new branch
4476 o | new branch
4476 |/
4477 |/
4477 o n
4478 o n
4478 |
4479 |
4479 o n
4480 o n
4480 |
4481 |
4481 o
4482 o
4482 |
4483 |
4483 o line 1
4484 o line 1
4484 line 2
4485 line 2
4485
4486
4486 Test word error messages for not enough and too many arguments
4487 Test word error messages for not enough and too many arguments
4487
4488
4488 $ hg log -Gv -R a --template "{word('0')}"
4489 $ hg log -Gv -R a --template "{word('0')}"
4489 hg: parse error: word expects two or three arguments, got 1
4490 hg: parse error: word expects two or three arguments, got 1
4490 [255]
4491 [255]
4491
4492
4492 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
4493 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
4493 hg: parse error: word expects two or three arguments, got 7
4494 hg: parse error: word expects two or three arguments, got 7
4494 [255]
4495 [255]
4495
4496
4496 Test word for integer literal
4497 Test word for integer literal
4497
4498
4498 $ hg log -R a --template "{word(2, desc)}\n" -r0
4499 $ hg log -R a --template "{word(2, desc)}\n" -r0
4499 line
4500 line
4500
4501
4501 Test word for invalid numbers
4502 Test word for invalid numbers
4502
4503
4503 $ hg log -Gv -R a --template "{word('a', desc)}"
4504 $ hg log -Gv -R a --template "{word('a', desc)}"
4504 hg: parse error: word expects an integer index
4505 hg: parse error: word expects an integer index
4505 [255]
4506 [255]
4506
4507
4507 Test word for out of range
4508 Test word for out of range
4508
4509
4509 $ hg log -R a --template "{word(10000, desc)}"
4510 $ hg log -R a --template "{word(10000, desc)}"
4510 $ hg log -R a --template "{word(-10000, desc)}"
4511 $ hg log -R a --template "{word(-10000, desc)}"
4511
4512
4512 Test indent and not adding to empty lines
4513 Test indent and not adding to empty lines
4513
4514
4514 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
4515 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
4515 -----
4516 -----
4516 > line 1
4517 > line 1
4517 >> line 2
4518 >> line 2
4518 -----
4519 -----
4519 > other 1
4520 > other 1
4520 >> other 2
4521 >> other 2
4521
4522
4522 >> other 3
4523 >> other 3
4523
4524
4524 Test with non-strings like dates
4525 Test with non-strings like dates
4525
4526
4526 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
4527 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
4527 1200000.00
4528 1200000.00
4528 1300000.00
4529 1300000.00
4529
4530
4530 Test broken string escapes:
4531 Test broken string escapes:
4531
4532
4532 $ hg log -T "bogus\\" -R a
4533 $ hg log -T "bogus\\" -R a
4533 hg: parse error: trailing \ in string
4534 hg: parse error: trailing \ in string
4534 [255]
4535 [255]
4535 $ hg log -T "\\xy" -R a
4536 $ hg log -T "\\xy" -R a
4536 hg: parse error: invalid \x escape* (glob)
4537 hg: parse error: invalid \x escape* (glob)
4537 [255]
4538 [255]
4538
4539
4539 json filter should escape HTML tags so that the output can be embedded in hgweb:
4540 json filter should escape HTML tags so that the output can be embedded in hgweb:
4540
4541
4541 $ hg log -T "{'<foo@example.org>'|json}\n" -R a -l1
4542 $ hg log -T "{'<foo@example.org>'|json}\n" -R a -l1
4542 "\u003cfoo@example.org\u003e"
4543 "\u003cfoo@example.org\u003e"
4543
4544
4544 Templater supports aliases of symbol and func() styles:
4545 Templater supports aliases of symbol and func() styles:
4545
4546
4546 $ hg clone -q a aliases
4547 $ hg clone -q a aliases
4547 $ cd aliases
4548 $ cd aliases
4548 $ cat <<EOF >> .hg/hgrc
4549 $ cat <<EOF >> .hg/hgrc
4549 > [templatealias]
4550 > [templatealias]
4550 > r = rev
4551 > r = rev
4551 > rn = "{r}:{node|short}"
4552 > rn = "{r}:{node|short}"
4552 > status(c, files) = files % "{c} {file}\n"
4553 > status(c, files) = files % "{c} {file}\n"
4553 > utcdate(d) = localdate(d, "UTC")
4554 > utcdate(d) = localdate(d, "UTC")
4554 > EOF
4555 > EOF
4555
4556
4556 $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n'
4557 $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n'
4557 (template
4558 (template
4558 (symbol 'rn')
4559 (symbol 'rn')
4559 (string ' ')
4560 (string ' ')
4560 (|
4561 (|
4561 (func
4562 (func
4562 (symbol 'utcdate')
4563 (symbol 'utcdate')
4563 (symbol 'date'))
4564 (symbol 'date'))
4564 (symbol 'isodate'))
4565 (symbol 'isodate'))
4565 (string '\n'))
4566 (string '\n'))
4566 * expanded:
4567 * expanded:
4567 (template
4568 (template
4568 (template
4569 (template
4569 (symbol 'rev')
4570 (symbol 'rev')
4570 (string ':')
4571 (string ':')
4571 (|
4572 (|
4572 (symbol 'node')
4573 (symbol 'node')
4573 (symbol 'short')))
4574 (symbol 'short')))
4574 (string ' ')
4575 (string ' ')
4575 (|
4576 (|
4576 (func
4577 (func
4577 (symbol 'localdate')
4578 (symbol 'localdate')
4578 (list
4579 (list
4579 (symbol 'date')
4580 (symbol 'date')
4580 (string 'UTC')))
4581 (string 'UTC')))
4581 (symbol 'isodate'))
4582 (symbol 'isodate'))
4582 (string '\n'))
4583 (string '\n'))
4583 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4584 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4584
4585
4585 $ hg debugtemplate -vr0 '{status("A", file_adds)}'
4586 $ hg debugtemplate -vr0 '{status("A", file_adds)}'
4586 (template
4587 (template
4587 (func
4588 (func
4588 (symbol 'status')
4589 (symbol 'status')
4589 (list
4590 (list
4590 (string 'A')
4591 (string 'A')
4591 (symbol 'file_adds'))))
4592 (symbol 'file_adds'))))
4592 * expanded:
4593 * expanded:
4593 (template
4594 (template
4594 (%
4595 (%
4595 (symbol 'file_adds')
4596 (symbol 'file_adds')
4596 (template
4597 (template
4597 (string 'A')
4598 (string 'A')
4598 (string ' ')
4599 (string ' ')
4599 (symbol 'file')
4600 (symbol 'file')
4600 (string '\n'))))
4601 (string '\n'))))
4601 A a
4602 A a
4602
4603
4603 A unary function alias can be called as a filter:
4604 A unary function alias can be called as a filter:
4604
4605
4605 $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n'
4606 $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n'
4606 (template
4607 (template
4607 (|
4608 (|
4608 (|
4609 (|
4609 (symbol 'date')
4610 (symbol 'date')
4610 (symbol 'utcdate'))
4611 (symbol 'utcdate'))
4611 (symbol 'isodate'))
4612 (symbol 'isodate'))
4612 (string '\n'))
4613 (string '\n'))
4613 * expanded:
4614 * expanded:
4614 (template
4615 (template
4615 (|
4616 (|
4616 (func
4617 (func
4617 (symbol 'localdate')
4618 (symbol 'localdate')
4618 (list
4619 (list
4619 (symbol 'date')
4620 (symbol 'date')
4620 (string 'UTC')))
4621 (string 'UTC')))
4621 (symbol 'isodate'))
4622 (symbol 'isodate'))
4622 (string '\n'))
4623 (string '\n'))
4623 1970-01-12 13:46 +0000
4624 1970-01-12 13:46 +0000
4624
4625
4625 Aliases should be applied only to command arguments and templates in hgrc.
4626 Aliases should be applied only to command arguments and templates in hgrc.
4626 Otherwise, our stock styles and web templates could be corrupted:
4627 Otherwise, our stock styles and web templates could be corrupted:
4627
4628
4628 $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n'
4629 $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n'
4629 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4630 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4630
4631
4631 $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"'
4632 $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"'
4632 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4633 0:1e4e1b8f71e0 1970-01-12 13:46 +0000
4633
4634
4634 $ cat <<EOF > tmpl
4635 $ cat <<EOF > tmpl
4635 > changeset = 'nothing expanded:{rn}\n'
4636 > changeset = 'nothing expanded:{rn}\n'
4636 > EOF
4637 > EOF
4637 $ hg log -r0 --style ./tmpl
4638 $ hg log -r0 --style ./tmpl
4638 nothing expanded:
4639 nothing expanded:
4639
4640
4640 Aliases in formatter:
4641 Aliases in formatter:
4641
4642
4642 $ hg branches -T '{pad(branch, 7)} {rn}\n'
4643 $ hg branches -T '{pad(branch, 7)} {rn}\n'
4643 default 6:d41e714fe50d
4644 default 6:d41e714fe50d
4644 foo 4:bbe44766e73d
4645 foo 4:bbe44766e73d
4645
4646
4646 Aliases should honor HGPLAIN:
4647 Aliases should honor HGPLAIN:
4647
4648
4648 $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n'
4649 $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n'
4649 nothing expanded:
4650 nothing expanded:
4650 $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n'
4651 $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n'
4651 0:1e4e1b8f71e0
4652 0:1e4e1b8f71e0
4652
4653
4653 Unparsable alias:
4654 Unparsable alias:
4654
4655
4655 $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}'
4656 $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}'
4656 (template
4657 (template
4657 (symbol 'bad'))
4658 (symbol 'bad'))
4658 abort: bad definition of template alias "bad": at 2: not a prefix: end
4659 abort: bad definition of template alias "bad": at 2: not a prefix: end
4659 [255]
4660 [255]
4660 $ hg log --config templatealias.bad='x(' -T '{bad}'
4661 $ hg log --config templatealias.bad='x(' -T '{bad}'
4661 abort: bad definition of template alias "bad": at 2: not a prefix: end
4662 abort: bad definition of template alias "bad": at 2: not a prefix: end
4662 [255]
4663 [255]
4663
4664
4664 $ cd ..
4665 $ cd ..
4665
4666
4666 Set up repository for non-ascii encoding tests:
4667 Set up repository for non-ascii encoding tests:
4667
4668
4668 $ hg init nonascii
4669 $ hg init nonascii
4669 $ cd nonascii
4670 $ cd nonascii
4670 $ $PYTHON <<EOF
4671 $ $PYTHON <<EOF
4671 > open('latin1', 'wb').write(b'\xe9')
4672 > open('latin1', 'wb').write(b'\xe9')
4672 > open('utf-8', 'wb').write(b'\xc3\xa9')
4673 > open('utf-8', 'wb').write(b'\xc3\xa9')
4673 > EOF
4674 > EOF
4674 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
4675 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
4675 $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8
4676 $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8
4676
4677
4677 json filter should try round-trip conversion to utf-8:
4678 json filter should try round-trip conversion to utf-8:
4678
4679
4679 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
4680 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
4680 "\u00e9"
4681 "\u00e9"
4681 $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0
4682 $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0
4682 "non-ascii branch: \u00e9"
4683 "non-ascii branch: \u00e9"
4683
4684
4684 json filter takes input as utf-8b:
4685 json filter takes input as utf-8b:
4685
4686
4686 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
4687 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
4687 "\u00e9"
4688 "\u00e9"
4688 $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1
4689 $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1
4689 "\udce9"
4690 "\udce9"
4690
4691
4691 utf8 filter:
4692 utf8 filter:
4692
4693
4693 $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0
4694 $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0
4694 round-trip: c3a9
4695 round-trip: c3a9
4695 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1
4696 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1
4696 decoded: c3a9
4697 decoded: c3a9
4697 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1
4698 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1
4698 abort: decoding near * (glob)
4699 abort: decoding near * (glob)
4699 [255]
4700 [255]
4700 $ hg log -T "coerced to string: {rev|utf8}\n" -r0
4701 $ hg log -T "coerced to string: {rev|utf8}\n" -r0
4701 coerced to string: 0
4702 coerced to string: 0
4702
4703
4703 pad width:
4704 pad width:
4704
4705
4705 $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n"
4706 $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n"
4706 \xc3\xa9- (esc)
4707 \xc3\xa9- (esc)
4707
4708
4708 $ cd ..
4709 $ cd ..
4709
4710
4710 Test that template function in extension is registered as expected
4711 Test that template function in extension is registered as expected
4711
4712
4712 $ cd a
4713 $ cd a
4713
4714
4714 $ cat <<EOF > $TESTTMP/customfunc.py
4715 $ cat <<EOF > $TESTTMP/customfunc.py
4715 > from mercurial import registrar
4716 > from mercurial import registrar
4716 >
4717 >
4717 > templatefunc = registrar.templatefunc()
4718 > templatefunc = registrar.templatefunc()
4718 >
4719 >
4719 > @templatefunc(b'custom()')
4720 > @templatefunc(b'custom()')
4720 > def custom(context, mapping, args):
4721 > def custom(context, mapping, args):
4721 > return b'custom'
4722 > return b'custom'
4722 > EOF
4723 > EOF
4723 $ cat <<EOF > .hg/hgrc
4724 $ cat <<EOF > .hg/hgrc
4724 > [extensions]
4725 > [extensions]
4725 > customfunc = $TESTTMP/customfunc.py
4726 > customfunc = $TESTTMP/customfunc.py
4726 > EOF
4727 > EOF
4727
4728
4728 $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true
4729 $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true
4729 custom
4730 custom
4730
4731
4731 $ cd ..
4732 $ cd ..
4732
4733
4733 Test 'graphwidth' in 'hg log' on various topologies. The key here is that the
4734 Test 'graphwidth' in 'hg log' on various topologies. The key here is that the
4734 printed graphwidths 3, 5, 7, etc. should all line up in their respective
4735 printed graphwidths 3, 5, 7, etc. should all line up in their respective
4735 columns. We don't care about other aspects of the graph rendering here.
4736 columns. We don't care about other aspects of the graph rendering here.
4736
4737
4737 $ hg init graphwidth
4738 $ hg init graphwidth
4738 $ cd graphwidth
4739 $ cd graphwidth
4739
4740
4740 $ wrappabletext="a a a a a a a a a a a a"
4741 $ wrappabletext="a a a a a a a a a a a a"
4741
4742
4742 $ printf "first\n" > file
4743 $ printf "first\n" > file
4743 $ hg add file
4744 $ hg add file
4744 $ hg commit -m "$wrappabletext"
4745 $ hg commit -m "$wrappabletext"
4745
4746
4746 $ printf "first\nsecond\n" > file
4747 $ printf "first\nsecond\n" > file
4747 $ hg commit -m "$wrappabletext"
4748 $ hg commit -m "$wrappabletext"
4748
4749
4749 $ hg checkout 0
4750 $ hg checkout 0
4750 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4751 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4751 $ printf "third\nfirst\n" > file
4752 $ printf "third\nfirst\n" > file
4752 $ hg commit -m "$wrappabletext"
4753 $ hg commit -m "$wrappabletext"
4753 created new head
4754 created new head
4754
4755
4755 $ hg merge
4756 $ hg merge
4756 merging file
4757 merging file
4757 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
4758 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
4758 (branch merge, don't forget to commit)
4759 (branch merge, don't forget to commit)
4759
4760
4760 $ hg log --graph -T "{graphwidth}"
4761 $ hg log --graph -T "{graphwidth}"
4761 @ 3
4762 @ 3
4762 |
4763 |
4763 | @ 5
4764 | @ 5
4764 |/
4765 |/
4765 o 3
4766 o 3
4766
4767
4767 $ hg commit -m "$wrappabletext"
4768 $ hg commit -m "$wrappabletext"
4768
4769
4769 $ hg log --graph -T "{graphwidth}"
4770 $ hg log --graph -T "{graphwidth}"
4770 @ 5
4771 @ 5
4771 |\
4772 |\
4772 | o 5
4773 | o 5
4773 | |
4774 | |
4774 o | 5
4775 o | 5
4775 |/
4776 |/
4776 o 3
4777 o 3
4777
4778
4778
4779
4779 $ hg checkout 0
4780 $ hg checkout 0
4780 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4781 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4781 $ printf "third\nfirst\nsecond\n" > file
4782 $ printf "third\nfirst\nsecond\n" > file
4782 $ hg commit -m "$wrappabletext"
4783 $ hg commit -m "$wrappabletext"
4783 created new head
4784 created new head
4784
4785
4785 $ hg log --graph -T "{graphwidth}"
4786 $ hg log --graph -T "{graphwidth}"
4786 @ 3
4787 @ 3
4787 |
4788 |
4788 | o 7
4789 | o 7
4789 | |\
4790 | |\
4790 +---o 7
4791 +---o 7
4791 | |
4792 | |
4792 | o 5
4793 | o 5
4793 |/
4794 |/
4794 o 3
4795 o 3
4795
4796
4796
4797
4797 $ hg log --graph -T "{graphwidth}" -r 3
4798 $ hg log --graph -T "{graphwidth}" -r 3
4798 o 5
4799 o 5
4799 |\
4800 |\
4800 ~ ~
4801 ~ ~
4801
4802
4802 $ hg log --graph -T "{graphwidth}" -r 1
4803 $ hg log --graph -T "{graphwidth}" -r 1
4803 o 3
4804 o 3
4804 |
4805 |
4805 ~
4806 ~
4806
4807
4807 $ hg merge
4808 $ hg merge
4808 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4809 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4809 (branch merge, don't forget to commit)
4810 (branch merge, don't forget to commit)
4810 $ hg commit -m "$wrappabletext"
4811 $ hg commit -m "$wrappabletext"
4811
4812
4812 $ printf "seventh\n" >> file
4813 $ printf "seventh\n" >> file
4813 $ hg commit -m "$wrappabletext"
4814 $ hg commit -m "$wrappabletext"
4814
4815
4815 $ hg log --graph -T "{graphwidth}"
4816 $ hg log --graph -T "{graphwidth}"
4816 @ 3
4817 @ 3
4817 |
4818 |
4818 o 5
4819 o 5
4819 |\
4820 |\
4820 | o 5
4821 | o 5
4821 | |
4822 | |
4822 o | 7
4823 o | 7
4823 |\ \
4824 |\ \
4824 | o | 7
4825 | o | 7
4825 | |/
4826 | |/
4826 o / 5
4827 o / 5
4827 |/
4828 |/
4828 o 3
4829 o 3
4829
4830
4830
4831
4831 The point of graphwidth is to allow wrapping that accounts for the space taken
4832 The point of graphwidth is to allow wrapping that accounts for the space taken
4832 by the graph.
4833 by the graph.
4833
4834
4834 $ COLUMNS=10 hg log --graph -T "{fill(desc, termwidth - graphwidth)}"
4835 $ COLUMNS=10 hg log --graph -T "{fill(desc, termwidth - graphwidth)}"
4835 @ a a a a
4836 @ a a a a
4836 | a a a a
4837 | a a a a
4837 | a a a a
4838 | a a a a
4838 o a a a
4839 o a a a
4839 |\ a a a
4840 |\ a a a
4840 | | a a a
4841 | | a a a
4841 | | a a a
4842 | | a a a
4842 | o a a a
4843 | o a a a
4843 | | a a a
4844 | | a a a
4844 | | a a a
4845 | | a a a
4845 | | a a a
4846 | | a a a
4846 o | a a
4847 o | a a
4847 |\ \ a a
4848 |\ \ a a
4848 | | | a a
4849 | | | a a
4849 | | | a a
4850 | | | a a
4850 | | | a a
4851 | | | a a
4851 | | | a a
4852 | | | a a
4852 | o | a a
4853 | o | a a
4853 | |/ a a
4854 | |/ a a
4854 | | a a
4855 | | a a
4855 | | a a
4856 | | a a
4856 | | a a
4857 | | a a
4857 | | a a
4858 | | a a
4858 o | a a a
4859 o | a a a
4859 |/ a a a
4860 |/ a a a
4860 | a a a
4861 | a a a
4861 | a a a
4862 | a a a
4862 o a a a a
4863 o a a a a
4863 a a a a
4864 a a a a
4864 a a a a
4865 a a a a
4865
4866
4866 Something tricky happens when there are elided nodes; the next drawn row of
4867 Something tricky happens when there are elided nodes; the next drawn row of
4867 edges can be more than one column wider, but the graph width only increases by
4868 edges can be more than one column wider, but the graph width only increases by
4868 one column. The remaining columns are added in between the nodes.
4869 one column. The remaining columns are added in between the nodes.
4869
4870
4870 $ hg log --graph -T "{graphwidth}" -r "0|2|4|5"
4871 $ hg log --graph -T "{graphwidth}" -r "0|2|4|5"
4871 o 5
4872 o 5
4872 |\
4873 |\
4873 | \
4874 | \
4874 | :\
4875 | :\
4875 o : : 7
4876 o : : 7
4876 :/ /
4877 :/ /
4877 : o 5
4878 : o 5
4878 :/
4879 :/
4879 o 3
4880 o 3
4880
4881
4881
4882
4882 $ cd ..
4883 $ cd ..
4883
4884
@@ -1,922 +1,922 b''
1 $ cat >> $HGRCPATH << EOF
1 $ cat >> $HGRCPATH << EOF
2 > [diff]
2 > [diff]
3 > git = true
3 > git = true
4 > EOF
4 > EOF
5
5
6 $ hg init
6 $ hg init
7 $ cat > foo << EOF
7 $ cat > foo << EOF
8 > 0
8 > 0
9 > 1
9 > 1
10 > 2
10 > 2
11 > 3
11 > 3
12 > 4
12 > 4
13 > EOF
13 > EOF
14 $ hg ci -Am init
14 $ hg ci -Am init
15 adding foo
15 adding foo
16 $ cat > foo << EOF
16 $ cat > foo << EOF
17 > 0
17 > 0
18 > 0
18 > 0
19 > 0
19 > 0
20 > 0
20 > 0
21 > 1
21 > 1
22 > 2
22 > 2
23 > 3
23 > 3
24 > 4
24 > 4
25 > EOF
25 > EOF
26 $ hg ci -m 'more 0'
26 $ hg ci -m 'more 0'
27 $ sed 's/2/2+/' foo > foo.new
27 $ sed 's/2/2+/' foo > foo.new
28 $ mv foo.new foo
28 $ mv foo.new foo
29 $ cat > bar << EOF
29 $ cat > bar << EOF
30 > a
30 > a
31 > b
31 > b
32 > c
32 > c
33 > d
33 > d
34 > e
34 > e
35 > EOF
35 > EOF
36 $ hg add bar
36 $ hg add bar
37 $ hg ci -Am "2 -> 2+; added bar"
37 $ hg ci -Am "2 -> 2+; added bar"
38 $ cat >> foo << EOF
38 $ cat >> foo << EOF
39 > 5
39 > 5
40 > 6
40 > 6
41 > 7
41 > 7
42 > 8
42 > 8
43 > 9
43 > 9
44 > 10
44 > 10
45 > 11
45 > 11
46 > EOF
46 > EOF
47 $ hg ci -m "to 11"
47 $ hg ci -m "to 11"
48
48
49 Add some changes with two diff hunks
49 Add some changes with two diff hunks
50
50
51 $ sed 's/^1$/ 1/' foo > foo.new
51 $ sed 's/^1$/ 1/' foo > foo.new
52 $ mv foo.new foo
52 $ mv foo.new foo
53 $ sed 's/^11$/11+/' foo > foo.new
53 $ sed 's/^11$/11+/' foo > foo.new
54 $ mv foo.new foo
54 $ mv foo.new foo
55 $ hg ci -m '11 -> 11+; leading space before "1"'
55 $ hg ci -m '11 -> 11+; leading space before "1"'
56 (make sure there are two hunks in "foo")
56 (make sure there are two hunks in "foo")
57 $ hg diff -c .
57 $ hg diff -c .
58 diff --git a/foo b/foo
58 diff --git a/foo b/foo
59 --- a/foo
59 --- a/foo
60 +++ b/foo
60 +++ b/foo
61 @@ -2,7 +2,7 @@
61 @@ -2,7 +2,7 @@
62 0
62 0
63 0
63 0
64 0
64 0
65 -1
65 -1
66 + 1
66 + 1
67 2+
67 2+
68 3
68 3
69 4
69 4
70 @@ -12,4 +12,4 @@
70 @@ -12,4 +12,4 @@
71 8
71 8
72 9
72 9
73 10
73 10
74 -11
74 -11
75 +11+
75 +11+
76 $ sed 's/3/3+/' foo > foo.new
76 $ sed 's/3/3+/' foo > foo.new
77 $ mv foo.new foo
77 $ mv foo.new foo
78 $ sed 's/^11+$/11-/' foo > foo.new
78 $ sed 's/^11+$/11-/' foo > foo.new
79 $ mv foo.new foo
79 $ mv foo.new foo
80 $ sed 's/a/a+/' bar > bar.new
80 $ sed 's/a/a+/' bar > bar.new
81 $ mv bar.new bar
81 $ mv bar.new bar
82 $ hg ci -m 'foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+'
82 $ hg ci -m 'foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+'
83 (make sure there are two hunks in "foo")
83 (make sure there are two hunks in "foo")
84 $ hg diff -c . foo
84 $ hg diff -c . foo
85 diff --git a/foo b/foo
85 diff --git a/foo b/foo
86 --- a/foo
86 --- a/foo
87 +++ b/foo
87 +++ b/foo
88 @@ -4,7 +4,7 @@
88 @@ -4,7 +4,7 @@
89 0
89 0
90 1
90 1
91 2+
91 2+
92 -3
92 -3
93 +3+
93 +3+
94 4
94 4
95 5
95 5
96 6
96 6
97 @@ -12,4 +12,4 @@
97 @@ -12,4 +12,4 @@
98 8
98 8
99 9
99 9
100 10
100 10
101 -11+
101 -11+
102 +11-
102 +11-
103
103
104 $ hg log -f -L foo,5:7 -p
104 $ hg log -f -L foo,5:7 -p
105 changeset: 5:cfdf972b3971
105 changeset: 5:cfdf972b3971
106 tag: tip
106 tag: tip
107 user: test
107 user: test
108 date: Thu Jan 01 00:00:00 1970 +0000
108 date: Thu Jan 01 00:00:00 1970 +0000
109 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
109 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
110
110
111 diff --git a/foo b/foo
111 diff --git a/foo b/foo
112 --- a/foo
112 --- a/foo
113 +++ b/foo
113 +++ b/foo
114 @@ -4,7 +4,7 @@
114 @@ -4,7 +4,7 @@
115 0
115 0
116 1
116 1
117 2+
117 2+
118 -3
118 -3
119 +3+
119 +3+
120 4
120 4
121 5
121 5
122 6
122 6
123
123
124 changeset: 4:eaec41c1a0c9
124 changeset: 4:eaec41c1a0c9
125 user: test
125 user: test
126 date: Thu Jan 01 00:00:00 1970 +0000
126 date: Thu Jan 01 00:00:00 1970 +0000
127 summary: 11 -> 11+; leading space before "1"
127 summary: 11 -> 11+; leading space before "1"
128
128
129 diff --git a/foo b/foo
129 diff --git a/foo b/foo
130 --- a/foo
130 --- a/foo
131 +++ b/foo
131 +++ b/foo
132 @@ -2,7 +2,7 @@
132 @@ -2,7 +2,7 @@
133 0
133 0
134 0
134 0
135 0
135 0
136 -1
136 -1
137 + 1
137 + 1
138 2+
138 2+
139 3
139 3
140 4
140 4
141
141
142 changeset: 2:63a884426fd0
142 changeset: 2:63a884426fd0
143 user: test
143 user: test
144 date: Thu Jan 01 00:00:00 1970 +0000
144 date: Thu Jan 01 00:00:00 1970 +0000
145 summary: 2 -> 2+; added bar
145 summary: 2 -> 2+; added bar
146
146
147 diff --git a/foo b/foo
147 diff --git a/foo b/foo
148 --- a/foo
148 --- a/foo
149 +++ b/foo
149 +++ b/foo
150 @@ -3,6 +3,6 @@
150 @@ -3,6 +3,6 @@
151 0
151 0
152 0
152 0
153 1
153 1
154 -2
154 -2
155 +2+
155 +2+
156 3
156 3
157 4
157 4
158
158
159 changeset: 0:5ae1f82b9a00
159 changeset: 0:5ae1f82b9a00
160 user: test
160 user: test
161 date: Thu Jan 01 00:00:00 1970 +0000
161 date: Thu Jan 01 00:00:00 1970 +0000
162 summary: init
162 summary: init
163
163
164 diff --git a/foo b/foo
164 diff --git a/foo b/foo
165 new file mode 100644
165 new file mode 100644
166 --- /dev/null
166 --- /dev/null
167 +++ b/foo
167 +++ b/foo
168 @@ -0,0 +1,5 @@
168 @@ -0,0 +1,5 @@
169 +0
169 +0
170 +1
170 +1
171 +2
171 +2
172 +3
172 +3
173 +4
173 +4
174
174
175 $ hg log -f --graph -L foo,5:7 -p
175 $ hg log -f --graph -L foo,5:7 -p
176 @ changeset: 5:cfdf972b3971
176 @ changeset: 5:cfdf972b3971
177 | tag: tip
177 | tag: tip
178 | user: test
178 | user: test
179 | date: Thu Jan 01 00:00:00 1970 +0000
179 | date: Thu Jan 01 00:00:00 1970 +0000
180 | summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
180 | summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
181 |
181 |
182 | diff --git a/foo b/foo
182 | diff --git a/foo b/foo
183 | --- a/foo
183 | --- a/foo
184 | +++ b/foo
184 | +++ b/foo
185 | @@ -4,7 +4,7 @@
185 | @@ -4,7 +4,7 @@
186 | 0
186 | 0
187 | 1
187 | 1
188 | 2+
188 | 2+
189 | -3
189 | -3
190 | +3+
190 | +3+
191 | 4
191 | 4
192 | 5
192 | 5
193 | 6
193 | 6
194 |
194 |
195 o changeset: 4:eaec41c1a0c9
195 o changeset: 4:eaec41c1a0c9
196 : user: test
196 : user: test
197 : date: Thu Jan 01 00:00:00 1970 +0000
197 : date: Thu Jan 01 00:00:00 1970 +0000
198 : summary: 11 -> 11+; leading space before "1"
198 : summary: 11 -> 11+; leading space before "1"
199 :
199 :
200 : diff --git a/foo b/foo
200 : diff --git a/foo b/foo
201 : --- a/foo
201 : --- a/foo
202 : +++ b/foo
202 : +++ b/foo
203 : @@ -2,7 +2,7 @@
203 : @@ -2,7 +2,7 @@
204 : 0
204 : 0
205 : 0
205 : 0
206 : 0
206 : 0
207 : -1
207 : -1
208 : + 1
208 : + 1
209 : 2+
209 : 2+
210 : 3
210 : 3
211 : 4
211 : 4
212 :
212 :
213 o changeset: 2:63a884426fd0
213 o changeset: 2:63a884426fd0
214 : user: test
214 : user: test
215 : date: Thu Jan 01 00:00:00 1970 +0000
215 : date: Thu Jan 01 00:00:00 1970 +0000
216 : summary: 2 -> 2+; added bar
216 : summary: 2 -> 2+; added bar
217 :
217 :
218 : diff --git a/foo b/foo
218 : diff --git a/foo b/foo
219 : --- a/foo
219 : --- a/foo
220 : +++ b/foo
220 : +++ b/foo
221 : @@ -3,6 +3,6 @@
221 : @@ -3,6 +3,6 @@
222 : 0
222 : 0
223 : 0
223 : 0
224 : 1
224 : 1
225 : -2
225 : -2
226 : +2+
226 : +2+
227 : 3
227 : 3
228 : 4
228 : 4
229 :
229 :
230 o changeset: 0:5ae1f82b9a00
230 o changeset: 0:5ae1f82b9a00
231 user: test
231 user: test
232 date: Thu Jan 01 00:00:00 1970 +0000
232 date: Thu Jan 01 00:00:00 1970 +0000
233 summary: init
233 summary: init
234
234
235 diff --git a/foo b/foo
235 diff --git a/foo b/foo
236 new file mode 100644
236 new file mode 100644
237 --- /dev/null
237 --- /dev/null
238 +++ b/foo
238 +++ b/foo
239 @@ -0,0 +1,5 @@
239 @@ -0,0 +1,5 @@
240 +0
240 +0
241 +1
241 +1
242 +2
242 +2
243 +3
243 +3
244 +4
244 +4
245
245
246
246
247 With --template.
247 With --template.
248
248
249 $ hg log -f -L foo,5:7 -T '{rev}:{node|short} {desc|firstline}\n'
249 $ hg log -f -L foo,5:7 -T '{rev}:{node|short} {desc|firstline}\n'
250 5:cfdf972b3971 foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
250 5:cfdf972b3971 foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
251 4:eaec41c1a0c9 11 -> 11+; leading space before "1"
251 4:eaec41c1a0c9 11 -> 11+; leading space before "1"
252 2:63a884426fd0 2 -> 2+; added bar
252 2:63a884426fd0 2 -> 2+; added bar
253 0:5ae1f82b9a00 init
253 0:5ae1f82b9a00 init
254 $ hg log -f -L foo,5:7 -T json
254 $ hg log -f -L foo,5:7 -T json
255 [
255 [
256 {
256 {
257 "rev": 5,
257 "bookmarks": [],
258 "node": "cfdf972b3971a2a59638bf9583c0debbffee5404",
259 "branch": "default",
258 "branch": "default",
260 "phase": "draft",
261 "user": "test",
262 "date": [0, 0],
259 "date": [0, 0],
263 "desc": "foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+",
260 "desc": "foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+",
264 "bookmarks": [],
261 "node": "cfdf972b3971a2a59638bf9583c0debbffee5404",
262 "parents": ["eaec41c1a0c9ad0a5e999611d0149d171beffb8c"],
263 "phase": "draft",
264 "rev": 5,
265 "tags": ["tip"],
265 "tags": ["tip"],
266 "parents": ["eaec41c1a0c9ad0a5e999611d0149d171beffb8c"]
266 "user": "test"
267 },
267 },
268 {
268 {
269 "rev": 4,
269 "bookmarks": [],
270 "node": "eaec41c1a0c9ad0a5e999611d0149d171beffb8c",
271 "branch": "default",
270 "branch": "default",
272 "phase": "draft",
273 "user": "test",
274 "date": [0, 0],
271 "date": [0, 0],
275 "desc": "11 -> 11+; leading space before \"1\"",
272 "desc": "11 -> 11+; leading space before \"1\"",
276 "bookmarks": [],
273 "node": "eaec41c1a0c9ad0a5e999611d0149d171beffb8c",
274 "parents": ["730a61fbaecf426c17c2c66bc42d195b5d5b0ba8"],
275 "phase": "draft",
276 "rev": 4,
277 "tags": [],
277 "tags": [],
278 "parents": ["730a61fbaecf426c17c2c66bc42d195b5d5b0ba8"]
278 "user": "test"
279 },
279 },
280 {
280 {
281 "rev": 2,
281 "bookmarks": [],
282 "node": "63a884426fd0b277fcd55895bbb2f230434576eb",
283 "branch": "default",
282 "branch": "default",
284 "phase": "draft",
285 "user": "test",
286 "date": [0, 0],
283 "date": [0, 0],
287 "desc": "2 -> 2+; added bar",
284 "desc": "2 -> 2+; added bar",
288 "bookmarks": [],
285 "node": "63a884426fd0b277fcd55895bbb2f230434576eb",
286 "parents": ["29a1e7c6b80024f63f310a2d71de979e9d2996d7"],
287 "phase": "draft",
288 "rev": 2,
289 "tags": [],
289 "tags": [],
290 "parents": ["29a1e7c6b80024f63f310a2d71de979e9d2996d7"]
290 "user": "test"
291 },
291 },
292 {
292 {
293 "rev": 0,
293 "bookmarks": [],
294 "node": "5ae1f82b9a000ff1e0967d0dac1c58b9d796e1b4",
295 "branch": "default",
294 "branch": "default",
296 "phase": "draft",
297 "user": "test",
298 "date": [0, 0],
295 "date": [0, 0],
299 "desc": "init",
296 "desc": "init",
300 "bookmarks": [],
297 "node": "5ae1f82b9a000ff1e0967d0dac1c58b9d796e1b4",
298 "parents": ["0000000000000000000000000000000000000000"],
299 "phase": "draft",
300 "rev": 0,
301 "tags": [],
301 "tags": [],
302 "parents": ["0000000000000000000000000000000000000000"]
302 "user": "test"
303 }
303 }
304 ]
304 ]
305
305
306 With some white-space diff option, respective revisions are skipped.
306 With some white-space diff option, respective revisions are skipped.
307
307
308 $ hg log -f -L foo,5:7 -p --config diff.ignorews=true
308 $ hg log -f -L foo,5:7 -p --config diff.ignorews=true
309 changeset: 5:cfdf972b3971
309 changeset: 5:cfdf972b3971
310 tag: tip
310 tag: tip
311 user: test
311 user: test
312 date: Thu Jan 01 00:00:00 1970 +0000
312 date: Thu Jan 01 00:00:00 1970 +0000
313 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
313 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
314
314
315 diff --git a/foo b/foo
315 diff --git a/foo b/foo
316 --- a/foo
316 --- a/foo
317 +++ b/foo
317 +++ b/foo
318 @@ -4,7 +4,7 @@
318 @@ -4,7 +4,7 @@
319 0
319 0
320 1
320 1
321 2+
321 2+
322 -3
322 -3
323 +3+
323 +3+
324 4
324 4
325 5
325 5
326 6
326 6
327
327
328 changeset: 2:63a884426fd0
328 changeset: 2:63a884426fd0
329 user: test
329 user: test
330 date: Thu Jan 01 00:00:00 1970 +0000
330 date: Thu Jan 01 00:00:00 1970 +0000
331 summary: 2 -> 2+; added bar
331 summary: 2 -> 2+; added bar
332
332
333 diff --git a/foo b/foo
333 diff --git a/foo b/foo
334 --- a/foo
334 --- a/foo
335 +++ b/foo
335 +++ b/foo
336 @@ -3,6 +3,6 @@
336 @@ -3,6 +3,6 @@
337 0
337 0
338 0
338 0
339 1
339 1
340 -2
340 -2
341 +2+
341 +2+
342 3
342 3
343 4
343 4
344
344
345 changeset: 0:5ae1f82b9a00
345 changeset: 0:5ae1f82b9a00
346 user: test
346 user: test
347 date: Thu Jan 01 00:00:00 1970 +0000
347 date: Thu Jan 01 00:00:00 1970 +0000
348 summary: init
348 summary: init
349
349
350 diff --git a/foo b/foo
350 diff --git a/foo b/foo
351 new file mode 100644
351 new file mode 100644
352 --- /dev/null
352 --- /dev/null
353 +++ b/foo
353 +++ b/foo
354 @@ -0,0 +1,5 @@
354 @@ -0,0 +1,5 @@
355 +0
355 +0
356 +1
356 +1
357 +2
357 +2
358 +3
358 +3
359 +4
359 +4
360
360
361
361
362 Regular file patterns are not allowed.
362 Regular file patterns are not allowed.
363
363
364 $ hg log -f -L foo,5:7 -p bar
364 $ hg log -f -L foo,5:7 -p bar
365 abort: FILE arguments are not compatible with --line-range option
365 abort: FILE arguments are not compatible with --line-range option
366 [255]
366 [255]
367
367
368 Option --rev acts as a restriction.
368 Option --rev acts as a restriction.
369
369
370 $ hg log -f -L foo,5:7 -p -r 'desc(2)'
370 $ hg log -f -L foo,5:7 -p -r 'desc(2)'
371 changeset: 2:63a884426fd0
371 changeset: 2:63a884426fd0
372 user: test
372 user: test
373 date: Thu Jan 01 00:00:00 1970 +0000
373 date: Thu Jan 01 00:00:00 1970 +0000
374 summary: 2 -> 2+; added bar
374 summary: 2 -> 2+; added bar
375
375
376 diff --git a/foo b/foo
376 diff --git a/foo b/foo
377 --- a/foo
377 --- a/foo
378 +++ b/foo
378 +++ b/foo
379 @@ -3,6 +3,6 @@
379 @@ -3,6 +3,6 @@
380 0
380 0
381 0
381 0
382 1
382 1
383 -2
383 -2
384 +2+
384 +2+
385 3
385 3
386 4
386 4
387
387
388 changeset: 0:5ae1f82b9a00
388 changeset: 0:5ae1f82b9a00
389 user: test
389 user: test
390 date: Thu Jan 01 00:00:00 1970 +0000
390 date: Thu Jan 01 00:00:00 1970 +0000
391 summary: init
391 summary: init
392
392
393 diff --git a/foo b/foo
393 diff --git a/foo b/foo
394 new file mode 100644
394 new file mode 100644
395 --- /dev/null
395 --- /dev/null
396 +++ b/foo
396 +++ b/foo
397 @@ -0,0 +1,5 @@
397 @@ -0,0 +1,5 @@
398 +0
398 +0
399 +1
399 +1
400 +2
400 +2
401 +3
401 +3
402 +4
402 +4
403
403
404
404
405 With several -L patterns, changes touching any files in their respective line
405 With several -L patterns, changes touching any files in their respective line
406 range are show.
406 range are show.
407
407
408 $ hg log -f -L foo,5:7 -L bar,1:2 -p
408 $ hg log -f -L foo,5:7 -L bar,1:2 -p
409 changeset: 5:cfdf972b3971
409 changeset: 5:cfdf972b3971
410 tag: tip
410 tag: tip
411 user: test
411 user: test
412 date: Thu Jan 01 00:00:00 1970 +0000
412 date: Thu Jan 01 00:00:00 1970 +0000
413 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
413 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
414
414
415 diff --git a/bar b/bar
415 diff --git a/bar b/bar
416 --- a/bar
416 --- a/bar
417 +++ b/bar
417 +++ b/bar
418 @@ -1,4 +1,4 @@
418 @@ -1,4 +1,4 @@
419 -a
419 -a
420 +a+
420 +a+
421 b
421 b
422 c
422 c
423 d
423 d
424 diff --git a/foo b/foo
424 diff --git a/foo b/foo
425 --- a/foo
425 --- a/foo
426 +++ b/foo
426 +++ b/foo
427 @@ -4,7 +4,7 @@
427 @@ -4,7 +4,7 @@
428 0
428 0
429 1
429 1
430 2+
430 2+
431 -3
431 -3
432 +3+
432 +3+
433 4
433 4
434 5
434 5
435 6
435 6
436
436
437 changeset: 4:eaec41c1a0c9
437 changeset: 4:eaec41c1a0c9
438 user: test
438 user: test
439 date: Thu Jan 01 00:00:00 1970 +0000
439 date: Thu Jan 01 00:00:00 1970 +0000
440 summary: 11 -> 11+; leading space before "1"
440 summary: 11 -> 11+; leading space before "1"
441
441
442 diff --git a/foo b/foo
442 diff --git a/foo b/foo
443 --- a/foo
443 --- a/foo
444 +++ b/foo
444 +++ b/foo
445 @@ -2,7 +2,7 @@
445 @@ -2,7 +2,7 @@
446 0
446 0
447 0
447 0
448 0
448 0
449 -1
449 -1
450 + 1
450 + 1
451 2+
451 2+
452 3
452 3
453 4
453 4
454
454
455 changeset: 2:63a884426fd0
455 changeset: 2:63a884426fd0
456 user: test
456 user: test
457 date: Thu Jan 01 00:00:00 1970 +0000
457 date: Thu Jan 01 00:00:00 1970 +0000
458 summary: 2 -> 2+; added bar
458 summary: 2 -> 2+; added bar
459
459
460 diff --git a/bar b/bar
460 diff --git a/bar b/bar
461 new file mode 100644
461 new file mode 100644
462 --- /dev/null
462 --- /dev/null
463 +++ b/bar
463 +++ b/bar
464 @@ -0,0 +1,5 @@
464 @@ -0,0 +1,5 @@
465 +a
465 +a
466 +b
466 +b
467 +c
467 +c
468 +d
468 +d
469 +e
469 +e
470 diff --git a/foo b/foo
470 diff --git a/foo b/foo
471 --- a/foo
471 --- a/foo
472 +++ b/foo
472 +++ b/foo
473 @@ -3,6 +3,6 @@
473 @@ -3,6 +3,6 @@
474 0
474 0
475 0
475 0
476 1
476 1
477 -2
477 -2
478 +2+
478 +2+
479 3
479 3
480 4
480 4
481
481
482 changeset: 0:5ae1f82b9a00
482 changeset: 0:5ae1f82b9a00
483 user: test
483 user: test
484 date: Thu Jan 01 00:00:00 1970 +0000
484 date: Thu Jan 01 00:00:00 1970 +0000
485 summary: init
485 summary: init
486
486
487 diff --git a/foo b/foo
487 diff --git a/foo b/foo
488 new file mode 100644
488 new file mode 100644
489 --- /dev/null
489 --- /dev/null
490 +++ b/foo
490 +++ b/foo
491 @@ -0,0 +1,5 @@
491 @@ -0,0 +1,5 @@
492 +0
492 +0
493 +1
493 +1
494 +2
494 +2
495 +3
495 +3
496 +4
496 +4
497
497
498
498
499 Multiple -L options with the same file yields changes touching any of
499 Multiple -L options with the same file yields changes touching any of
500 specified line ranges.
500 specified line ranges.
501
501
502 $ hg log -f -L foo,5:7 -L foo,14:15 -p
502 $ hg log -f -L foo,5:7 -L foo,14:15 -p
503 changeset: 5:cfdf972b3971
503 changeset: 5:cfdf972b3971
504 tag: tip
504 tag: tip
505 user: test
505 user: test
506 date: Thu Jan 01 00:00:00 1970 +0000
506 date: Thu Jan 01 00:00:00 1970 +0000
507 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
507 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
508
508
509 diff --git a/foo b/foo
509 diff --git a/foo b/foo
510 --- a/foo
510 --- a/foo
511 +++ b/foo
511 +++ b/foo
512 @@ -4,7 +4,7 @@
512 @@ -4,7 +4,7 @@
513 0
513 0
514 1
514 1
515 2+
515 2+
516 -3
516 -3
517 +3+
517 +3+
518 4
518 4
519 5
519 5
520 6
520 6
521 @@ -12,4 +12,4 @@
521 @@ -12,4 +12,4 @@
522 8
522 8
523 9
523 9
524 10
524 10
525 -11+
525 -11+
526 +11-
526 +11-
527
527
528 changeset: 4:eaec41c1a0c9
528 changeset: 4:eaec41c1a0c9
529 user: test
529 user: test
530 date: Thu Jan 01 00:00:00 1970 +0000
530 date: Thu Jan 01 00:00:00 1970 +0000
531 summary: 11 -> 11+; leading space before "1"
531 summary: 11 -> 11+; leading space before "1"
532
532
533 diff --git a/foo b/foo
533 diff --git a/foo b/foo
534 --- a/foo
534 --- a/foo
535 +++ b/foo
535 +++ b/foo
536 @@ -2,7 +2,7 @@
536 @@ -2,7 +2,7 @@
537 0
537 0
538 0
538 0
539 0
539 0
540 -1
540 -1
541 + 1
541 + 1
542 2+
542 2+
543 3
543 3
544 4
544 4
545 @@ -12,4 +12,4 @@
545 @@ -12,4 +12,4 @@
546 8
546 8
547 9
547 9
548 10
548 10
549 -11
549 -11
550 +11+
550 +11+
551
551
552 changeset: 3:730a61fbaecf
552 changeset: 3:730a61fbaecf
553 user: test
553 user: test
554 date: Thu Jan 01 00:00:00 1970 +0000
554 date: Thu Jan 01 00:00:00 1970 +0000
555 summary: to 11
555 summary: to 11
556
556
557 diff --git a/foo b/foo
557 diff --git a/foo b/foo
558 --- a/foo
558 --- a/foo
559 +++ b/foo
559 +++ b/foo
560 @@ -6,3 +6,10 @@
560 @@ -6,3 +6,10 @@
561 2+
561 2+
562 3
562 3
563 4
563 4
564 +5
564 +5
565 +6
565 +6
566 +7
566 +7
567 +8
567 +8
568 +9
568 +9
569 +10
569 +10
570 +11
570 +11
571
571
572 changeset: 2:63a884426fd0
572 changeset: 2:63a884426fd0
573 user: test
573 user: test
574 date: Thu Jan 01 00:00:00 1970 +0000
574 date: Thu Jan 01 00:00:00 1970 +0000
575 summary: 2 -> 2+; added bar
575 summary: 2 -> 2+; added bar
576
576
577 diff --git a/foo b/foo
577 diff --git a/foo b/foo
578 --- a/foo
578 --- a/foo
579 +++ b/foo
579 +++ b/foo
580 @@ -3,6 +3,6 @@
580 @@ -3,6 +3,6 @@
581 0
581 0
582 0
582 0
583 1
583 1
584 -2
584 -2
585 +2+
585 +2+
586 3
586 3
587 4
587 4
588
588
589 changeset: 0:5ae1f82b9a00
589 changeset: 0:5ae1f82b9a00
590 user: test
590 user: test
591 date: Thu Jan 01 00:00:00 1970 +0000
591 date: Thu Jan 01 00:00:00 1970 +0000
592 summary: init
592 summary: init
593
593
594 diff --git a/foo b/foo
594 diff --git a/foo b/foo
595 new file mode 100644
595 new file mode 100644
596 --- /dev/null
596 --- /dev/null
597 +++ b/foo
597 +++ b/foo
598 @@ -0,0 +1,5 @@
598 @@ -0,0 +1,5 @@
599 +0
599 +0
600 +1
600 +1
601 +2
601 +2
602 +3
602 +3
603 +4
603 +4
604
604
605
605
606 A file with a comma in its name.
606 A file with a comma in its name.
607
607
608 $ cat > ba,z << EOF
608 $ cat > ba,z << EOF
609 > q
609 > q
610 > w
610 > w
611 > e
611 > e
612 > r
612 > r
613 > t
613 > t
614 > y
614 > y
615 > EOF
615 > EOF
616 $ hg ci -Am 'querty'
616 $ hg ci -Am 'querty'
617 adding ba,z
617 adding ba,z
618 $ cat >> ba,z << EOF
618 $ cat >> ba,z << EOF
619 > u
619 > u
620 > i
620 > i
621 > o
621 > o
622 > p
622 > p
623 > EOF
623 > EOF
624 $ hg ci -m 'more keys'
624 $ hg ci -m 'more keys'
625 $ cat > ba,z << EOF
625 $ cat > ba,z << EOF
626 > a
626 > a
627 > z
627 > z
628 > e
628 > e
629 > r
629 > r
630 > t
630 > t
631 > y
631 > y
632 > u
632 > u
633 > i
633 > i
634 > o
634 > o
635 > p
635 > p
636 > EOF
636 > EOF
637 $ hg ci -m 'azerty'
637 $ hg ci -m 'azerty'
638 $ hg log -f -L ba,z,1:2 -p
638 $ hg log -f -L ba,z,1:2 -p
639 changeset: 8:52373265138b
639 changeset: 8:52373265138b
640 tag: tip
640 tag: tip
641 user: test
641 user: test
642 date: Thu Jan 01 00:00:00 1970 +0000
642 date: Thu Jan 01 00:00:00 1970 +0000
643 summary: azerty
643 summary: azerty
644
644
645 diff --git a/ba,z b/ba,z
645 diff --git a/ba,z b/ba,z
646 --- a/ba,z
646 --- a/ba,z
647 +++ b/ba,z
647 +++ b/ba,z
648 @@ -1,5 +1,5 @@
648 @@ -1,5 +1,5 @@
649 -q
649 -q
650 -w
650 -w
651 +a
651 +a
652 +z
652 +z
653 e
653 e
654 r
654 r
655 t
655 t
656
656
657 changeset: 6:96ba8850f316
657 changeset: 6:96ba8850f316
658 user: test
658 user: test
659 date: Thu Jan 01 00:00:00 1970 +0000
659 date: Thu Jan 01 00:00:00 1970 +0000
660 summary: querty
660 summary: querty
661
661
662 diff --git a/ba,z b/ba,z
662 diff --git a/ba,z b/ba,z
663 new file mode 100644
663 new file mode 100644
664 --- /dev/null
664 --- /dev/null
665 +++ b/ba,z
665 +++ b/ba,z
666 @@ -0,0 +1,6 @@
666 @@ -0,0 +1,6 @@
667 +q
667 +q
668 +w
668 +w
669 +e
669 +e
670 +r
670 +r
671 +t
671 +t
672 +y
672 +y
673
673
674
674
675 Exact prefix kinds work in -L options.
675 Exact prefix kinds work in -L options.
676
676
677 $ mkdir dir
677 $ mkdir dir
678 $ cd dir
678 $ cd dir
679 $ hg log -f -L path:foo,5:7 -p
679 $ hg log -f -L path:foo,5:7 -p
680 changeset: 5:cfdf972b3971
680 changeset: 5:cfdf972b3971
681 user: test
681 user: test
682 date: Thu Jan 01 00:00:00 1970 +0000
682 date: Thu Jan 01 00:00:00 1970 +0000
683 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
683 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
684
684
685 diff --git a/foo b/foo
685 diff --git a/foo b/foo
686 --- a/foo
686 --- a/foo
687 +++ b/foo
687 +++ b/foo
688 @@ -4,7 +4,7 @@
688 @@ -4,7 +4,7 @@
689 0
689 0
690 1
690 1
691 2+
691 2+
692 -3
692 -3
693 +3+
693 +3+
694 4
694 4
695 5
695 5
696 6
696 6
697
697
698 changeset: 4:eaec41c1a0c9
698 changeset: 4:eaec41c1a0c9
699 user: test
699 user: test
700 date: Thu Jan 01 00:00:00 1970 +0000
700 date: Thu Jan 01 00:00:00 1970 +0000
701 summary: 11 -> 11+; leading space before "1"
701 summary: 11 -> 11+; leading space before "1"
702
702
703 diff --git a/foo b/foo
703 diff --git a/foo b/foo
704 --- a/foo
704 --- a/foo
705 +++ b/foo
705 +++ b/foo
706 @@ -2,7 +2,7 @@
706 @@ -2,7 +2,7 @@
707 0
707 0
708 0
708 0
709 0
709 0
710 -1
710 -1
711 + 1
711 + 1
712 2+
712 2+
713 3
713 3
714 4
714 4
715
715
716 changeset: 2:63a884426fd0
716 changeset: 2:63a884426fd0
717 user: test
717 user: test
718 date: Thu Jan 01 00:00:00 1970 +0000
718 date: Thu Jan 01 00:00:00 1970 +0000
719 summary: 2 -> 2+; added bar
719 summary: 2 -> 2+; added bar
720
720
721 diff --git a/foo b/foo
721 diff --git a/foo b/foo
722 --- a/foo
722 --- a/foo
723 +++ b/foo
723 +++ b/foo
724 @@ -3,6 +3,6 @@
724 @@ -3,6 +3,6 @@
725 0
725 0
726 0
726 0
727 1
727 1
728 -2
728 -2
729 +2+
729 +2+
730 3
730 3
731 4
731 4
732
732
733 changeset: 0:5ae1f82b9a00
733 changeset: 0:5ae1f82b9a00
734 user: test
734 user: test
735 date: Thu Jan 01 00:00:00 1970 +0000
735 date: Thu Jan 01 00:00:00 1970 +0000
736 summary: init
736 summary: init
737
737
738 diff --git a/foo b/foo
738 diff --git a/foo b/foo
739 new file mode 100644
739 new file mode 100644
740 --- /dev/null
740 --- /dev/null
741 +++ b/foo
741 +++ b/foo
742 @@ -0,0 +1,5 @@
742 @@ -0,0 +1,5 @@
743 +0
743 +0
744 +1
744 +1
745 +2
745 +2
746 +3
746 +3
747 +4
747 +4
748
748
749
749
750 Renames are followed.
750 Renames are followed.
751
751
752 $ hg mv ../foo baz
752 $ hg mv ../foo baz
753 $ sed 's/1/1+/' baz > baz.new
753 $ sed 's/1/1+/' baz > baz.new
754 $ mv baz.new baz
754 $ mv baz.new baz
755 $ hg ci -m 'foo -> dir/baz; 1-1+'
755 $ hg ci -m 'foo -> dir/baz; 1-1+'
756 $ hg diff -c .
756 $ hg diff -c .
757 diff --git a/foo b/dir/baz
757 diff --git a/foo b/dir/baz
758 rename from foo
758 rename from foo
759 rename to dir/baz
759 rename to dir/baz
760 --- a/foo
760 --- a/foo
761 +++ b/dir/baz
761 +++ b/dir/baz
762 @@ -2,7 +2,7 @@
762 @@ -2,7 +2,7 @@
763 0
763 0
764 0
764 0
765 0
765 0
766 - 1
766 - 1
767 + 1+
767 + 1+
768 2+
768 2+
769 3+
769 3+
770 4
770 4
771 @@ -11,5 +11,5 @@
771 @@ -11,5 +11,5 @@
772 7
772 7
773 8
773 8
774 9
774 9
775 -10
775 -10
776 -11-
776 -11-
777 +1+0
777 +1+0
778 +1+1-
778 +1+1-
779 $ hg log -f -L relpath:baz,5:7 -p
779 $ hg log -f -L relpath:baz,5:7 -p
780 changeset: 9:6af29c3a778f
780 changeset: 9:6af29c3a778f
781 tag: tip
781 tag: tip
782 user: test
782 user: test
783 date: Thu Jan 01 00:00:00 1970 +0000
783 date: Thu Jan 01 00:00:00 1970 +0000
784 summary: foo -> dir/baz; 1-1+
784 summary: foo -> dir/baz; 1-1+
785
785
786 diff --git a/foo b/dir/baz
786 diff --git a/foo b/dir/baz
787 copy from foo
787 copy from foo
788 copy to dir/baz
788 copy to dir/baz
789 --- a/foo
789 --- a/foo
790 +++ b/dir/baz
790 +++ b/dir/baz
791 @@ -2,7 +2,7 @@
791 @@ -2,7 +2,7 @@
792 0
792 0
793 0
793 0
794 0
794 0
795 - 1
795 - 1
796 + 1+
796 + 1+
797 2+
797 2+
798 3+
798 3+
799 4
799 4
800
800
801 changeset: 5:cfdf972b3971
801 changeset: 5:cfdf972b3971
802 user: test
802 user: test
803 date: Thu Jan 01 00:00:00 1970 +0000
803 date: Thu Jan 01 00:00:00 1970 +0000
804 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
804 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
805
805
806 diff --git a/foo b/foo
806 diff --git a/foo b/foo
807 --- a/foo
807 --- a/foo
808 +++ b/foo
808 +++ b/foo
809 @@ -4,7 +4,7 @@
809 @@ -4,7 +4,7 @@
810 0
810 0
811 1
811 1
812 2+
812 2+
813 -3
813 -3
814 +3+
814 +3+
815 4
815 4
816 5
816 5
817 6
817 6
818
818
819 changeset: 4:eaec41c1a0c9
819 changeset: 4:eaec41c1a0c9
820 user: test
820 user: test
821 date: Thu Jan 01 00:00:00 1970 +0000
821 date: Thu Jan 01 00:00:00 1970 +0000
822 summary: 11 -> 11+; leading space before "1"
822 summary: 11 -> 11+; leading space before "1"
823
823
824 diff --git a/foo b/foo
824 diff --git a/foo b/foo
825 --- a/foo
825 --- a/foo
826 +++ b/foo
826 +++ b/foo
827 @@ -2,7 +2,7 @@
827 @@ -2,7 +2,7 @@
828 0
828 0
829 0
829 0
830 0
830 0
831 -1
831 -1
832 + 1
832 + 1
833 2+
833 2+
834 3
834 3
835 4
835 4
836
836
837 changeset: 2:63a884426fd0
837 changeset: 2:63a884426fd0
838 user: test
838 user: test
839 date: Thu Jan 01 00:00:00 1970 +0000
839 date: Thu Jan 01 00:00:00 1970 +0000
840 summary: 2 -> 2+; added bar
840 summary: 2 -> 2+; added bar
841
841
842 diff --git a/foo b/foo
842 diff --git a/foo b/foo
843 --- a/foo
843 --- a/foo
844 +++ b/foo
844 +++ b/foo
845 @@ -3,6 +3,6 @@
845 @@ -3,6 +3,6 @@
846 0
846 0
847 0
847 0
848 1
848 1
849 -2
849 -2
850 +2+
850 +2+
851 3
851 3
852 4
852 4
853
853
854 changeset: 0:5ae1f82b9a00
854 changeset: 0:5ae1f82b9a00
855 user: test
855 user: test
856 date: Thu Jan 01 00:00:00 1970 +0000
856 date: Thu Jan 01 00:00:00 1970 +0000
857 summary: init
857 summary: init
858
858
859 diff --git a/foo b/foo
859 diff --git a/foo b/foo
860 new file mode 100644
860 new file mode 100644
861 --- /dev/null
861 --- /dev/null
862 +++ b/foo
862 +++ b/foo
863 @@ -0,0 +1,5 @@
863 @@ -0,0 +1,5 @@
864 +0
864 +0
865 +1
865 +1
866 +2
866 +2
867 +3
867 +3
868 +4
868 +4
869
869
870
870
871 Binary files work but without diff hunks filtering.
871 Binary files work but without diff hunks filtering.
872 (Checking w/ and w/o diff.git option.)
872 (Checking w/ and w/o diff.git option.)
873
873
874 >>> open('binary', 'wb').write(b'this\nis\na\nbinary\0') and None
874 >>> open('binary', 'wb').write(b'this\nis\na\nbinary\0') and None
875 $ hg add binary
875 $ hg add binary
876 $ hg ci -m 'add a binary file' --quiet
876 $ hg ci -m 'add a binary file' --quiet
877 $ hg log -f -L binary,1:2 -p
877 $ hg log -f -L binary,1:2 -p
878 changeset: 10:c96381c229df
878 changeset: 10:c96381c229df
879 tag: tip
879 tag: tip
880 user: test
880 user: test
881 date: Thu Jan 01 00:00:00 1970 +0000
881 date: Thu Jan 01 00:00:00 1970 +0000
882 summary: add a binary file
882 summary: add a binary file
883
883
884 diff --git a/dir/binary b/dir/binary
884 diff --git a/dir/binary b/dir/binary
885 new file mode 100644
885 new file mode 100644
886 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c2e1fbed209fe919b3f189a6a31950e9adf61e45
886 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c2e1fbed209fe919b3f189a6a31950e9adf61e45
887 GIT binary patch
887 GIT binary patch
888 literal 17
888 literal 17
889 Wc$_QA$SmdpqC~Ew%)G>+N(KNlNClYy
889 Wc$_QA$SmdpqC~Ew%)G>+N(KNlNClYy
890
890
891
891
892 $ hg log -f -L binary,1:2 -p --config diff.git=false
892 $ hg log -f -L binary,1:2 -p --config diff.git=false
893 changeset: 10:c96381c229df
893 changeset: 10:c96381c229df
894 tag: tip
894 tag: tip
895 user: test
895 user: test
896 date: Thu Jan 01 00:00:00 1970 +0000
896 date: Thu Jan 01 00:00:00 1970 +0000
897 summary: add a binary file
897 summary: add a binary file
898
898
899 diff -r 6af29c3a778f -r c96381c229df dir/binary
899 diff -r 6af29c3a778f -r c96381c229df dir/binary
900 Binary file dir/binary has changed
900 Binary file dir/binary has changed
901
901
902
902
903 Option --follow is required.
903 Option --follow is required.
904
904
905 $ hg log -L foo,5:7
905 $ hg log -L foo,5:7
906 abort: --line-range requires --follow
906 abort: --line-range requires --follow
907 [255]
907 [255]
908
908
909 Non-exact pattern kinds are not allowed.
909 Non-exact pattern kinds are not allowed.
910
910
911 $ cd ..
911 $ cd ..
912 $ hg log -f -L glob:*a*,1:2
912 $ hg log -f -L glob:*a*,1:2
913 hg: parse error: line range pattern 'glob:*a*' must match exactly one file
913 hg: parse error: line range pattern 'glob:*a*' must match exactly one file
914 [255]
914 [255]
915
915
916 We get an error for removed files.
916 We get an error for removed files.
917
917
918 $ hg rm dir/baz
918 $ hg rm dir/baz
919 $ hg ci -m 'remove baz' --quiet
919 $ hg ci -m 'remove baz' --quiet
920 $ hg log -f -L dir/baz,5:7 -p
920 $ hg log -f -L dir/baz,5:7 -p
921 abort: cannot follow file not in parent revision: "dir/baz"
921 abort: cannot follow file not in parent revision: "dir/baz"
922 [255]
922 [255]
@@ -1,2634 +1,2634 b''
1 Log on empty repository: checking consistency
1 Log on empty repository: checking consistency
2
2
3 $ hg init empty
3 $ hg init empty
4 $ cd empty
4 $ cd empty
5 $ hg log
5 $ hg log
6 $ hg log -r 1
6 $ hg log -r 1
7 abort: unknown revision '1'!
7 abort: unknown revision '1'!
8 [255]
8 [255]
9 $ hg log -r -1:0
9 $ hg log -r -1:0
10 abort: unknown revision '-1'!
10 abort: unknown revision '-1'!
11 [255]
11 [255]
12 $ hg log -r 'branch(name)'
12 $ hg log -r 'branch(name)'
13 abort: unknown revision 'name'!
13 abort: unknown revision 'name'!
14 [255]
14 [255]
15 $ hg log -r null -q
15 $ hg log -r null -q
16 -1:000000000000
16 -1:000000000000
17
17
18 $ cd ..
18 $ cd ..
19
19
20 The g is crafted to have 2 filelog topological heads in a linear
20 The g is crafted to have 2 filelog topological heads in a linear
21 changeset graph
21 changeset graph
22
22
23 $ hg init a
23 $ hg init a
24 $ cd a
24 $ cd a
25 $ echo a > a
25 $ echo a > a
26 $ echo f > f
26 $ echo f > f
27 $ hg ci -Ama -d '1 0'
27 $ hg ci -Ama -d '1 0'
28 adding a
28 adding a
29 adding f
29 adding f
30
30
31 $ hg cp a b
31 $ hg cp a b
32 $ hg cp f g
32 $ hg cp f g
33 $ hg ci -mb -d '2 0'
33 $ hg ci -mb -d '2 0'
34
34
35 $ mkdir dir
35 $ mkdir dir
36 $ hg mv b dir
36 $ hg mv b dir
37 $ echo g >> g
37 $ echo g >> g
38 $ echo f >> f
38 $ echo f >> f
39 $ hg ci -mc -d '3 0'
39 $ hg ci -mc -d '3 0'
40
40
41 $ hg mv a b
41 $ hg mv a b
42 $ hg cp -f f g
42 $ hg cp -f f g
43 $ echo a > d
43 $ echo a > d
44 $ hg add d
44 $ hg add d
45 $ hg ci -md -d '4 0'
45 $ hg ci -md -d '4 0'
46
46
47 $ hg mv dir/b e
47 $ hg mv dir/b e
48 $ hg ci -me -d '5 0'
48 $ hg ci -me -d '5 0'
49
49
50 Make sure largefiles doesn't interfere with logging a regular file
50 Make sure largefiles doesn't interfere with logging a regular file
51 $ hg --debug log a -T '{rev}: {desc}\n' --config extensions.largefiles=
51 $ hg --debug log a -T '{rev}: {desc}\n' --config extensions.largefiles=
52 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
52 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
53 updated patterns: .hglf/a, a
53 updated patterns: .hglf/a, a
54 0: a
54 0: a
55 $ hg log a
55 $ hg log a
56 changeset: 0:9161b9aeaf16
56 changeset: 0:9161b9aeaf16
57 user: test
57 user: test
58 date: Thu Jan 01 00:00:01 1970 +0000
58 date: Thu Jan 01 00:00:01 1970 +0000
59 summary: a
59 summary: a
60
60
61 $ hg log glob:a*
61 $ hg log glob:a*
62 changeset: 3:2ca5ba701980
62 changeset: 3:2ca5ba701980
63 user: test
63 user: test
64 date: Thu Jan 01 00:00:04 1970 +0000
64 date: Thu Jan 01 00:00:04 1970 +0000
65 summary: d
65 summary: d
66
66
67 changeset: 0:9161b9aeaf16
67 changeset: 0:9161b9aeaf16
68 user: test
68 user: test
69 date: Thu Jan 01 00:00:01 1970 +0000
69 date: Thu Jan 01 00:00:01 1970 +0000
70 summary: a
70 summary: a
71
71
72 $ hg --debug log glob:a* -T '{rev}: {desc}\n' --config extensions.largefiles=
72 $ hg --debug log glob:a* -T '{rev}: {desc}\n' --config extensions.largefiles=
73 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
73 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
74 updated patterns: glob:.hglf/a*, glob:a*
74 updated patterns: glob:.hglf/a*, glob:a*
75 3: d
75 3: d
76 0: a
76 0: a
77
77
78 log on directory
78 log on directory
79
79
80 $ hg log dir
80 $ hg log dir
81 changeset: 4:7e4639b4691b
81 changeset: 4:7e4639b4691b
82 tag: tip
82 tag: tip
83 user: test
83 user: test
84 date: Thu Jan 01 00:00:05 1970 +0000
84 date: Thu Jan 01 00:00:05 1970 +0000
85 summary: e
85 summary: e
86
86
87 changeset: 2:f8954cd4dc1f
87 changeset: 2:f8954cd4dc1f
88 user: test
88 user: test
89 date: Thu Jan 01 00:00:03 1970 +0000
89 date: Thu Jan 01 00:00:03 1970 +0000
90 summary: c
90 summary: c
91
91
92 $ hg log somethingthatdoesntexist dir
92 $ hg log somethingthatdoesntexist dir
93 changeset: 4:7e4639b4691b
93 changeset: 4:7e4639b4691b
94 tag: tip
94 tag: tip
95 user: test
95 user: test
96 date: Thu Jan 01 00:00:05 1970 +0000
96 date: Thu Jan 01 00:00:05 1970 +0000
97 summary: e
97 summary: e
98
98
99 changeset: 2:f8954cd4dc1f
99 changeset: 2:f8954cd4dc1f
100 user: test
100 user: test
101 date: Thu Jan 01 00:00:03 1970 +0000
101 date: Thu Jan 01 00:00:03 1970 +0000
102 summary: c
102 summary: c
103
103
104
104
105 -X, with explicit path
105 -X, with explicit path
106
106
107 $ hg log a -X a
107 $ hg log a -X a
108
108
109 -f, non-existent directory
109 -f, non-existent directory
110
110
111 $ hg log -f dir
111 $ hg log -f dir
112 abort: cannot follow file not in parent revision: "dir"
112 abort: cannot follow file not in parent revision: "dir"
113 [255]
113 [255]
114
114
115 -f, directory
115 -f, directory
116
116
117 $ hg up -q 3
117 $ hg up -q 3
118 $ hg log -f dir
118 $ hg log -f dir
119 changeset: 2:f8954cd4dc1f
119 changeset: 2:f8954cd4dc1f
120 user: test
120 user: test
121 date: Thu Jan 01 00:00:03 1970 +0000
121 date: Thu Jan 01 00:00:03 1970 +0000
122 summary: c
122 summary: c
123
123
124 -f, directory with --patch
124 -f, directory with --patch
125
125
126 $ hg log -f dir -p
126 $ hg log -f dir -p
127 changeset: 2:f8954cd4dc1f
127 changeset: 2:f8954cd4dc1f
128 user: test
128 user: test
129 date: Thu Jan 01 00:00:03 1970 +0000
129 date: Thu Jan 01 00:00:03 1970 +0000
130 summary: c
130 summary: c
131
131
132 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
132 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
133 --- /dev/null* (glob)
133 --- /dev/null* (glob)
134 +++ b/dir/b* (glob)
134 +++ b/dir/b* (glob)
135 @@ -0,0 +1,1 @@
135 @@ -0,0 +1,1 @@
136 +a
136 +a
137
137
138
138
139 -f, pattern
139 -f, pattern
140
140
141 $ hg log -f -I 'dir**' -p
141 $ hg log -f -I 'dir**' -p
142 changeset: 2:f8954cd4dc1f
142 changeset: 2:f8954cd4dc1f
143 user: test
143 user: test
144 date: Thu Jan 01 00:00:03 1970 +0000
144 date: Thu Jan 01 00:00:03 1970 +0000
145 summary: c
145 summary: c
146
146
147 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
147 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
148 --- /dev/null* (glob)
148 --- /dev/null* (glob)
149 +++ b/dir/b* (glob)
149 +++ b/dir/b* (glob)
150 @@ -0,0 +1,1 @@
150 @@ -0,0 +1,1 @@
151 +a
151 +a
152
152
153 $ hg up -q 4
153 $ hg up -q 4
154
154
155 -f, a wrong style
155 -f, a wrong style
156
156
157 $ hg log -f -l1 --style something
157 $ hg log -f -l1 --style something
158 abort: style 'something' not found
158 abort: style 'something' not found
159 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
159 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
160 [255]
160 [255]
161
161
162 -f, phases style
162 -f, phases style
163
163
164
164
165 $ hg log -f -l1 --style phases
165 $ hg log -f -l1 --style phases
166 changeset: 4:7e4639b4691b
166 changeset: 4:7e4639b4691b
167 tag: tip
167 tag: tip
168 phase: draft
168 phase: draft
169 user: test
169 user: test
170 date: Thu Jan 01 00:00:05 1970 +0000
170 date: Thu Jan 01 00:00:05 1970 +0000
171 summary: e
171 summary: e
172
172
173
173
174 $ hg log -f -l1 --style phases -q
174 $ hg log -f -l1 --style phases -q
175 4:7e4639b4691b
175 4:7e4639b4691b
176
176
177 -f, but no args
177 -f, but no args
178
178
179 $ hg log -f
179 $ hg log -f
180 changeset: 4:7e4639b4691b
180 changeset: 4:7e4639b4691b
181 tag: tip
181 tag: tip
182 user: test
182 user: test
183 date: Thu Jan 01 00:00:05 1970 +0000
183 date: Thu Jan 01 00:00:05 1970 +0000
184 summary: e
184 summary: e
185
185
186 changeset: 3:2ca5ba701980
186 changeset: 3:2ca5ba701980
187 user: test
187 user: test
188 date: Thu Jan 01 00:00:04 1970 +0000
188 date: Thu Jan 01 00:00:04 1970 +0000
189 summary: d
189 summary: d
190
190
191 changeset: 2:f8954cd4dc1f
191 changeset: 2:f8954cd4dc1f
192 user: test
192 user: test
193 date: Thu Jan 01 00:00:03 1970 +0000
193 date: Thu Jan 01 00:00:03 1970 +0000
194 summary: c
194 summary: c
195
195
196 changeset: 1:d89b0a12d229
196 changeset: 1:d89b0a12d229
197 user: test
197 user: test
198 date: Thu Jan 01 00:00:02 1970 +0000
198 date: Thu Jan 01 00:00:02 1970 +0000
199 summary: b
199 summary: b
200
200
201 changeset: 0:9161b9aeaf16
201 changeset: 0:9161b9aeaf16
202 user: test
202 user: test
203 date: Thu Jan 01 00:00:01 1970 +0000
203 date: Thu Jan 01 00:00:01 1970 +0000
204 summary: a
204 summary: a
205
205
206
206
207 one rename
207 one rename
208
208
209 $ hg up -q 2
209 $ hg up -q 2
210 $ hg log -vf a
210 $ hg log -vf a
211 changeset: 0:9161b9aeaf16
211 changeset: 0:9161b9aeaf16
212 user: test
212 user: test
213 date: Thu Jan 01 00:00:01 1970 +0000
213 date: Thu Jan 01 00:00:01 1970 +0000
214 files: a f
214 files: a f
215 description:
215 description:
216 a
216 a
217
217
218
218
219
219
220 many renames
220 many renames
221
221
222 $ hg up -q tip
222 $ hg up -q tip
223 $ hg log -vf e
223 $ hg log -vf e
224 changeset: 4:7e4639b4691b
224 changeset: 4:7e4639b4691b
225 tag: tip
225 tag: tip
226 user: test
226 user: test
227 date: Thu Jan 01 00:00:05 1970 +0000
227 date: Thu Jan 01 00:00:05 1970 +0000
228 files: dir/b e
228 files: dir/b e
229 description:
229 description:
230 e
230 e
231
231
232
232
233 changeset: 2:f8954cd4dc1f
233 changeset: 2:f8954cd4dc1f
234 user: test
234 user: test
235 date: Thu Jan 01 00:00:03 1970 +0000
235 date: Thu Jan 01 00:00:03 1970 +0000
236 files: b dir/b f g
236 files: b dir/b f g
237 description:
237 description:
238 c
238 c
239
239
240
240
241 changeset: 1:d89b0a12d229
241 changeset: 1:d89b0a12d229
242 user: test
242 user: test
243 date: Thu Jan 01 00:00:02 1970 +0000
243 date: Thu Jan 01 00:00:02 1970 +0000
244 files: b g
244 files: b g
245 description:
245 description:
246 b
246 b
247
247
248
248
249 changeset: 0:9161b9aeaf16
249 changeset: 0:9161b9aeaf16
250 user: test
250 user: test
251 date: Thu Jan 01 00:00:01 1970 +0000
251 date: Thu Jan 01 00:00:01 1970 +0000
252 files: a f
252 files: a f
253 description:
253 description:
254 a
254 a
255
255
256
256
257
257
258
258
259 log -pf dir/b
259 log -pf dir/b
260
260
261 $ hg up -q 3
261 $ hg up -q 3
262 $ hg log -pf dir/b
262 $ hg log -pf dir/b
263 changeset: 2:f8954cd4dc1f
263 changeset: 2:f8954cd4dc1f
264 user: test
264 user: test
265 date: Thu Jan 01 00:00:03 1970 +0000
265 date: Thu Jan 01 00:00:03 1970 +0000
266 summary: c
266 summary: c
267
267
268 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
268 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
269 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
269 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
270 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
270 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
271 @@ -0,0 +1,1 @@
271 @@ -0,0 +1,1 @@
272 +a
272 +a
273
273
274 changeset: 1:d89b0a12d229
274 changeset: 1:d89b0a12d229
275 user: test
275 user: test
276 date: Thu Jan 01 00:00:02 1970 +0000
276 date: Thu Jan 01 00:00:02 1970 +0000
277 summary: b
277 summary: b
278
278
279 diff -r 9161b9aeaf16 -r d89b0a12d229 b
279 diff -r 9161b9aeaf16 -r d89b0a12d229 b
280 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
280 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
281 +++ b/b Thu Jan 01 00:00:02 1970 +0000
281 +++ b/b Thu Jan 01 00:00:02 1970 +0000
282 @@ -0,0 +1,1 @@
282 @@ -0,0 +1,1 @@
283 +a
283 +a
284
284
285 changeset: 0:9161b9aeaf16
285 changeset: 0:9161b9aeaf16
286 user: test
286 user: test
287 date: Thu Jan 01 00:00:01 1970 +0000
287 date: Thu Jan 01 00:00:01 1970 +0000
288 summary: a
288 summary: a
289
289
290 diff -r 000000000000 -r 9161b9aeaf16 a
290 diff -r 000000000000 -r 9161b9aeaf16 a
291 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
291 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
292 +++ b/a Thu Jan 01 00:00:01 1970 +0000
292 +++ b/a Thu Jan 01 00:00:01 1970 +0000
293 @@ -0,0 +1,1 @@
293 @@ -0,0 +1,1 @@
294 +a
294 +a
295
295
296
296
297 log -pf b inside dir
297 log -pf b inside dir
298
298
299 $ hg --cwd=dir log -pf b
299 $ hg --cwd=dir log -pf b
300 changeset: 2:f8954cd4dc1f
300 changeset: 2:f8954cd4dc1f
301 user: test
301 user: test
302 date: Thu Jan 01 00:00:03 1970 +0000
302 date: Thu Jan 01 00:00:03 1970 +0000
303 summary: c
303 summary: c
304
304
305 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
305 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
306 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
306 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
307 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
307 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
308 @@ -0,0 +1,1 @@
308 @@ -0,0 +1,1 @@
309 +a
309 +a
310
310
311 changeset: 1:d89b0a12d229
311 changeset: 1:d89b0a12d229
312 user: test
312 user: test
313 date: Thu Jan 01 00:00:02 1970 +0000
313 date: Thu Jan 01 00:00:02 1970 +0000
314 summary: b
314 summary: b
315
315
316 diff -r 9161b9aeaf16 -r d89b0a12d229 b
316 diff -r 9161b9aeaf16 -r d89b0a12d229 b
317 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
317 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
318 +++ b/b Thu Jan 01 00:00:02 1970 +0000
318 +++ b/b Thu Jan 01 00:00:02 1970 +0000
319 @@ -0,0 +1,1 @@
319 @@ -0,0 +1,1 @@
320 +a
320 +a
321
321
322 changeset: 0:9161b9aeaf16
322 changeset: 0:9161b9aeaf16
323 user: test
323 user: test
324 date: Thu Jan 01 00:00:01 1970 +0000
324 date: Thu Jan 01 00:00:01 1970 +0000
325 summary: a
325 summary: a
326
326
327 diff -r 000000000000 -r 9161b9aeaf16 a
327 diff -r 000000000000 -r 9161b9aeaf16 a
328 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
328 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
329 +++ b/a Thu Jan 01 00:00:01 1970 +0000
329 +++ b/a Thu Jan 01 00:00:01 1970 +0000
330 @@ -0,0 +1,1 @@
330 @@ -0,0 +1,1 @@
331 +a
331 +a
332
332
333
333
334 log -pf, but no args
334 log -pf, but no args
335
335
336 $ hg log -pf
336 $ hg log -pf
337 changeset: 3:2ca5ba701980
337 changeset: 3:2ca5ba701980
338 user: test
338 user: test
339 date: Thu Jan 01 00:00:04 1970 +0000
339 date: Thu Jan 01 00:00:04 1970 +0000
340 summary: d
340 summary: d
341
341
342 diff -r f8954cd4dc1f -r 2ca5ba701980 a
342 diff -r f8954cd4dc1f -r 2ca5ba701980 a
343 --- a/a Thu Jan 01 00:00:03 1970 +0000
343 --- a/a Thu Jan 01 00:00:03 1970 +0000
344 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
344 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
345 @@ -1,1 +0,0 @@
345 @@ -1,1 +0,0 @@
346 -a
346 -a
347 diff -r f8954cd4dc1f -r 2ca5ba701980 b
347 diff -r f8954cd4dc1f -r 2ca5ba701980 b
348 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
348 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
349 +++ b/b Thu Jan 01 00:00:04 1970 +0000
349 +++ b/b Thu Jan 01 00:00:04 1970 +0000
350 @@ -0,0 +1,1 @@
350 @@ -0,0 +1,1 @@
351 +a
351 +a
352 diff -r f8954cd4dc1f -r 2ca5ba701980 d
352 diff -r f8954cd4dc1f -r 2ca5ba701980 d
353 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
353 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
354 +++ b/d Thu Jan 01 00:00:04 1970 +0000
354 +++ b/d Thu Jan 01 00:00:04 1970 +0000
355 @@ -0,0 +1,1 @@
355 @@ -0,0 +1,1 @@
356 +a
356 +a
357 diff -r f8954cd4dc1f -r 2ca5ba701980 g
357 diff -r f8954cd4dc1f -r 2ca5ba701980 g
358 --- a/g Thu Jan 01 00:00:03 1970 +0000
358 --- a/g Thu Jan 01 00:00:03 1970 +0000
359 +++ b/g Thu Jan 01 00:00:04 1970 +0000
359 +++ b/g Thu Jan 01 00:00:04 1970 +0000
360 @@ -1,2 +1,2 @@
360 @@ -1,2 +1,2 @@
361 f
361 f
362 -g
362 -g
363 +f
363 +f
364
364
365 changeset: 2:f8954cd4dc1f
365 changeset: 2:f8954cd4dc1f
366 user: test
366 user: test
367 date: Thu Jan 01 00:00:03 1970 +0000
367 date: Thu Jan 01 00:00:03 1970 +0000
368 summary: c
368 summary: c
369
369
370 diff -r d89b0a12d229 -r f8954cd4dc1f b
370 diff -r d89b0a12d229 -r f8954cd4dc1f b
371 --- a/b Thu Jan 01 00:00:02 1970 +0000
371 --- a/b Thu Jan 01 00:00:02 1970 +0000
372 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
372 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
373 @@ -1,1 +0,0 @@
373 @@ -1,1 +0,0 @@
374 -a
374 -a
375 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
375 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
376 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
376 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
377 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
377 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
378 @@ -0,0 +1,1 @@
378 @@ -0,0 +1,1 @@
379 +a
379 +a
380 diff -r d89b0a12d229 -r f8954cd4dc1f f
380 diff -r d89b0a12d229 -r f8954cd4dc1f f
381 --- a/f Thu Jan 01 00:00:02 1970 +0000
381 --- a/f Thu Jan 01 00:00:02 1970 +0000
382 +++ b/f Thu Jan 01 00:00:03 1970 +0000
382 +++ b/f Thu Jan 01 00:00:03 1970 +0000
383 @@ -1,1 +1,2 @@
383 @@ -1,1 +1,2 @@
384 f
384 f
385 +f
385 +f
386 diff -r d89b0a12d229 -r f8954cd4dc1f g
386 diff -r d89b0a12d229 -r f8954cd4dc1f g
387 --- a/g Thu Jan 01 00:00:02 1970 +0000
387 --- a/g Thu Jan 01 00:00:02 1970 +0000
388 +++ b/g Thu Jan 01 00:00:03 1970 +0000
388 +++ b/g Thu Jan 01 00:00:03 1970 +0000
389 @@ -1,1 +1,2 @@
389 @@ -1,1 +1,2 @@
390 f
390 f
391 +g
391 +g
392
392
393 changeset: 1:d89b0a12d229
393 changeset: 1:d89b0a12d229
394 user: test
394 user: test
395 date: Thu Jan 01 00:00:02 1970 +0000
395 date: Thu Jan 01 00:00:02 1970 +0000
396 summary: b
396 summary: b
397
397
398 diff -r 9161b9aeaf16 -r d89b0a12d229 b
398 diff -r 9161b9aeaf16 -r d89b0a12d229 b
399 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
399 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
400 +++ b/b Thu Jan 01 00:00:02 1970 +0000
400 +++ b/b Thu Jan 01 00:00:02 1970 +0000
401 @@ -0,0 +1,1 @@
401 @@ -0,0 +1,1 @@
402 +a
402 +a
403 diff -r 9161b9aeaf16 -r d89b0a12d229 g
403 diff -r 9161b9aeaf16 -r d89b0a12d229 g
404 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
404 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
405 +++ b/g Thu Jan 01 00:00:02 1970 +0000
405 +++ b/g Thu Jan 01 00:00:02 1970 +0000
406 @@ -0,0 +1,1 @@
406 @@ -0,0 +1,1 @@
407 +f
407 +f
408
408
409 changeset: 0:9161b9aeaf16
409 changeset: 0:9161b9aeaf16
410 user: test
410 user: test
411 date: Thu Jan 01 00:00:01 1970 +0000
411 date: Thu Jan 01 00:00:01 1970 +0000
412 summary: a
412 summary: a
413
413
414 diff -r 000000000000 -r 9161b9aeaf16 a
414 diff -r 000000000000 -r 9161b9aeaf16 a
415 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
415 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
416 +++ b/a Thu Jan 01 00:00:01 1970 +0000
416 +++ b/a Thu Jan 01 00:00:01 1970 +0000
417 @@ -0,0 +1,1 @@
417 @@ -0,0 +1,1 @@
418 +a
418 +a
419 diff -r 000000000000 -r 9161b9aeaf16 f
419 diff -r 000000000000 -r 9161b9aeaf16 f
420 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
420 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
421 +++ b/f Thu Jan 01 00:00:01 1970 +0000
421 +++ b/f Thu Jan 01 00:00:01 1970 +0000
422 @@ -0,0 +1,1 @@
422 @@ -0,0 +1,1 @@
423 +f
423 +f
424
424
425
425
426 log -vf dir/b
426 log -vf dir/b
427
427
428 $ hg log -vf dir/b
428 $ hg log -vf dir/b
429 changeset: 2:f8954cd4dc1f
429 changeset: 2:f8954cd4dc1f
430 user: test
430 user: test
431 date: Thu Jan 01 00:00:03 1970 +0000
431 date: Thu Jan 01 00:00:03 1970 +0000
432 files: b dir/b f g
432 files: b dir/b f g
433 description:
433 description:
434 c
434 c
435
435
436
436
437 changeset: 1:d89b0a12d229
437 changeset: 1:d89b0a12d229
438 user: test
438 user: test
439 date: Thu Jan 01 00:00:02 1970 +0000
439 date: Thu Jan 01 00:00:02 1970 +0000
440 files: b g
440 files: b g
441 description:
441 description:
442 b
442 b
443
443
444
444
445 changeset: 0:9161b9aeaf16
445 changeset: 0:9161b9aeaf16
446 user: test
446 user: test
447 date: Thu Jan 01 00:00:01 1970 +0000
447 date: Thu Jan 01 00:00:01 1970 +0000
448 files: a f
448 files: a f
449 description:
449 description:
450 a
450 a
451
451
452
452
453
453
454
454
455 -f and multiple filelog heads
455 -f and multiple filelog heads
456
456
457 $ hg up -q 2
457 $ hg up -q 2
458 $ hg log -f g --template '{rev}\n'
458 $ hg log -f g --template '{rev}\n'
459 2
459 2
460 1
460 1
461 0
461 0
462 $ hg up -q tip
462 $ hg up -q tip
463 $ hg log -f g --template '{rev}\n'
463 $ hg log -f g --template '{rev}\n'
464 3
464 3
465 2
465 2
466 0
466 0
467
467
468 follow files from the specified revisions (issue4959)
468 follow files from the specified revisions (issue4959)
469
469
470 $ hg log -G -T '{rev} {files},{file_copies % " {source}->{name}"}\n'
470 $ hg log -G -T '{rev} {files},{file_copies % " {source}->{name}"}\n'
471 @ 4 dir/b e, dir/b->e
471 @ 4 dir/b e, dir/b->e
472 |
472 |
473 o 3 a b d g, a->b f->g
473 o 3 a b d g, a->b f->g
474 |
474 |
475 o 2 b dir/b f g, b->dir/b
475 o 2 b dir/b f g, b->dir/b
476 |
476 |
477 o 1 b g, a->b f->g
477 o 1 b g, a->b f->g
478 |
478 |
479 o 0 a f,
479 o 0 a f,
480
480
481
481
482 $ hg log -T '{rev}\n' -fr 4 e
482 $ hg log -T '{rev}\n' -fr 4 e
483 4
483 4
484 2
484 2
485 1
485 1
486 0
486 0
487 $ hg log -T '{rev}\n' -fr 2 g
487 $ hg log -T '{rev}\n' -fr 2 g
488 2
488 2
489 1
489 1
490 0
490 0
491 $ hg log -T '{rev}\n' -fr '2+3' g
491 $ hg log -T '{rev}\n' -fr '2+3' g
492 3
492 3
493 2
493 2
494 1
494 1
495 0
495 0
496
496
497 follow files from the specified revisions with glob patterns (issue5053)
497 follow files from the specified revisions with glob patterns (issue5053)
498 (BROKEN: should follow copies from e@4)
498 (BROKEN: should follow copies from e@4)
499
499
500 $ hg log -T '{rev}\n' -fr4 e -X '[abcdfg]'
500 $ hg log -T '{rev}\n' -fr4 e -X '[abcdfg]'
501 4
501 4
502 2 (false !)
502 2 (false !)
503 1 (false !)
503 1 (false !)
504 0 (false !)
504 0 (false !)
505
505
506 follow files from the specified revisions with missing patterns
506 follow files from the specified revisions with missing patterns
507 (BROKEN: should follow copies from e@4)
507 (BROKEN: should follow copies from e@4)
508
508
509 $ hg log -T '{rev}\n' -fr4 e x
509 $ hg log -T '{rev}\n' -fr4 e x
510 4
510 4
511 2 (false !)
511 2 (false !)
512 1 (false !)
512 1 (false !)
513 0 (false !)
513 0 (false !)
514
514
515 follow files from the specified revisions across copies with -p/--patch
515 follow files from the specified revisions across copies with -p/--patch
516
516
517 $ hg log -T '== rev: {rev},{file_copies % " {source}->{name}"} ==\n' -fpr 4 e g
517 $ hg log -T '== rev: {rev},{file_copies % " {source}->{name}"} ==\n' -fpr 4 e g
518 == rev: 4, dir/b->e ==
518 == rev: 4, dir/b->e ==
519 diff -r 2ca5ba701980 -r 7e4639b4691b e
519 diff -r 2ca5ba701980 -r 7e4639b4691b e
520 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
520 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
521 +++ b/e Thu Jan 01 00:00:05 1970 +0000
521 +++ b/e Thu Jan 01 00:00:05 1970 +0000
522 @@ -0,0 +1,1 @@
522 @@ -0,0 +1,1 @@
523 +a
523 +a
524
524
525 == rev: 3, a->b f->g ==
525 == rev: 3, a->b f->g ==
526 diff -r f8954cd4dc1f -r 2ca5ba701980 g
526 diff -r f8954cd4dc1f -r 2ca5ba701980 g
527 --- a/g Thu Jan 01 00:00:03 1970 +0000
527 --- a/g Thu Jan 01 00:00:03 1970 +0000
528 +++ b/g Thu Jan 01 00:00:04 1970 +0000
528 +++ b/g Thu Jan 01 00:00:04 1970 +0000
529 @@ -1,2 +1,2 @@
529 @@ -1,2 +1,2 @@
530 f
530 f
531 -g
531 -g
532 +f
532 +f
533
533
534 == rev: 2, b->dir/b ==
534 == rev: 2, b->dir/b ==
535 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
535 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
536 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
536 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
537 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
537 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
538 @@ -0,0 +1,1 @@
538 @@ -0,0 +1,1 @@
539 +a
539 +a
540 diff -r d89b0a12d229 -r f8954cd4dc1f f
540 diff -r d89b0a12d229 -r f8954cd4dc1f f
541 --- a/f Thu Jan 01 00:00:02 1970 +0000
541 --- a/f Thu Jan 01 00:00:02 1970 +0000
542 +++ b/f Thu Jan 01 00:00:03 1970 +0000
542 +++ b/f Thu Jan 01 00:00:03 1970 +0000
543 @@ -1,1 +1,2 @@
543 @@ -1,1 +1,2 @@
544 f
544 f
545 +f
545 +f
546
546
547 == rev: 1, a->b f->g ==
547 == rev: 1, a->b f->g ==
548 diff -r 9161b9aeaf16 -r d89b0a12d229 b
548 diff -r 9161b9aeaf16 -r d89b0a12d229 b
549 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
549 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
550 +++ b/b Thu Jan 01 00:00:02 1970 +0000
550 +++ b/b Thu Jan 01 00:00:02 1970 +0000
551 @@ -0,0 +1,1 @@
551 @@ -0,0 +1,1 @@
552 +a
552 +a
553
553
554 == rev: 0, ==
554 == rev: 0, ==
555 diff -r 000000000000 -r 9161b9aeaf16 a
555 diff -r 000000000000 -r 9161b9aeaf16 a
556 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
556 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
557 +++ b/a Thu Jan 01 00:00:01 1970 +0000
557 +++ b/a Thu Jan 01 00:00:01 1970 +0000
558 @@ -0,0 +1,1 @@
558 @@ -0,0 +1,1 @@
559 +a
559 +a
560 diff -r 000000000000 -r 9161b9aeaf16 f
560 diff -r 000000000000 -r 9161b9aeaf16 f
561 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
561 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
562 +++ b/f Thu Jan 01 00:00:01 1970 +0000
562 +++ b/f Thu Jan 01 00:00:01 1970 +0000
563 @@ -0,0 +1,1 @@
563 @@ -0,0 +1,1 @@
564 +f
564 +f
565
565
566
566
567 log copies with --copies
567 log copies with --copies
568
568
569 $ hg log -vC --template '{rev} {file_copies}\n'
569 $ hg log -vC --template '{rev} {file_copies}\n'
570 4 e (dir/b)
570 4 e (dir/b)
571 3 b (a)g (f)
571 3 b (a)g (f)
572 2 dir/b (b)
572 2 dir/b (b)
573 1 b (a)g (f)
573 1 b (a)g (f)
574 0
574 0
575
575
576 log copies switch without --copies, with old filecopy template
576 log copies switch without --copies, with old filecopy template
577
577
578 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
578 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
579 4
579 4
580 3
580 3
581 2
581 2
582 1
582 1
583 0
583 0
584
584
585 log copies switch with --copies
585 log copies switch with --copies
586
586
587 $ hg log -vC --template '{rev} {file_copies_switch}\n'
587 $ hg log -vC --template '{rev} {file_copies_switch}\n'
588 4 e (dir/b)
588 4 e (dir/b)
589 3 b (a)g (f)
589 3 b (a)g (f)
590 2 dir/b (b)
590 2 dir/b (b)
591 1 b (a)g (f)
591 1 b (a)g (f)
592 0
592 0
593
593
594
594
595 log copies with hardcoded style and with --style=default
595 log copies with hardcoded style and with --style=default
596
596
597 $ hg log -vC -r4
597 $ hg log -vC -r4
598 changeset: 4:7e4639b4691b
598 changeset: 4:7e4639b4691b
599 tag: tip
599 tag: tip
600 user: test
600 user: test
601 date: Thu Jan 01 00:00:05 1970 +0000
601 date: Thu Jan 01 00:00:05 1970 +0000
602 files: dir/b e
602 files: dir/b e
603 copies: e (dir/b)
603 copies: e (dir/b)
604 description:
604 description:
605 e
605 e
606
606
607
607
608 $ hg log -vC -r4 --style=default
608 $ hg log -vC -r4 --style=default
609 changeset: 4:7e4639b4691b
609 changeset: 4:7e4639b4691b
610 tag: tip
610 tag: tip
611 user: test
611 user: test
612 date: Thu Jan 01 00:00:05 1970 +0000
612 date: Thu Jan 01 00:00:05 1970 +0000
613 files: dir/b e
613 files: dir/b e
614 copies: e (dir/b)
614 copies: e (dir/b)
615 description:
615 description:
616 e
616 e
617
617
618
618
619 $ hg log -vC -r4 -Tjson
619 $ hg log -vC -r4 -Tjson
620 [
620 [
621 {
621 {
622 "rev": 4,
622 "bookmarks": [],
623 "node": "7e4639b4691b9f84b81036a8d4fb218ce3c5e3a3",
624 "branch": "default",
623 "branch": "default",
625 "phase": "draft",
624 "copies": {"e": "dir/b"},
626 "user": "test",
627 "date": [5, 0],
625 "date": [5, 0],
628 "desc": "e",
626 "desc": "e",
629 "bookmarks": [],
627 "files": ["dir/b", "e"],
630 "tags": ["tip"],
628 "node": "7e4639b4691b9f84b81036a8d4fb218ce3c5e3a3",
631 "parents": ["2ca5ba7019804f1f597249caddf22a64d34df0ba"],
629 "parents": ["2ca5ba7019804f1f597249caddf22a64d34df0ba"],
632 "files": ["dir/b", "e"],
630 "phase": "draft",
633 "copies": {"e": "dir/b"}
631 "rev": 4,
632 "tags": ["tip"],
633 "user": "test"
634 }
634 }
635 ]
635 ]
636
636
637 log copies, non-linear manifest
637 log copies, non-linear manifest
638
638
639 $ hg up -C 3
639 $ hg up -C 3
640 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
640 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
641 $ hg mv dir/b e
641 $ hg mv dir/b e
642 $ echo foo > foo
642 $ echo foo > foo
643 $ hg ci -Ame2 -d '6 0'
643 $ hg ci -Ame2 -d '6 0'
644 adding foo
644 adding foo
645 created new head
645 created new head
646 $ hg log -v --template '{rev} {file_copies}\n' -r 5
646 $ hg log -v --template '{rev} {file_copies}\n' -r 5
647 5 e (dir/b)
647 5 e (dir/b)
648
648
649
649
650 log copies, execute bit set
650 log copies, execute bit set
651
651
652 #if execbit
652 #if execbit
653 $ chmod +x e
653 $ chmod +x e
654 $ hg ci -me3 -d '7 0'
654 $ hg ci -me3 -d '7 0'
655 $ hg log -v --template '{rev} {file_copies}\n' -r 6
655 $ hg log -v --template '{rev} {file_copies}\n' -r 6
656 6
656 6
657 #endif
657 #endif
658
658
659
659
660 log -p d
660 log -p d
661
661
662 $ hg log -pv d
662 $ hg log -pv d
663 changeset: 3:2ca5ba701980
663 changeset: 3:2ca5ba701980
664 user: test
664 user: test
665 date: Thu Jan 01 00:00:04 1970 +0000
665 date: Thu Jan 01 00:00:04 1970 +0000
666 files: a b d g
666 files: a b d g
667 description:
667 description:
668 d
668 d
669
669
670
670
671 diff -r f8954cd4dc1f -r 2ca5ba701980 d
671 diff -r f8954cd4dc1f -r 2ca5ba701980 d
672 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
672 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
673 +++ b/d Thu Jan 01 00:00:04 1970 +0000
673 +++ b/d Thu Jan 01 00:00:04 1970 +0000
674 @@ -0,0 +1,1 @@
674 @@ -0,0 +1,1 @@
675 +a
675 +a
676
676
677
677
678
678
679 log --removed file
679 log --removed file
680
680
681 $ hg log --removed -v a
681 $ hg log --removed -v a
682 changeset: 3:2ca5ba701980
682 changeset: 3:2ca5ba701980
683 user: test
683 user: test
684 date: Thu Jan 01 00:00:04 1970 +0000
684 date: Thu Jan 01 00:00:04 1970 +0000
685 files: a b d g
685 files: a b d g
686 description:
686 description:
687 d
687 d
688
688
689
689
690 changeset: 0:9161b9aeaf16
690 changeset: 0:9161b9aeaf16
691 user: test
691 user: test
692 date: Thu Jan 01 00:00:01 1970 +0000
692 date: Thu Jan 01 00:00:01 1970 +0000
693 files: a f
693 files: a f
694 description:
694 description:
695 a
695 a
696
696
697
697
698
698
699 log --removed revrange file
699 log --removed revrange file
700
700
701 $ hg log --removed -v -r0:2 a
701 $ hg log --removed -v -r0:2 a
702 changeset: 0:9161b9aeaf16
702 changeset: 0:9161b9aeaf16
703 user: test
703 user: test
704 date: Thu Jan 01 00:00:01 1970 +0000
704 date: Thu Jan 01 00:00:01 1970 +0000
705 files: a f
705 files: a f
706 description:
706 description:
707 a
707 a
708
708
709
709
710 $ cd ..
710 $ cd ..
711
711
712 log --follow tests
712 log --follow tests
713
713
714 $ hg init follow
714 $ hg init follow
715 $ cd follow
715 $ cd follow
716
716
717 $ echo base > base
717 $ echo base > base
718 $ hg ci -Ambase -d '1 0'
718 $ hg ci -Ambase -d '1 0'
719 adding base
719 adding base
720
720
721 $ echo r1 >> base
721 $ echo r1 >> base
722 $ hg ci -Amr1 -d '1 0'
722 $ hg ci -Amr1 -d '1 0'
723 $ echo r2 >> base
723 $ echo r2 >> base
724 $ hg ci -Amr2 -d '1 0'
724 $ hg ci -Amr2 -d '1 0'
725
725
726 $ hg up -C 1
726 $ hg up -C 1
727 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
727 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
728 $ echo b1 > b1
728 $ echo b1 > b1
729
729
730 log -r "follow('set:clean()')"
730 log -r "follow('set:clean()')"
731
731
732 $ hg log -r "follow('set:clean()')"
732 $ hg log -r "follow('set:clean()')"
733 changeset: 0:67e992f2c4f3
733 changeset: 0:67e992f2c4f3
734 user: test
734 user: test
735 date: Thu Jan 01 00:00:01 1970 +0000
735 date: Thu Jan 01 00:00:01 1970 +0000
736 summary: base
736 summary: base
737
737
738 changeset: 1:3d5bf5654eda
738 changeset: 1:3d5bf5654eda
739 user: test
739 user: test
740 date: Thu Jan 01 00:00:01 1970 +0000
740 date: Thu Jan 01 00:00:01 1970 +0000
741 summary: r1
741 summary: r1
742
742
743
743
744 $ hg ci -Amb1 -d '1 0'
744 $ hg ci -Amb1 -d '1 0'
745 adding b1
745 adding b1
746 created new head
746 created new head
747
747
748
748
749 log -f
749 log -f
750
750
751 $ hg log -f
751 $ hg log -f
752 changeset: 3:e62f78d544b4
752 changeset: 3:e62f78d544b4
753 tag: tip
753 tag: tip
754 parent: 1:3d5bf5654eda
754 parent: 1:3d5bf5654eda
755 user: test
755 user: test
756 date: Thu Jan 01 00:00:01 1970 +0000
756 date: Thu Jan 01 00:00:01 1970 +0000
757 summary: b1
757 summary: b1
758
758
759 changeset: 1:3d5bf5654eda
759 changeset: 1:3d5bf5654eda
760 user: test
760 user: test
761 date: Thu Jan 01 00:00:01 1970 +0000
761 date: Thu Jan 01 00:00:01 1970 +0000
762 summary: r1
762 summary: r1
763
763
764 changeset: 0:67e992f2c4f3
764 changeset: 0:67e992f2c4f3
765 user: test
765 user: test
766 date: Thu Jan 01 00:00:01 1970 +0000
766 date: Thu Jan 01 00:00:01 1970 +0000
767 summary: base
767 summary: base
768
768
769
769
770 log -r follow('glob:b*')
770 log -r follow('glob:b*')
771
771
772 $ hg log -r "follow('glob:b*')"
772 $ hg log -r "follow('glob:b*')"
773 changeset: 0:67e992f2c4f3
773 changeset: 0:67e992f2c4f3
774 user: test
774 user: test
775 date: Thu Jan 01 00:00:01 1970 +0000
775 date: Thu Jan 01 00:00:01 1970 +0000
776 summary: base
776 summary: base
777
777
778 changeset: 1:3d5bf5654eda
778 changeset: 1:3d5bf5654eda
779 user: test
779 user: test
780 date: Thu Jan 01 00:00:01 1970 +0000
780 date: Thu Jan 01 00:00:01 1970 +0000
781 summary: r1
781 summary: r1
782
782
783 changeset: 3:e62f78d544b4
783 changeset: 3:e62f78d544b4
784 tag: tip
784 tag: tip
785 parent: 1:3d5bf5654eda
785 parent: 1:3d5bf5654eda
786 user: test
786 user: test
787 date: Thu Jan 01 00:00:01 1970 +0000
787 date: Thu Jan 01 00:00:01 1970 +0000
788 summary: b1
788 summary: b1
789
789
790 log -f -r '1 + 4'
790 log -f -r '1 + 4'
791
791
792 $ hg up -C 0
792 $ hg up -C 0
793 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
793 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
794 $ echo b2 > b2
794 $ echo b2 > b2
795 $ hg ci -Amb2 -d '1 0'
795 $ hg ci -Amb2 -d '1 0'
796 adding b2
796 adding b2
797 created new head
797 created new head
798 $ hg log -f -r '1 + 4'
798 $ hg log -f -r '1 + 4'
799 changeset: 4:ddb82e70d1a1
799 changeset: 4:ddb82e70d1a1
800 tag: tip
800 tag: tip
801 parent: 0:67e992f2c4f3
801 parent: 0:67e992f2c4f3
802 user: test
802 user: test
803 date: Thu Jan 01 00:00:01 1970 +0000
803 date: Thu Jan 01 00:00:01 1970 +0000
804 summary: b2
804 summary: b2
805
805
806 changeset: 1:3d5bf5654eda
806 changeset: 1:3d5bf5654eda
807 user: test
807 user: test
808 date: Thu Jan 01 00:00:01 1970 +0000
808 date: Thu Jan 01 00:00:01 1970 +0000
809 summary: r1
809 summary: r1
810
810
811 changeset: 0:67e992f2c4f3
811 changeset: 0:67e992f2c4f3
812 user: test
812 user: test
813 date: Thu Jan 01 00:00:01 1970 +0000
813 date: Thu Jan 01 00:00:01 1970 +0000
814 summary: base
814 summary: base
815
815
816
816
817 log -fr with aliases: 'A' should be expanded, but 'reverse()' should have no
817 log -fr with aliases: 'A' should be expanded, but 'reverse()' should have no
818 effect
818 effect
819
819
820 $ hg log --config 'revsetalias.reverse(x)=x' --config 'revsetalias.A=1+4' -qfrA
820 $ hg log --config 'revsetalias.reverse(x)=x' --config 'revsetalias.A=1+4' -qfrA
821 4:ddb82e70d1a1
821 4:ddb82e70d1a1
822 1:3d5bf5654eda
822 1:3d5bf5654eda
823 0:67e992f2c4f3
823 0:67e992f2c4f3
824
824
825 log -r "follow('set:grep(b2)')"
825 log -r "follow('set:grep(b2)')"
826
826
827 $ hg log -r "follow('set:grep(b2)')"
827 $ hg log -r "follow('set:grep(b2)')"
828 changeset: 4:ddb82e70d1a1
828 changeset: 4:ddb82e70d1a1
829 tag: tip
829 tag: tip
830 parent: 0:67e992f2c4f3
830 parent: 0:67e992f2c4f3
831 user: test
831 user: test
832 date: Thu Jan 01 00:00:01 1970 +0000
832 date: Thu Jan 01 00:00:01 1970 +0000
833 summary: b2
833 summary: b2
834
834
835 log -r "follow('set:grep(b2)', 4)"
835 log -r "follow('set:grep(b2)', 4)"
836
836
837 $ hg up -qC 0
837 $ hg up -qC 0
838 $ hg log -r "follow('set:grep(b2)', 4)"
838 $ hg log -r "follow('set:grep(b2)', 4)"
839 changeset: 4:ddb82e70d1a1
839 changeset: 4:ddb82e70d1a1
840 tag: tip
840 tag: tip
841 parent: 0:67e992f2c4f3
841 parent: 0:67e992f2c4f3
842 user: test
842 user: test
843 date: Thu Jan 01 00:00:01 1970 +0000
843 date: Thu Jan 01 00:00:01 1970 +0000
844 summary: b2
844 summary: b2
845
845
846
846
847 follow files starting from multiple revisions:
847 follow files starting from multiple revisions:
848
848
849 $ hg log -T '{rev}: {files}\n' -r "follow('glob:b?', startrev=2+3+4)"
849 $ hg log -T '{rev}: {files}\n' -r "follow('glob:b?', startrev=2+3+4)"
850 3: b1
850 3: b1
851 4: b2
851 4: b2
852
852
853 follow files starting from empty revision:
853 follow files starting from empty revision:
854
854
855 $ hg log -T '{rev}: {files}\n' -r "follow('glob:*', startrev=.-.)"
855 $ hg log -T '{rev}: {files}\n' -r "follow('glob:*', startrev=.-.)"
856
856
857 follow starting from revisions:
857 follow starting from revisions:
858
858
859 $ hg log -Gq -r "follow(startrev=2+4)"
859 $ hg log -Gq -r "follow(startrev=2+4)"
860 o 4:ddb82e70d1a1
860 o 4:ddb82e70d1a1
861 |
861 |
862 | o 2:60c670bf5b30
862 | o 2:60c670bf5b30
863 | |
863 | |
864 | o 1:3d5bf5654eda
864 | o 1:3d5bf5654eda
865 |/
865 |/
866 @ 0:67e992f2c4f3
866 @ 0:67e992f2c4f3
867
867
868
868
869 follow the current revision:
869 follow the current revision:
870
870
871 $ hg log -Gq -r "follow()"
871 $ hg log -Gq -r "follow()"
872 @ 0:67e992f2c4f3
872 @ 0:67e992f2c4f3
873
873
874
874
875 $ hg up -qC 4
875 $ hg up -qC 4
876
876
877 log -f -r null
877 log -f -r null
878
878
879 $ hg log -f -r null
879 $ hg log -f -r null
880 changeset: -1:000000000000
880 changeset: -1:000000000000
881 user:
881 user:
882 date: Thu Jan 01 00:00:00 1970 +0000
882 date: Thu Jan 01 00:00:00 1970 +0000
883
883
884 $ hg log -f -r null -G
884 $ hg log -f -r null -G
885 o changeset: -1:000000000000
885 o changeset: -1:000000000000
886 user:
886 user:
887 date: Thu Jan 01 00:00:00 1970 +0000
887 date: Thu Jan 01 00:00:00 1970 +0000
888
888
889
889
890
890
891 log -f with null parent
891 log -f with null parent
892
892
893 $ hg up -C null
893 $ hg up -C null
894 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
894 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
895 $ hg log -f
895 $ hg log -f
896
896
897
897
898 log -r . with two parents
898 log -r . with two parents
899
899
900 $ hg up -C 3
900 $ hg up -C 3
901 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
901 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
902 $ hg merge tip
902 $ hg merge tip
903 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
903 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
904 (branch merge, don't forget to commit)
904 (branch merge, don't forget to commit)
905 $ hg log -r .
905 $ hg log -r .
906 changeset: 3:e62f78d544b4
906 changeset: 3:e62f78d544b4
907 parent: 1:3d5bf5654eda
907 parent: 1:3d5bf5654eda
908 user: test
908 user: test
909 date: Thu Jan 01 00:00:01 1970 +0000
909 date: Thu Jan 01 00:00:01 1970 +0000
910 summary: b1
910 summary: b1
911
911
912
912
913
913
914 log -r . with one parent
914 log -r . with one parent
915
915
916 $ hg ci -mm12 -d '1 0'
916 $ hg ci -mm12 -d '1 0'
917 $ hg log -r .
917 $ hg log -r .
918 changeset: 5:302e9dd6890d
918 changeset: 5:302e9dd6890d
919 tag: tip
919 tag: tip
920 parent: 3:e62f78d544b4
920 parent: 3:e62f78d544b4
921 parent: 4:ddb82e70d1a1
921 parent: 4:ddb82e70d1a1
922 user: test
922 user: test
923 date: Thu Jan 01 00:00:01 1970 +0000
923 date: Thu Jan 01 00:00:01 1970 +0000
924 summary: m12
924 summary: m12
925
925
926
926
927 $ echo postm >> b1
927 $ echo postm >> b1
928 $ hg ci -Amb1.1 -d'1 0'
928 $ hg ci -Amb1.1 -d'1 0'
929
929
930
930
931 log --follow-first
931 log --follow-first
932
932
933 $ hg log --follow-first
933 $ hg log --follow-first
934 changeset: 6:2404bbcab562
934 changeset: 6:2404bbcab562
935 tag: tip
935 tag: tip
936 user: test
936 user: test
937 date: Thu Jan 01 00:00:01 1970 +0000
937 date: Thu Jan 01 00:00:01 1970 +0000
938 summary: b1.1
938 summary: b1.1
939
939
940 changeset: 5:302e9dd6890d
940 changeset: 5:302e9dd6890d
941 parent: 3:e62f78d544b4
941 parent: 3:e62f78d544b4
942 parent: 4:ddb82e70d1a1
942 parent: 4:ddb82e70d1a1
943 user: test
943 user: test
944 date: Thu Jan 01 00:00:01 1970 +0000
944 date: Thu Jan 01 00:00:01 1970 +0000
945 summary: m12
945 summary: m12
946
946
947 changeset: 3:e62f78d544b4
947 changeset: 3:e62f78d544b4
948 parent: 1:3d5bf5654eda
948 parent: 1:3d5bf5654eda
949 user: test
949 user: test
950 date: Thu Jan 01 00:00:01 1970 +0000
950 date: Thu Jan 01 00:00:01 1970 +0000
951 summary: b1
951 summary: b1
952
952
953 changeset: 1:3d5bf5654eda
953 changeset: 1:3d5bf5654eda
954 user: test
954 user: test
955 date: Thu Jan 01 00:00:01 1970 +0000
955 date: Thu Jan 01 00:00:01 1970 +0000
956 summary: r1
956 summary: r1
957
957
958 changeset: 0:67e992f2c4f3
958 changeset: 0:67e992f2c4f3
959 user: test
959 user: test
960 date: Thu Jan 01 00:00:01 1970 +0000
960 date: Thu Jan 01 00:00:01 1970 +0000
961 summary: base
961 summary: base
962
962
963
963
964
964
965 log -P 2
965 log -P 2
966
966
967 $ hg log -P 2
967 $ hg log -P 2
968 changeset: 6:2404bbcab562
968 changeset: 6:2404bbcab562
969 tag: tip
969 tag: tip
970 user: test
970 user: test
971 date: Thu Jan 01 00:00:01 1970 +0000
971 date: Thu Jan 01 00:00:01 1970 +0000
972 summary: b1.1
972 summary: b1.1
973
973
974 changeset: 5:302e9dd6890d
974 changeset: 5:302e9dd6890d
975 parent: 3:e62f78d544b4
975 parent: 3:e62f78d544b4
976 parent: 4:ddb82e70d1a1
976 parent: 4:ddb82e70d1a1
977 user: test
977 user: test
978 date: Thu Jan 01 00:00:01 1970 +0000
978 date: Thu Jan 01 00:00:01 1970 +0000
979 summary: m12
979 summary: m12
980
980
981 changeset: 4:ddb82e70d1a1
981 changeset: 4:ddb82e70d1a1
982 parent: 0:67e992f2c4f3
982 parent: 0:67e992f2c4f3
983 user: test
983 user: test
984 date: Thu Jan 01 00:00:01 1970 +0000
984 date: Thu Jan 01 00:00:01 1970 +0000
985 summary: b2
985 summary: b2
986
986
987 changeset: 3:e62f78d544b4
987 changeset: 3:e62f78d544b4
988 parent: 1:3d5bf5654eda
988 parent: 1:3d5bf5654eda
989 user: test
989 user: test
990 date: Thu Jan 01 00:00:01 1970 +0000
990 date: Thu Jan 01 00:00:01 1970 +0000
991 summary: b1
991 summary: b1
992
992
993
993
994
994
995 log -r tip -p --git
995 log -r tip -p --git
996
996
997 $ hg log -r tip -p --git
997 $ hg log -r tip -p --git
998 changeset: 6:2404bbcab562
998 changeset: 6:2404bbcab562
999 tag: tip
999 tag: tip
1000 user: test
1000 user: test
1001 date: Thu Jan 01 00:00:01 1970 +0000
1001 date: Thu Jan 01 00:00:01 1970 +0000
1002 summary: b1.1
1002 summary: b1.1
1003
1003
1004 diff --git a/b1 b/b1
1004 diff --git a/b1 b/b1
1005 --- a/b1
1005 --- a/b1
1006 +++ b/b1
1006 +++ b/b1
1007 @@ -1,1 +1,2 @@
1007 @@ -1,1 +1,2 @@
1008 b1
1008 b1
1009 +postm
1009 +postm
1010
1010
1011
1011
1012
1012
1013 log -r ""
1013 log -r ""
1014
1014
1015 $ hg log -r ''
1015 $ hg log -r ''
1016 hg: parse error: empty query
1016 hg: parse error: empty query
1017 [255]
1017 [255]
1018
1018
1019 log -r <some unknown node id>
1019 log -r <some unknown node id>
1020
1020
1021 $ hg log -r 1000000000000000000000000000000000000000
1021 $ hg log -r 1000000000000000000000000000000000000000
1022 abort: unknown revision '1000000000000000000000000000000000000000'!
1022 abort: unknown revision '1000000000000000000000000000000000000000'!
1023 [255]
1023 [255]
1024
1024
1025 log -k r1
1025 log -k r1
1026
1026
1027 $ hg log -k r1
1027 $ hg log -k r1
1028 changeset: 1:3d5bf5654eda
1028 changeset: 1:3d5bf5654eda
1029 user: test
1029 user: test
1030 date: Thu Jan 01 00:00:01 1970 +0000
1030 date: Thu Jan 01 00:00:01 1970 +0000
1031 summary: r1
1031 summary: r1
1032
1032
1033 log -p -l2 --color=always
1033 log -p -l2 --color=always
1034
1034
1035 $ hg --config extensions.color= --config color.mode=ansi \
1035 $ hg --config extensions.color= --config color.mode=ansi \
1036 > log -p -l2 --color=always
1036 > log -p -l2 --color=always
1037 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
1037 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
1038 tag: tip
1038 tag: tip
1039 user: test
1039 user: test
1040 date: Thu Jan 01 00:00:01 1970 +0000
1040 date: Thu Jan 01 00:00:01 1970 +0000
1041 summary: b1.1
1041 summary: b1.1
1042
1042
1043 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
1043 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
1044 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
1044 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
1045 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
1045 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
1046 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
1046 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
1047 b1
1047 b1
1048 \x1b[0;32m+postm\x1b[0m (esc)
1048 \x1b[0;32m+postm\x1b[0m (esc)
1049
1049
1050 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
1050 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
1051 parent: 3:e62f78d544b4
1051 parent: 3:e62f78d544b4
1052 parent: 4:ddb82e70d1a1
1052 parent: 4:ddb82e70d1a1
1053 user: test
1053 user: test
1054 date: Thu Jan 01 00:00:01 1970 +0000
1054 date: Thu Jan 01 00:00:01 1970 +0000
1055 summary: m12
1055 summary: m12
1056
1056
1057 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
1057 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
1058 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
1058 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
1059 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
1059 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
1060 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
1060 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
1061 \x1b[0;32m+b2\x1b[0m (esc)
1061 \x1b[0;32m+b2\x1b[0m (esc)
1062
1062
1063
1063
1064
1064
1065 log -r tip --stat
1065 log -r tip --stat
1066
1066
1067 $ hg log -r tip --stat
1067 $ hg log -r tip --stat
1068 changeset: 6:2404bbcab562
1068 changeset: 6:2404bbcab562
1069 tag: tip
1069 tag: tip
1070 user: test
1070 user: test
1071 date: Thu Jan 01 00:00:01 1970 +0000
1071 date: Thu Jan 01 00:00:01 1970 +0000
1072 summary: b1.1
1072 summary: b1.1
1073
1073
1074 b1 | 1 +
1074 b1 | 1 +
1075 1 files changed, 1 insertions(+), 0 deletions(-)
1075 1 files changed, 1 insertions(+), 0 deletions(-)
1076
1076
1077
1077
1078 $ cd ..
1078 $ cd ..
1079
1079
1080 log --follow --patch FILE in repository where linkrev isn't trustworthy
1080 log --follow --patch FILE in repository where linkrev isn't trustworthy
1081 (issue5376)
1081 (issue5376)
1082
1082
1083 $ hg init follow-dup
1083 $ hg init follow-dup
1084 $ cd follow-dup
1084 $ cd follow-dup
1085 $ cat <<EOF >> .hg/hgrc
1085 $ cat <<EOF >> .hg/hgrc
1086 > [ui]
1086 > [ui]
1087 > logtemplate = '=== {rev}: {desc}\n'
1087 > logtemplate = '=== {rev}: {desc}\n'
1088 > [diff]
1088 > [diff]
1089 > nodates = True
1089 > nodates = True
1090 > EOF
1090 > EOF
1091 $ echo 0 >> a
1091 $ echo 0 >> a
1092 $ hg ci -qAm 'a0'
1092 $ hg ci -qAm 'a0'
1093 $ echo 1 >> a
1093 $ echo 1 >> a
1094 $ hg ci -m 'a1'
1094 $ hg ci -m 'a1'
1095 $ hg up -q 0
1095 $ hg up -q 0
1096 $ echo 1 >> a
1096 $ echo 1 >> a
1097 $ touch b
1097 $ touch b
1098 $ hg ci -qAm 'a1 with b'
1098 $ hg ci -qAm 'a1 with b'
1099 $ echo 3 >> a
1099 $ echo 3 >> a
1100 $ hg ci -m 'a3'
1100 $ hg ci -m 'a3'
1101
1101
1102 fctx.rev() == 2, but fctx.linkrev() == 1
1102 fctx.rev() == 2, but fctx.linkrev() == 1
1103
1103
1104 $ hg log -pf a
1104 $ hg log -pf a
1105 === 3: a3
1105 === 3: a3
1106 diff -r 4ea02ba94d66 -r e7a6331a34f0 a
1106 diff -r 4ea02ba94d66 -r e7a6331a34f0 a
1107 --- a/a
1107 --- a/a
1108 +++ b/a
1108 +++ b/a
1109 @@ -1,2 +1,3 @@
1109 @@ -1,2 +1,3 @@
1110 0
1110 0
1111 1
1111 1
1112 +3
1112 +3
1113
1113
1114 === 2: a1 with b
1114 === 2: a1 with b
1115 diff -r 49b5e81287e2 -r 4ea02ba94d66 a
1115 diff -r 49b5e81287e2 -r 4ea02ba94d66 a
1116 --- a/a
1116 --- a/a
1117 +++ b/a
1117 +++ b/a
1118 @@ -1,1 +1,2 @@
1118 @@ -1,1 +1,2 @@
1119 0
1119 0
1120 +1
1120 +1
1121
1121
1122 === 0: a0
1122 === 0: a0
1123 diff -r 000000000000 -r 49b5e81287e2 a
1123 diff -r 000000000000 -r 49b5e81287e2 a
1124 --- /dev/null
1124 --- /dev/null
1125 +++ b/a
1125 +++ b/a
1126 @@ -0,0 +1,1 @@
1126 @@ -0,0 +1,1 @@
1127 +0
1127 +0
1128
1128
1129
1129
1130 fctx.introrev() == 2, but fctx.linkrev() == 1
1130 fctx.introrev() == 2, but fctx.linkrev() == 1
1131
1131
1132 $ hg up -q 2
1132 $ hg up -q 2
1133 $ hg log -pf a
1133 $ hg log -pf a
1134 === 2: a1 with b
1134 === 2: a1 with b
1135 diff -r 49b5e81287e2 -r 4ea02ba94d66 a
1135 diff -r 49b5e81287e2 -r 4ea02ba94d66 a
1136 --- a/a
1136 --- a/a
1137 +++ b/a
1137 +++ b/a
1138 @@ -1,1 +1,2 @@
1138 @@ -1,1 +1,2 @@
1139 0
1139 0
1140 +1
1140 +1
1141
1141
1142 === 0: a0
1142 === 0: a0
1143 diff -r 000000000000 -r 49b5e81287e2 a
1143 diff -r 000000000000 -r 49b5e81287e2 a
1144 --- /dev/null
1144 --- /dev/null
1145 +++ b/a
1145 +++ b/a
1146 @@ -0,0 +1,1 @@
1146 @@ -0,0 +1,1 @@
1147 +0
1147 +0
1148
1148
1149
1149
1150 $ cd ..
1150 $ cd ..
1151
1151
1152 Multiple copy sources of a file:
1152 Multiple copy sources of a file:
1153
1153
1154 $ hg init follow-multi
1154 $ hg init follow-multi
1155 $ cd follow-multi
1155 $ cd follow-multi
1156 $ echo 0 >> a
1156 $ echo 0 >> a
1157 $ hg ci -qAm 'a'
1157 $ hg ci -qAm 'a'
1158 $ hg cp a b
1158 $ hg cp a b
1159 $ hg ci -m 'a->b'
1159 $ hg ci -m 'a->b'
1160 $ echo 2 >> a
1160 $ echo 2 >> a
1161 $ hg ci -m 'a'
1161 $ hg ci -m 'a'
1162 $ echo 3 >> b
1162 $ echo 3 >> b
1163 $ hg ci -m 'b'
1163 $ hg ci -m 'b'
1164 $ echo 4 >> a
1164 $ echo 4 >> a
1165 $ echo 4 >> b
1165 $ echo 4 >> b
1166 $ hg ci -m 'a,b'
1166 $ hg ci -m 'a,b'
1167 $ echo 5 >> a
1167 $ echo 5 >> a
1168 $ hg ci -m 'a0'
1168 $ hg ci -m 'a0'
1169 $ echo 6 >> b
1169 $ echo 6 >> b
1170 $ hg ci -m 'b0'
1170 $ hg ci -m 'b0'
1171 $ hg up -q 4
1171 $ hg up -q 4
1172 $ echo 7 >> b
1172 $ echo 7 >> b
1173 $ hg ci -m 'b1'
1173 $ hg ci -m 'b1'
1174 created new head
1174 created new head
1175 $ echo 8 >> a
1175 $ echo 8 >> a
1176 $ hg ci -m 'a1'
1176 $ hg ci -m 'a1'
1177 $ hg rm a
1177 $ hg rm a
1178 $ hg mv b a
1178 $ hg mv b a
1179 $ hg ci -m 'b1->a1'
1179 $ hg ci -m 'b1->a1'
1180 $ hg merge -qt :local
1180 $ hg merge -qt :local
1181 $ hg ci -m '(a0,b1->a1)->a'
1181 $ hg ci -m '(a0,b1->a1)->a'
1182
1182
1183 $ hg log -GT '{rev}: {desc}\n'
1183 $ hg log -GT '{rev}: {desc}\n'
1184 @ 10: (a0,b1->a1)->a
1184 @ 10: (a0,b1->a1)->a
1185 |\
1185 |\
1186 | o 9: b1->a1
1186 | o 9: b1->a1
1187 | |
1187 | |
1188 | o 8: a1
1188 | o 8: a1
1189 | |
1189 | |
1190 | o 7: b1
1190 | o 7: b1
1191 | |
1191 | |
1192 o | 6: b0
1192 o | 6: b0
1193 | |
1193 | |
1194 o | 5: a0
1194 o | 5: a0
1195 |/
1195 |/
1196 o 4: a,b
1196 o 4: a,b
1197 |
1197 |
1198 o 3: b
1198 o 3: b
1199 |
1199 |
1200 o 2: a
1200 o 2: a
1201 |
1201 |
1202 o 1: a->b
1202 o 1: a->b
1203 |
1203 |
1204 o 0: a
1204 o 0: a
1205
1205
1206
1206
1207 since file 'a' has multiple copy sources at the revision 4, ancestors can't
1207 since file 'a' has multiple copy sources at the revision 4, ancestors can't
1208 be indexed solely by fctx.linkrev().
1208 be indexed solely by fctx.linkrev().
1209
1209
1210 $ hg log -T '{rev}: {desc}\n' -f a
1210 $ hg log -T '{rev}: {desc}\n' -f a
1211 10: (a0,b1->a1)->a
1211 10: (a0,b1->a1)->a
1212 9: b1->a1
1212 9: b1->a1
1213 7: b1
1213 7: b1
1214 5: a0
1214 5: a0
1215 4: a,b
1215 4: a,b
1216 3: b
1216 3: b
1217 2: a
1217 2: a
1218 1: a->b
1218 1: a->b
1219 0: a
1219 0: a
1220
1220
1221 $ cd ..
1221 $ cd ..
1222
1222
1223 Test that log should respect the order of -rREV even if multiple OR conditions
1223 Test that log should respect the order of -rREV even if multiple OR conditions
1224 are specified (issue5100):
1224 are specified (issue5100):
1225
1225
1226 $ hg init revorder
1226 $ hg init revorder
1227 $ cd revorder
1227 $ cd revorder
1228
1228
1229 $ hg branch -q b0
1229 $ hg branch -q b0
1230 $ echo 0 >> f0
1230 $ echo 0 >> f0
1231 $ hg ci -qAm k0 -u u0
1231 $ hg ci -qAm k0 -u u0
1232 $ hg branch -q b1
1232 $ hg branch -q b1
1233 $ echo 1 >> f1
1233 $ echo 1 >> f1
1234 $ hg ci -qAm k1 -u u1
1234 $ hg ci -qAm k1 -u u1
1235 $ hg branch -q b2
1235 $ hg branch -q b2
1236 $ echo 2 >> f2
1236 $ echo 2 >> f2
1237 $ hg ci -qAm k2 -u u2
1237 $ hg ci -qAm k2 -u u2
1238
1238
1239 $ hg update -q b2
1239 $ hg update -q b2
1240 $ echo 3 >> f2
1240 $ echo 3 >> f2
1241 $ hg ci -qAm k2 -u u2
1241 $ hg ci -qAm k2 -u u2
1242 $ hg update -q b1
1242 $ hg update -q b1
1243 $ echo 4 >> f1
1243 $ echo 4 >> f1
1244 $ hg ci -qAm k1 -u u1
1244 $ hg ci -qAm k1 -u u1
1245 $ hg update -q b0
1245 $ hg update -q b0
1246 $ echo 5 >> f0
1246 $ echo 5 >> f0
1247 $ hg ci -qAm k0 -u u0
1247 $ hg ci -qAm k0 -u u0
1248
1248
1249 summary of revisions:
1249 summary of revisions:
1250
1250
1251 $ hg log -G -T '{rev} {branch} {author} {desc} {files}\n'
1251 $ hg log -G -T '{rev} {branch} {author} {desc} {files}\n'
1252 @ 5 b0 u0 k0 f0
1252 @ 5 b0 u0 k0 f0
1253 |
1253 |
1254 | o 4 b1 u1 k1 f1
1254 | o 4 b1 u1 k1 f1
1255 | |
1255 | |
1256 | | o 3 b2 u2 k2 f2
1256 | | o 3 b2 u2 k2 f2
1257 | | |
1257 | | |
1258 | | o 2 b2 u2 k2 f2
1258 | | o 2 b2 u2 k2 f2
1259 | |/
1259 | |/
1260 | o 1 b1 u1 k1 f1
1260 | o 1 b1 u1 k1 f1
1261 |/
1261 |/
1262 o 0 b0 u0 k0 f0
1262 o 0 b0 u0 k0 f0
1263
1263
1264
1264
1265 log -b BRANCH in ascending order:
1265 log -b BRANCH in ascending order:
1266
1266
1267 $ hg log -r0:tip -T '{rev} {branch}\n' -b b0 -b b1
1267 $ hg log -r0:tip -T '{rev} {branch}\n' -b b0 -b b1
1268 0 b0
1268 0 b0
1269 1 b1
1269 1 b1
1270 4 b1
1270 4 b1
1271 5 b0
1271 5 b0
1272 $ hg log -r0:tip -T '{rev} {branch}\n' -b b1 -b b0
1272 $ hg log -r0:tip -T '{rev} {branch}\n' -b b1 -b b0
1273 0 b0
1273 0 b0
1274 1 b1
1274 1 b1
1275 4 b1
1275 4 b1
1276 5 b0
1276 5 b0
1277
1277
1278 log --only-branch BRANCH in descending order:
1278 log --only-branch BRANCH in descending order:
1279
1279
1280 $ hg log -rtip:0 -T '{rev} {branch}\n' --only-branch b1 --only-branch b2
1280 $ hg log -rtip:0 -T '{rev} {branch}\n' --only-branch b1 --only-branch b2
1281 4 b1
1281 4 b1
1282 3 b2
1282 3 b2
1283 2 b2
1283 2 b2
1284 1 b1
1284 1 b1
1285 $ hg log -rtip:0 -T '{rev} {branch}\n' --only-branch b2 --only-branch b1
1285 $ hg log -rtip:0 -T '{rev} {branch}\n' --only-branch b2 --only-branch b1
1286 4 b1
1286 4 b1
1287 3 b2
1287 3 b2
1288 2 b2
1288 2 b2
1289 1 b1
1289 1 b1
1290
1290
1291 log -u USER in ascending order, against compound set:
1291 log -u USER in ascending order, against compound set:
1292
1292
1293 $ hg log -r'::head()' -T '{rev} {author}\n' -u u0 -u u2
1293 $ hg log -r'::head()' -T '{rev} {author}\n' -u u0 -u u2
1294 0 u0
1294 0 u0
1295 2 u2
1295 2 u2
1296 3 u2
1296 3 u2
1297 5 u0
1297 5 u0
1298 $ hg log -r'::head()' -T '{rev} {author}\n' -u u2 -u u0
1298 $ hg log -r'::head()' -T '{rev} {author}\n' -u u2 -u u0
1299 0 u0
1299 0 u0
1300 2 u2
1300 2 u2
1301 3 u2
1301 3 u2
1302 5 u0
1302 5 u0
1303
1303
1304 log -k TEXT in descending order, against compound set:
1304 log -k TEXT in descending order, against compound set:
1305
1305
1306 $ hg log -r'5 + reverse(::3)' -T '{rev} {desc}\n' -k k0 -k k1 -k k2
1306 $ hg log -r'5 + reverse(::3)' -T '{rev} {desc}\n' -k k0 -k k1 -k k2
1307 5 k0
1307 5 k0
1308 3 k2
1308 3 k2
1309 2 k2
1309 2 k2
1310 1 k1
1310 1 k1
1311 0 k0
1311 0 k0
1312 $ hg log -r'5 + reverse(::3)' -T '{rev} {desc}\n' -k k2 -k k1 -k k0
1312 $ hg log -r'5 + reverse(::3)' -T '{rev} {desc}\n' -k k2 -k k1 -k k0
1313 5 k0
1313 5 k0
1314 3 k2
1314 3 k2
1315 2 k2
1315 2 k2
1316 1 k1
1316 1 k1
1317 0 k0
1317 0 k0
1318
1318
1319 log FILE in ascending order, against dagrange:
1319 log FILE in ascending order, against dagrange:
1320
1320
1321 $ hg log -r1:: -T '{rev} {files}\n' f1 f2
1321 $ hg log -r1:: -T '{rev} {files}\n' f1 f2
1322 1 f1
1322 1 f1
1323 2 f2
1323 2 f2
1324 3 f2
1324 3 f2
1325 4 f1
1325 4 f1
1326 $ hg log -r1:: -T '{rev} {files}\n' f2 f1
1326 $ hg log -r1:: -T '{rev} {files}\n' f2 f1
1327 1 f1
1327 1 f1
1328 2 f2
1328 2 f2
1329 3 f2
1329 3 f2
1330 4 f1
1330 4 f1
1331
1331
1332 $ cd ..
1332 $ cd ..
1333
1333
1334 User
1334 User
1335
1335
1336 $ hg init usertest
1336 $ hg init usertest
1337 $ cd usertest
1337 $ cd usertest
1338
1338
1339 $ echo a > a
1339 $ echo a > a
1340 $ hg ci -A -m "a" -u "User One <user1@example.org>"
1340 $ hg ci -A -m "a" -u "User One <user1@example.org>"
1341 adding a
1341 adding a
1342 $ echo b > b
1342 $ echo b > b
1343 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
1343 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
1344 adding b
1344 adding b
1345
1345
1346 $ hg log -u "User One <user1@example.org>"
1346 $ hg log -u "User One <user1@example.org>"
1347 changeset: 0:29a4c94f1924
1347 changeset: 0:29a4c94f1924
1348 user: User One <user1@example.org>
1348 user: User One <user1@example.org>
1349 date: Thu Jan 01 00:00:00 1970 +0000
1349 date: Thu Jan 01 00:00:00 1970 +0000
1350 summary: a
1350 summary: a
1351
1351
1352 $ hg log -u "user1" -u "user2"
1352 $ hg log -u "user1" -u "user2"
1353 changeset: 1:e834b5e69c0e
1353 changeset: 1:e834b5e69c0e
1354 tag: tip
1354 tag: tip
1355 user: User Two <user2@example.org>
1355 user: User Two <user2@example.org>
1356 date: Thu Jan 01 00:00:00 1970 +0000
1356 date: Thu Jan 01 00:00:00 1970 +0000
1357 summary: b
1357 summary: b
1358
1358
1359 changeset: 0:29a4c94f1924
1359 changeset: 0:29a4c94f1924
1360 user: User One <user1@example.org>
1360 user: User One <user1@example.org>
1361 date: Thu Jan 01 00:00:00 1970 +0000
1361 date: Thu Jan 01 00:00:00 1970 +0000
1362 summary: a
1362 summary: a
1363
1363
1364 $ hg log -u "user3"
1364 $ hg log -u "user3"
1365
1365
1366 "-u USER" shouldn't be overridden by "user(USER)" alias
1366 "-u USER" shouldn't be overridden by "user(USER)" alias
1367
1367
1368 $ hg log --config 'revsetalias.user(x)=branch(x)' -u default
1368 $ hg log --config 'revsetalias.user(x)=branch(x)' -u default
1369 $ hg log --config 'revsetalias.user(x)=branch(x)' -u user1
1369 $ hg log --config 'revsetalias.user(x)=branch(x)' -u user1
1370 changeset: 0:29a4c94f1924
1370 changeset: 0:29a4c94f1924
1371 user: User One <user1@example.org>
1371 user: User One <user1@example.org>
1372 date: Thu Jan 01 00:00:00 1970 +0000
1372 date: Thu Jan 01 00:00:00 1970 +0000
1373 summary: a
1373 summary: a
1374
1374
1375
1375
1376 $ cd ..
1376 $ cd ..
1377
1377
1378 $ hg init branches
1378 $ hg init branches
1379 $ cd branches
1379 $ cd branches
1380
1380
1381 $ echo a > a
1381 $ echo a > a
1382 $ hg ci -A -m "commit on default"
1382 $ hg ci -A -m "commit on default"
1383 adding a
1383 adding a
1384 $ hg branch test
1384 $ hg branch test
1385 marked working directory as branch test
1385 marked working directory as branch test
1386 (branches are permanent and global, did you want a bookmark?)
1386 (branches are permanent and global, did you want a bookmark?)
1387 $ echo b > b
1387 $ echo b > b
1388 $ hg ci -A -m "commit on test"
1388 $ hg ci -A -m "commit on test"
1389 adding b
1389 adding b
1390
1390
1391 $ hg up default
1391 $ hg up default
1392 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1392 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1393 $ echo c > c
1393 $ echo c > c
1394 $ hg ci -A -m "commit on default"
1394 $ hg ci -A -m "commit on default"
1395 adding c
1395 adding c
1396 $ hg up test
1396 $ hg up test
1397 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1397 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1398 $ echo c > c
1398 $ echo c > c
1399 $ hg ci -A -m "commit on test"
1399 $ hg ci -A -m "commit on test"
1400 adding c
1400 adding c
1401
1401
1402
1402
1403 log -b default
1403 log -b default
1404
1404
1405 $ hg log -b default
1405 $ hg log -b default
1406 changeset: 2:c3a4f03cc9a7
1406 changeset: 2:c3a4f03cc9a7
1407 parent: 0:24427303d56f
1407 parent: 0:24427303d56f
1408 user: test
1408 user: test
1409 date: Thu Jan 01 00:00:00 1970 +0000
1409 date: Thu Jan 01 00:00:00 1970 +0000
1410 summary: commit on default
1410 summary: commit on default
1411
1411
1412 changeset: 0:24427303d56f
1412 changeset: 0:24427303d56f
1413 user: test
1413 user: test
1414 date: Thu Jan 01 00:00:00 1970 +0000
1414 date: Thu Jan 01 00:00:00 1970 +0000
1415 summary: commit on default
1415 summary: commit on default
1416
1416
1417
1417
1418
1418
1419 log -b test
1419 log -b test
1420
1420
1421 $ hg log -b test
1421 $ hg log -b test
1422 changeset: 3:f5d8de11c2e2
1422 changeset: 3:f5d8de11c2e2
1423 branch: test
1423 branch: test
1424 tag: tip
1424 tag: tip
1425 parent: 1:d32277701ccb
1425 parent: 1:d32277701ccb
1426 user: test
1426 user: test
1427 date: Thu Jan 01 00:00:00 1970 +0000
1427 date: Thu Jan 01 00:00:00 1970 +0000
1428 summary: commit on test
1428 summary: commit on test
1429
1429
1430 changeset: 1:d32277701ccb
1430 changeset: 1:d32277701ccb
1431 branch: test
1431 branch: test
1432 user: test
1432 user: test
1433 date: Thu Jan 01 00:00:00 1970 +0000
1433 date: Thu Jan 01 00:00:00 1970 +0000
1434 summary: commit on test
1434 summary: commit on test
1435
1435
1436
1436
1437
1437
1438 log -b dummy
1438 log -b dummy
1439
1439
1440 $ hg log -b dummy
1440 $ hg log -b dummy
1441 abort: unknown revision 'dummy'!
1441 abort: unknown revision 'dummy'!
1442 [255]
1442 [255]
1443
1443
1444
1444
1445 log -b .
1445 log -b .
1446
1446
1447 $ hg log -b .
1447 $ hg log -b .
1448 changeset: 3:f5d8de11c2e2
1448 changeset: 3:f5d8de11c2e2
1449 branch: test
1449 branch: test
1450 tag: tip
1450 tag: tip
1451 parent: 1:d32277701ccb
1451 parent: 1:d32277701ccb
1452 user: test
1452 user: test
1453 date: Thu Jan 01 00:00:00 1970 +0000
1453 date: Thu Jan 01 00:00:00 1970 +0000
1454 summary: commit on test
1454 summary: commit on test
1455
1455
1456 changeset: 1:d32277701ccb
1456 changeset: 1:d32277701ccb
1457 branch: test
1457 branch: test
1458 user: test
1458 user: test
1459 date: Thu Jan 01 00:00:00 1970 +0000
1459 date: Thu Jan 01 00:00:00 1970 +0000
1460 summary: commit on test
1460 summary: commit on test
1461
1461
1462
1462
1463
1463
1464 log -b default -b test
1464 log -b default -b test
1465
1465
1466 $ hg log -b default -b test
1466 $ hg log -b default -b test
1467 changeset: 3:f5d8de11c2e2
1467 changeset: 3:f5d8de11c2e2
1468 branch: test
1468 branch: test
1469 tag: tip
1469 tag: tip
1470 parent: 1:d32277701ccb
1470 parent: 1:d32277701ccb
1471 user: test
1471 user: test
1472 date: Thu Jan 01 00:00:00 1970 +0000
1472 date: Thu Jan 01 00:00:00 1970 +0000
1473 summary: commit on test
1473 summary: commit on test
1474
1474
1475 changeset: 2:c3a4f03cc9a7
1475 changeset: 2:c3a4f03cc9a7
1476 parent: 0:24427303d56f
1476 parent: 0:24427303d56f
1477 user: test
1477 user: test
1478 date: Thu Jan 01 00:00:00 1970 +0000
1478 date: Thu Jan 01 00:00:00 1970 +0000
1479 summary: commit on default
1479 summary: commit on default
1480
1480
1481 changeset: 1:d32277701ccb
1481 changeset: 1:d32277701ccb
1482 branch: test
1482 branch: test
1483 user: test
1483 user: test
1484 date: Thu Jan 01 00:00:00 1970 +0000
1484 date: Thu Jan 01 00:00:00 1970 +0000
1485 summary: commit on test
1485 summary: commit on test
1486
1486
1487 changeset: 0:24427303d56f
1487 changeset: 0:24427303d56f
1488 user: test
1488 user: test
1489 date: Thu Jan 01 00:00:00 1970 +0000
1489 date: Thu Jan 01 00:00:00 1970 +0000
1490 summary: commit on default
1490 summary: commit on default
1491
1491
1492
1492
1493
1493
1494 log -b default -b .
1494 log -b default -b .
1495
1495
1496 $ hg log -b default -b .
1496 $ hg log -b default -b .
1497 changeset: 3:f5d8de11c2e2
1497 changeset: 3:f5d8de11c2e2
1498 branch: test
1498 branch: test
1499 tag: tip
1499 tag: tip
1500 parent: 1:d32277701ccb
1500 parent: 1:d32277701ccb
1501 user: test
1501 user: test
1502 date: Thu Jan 01 00:00:00 1970 +0000
1502 date: Thu Jan 01 00:00:00 1970 +0000
1503 summary: commit on test
1503 summary: commit on test
1504
1504
1505 changeset: 2:c3a4f03cc9a7
1505 changeset: 2:c3a4f03cc9a7
1506 parent: 0:24427303d56f
1506 parent: 0:24427303d56f
1507 user: test
1507 user: test
1508 date: Thu Jan 01 00:00:00 1970 +0000
1508 date: Thu Jan 01 00:00:00 1970 +0000
1509 summary: commit on default
1509 summary: commit on default
1510
1510
1511 changeset: 1:d32277701ccb
1511 changeset: 1:d32277701ccb
1512 branch: test
1512 branch: test
1513 user: test
1513 user: test
1514 date: Thu Jan 01 00:00:00 1970 +0000
1514 date: Thu Jan 01 00:00:00 1970 +0000
1515 summary: commit on test
1515 summary: commit on test
1516
1516
1517 changeset: 0:24427303d56f
1517 changeset: 0:24427303d56f
1518 user: test
1518 user: test
1519 date: Thu Jan 01 00:00:00 1970 +0000
1519 date: Thu Jan 01 00:00:00 1970 +0000
1520 summary: commit on default
1520 summary: commit on default
1521
1521
1522
1522
1523
1523
1524 log -b . -b test
1524 log -b . -b test
1525
1525
1526 $ hg log -b . -b test
1526 $ hg log -b . -b test
1527 changeset: 3:f5d8de11c2e2
1527 changeset: 3:f5d8de11c2e2
1528 branch: test
1528 branch: test
1529 tag: tip
1529 tag: tip
1530 parent: 1:d32277701ccb
1530 parent: 1:d32277701ccb
1531 user: test
1531 user: test
1532 date: Thu Jan 01 00:00:00 1970 +0000
1532 date: Thu Jan 01 00:00:00 1970 +0000
1533 summary: commit on test
1533 summary: commit on test
1534
1534
1535 changeset: 1:d32277701ccb
1535 changeset: 1:d32277701ccb
1536 branch: test
1536 branch: test
1537 user: test
1537 user: test
1538 date: Thu Jan 01 00:00:00 1970 +0000
1538 date: Thu Jan 01 00:00:00 1970 +0000
1539 summary: commit on test
1539 summary: commit on test
1540
1540
1541
1541
1542
1542
1543 log -b 2
1543 log -b 2
1544
1544
1545 $ hg log -b 2
1545 $ hg log -b 2
1546 changeset: 2:c3a4f03cc9a7
1546 changeset: 2:c3a4f03cc9a7
1547 parent: 0:24427303d56f
1547 parent: 0:24427303d56f
1548 user: test
1548 user: test
1549 date: Thu Jan 01 00:00:00 1970 +0000
1549 date: Thu Jan 01 00:00:00 1970 +0000
1550 summary: commit on default
1550 summary: commit on default
1551
1551
1552 changeset: 0:24427303d56f
1552 changeset: 0:24427303d56f
1553 user: test
1553 user: test
1554 date: Thu Jan 01 00:00:00 1970 +0000
1554 date: Thu Jan 01 00:00:00 1970 +0000
1555 summary: commit on default
1555 summary: commit on default
1556
1556
1557 #if gettext
1557 #if gettext
1558
1558
1559 Test that all log names are translated (e.g. branches, bookmarks, tags):
1559 Test that all log names are translated (e.g. branches, bookmarks, tags):
1560
1560
1561 $ hg bookmark babar -r tip
1561 $ hg bookmark babar -r tip
1562
1562
1563 $ HGENCODING=UTF-8 LANGUAGE=de hg log -r tip
1563 $ HGENCODING=UTF-8 LANGUAGE=de hg log -r tip
1564 \xc3\x84nderung: 3:f5d8de11c2e2 (esc)
1564 \xc3\x84nderung: 3:f5d8de11c2e2 (esc)
1565 Zweig: test
1565 Zweig: test
1566 Lesezeichen: babar
1566 Lesezeichen: babar
1567 Marke: tip
1567 Marke: tip
1568 Vorg\xc3\xa4nger: 1:d32277701ccb (esc)
1568 Vorg\xc3\xa4nger: 1:d32277701ccb (esc)
1569 Nutzer: test
1569 Nutzer: test
1570 Datum: Thu Jan 01 00:00:00 1970 +0000
1570 Datum: Thu Jan 01 00:00:00 1970 +0000
1571 Zusammenfassung: commit on test
1571 Zusammenfassung: commit on test
1572
1572
1573 $ hg bookmark -d babar
1573 $ hg bookmark -d babar
1574
1574
1575 #endif
1575 #endif
1576
1576
1577 log -p --cwd dir (in subdir)
1577 log -p --cwd dir (in subdir)
1578
1578
1579 $ mkdir dir
1579 $ mkdir dir
1580 $ hg log -p --cwd dir
1580 $ hg log -p --cwd dir
1581 changeset: 3:f5d8de11c2e2
1581 changeset: 3:f5d8de11c2e2
1582 branch: test
1582 branch: test
1583 tag: tip
1583 tag: tip
1584 parent: 1:d32277701ccb
1584 parent: 1:d32277701ccb
1585 user: test
1585 user: test
1586 date: Thu Jan 01 00:00:00 1970 +0000
1586 date: Thu Jan 01 00:00:00 1970 +0000
1587 summary: commit on test
1587 summary: commit on test
1588
1588
1589 diff -r d32277701ccb -r f5d8de11c2e2 c
1589 diff -r d32277701ccb -r f5d8de11c2e2 c
1590 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1590 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1591 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1591 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1592 @@ -0,0 +1,1 @@
1592 @@ -0,0 +1,1 @@
1593 +c
1593 +c
1594
1594
1595 changeset: 2:c3a4f03cc9a7
1595 changeset: 2:c3a4f03cc9a7
1596 parent: 0:24427303d56f
1596 parent: 0:24427303d56f
1597 user: test
1597 user: test
1598 date: Thu Jan 01 00:00:00 1970 +0000
1598 date: Thu Jan 01 00:00:00 1970 +0000
1599 summary: commit on default
1599 summary: commit on default
1600
1600
1601 diff -r 24427303d56f -r c3a4f03cc9a7 c
1601 diff -r 24427303d56f -r c3a4f03cc9a7 c
1602 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1602 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1603 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1603 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1604 @@ -0,0 +1,1 @@
1604 @@ -0,0 +1,1 @@
1605 +c
1605 +c
1606
1606
1607 changeset: 1:d32277701ccb
1607 changeset: 1:d32277701ccb
1608 branch: test
1608 branch: test
1609 user: test
1609 user: test
1610 date: Thu Jan 01 00:00:00 1970 +0000
1610 date: Thu Jan 01 00:00:00 1970 +0000
1611 summary: commit on test
1611 summary: commit on test
1612
1612
1613 diff -r 24427303d56f -r d32277701ccb b
1613 diff -r 24427303d56f -r d32277701ccb b
1614 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1614 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1615 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1615 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1616 @@ -0,0 +1,1 @@
1616 @@ -0,0 +1,1 @@
1617 +b
1617 +b
1618
1618
1619 changeset: 0:24427303d56f
1619 changeset: 0:24427303d56f
1620 user: test
1620 user: test
1621 date: Thu Jan 01 00:00:00 1970 +0000
1621 date: Thu Jan 01 00:00:00 1970 +0000
1622 summary: commit on default
1622 summary: commit on default
1623
1623
1624 diff -r 000000000000 -r 24427303d56f a
1624 diff -r 000000000000 -r 24427303d56f a
1625 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1625 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1626 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1626 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1627 @@ -0,0 +1,1 @@
1627 @@ -0,0 +1,1 @@
1628 +a
1628 +a
1629
1629
1630
1630
1631
1631
1632 log -p -R repo
1632 log -p -R repo
1633
1633
1634 $ cd dir
1634 $ cd dir
1635 $ hg log -p -R .. ../a
1635 $ hg log -p -R .. ../a
1636 changeset: 0:24427303d56f
1636 changeset: 0:24427303d56f
1637 user: test
1637 user: test
1638 date: Thu Jan 01 00:00:00 1970 +0000
1638 date: Thu Jan 01 00:00:00 1970 +0000
1639 summary: commit on default
1639 summary: commit on default
1640
1640
1641 diff -r 000000000000 -r 24427303d56f a
1641 diff -r 000000000000 -r 24427303d56f a
1642 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1642 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1643 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1643 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1644 @@ -0,0 +1,1 @@
1644 @@ -0,0 +1,1 @@
1645 +a
1645 +a
1646
1646
1647
1647
1648 $ cd ../..
1648 $ cd ../..
1649
1649
1650 $ hg init follow2
1650 $ hg init follow2
1651 $ cd follow2
1651 $ cd follow2
1652
1652
1653 # Build the following history:
1653 # Build the following history:
1654 # tip - o - x - o - x - x
1654 # tip - o - x - o - x - x
1655 # \ /
1655 # \ /
1656 # o - o - o - x
1656 # o - o - o - x
1657 # \ /
1657 # \ /
1658 # o
1658 # o
1659 #
1659 #
1660 # Where "o" is a revision containing "foo" and
1660 # Where "o" is a revision containing "foo" and
1661 # "x" is a revision without "foo"
1661 # "x" is a revision without "foo"
1662
1662
1663 $ touch init
1663 $ touch init
1664 $ hg ci -A -m "init, unrelated"
1664 $ hg ci -A -m "init, unrelated"
1665 adding init
1665 adding init
1666 $ echo 'foo' > init
1666 $ echo 'foo' > init
1667 $ hg ci -m "change, unrelated"
1667 $ hg ci -m "change, unrelated"
1668 $ echo 'foo' > foo
1668 $ echo 'foo' > foo
1669 $ hg ci -A -m "add unrelated old foo"
1669 $ hg ci -A -m "add unrelated old foo"
1670 adding foo
1670 adding foo
1671 $ hg rm foo
1671 $ hg rm foo
1672 $ hg ci -m "delete foo, unrelated"
1672 $ hg ci -m "delete foo, unrelated"
1673 $ echo 'related' > foo
1673 $ echo 'related' > foo
1674 $ hg ci -A -m "add foo, related"
1674 $ hg ci -A -m "add foo, related"
1675 adding foo
1675 adding foo
1676
1676
1677 $ hg up 0
1677 $ hg up 0
1678 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1678 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1679 $ touch branch
1679 $ touch branch
1680 $ hg ci -A -m "first branch, unrelated"
1680 $ hg ci -A -m "first branch, unrelated"
1681 adding branch
1681 adding branch
1682 created new head
1682 created new head
1683 $ touch foo
1683 $ touch foo
1684 $ hg ci -A -m "create foo, related"
1684 $ hg ci -A -m "create foo, related"
1685 adding foo
1685 adding foo
1686 $ echo 'change' > foo
1686 $ echo 'change' > foo
1687 $ hg ci -m "change foo, related"
1687 $ hg ci -m "change foo, related"
1688
1688
1689 $ hg up 6
1689 $ hg up 6
1690 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1690 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1691 $ echo 'change foo in branch' > foo
1691 $ echo 'change foo in branch' > foo
1692 $ hg ci -m "change foo in branch, related"
1692 $ hg ci -m "change foo in branch, related"
1693 created new head
1693 created new head
1694 $ hg merge 7
1694 $ hg merge 7
1695 merging foo
1695 merging foo
1696 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
1696 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
1697 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1697 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1698 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1698 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1699 [1]
1699 [1]
1700 $ echo 'merge 1' > foo
1700 $ echo 'merge 1' > foo
1701 $ hg resolve -m foo
1701 $ hg resolve -m foo
1702 (no more unresolved files)
1702 (no more unresolved files)
1703 $ hg ci -m "First merge, related"
1703 $ hg ci -m "First merge, related"
1704
1704
1705 $ hg merge 4
1705 $ hg merge 4
1706 merging foo
1706 merging foo
1707 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
1707 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
1708 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
1708 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
1709 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1709 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1710 [1]
1710 [1]
1711 $ echo 'merge 2' > foo
1711 $ echo 'merge 2' > foo
1712 $ hg resolve -m foo
1712 $ hg resolve -m foo
1713 (no more unresolved files)
1713 (no more unresolved files)
1714 $ hg ci -m "Last merge, related"
1714 $ hg ci -m "Last merge, related"
1715
1715
1716 $ hg log --graph
1716 $ hg log --graph
1717 @ changeset: 10:4dae8563d2c5
1717 @ changeset: 10:4dae8563d2c5
1718 |\ tag: tip
1718 |\ tag: tip
1719 | | parent: 9:7b35701b003e
1719 | | parent: 9:7b35701b003e
1720 | | parent: 4:88176d361b69
1720 | | parent: 4:88176d361b69
1721 | | user: test
1721 | | user: test
1722 | | date: Thu Jan 01 00:00:00 1970 +0000
1722 | | date: Thu Jan 01 00:00:00 1970 +0000
1723 | | summary: Last merge, related
1723 | | summary: Last merge, related
1724 | |
1724 | |
1725 | o changeset: 9:7b35701b003e
1725 | o changeset: 9:7b35701b003e
1726 | |\ parent: 8:e5416ad8a855
1726 | |\ parent: 8:e5416ad8a855
1727 | | | parent: 7:87fe3144dcfa
1727 | | | parent: 7:87fe3144dcfa
1728 | | | user: test
1728 | | | user: test
1729 | | | date: Thu Jan 01 00:00:00 1970 +0000
1729 | | | date: Thu Jan 01 00:00:00 1970 +0000
1730 | | | summary: First merge, related
1730 | | | summary: First merge, related
1731 | | |
1731 | | |
1732 | | o changeset: 8:e5416ad8a855
1732 | | o changeset: 8:e5416ad8a855
1733 | | | parent: 6:dc6c325fe5ee
1733 | | | parent: 6:dc6c325fe5ee
1734 | | | user: test
1734 | | | user: test
1735 | | | date: Thu Jan 01 00:00:00 1970 +0000
1735 | | | date: Thu Jan 01 00:00:00 1970 +0000
1736 | | | summary: change foo in branch, related
1736 | | | summary: change foo in branch, related
1737 | | |
1737 | | |
1738 | o | changeset: 7:87fe3144dcfa
1738 | o | changeset: 7:87fe3144dcfa
1739 | |/ user: test
1739 | |/ user: test
1740 | | date: Thu Jan 01 00:00:00 1970 +0000
1740 | | date: Thu Jan 01 00:00:00 1970 +0000
1741 | | summary: change foo, related
1741 | | summary: change foo, related
1742 | |
1742 | |
1743 | o changeset: 6:dc6c325fe5ee
1743 | o changeset: 6:dc6c325fe5ee
1744 | | user: test
1744 | | user: test
1745 | | date: Thu Jan 01 00:00:00 1970 +0000
1745 | | date: Thu Jan 01 00:00:00 1970 +0000
1746 | | summary: create foo, related
1746 | | summary: create foo, related
1747 | |
1747 | |
1748 | o changeset: 5:73db34516eb9
1748 | o changeset: 5:73db34516eb9
1749 | | parent: 0:e87515fd044a
1749 | | parent: 0:e87515fd044a
1750 | | user: test
1750 | | user: test
1751 | | date: Thu Jan 01 00:00:00 1970 +0000
1751 | | date: Thu Jan 01 00:00:00 1970 +0000
1752 | | summary: first branch, unrelated
1752 | | summary: first branch, unrelated
1753 | |
1753 | |
1754 o | changeset: 4:88176d361b69
1754 o | changeset: 4:88176d361b69
1755 | | user: test
1755 | | user: test
1756 | | date: Thu Jan 01 00:00:00 1970 +0000
1756 | | date: Thu Jan 01 00:00:00 1970 +0000
1757 | | summary: add foo, related
1757 | | summary: add foo, related
1758 | |
1758 | |
1759 o | changeset: 3:dd78ae4afb56
1759 o | changeset: 3:dd78ae4afb56
1760 | | user: test
1760 | | user: test
1761 | | date: Thu Jan 01 00:00:00 1970 +0000
1761 | | date: Thu Jan 01 00:00:00 1970 +0000
1762 | | summary: delete foo, unrelated
1762 | | summary: delete foo, unrelated
1763 | |
1763 | |
1764 o | changeset: 2:c4c64aedf0f7
1764 o | changeset: 2:c4c64aedf0f7
1765 | | user: test
1765 | | user: test
1766 | | date: Thu Jan 01 00:00:00 1970 +0000
1766 | | date: Thu Jan 01 00:00:00 1970 +0000
1767 | | summary: add unrelated old foo
1767 | | summary: add unrelated old foo
1768 | |
1768 | |
1769 o | changeset: 1:e5faa7440653
1769 o | changeset: 1:e5faa7440653
1770 |/ user: test
1770 |/ user: test
1771 | date: Thu Jan 01 00:00:00 1970 +0000
1771 | date: Thu Jan 01 00:00:00 1970 +0000
1772 | summary: change, unrelated
1772 | summary: change, unrelated
1773 |
1773 |
1774 o changeset: 0:e87515fd044a
1774 o changeset: 0:e87515fd044a
1775 user: test
1775 user: test
1776 date: Thu Jan 01 00:00:00 1970 +0000
1776 date: Thu Jan 01 00:00:00 1970 +0000
1777 summary: init, unrelated
1777 summary: init, unrelated
1778
1778
1779
1779
1780 $ hg --traceback log -f foo
1780 $ hg --traceback log -f foo
1781 changeset: 10:4dae8563d2c5
1781 changeset: 10:4dae8563d2c5
1782 tag: tip
1782 tag: tip
1783 parent: 9:7b35701b003e
1783 parent: 9:7b35701b003e
1784 parent: 4:88176d361b69
1784 parent: 4:88176d361b69
1785 user: test
1785 user: test
1786 date: Thu Jan 01 00:00:00 1970 +0000
1786 date: Thu Jan 01 00:00:00 1970 +0000
1787 summary: Last merge, related
1787 summary: Last merge, related
1788
1788
1789 changeset: 9:7b35701b003e
1789 changeset: 9:7b35701b003e
1790 parent: 8:e5416ad8a855
1790 parent: 8:e5416ad8a855
1791 parent: 7:87fe3144dcfa
1791 parent: 7:87fe3144dcfa
1792 user: test
1792 user: test
1793 date: Thu Jan 01 00:00:00 1970 +0000
1793 date: Thu Jan 01 00:00:00 1970 +0000
1794 summary: First merge, related
1794 summary: First merge, related
1795
1795
1796 changeset: 8:e5416ad8a855
1796 changeset: 8:e5416ad8a855
1797 parent: 6:dc6c325fe5ee
1797 parent: 6:dc6c325fe5ee
1798 user: test
1798 user: test
1799 date: Thu Jan 01 00:00:00 1970 +0000
1799 date: Thu Jan 01 00:00:00 1970 +0000
1800 summary: change foo in branch, related
1800 summary: change foo in branch, related
1801
1801
1802 changeset: 7:87fe3144dcfa
1802 changeset: 7:87fe3144dcfa
1803 user: test
1803 user: test
1804 date: Thu Jan 01 00:00:00 1970 +0000
1804 date: Thu Jan 01 00:00:00 1970 +0000
1805 summary: change foo, related
1805 summary: change foo, related
1806
1806
1807 changeset: 6:dc6c325fe5ee
1807 changeset: 6:dc6c325fe5ee
1808 user: test
1808 user: test
1809 date: Thu Jan 01 00:00:00 1970 +0000
1809 date: Thu Jan 01 00:00:00 1970 +0000
1810 summary: create foo, related
1810 summary: create foo, related
1811
1811
1812 changeset: 4:88176d361b69
1812 changeset: 4:88176d361b69
1813 user: test
1813 user: test
1814 date: Thu Jan 01 00:00:00 1970 +0000
1814 date: Thu Jan 01 00:00:00 1970 +0000
1815 summary: add foo, related
1815 summary: add foo, related
1816
1816
1817
1817
1818 Also check when maxrev < lastrevfilelog
1818 Also check when maxrev < lastrevfilelog
1819
1819
1820 $ hg --traceback log -f -r4 foo
1820 $ hg --traceback log -f -r4 foo
1821 changeset: 4:88176d361b69
1821 changeset: 4:88176d361b69
1822 user: test
1822 user: test
1823 date: Thu Jan 01 00:00:00 1970 +0000
1823 date: Thu Jan 01 00:00:00 1970 +0000
1824 summary: add foo, related
1824 summary: add foo, related
1825
1825
1826 $ cd ..
1826 $ cd ..
1827
1827
1828 Issue2383: hg log showing _less_ differences than hg diff
1828 Issue2383: hg log showing _less_ differences than hg diff
1829
1829
1830 $ hg init issue2383
1830 $ hg init issue2383
1831 $ cd issue2383
1831 $ cd issue2383
1832
1832
1833 Create a test repo:
1833 Create a test repo:
1834
1834
1835 $ echo a > a
1835 $ echo a > a
1836 $ hg ci -Am0
1836 $ hg ci -Am0
1837 adding a
1837 adding a
1838 $ echo b > b
1838 $ echo b > b
1839 $ hg ci -Am1
1839 $ hg ci -Am1
1840 adding b
1840 adding b
1841 $ hg co 0
1841 $ hg co 0
1842 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1842 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1843 $ echo b > a
1843 $ echo b > a
1844 $ hg ci -m2
1844 $ hg ci -m2
1845 created new head
1845 created new head
1846
1846
1847 Merge:
1847 Merge:
1848
1848
1849 $ hg merge
1849 $ hg merge
1850 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1850 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1851 (branch merge, don't forget to commit)
1851 (branch merge, don't forget to commit)
1852
1852
1853 Make sure there's a file listed in the merge to trigger the bug:
1853 Make sure there's a file listed in the merge to trigger the bug:
1854
1854
1855 $ echo c > a
1855 $ echo c > a
1856 $ hg ci -m3
1856 $ hg ci -m3
1857
1857
1858 Two files shown here in diff:
1858 Two files shown here in diff:
1859
1859
1860 $ hg diff --rev 2:3
1860 $ hg diff --rev 2:3
1861 diff -r b09be438c43a -r 8e07aafe1edc a
1861 diff -r b09be438c43a -r 8e07aafe1edc a
1862 --- a/a Thu Jan 01 00:00:00 1970 +0000
1862 --- a/a Thu Jan 01 00:00:00 1970 +0000
1863 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1863 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1864 @@ -1,1 +1,1 @@
1864 @@ -1,1 +1,1 @@
1865 -b
1865 -b
1866 +c
1866 +c
1867 diff -r b09be438c43a -r 8e07aafe1edc b
1867 diff -r b09be438c43a -r 8e07aafe1edc b
1868 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1868 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1869 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1869 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1870 @@ -0,0 +1,1 @@
1870 @@ -0,0 +1,1 @@
1871 +b
1871 +b
1872
1872
1873 Diff here should be the same:
1873 Diff here should be the same:
1874
1874
1875 $ hg log -vpr 3
1875 $ hg log -vpr 3
1876 changeset: 3:8e07aafe1edc
1876 changeset: 3:8e07aafe1edc
1877 tag: tip
1877 tag: tip
1878 parent: 2:b09be438c43a
1878 parent: 2:b09be438c43a
1879 parent: 1:925d80f479bb
1879 parent: 1:925d80f479bb
1880 user: test
1880 user: test
1881 date: Thu Jan 01 00:00:00 1970 +0000
1881 date: Thu Jan 01 00:00:00 1970 +0000
1882 files: a
1882 files: a
1883 description:
1883 description:
1884 3
1884 3
1885
1885
1886
1886
1887 diff -r b09be438c43a -r 8e07aafe1edc a
1887 diff -r b09be438c43a -r 8e07aafe1edc a
1888 --- a/a Thu Jan 01 00:00:00 1970 +0000
1888 --- a/a Thu Jan 01 00:00:00 1970 +0000
1889 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1889 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1890 @@ -1,1 +1,1 @@
1890 @@ -1,1 +1,1 @@
1891 -b
1891 -b
1892 +c
1892 +c
1893 diff -r b09be438c43a -r 8e07aafe1edc b
1893 diff -r b09be438c43a -r 8e07aafe1edc b
1894 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1894 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1895 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1895 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1896 @@ -0,0 +1,1 @@
1896 @@ -0,0 +1,1 @@
1897 +b
1897 +b
1898
1898
1899 $ cd ..
1899 $ cd ..
1900
1900
1901 'hg log -r rev fn' when last(filelog(fn)) != rev
1901 'hg log -r rev fn' when last(filelog(fn)) != rev
1902
1902
1903 $ hg init simplelog
1903 $ hg init simplelog
1904 $ cd simplelog
1904 $ cd simplelog
1905 $ echo f > a
1905 $ echo f > a
1906 $ hg ci -Am'a' -d '0 0'
1906 $ hg ci -Am'a' -d '0 0'
1907 adding a
1907 adding a
1908 $ echo f >> a
1908 $ echo f >> a
1909 $ hg ci -Am'a bis' -d '1 0'
1909 $ hg ci -Am'a bis' -d '1 0'
1910
1910
1911 $ hg log -r0 a
1911 $ hg log -r0 a
1912 changeset: 0:9f758d63dcde
1912 changeset: 0:9f758d63dcde
1913 user: test
1913 user: test
1914 date: Thu Jan 01 00:00:00 1970 +0000
1914 date: Thu Jan 01 00:00:00 1970 +0000
1915 summary: a
1915 summary: a
1916
1916
1917 enable obsolete to test hidden feature
1917 enable obsolete to test hidden feature
1918
1918
1919 $ cat >> $HGRCPATH << EOF
1919 $ cat >> $HGRCPATH << EOF
1920 > [experimental]
1920 > [experimental]
1921 > evolution.createmarkers=True
1921 > evolution.createmarkers=True
1922 > EOF
1922 > EOF
1923
1923
1924 $ hg log --template='{rev}:{node}\n'
1924 $ hg log --template='{rev}:{node}\n'
1925 1:a765632148dc55d38c35c4f247c618701886cb2f
1925 1:a765632148dc55d38c35c4f247c618701886cb2f
1926 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1926 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1927 $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
1927 $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
1928 obsoleted 1 changesets
1928 obsoleted 1 changesets
1929 $ hg up null -q
1929 $ hg up null -q
1930 $ hg log --template='{rev}:{node}\n'
1930 $ hg log --template='{rev}:{node}\n'
1931 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1931 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1932 $ hg log --template='{rev}:{node}\n' --hidden
1932 $ hg log --template='{rev}:{node}\n' --hidden
1933 1:a765632148dc55d38c35c4f247c618701886cb2f
1933 1:a765632148dc55d38c35c4f247c618701886cb2f
1934 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1934 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1935 $ hg log -r a
1935 $ hg log -r a
1936 abort: hidden revision 'a' is pruned!
1936 abort: hidden revision 'a' is pruned!
1937 (use --hidden to access hidden revisions)
1937 (use --hidden to access hidden revisions)
1938 [255]
1938 [255]
1939
1939
1940 test that parent prevent a changeset to be hidden
1940 test that parent prevent a changeset to be hidden
1941
1941
1942 $ hg up 1 -q --hidden
1942 $ hg up 1 -q --hidden
1943 updating to a hidden changeset a765632148dc
1943 updating to a hidden changeset a765632148dc
1944 (hidden revision 'a765632148dc' is pruned)
1944 (hidden revision 'a765632148dc' is pruned)
1945 $ hg log --template='{rev}:{node}\n'
1945 $ hg log --template='{rev}:{node}\n'
1946 1:a765632148dc55d38c35c4f247c618701886cb2f
1946 1:a765632148dc55d38c35c4f247c618701886cb2f
1947 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1947 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1948
1948
1949 test that second parent prevent a changeset to be hidden too
1949 test that second parent prevent a changeset to be hidden too
1950
1950
1951 $ hg debugsetparents 0 1 # nothing suitable to merge here
1951 $ hg debugsetparents 0 1 # nothing suitable to merge here
1952 $ hg log --template='{rev}:{node}\n'
1952 $ hg log --template='{rev}:{node}\n'
1953 1:a765632148dc55d38c35c4f247c618701886cb2f
1953 1:a765632148dc55d38c35c4f247c618701886cb2f
1954 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1954 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1955 $ hg debugsetparents 1
1955 $ hg debugsetparents 1
1956 $ hg up -q null
1956 $ hg up -q null
1957
1957
1958 bookmarks prevent a changeset being hidden
1958 bookmarks prevent a changeset being hidden
1959
1959
1960 $ hg bookmark --hidden -r 1 X
1960 $ hg bookmark --hidden -r 1 X
1961 bookmarking hidden changeset a765632148dc
1961 bookmarking hidden changeset a765632148dc
1962 (hidden revision 'a765632148dc' is pruned)
1962 (hidden revision 'a765632148dc' is pruned)
1963 $ hg log --template '{rev}:{node}\n'
1963 $ hg log --template '{rev}:{node}\n'
1964 1:a765632148dc55d38c35c4f247c618701886cb2f
1964 1:a765632148dc55d38c35c4f247c618701886cb2f
1965 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1965 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1966 $ hg bookmark -d X
1966 $ hg bookmark -d X
1967
1967
1968 divergent bookmarks are not hidden
1968 divergent bookmarks are not hidden
1969
1969
1970 $ hg bookmark --hidden -r 1 X@foo
1970 $ hg bookmark --hidden -r 1 X@foo
1971 bookmarking hidden changeset a765632148dc
1971 bookmarking hidden changeset a765632148dc
1972 (hidden revision 'a765632148dc' is pruned)
1972 (hidden revision 'a765632148dc' is pruned)
1973 $ hg log --template '{rev}:{node}\n'
1973 $ hg log --template '{rev}:{node}\n'
1974 1:a765632148dc55d38c35c4f247c618701886cb2f
1974 1:a765632148dc55d38c35c4f247c618701886cb2f
1975 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1975 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1976
1976
1977 test hidden revision 0 (issue5385)
1977 test hidden revision 0 (issue5385)
1978
1978
1979 $ hg bookmark -d X@foo
1979 $ hg bookmark -d X@foo
1980 $ hg up null -q
1980 $ hg up null -q
1981 $ hg debugobsolete 9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1981 $ hg debugobsolete 9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1982 obsoleted 1 changesets
1982 obsoleted 1 changesets
1983 $ echo f > b
1983 $ echo f > b
1984 $ hg ci -Am'b' -d '2 0'
1984 $ hg ci -Am'b' -d '2 0'
1985 adding b
1985 adding b
1986 $ echo f >> b
1986 $ echo f >> b
1987 $ hg ci -m'b bis' -d '3 0'
1987 $ hg ci -m'b bis' -d '3 0'
1988 $ hg log -T'{rev}:{node}\n'
1988 $ hg log -T'{rev}:{node}\n'
1989 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
1989 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
1990 2:94375ec45bddd2a824535fc04855bd058c926ec0
1990 2:94375ec45bddd2a824535fc04855bd058c926ec0
1991
1991
1992 $ hg log -T'{rev}:{node}\n' -r:
1992 $ hg log -T'{rev}:{node}\n' -r:
1993 2:94375ec45bddd2a824535fc04855bd058c926ec0
1993 2:94375ec45bddd2a824535fc04855bd058c926ec0
1994 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
1994 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
1995 $ hg log -T'{rev}:{node}\n' -r:tip
1995 $ hg log -T'{rev}:{node}\n' -r:tip
1996 2:94375ec45bddd2a824535fc04855bd058c926ec0
1996 2:94375ec45bddd2a824535fc04855bd058c926ec0
1997 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
1997 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
1998 $ hg log -T'{rev}:{node}\n' -r:0
1998 $ hg log -T'{rev}:{node}\n' -r:0
1999 abort: hidden revision '0' is pruned!
1999 abort: hidden revision '0' is pruned!
2000 (use --hidden to access hidden revisions)
2000 (use --hidden to access hidden revisions)
2001 [255]
2001 [255]
2002 $ hg log -T'{rev}:{node}\n' -f
2002 $ hg log -T'{rev}:{node}\n' -f
2003 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
2003 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
2004 2:94375ec45bddd2a824535fc04855bd058c926ec0
2004 2:94375ec45bddd2a824535fc04855bd058c926ec0
2005
2005
2006 clear extensions configuration
2006 clear extensions configuration
2007 $ echo '[extensions]' >> $HGRCPATH
2007 $ echo '[extensions]' >> $HGRCPATH
2008 $ echo "obs=!" >> $HGRCPATH
2008 $ echo "obs=!" >> $HGRCPATH
2009 $ cd ..
2009 $ cd ..
2010
2010
2011 test -u/-k for problematic encoding
2011 test -u/-k for problematic encoding
2012 # unicode: cp932:
2012 # unicode: cp932:
2013 # u30A2 0x83 0x41(= 'A')
2013 # u30A2 0x83 0x41(= 'A')
2014 # u30C2 0x83 0x61(= 'a')
2014 # u30C2 0x83 0x61(= 'a')
2015
2015
2016 $ hg init problematicencoding
2016 $ hg init problematicencoding
2017 $ cd problematicencoding
2017 $ cd problematicencoding
2018
2018
2019 >>> with open('setup.sh', 'wb') as f:
2019 >>> with open('setup.sh', 'wb') as f:
2020 ... f.write(u'''
2020 ... f.write(u'''
2021 ... echo a > text
2021 ... echo a > text
2022 ... hg add text
2022 ... hg add text
2023 ... hg --encoding utf-8 commit -u '\u30A2' -m none
2023 ... hg --encoding utf-8 commit -u '\u30A2' -m none
2024 ... echo b > text
2024 ... echo b > text
2025 ... hg --encoding utf-8 commit -u '\u30C2' -m none
2025 ... hg --encoding utf-8 commit -u '\u30C2' -m none
2026 ... echo c > text
2026 ... echo c > text
2027 ... hg --encoding utf-8 commit -u none -m '\u30A2'
2027 ... hg --encoding utf-8 commit -u none -m '\u30A2'
2028 ... echo d > text
2028 ... echo d > text
2029 ... hg --encoding utf-8 commit -u none -m '\u30C2'
2029 ... hg --encoding utf-8 commit -u none -m '\u30C2'
2030 ... '''.encode('utf-8')) and None
2030 ... '''.encode('utf-8')) and None
2031 $ sh < setup.sh
2031 $ sh < setup.sh
2032
2032
2033 test in problematic encoding
2033 test in problematic encoding
2034 >>> with open('test.sh', 'wb') as f:
2034 >>> with open('test.sh', 'wb') as f:
2035 ... f.write(u'''
2035 ... f.write(u'''
2036 ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
2036 ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
2037 ... echo ====
2037 ... echo ====
2038 ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
2038 ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
2039 ... echo ====
2039 ... echo ====
2040 ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
2040 ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
2041 ... echo ====
2041 ... echo ====
2042 ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
2042 ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
2043 ... '''.encode('cp932')) and None
2043 ... '''.encode('cp932')) and None
2044 $ sh < test.sh
2044 $ sh < test.sh
2045 0
2045 0
2046 ====
2046 ====
2047 1
2047 1
2048 ====
2048 ====
2049 2
2049 2
2050 0
2050 0
2051 ====
2051 ====
2052 3
2052 3
2053 1
2053 1
2054
2054
2055 $ cd ..
2055 $ cd ..
2056
2056
2057 test hg log on non-existent files and on directories
2057 test hg log on non-existent files and on directories
2058 $ hg init issue1340
2058 $ hg init issue1340
2059 $ cd issue1340
2059 $ cd issue1340
2060 $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6
2060 $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6
2061 $ echo 1 > d1/f1
2061 $ echo 1 > d1/f1
2062 $ echo 1 > D2/f1
2062 $ echo 1 > D2/f1
2063 $ echo 1 > D3.i/f1
2063 $ echo 1 > D3.i/f1
2064 $ echo 1 > d4.hg/f1
2064 $ echo 1 > d4.hg/f1
2065 $ echo 1 > d5.d/f1
2065 $ echo 1 > d5.d/f1
2066 $ echo 1 > .d6/f1
2066 $ echo 1 > .d6/f1
2067 $ hg -q add .
2067 $ hg -q add .
2068 $ hg commit -m "a bunch of weird directories"
2068 $ hg commit -m "a bunch of weird directories"
2069 $ hg log -l1 d1/f1 | grep changeset
2069 $ hg log -l1 d1/f1 | grep changeset
2070 changeset: 0:65624cd9070a
2070 changeset: 0:65624cd9070a
2071 $ hg log -l1 f1
2071 $ hg log -l1 f1
2072 $ hg log -l1 . | grep changeset
2072 $ hg log -l1 . | grep changeset
2073 changeset: 0:65624cd9070a
2073 changeset: 0:65624cd9070a
2074 $ hg log -l1 ./ | grep changeset
2074 $ hg log -l1 ./ | grep changeset
2075 changeset: 0:65624cd9070a
2075 changeset: 0:65624cd9070a
2076 $ hg log -l1 d1 | grep changeset
2076 $ hg log -l1 d1 | grep changeset
2077 changeset: 0:65624cd9070a
2077 changeset: 0:65624cd9070a
2078 $ hg log -l1 D2 | grep changeset
2078 $ hg log -l1 D2 | grep changeset
2079 changeset: 0:65624cd9070a
2079 changeset: 0:65624cd9070a
2080 $ hg log -l1 D2/f1 | grep changeset
2080 $ hg log -l1 D2/f1 | grep changeset
2081 changeset: 0:65624cd9070a
2081 changeset: 0:65624cd9070a
2082 $ hg log -l1 D3.i | grep changeset
2082 $ hg log -l1 D3.i | grep changeset
2083 changeset: 0:65624cd9070a
2083 changeset: 0:65624cd9070a
2084 $ hg log -l1 D3.i/f1 | grep changeset
2084 $ hg log -l1 D3.i/f1 | grep changeset
2085 changeset: 0:65624cd9070a
2085 changeset: 0:65624cd9070a
2086 $ hg log -l1 d4.hg | grep changeset
2086 $ hg log -l1 d4.hg | grep changeset
2087 changeset: 0:65624cd9070a
2087 changeset: 0:65624cd9070a
2088 $ hg log -l1 d4.hg/f1 | grep changeset
2088 $ hg log -l1 d4.hg/f1 | grep changeset
2089 changeset: 0:65624cd9070a
2089 changeset: 0:65624cd9070a
2090 $ hg log -l1 d5.d | grep changeset
2090 $ hg log -l1 d5.d | grep changeset
2091 changeset: 0:65624cd9070a
2091 changeset: 0:65624cd9070a
2092 $ hg log -l1 d5.d/f1 | grep changeset
2092 $ hg log -l1 d5.d/f1 | grep changeset
2093 changeset: 0:65624cd9070a
2093 changeset: 0:65624cd9070a
2094 $ hg log -l1 .d6 | grep changeset
2094 $ hg log -l1 .d6 | grep changeset
2095 changeset: 0:65624cd9070a
2095 changeset: 0:65624cd9070a
2096 $ hg log -l1 .d6/f1 | grep changeset
2096 $ hg log -l1 .d6/f1 | grep changeset
2097 changeset: 0:65624cd9070a
2097 changeset: 0:65624cd9070a
2098
2098
2099 issue3772: hg log -r :null showing revision 0 as well
2099 issue3772: hg log -r :null showing revision 0 as well
2100
2100
2101 $ hg log -r :null
2101 $ hg log -r :null
2102 changeset: 0:65624cd9070a
2102 changeset: 0:65624cd9070a
2103 tag: tip
2103 tag: tip
2104 user: test
2104 user: test
2105 date: Thu Jan 01 00:00:00 1970 +0000
2105 date: Thu Jan 01 00:00:00 1970 +0000
2106 summary: a bunch of weird directories
2106 summary: a bunch of weird directories
2107
2107
2108 changeset: -1:000000000000
2108 changeset: -1:000000000000
2109 user:
2109 user:
2110 date: Thu Jan 01 00:00:00 1970 +0000
2110 date: Thu Jan 01 00:00:00 1970 +0000
2111
2111
2112 $ hg log -r null:null
2112 $ hg log -r null:null
2113 changeset: -1:000000000000
2113 changeset: -1:000000000000
2114 user:
2114 user:
2115 date: Thu Jan 01 00:00:00 1970 +0000
2115 date: Thu Jan 01 00:00:00 1970 +0000
2116
2116
2117 working-directory revision requires special treatment
2117 working-directory revision requires special treatment
2118
2118
2119 clean:
2119 clean:
2120
2120
2121 $ hg log -r 'wdir()' --debug
2121 $ hg log -r 'wdir()' --debug
2122 changeset: 2147483647:ffffffffffffffffffffffffffffffffffffffff
2122 changeset: 2147483647:ffffffffffffffffffffffffffffffffffffffff
2123 phase: draft
2123 phase: draft
2124 parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08
2124 parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08
2125 parent: -1:0000000000000000000000000000000000000000
2125 parent: -1:0000000000000000000000000000000000000000
2126 user: test
2126 user: test
2127 date: [A-Za-z0-9:+ ]+ (re)
2127 date: [A-Za-z0-9:+ ]+ (re)
2128 extra: branch=default
2128 extra: branch=default
2129
2129
2130 $ hg log -r 'wdir()' -p --stat
2130 $ hg log -r 'wdir()' -p --stat
2131 changeset: 2147483647:ffffffffffff
2131 changeset: 2147483647:ffffffffffff
2132 parent: 0:65624cd9070a
2132 parent: 0:65624cd9070a
2133 user: test
2133 user: test
2134 date: [A-Za-z0-9:+ ]+ (re)
2134 date: [A-Za-z0-9:+ ]+ (re)
2135
2135
2136
2136
2137
2137
2138
2138
2139 dirty:
2139 dirty:
2140
2140
2141 $ echo 2 >> d1/f1
2141 $ echo 2 >> d1/f1
2142 $ echo 2 > d1/f2
2142 $ echo 2 > d1/f2
2143 $ hg add d1/f2
2143 $ hg add d1/f2
2144 $ hg remove .d6/f1
2144 $ hg remove .d6/f1
2145 $ hg status
2145 $ hg status
2146 M d1/f1
2146 M d1/f1
2147 A d1/f2
2147 A d1/f2
2148 R .d6/f1
2148 R .d6/f1
2149
2149
2150 $ hg log -r 'wdir()'
2150 $ hg log -r 'wdir()'
2151 changeset: 2147483647:ffffffffffff
2151 changeset: 2147483647:ffffffffffff
2152 parent: 0:65624cd9070a
2152 parent: 0:65624cd9070a
2153 user: test
2153 user: test
2154 date: [A-Za-z0-9:+ ]+ (re)
2154 date: [A-Za-z0-9:+ ]+ (re)
2155
2155
2156 $ hg log -r 'wdir()' -q
2156 $ hg log -r 'wdir()' -q
2157 2147483647:ffffffffffff
2157 2147483647:ffffffffffff
2158
2158
2159 $ hg log -r 'wdir()' --debug
2159 $ hg log -r 'wdir()' --debug
2160 changeset: 2147483647:ffffffffffffffffffffffffffffffffffffffff
2160 changeset: 2147483647:ffffffffffffffffffffffffffffffffffffffff
2161 phase: draft
2161 phase: draft
2162 parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08
2162 parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08
2163 parent: -1:0000000000000000000000000000000000000000
2163 parent: -1:0000000000000000000000000000000000000000
2164 user: test
2164 user: test
2165 date: [A-Za-z0-9:+ ]+ (re)
2165 date: [A-Za-z0-9:+ ]+ (re)
2166 files: d1/f1
2166 files: d1/f1
2167 files+: d1/f2
2167 files+: d1/f2
2168 files-: .d6/f1
2168 files-: .d6/f1
2169 extra: branch=default
2169 extra: branch=default
2170
2170
2171 $ hg log -r 'wdir()' -p --stat --git
2171 $ hg log -r 'wdir()' -p --stat --git
2172 changeset: 2147483647:ffffffffffff
2172 changeset: 2147483647:ffffffffffff
2173 parent: 0:65624cd9070a
2173 parent: 0:65624cd9070a
2174 user: test
2174 user: test
2175 date: [A-Za-z0-9:+ ]+ (re)
2175 date: [A-Za-z0-9:+ ]+ (re)
2176
2176
2177 .d6/f1 | 1 -
2177 .d6/f1 | 1 -
2178 d1/f1 | 1 +
2178 d1/f1 | 1 +
2179 d1/f2 | 1 +
2179 d1/f2 | 1 +
2180 3 files changed, 2 insertions(+), 1 deletions(-)
2180 3 files changed, 2 insertions(+), 1 deletions(-)
2181
2181
2182 diff --git a/.d6/f1 b/.d6/f1
2182 diff --git a/.d6/f1 b/.d6/f1
2183 deleted file mode 100644
2183 deleted file mode 100644
2184 --- a/.d6/f1
2184 --- a/.d6/f1
2185 +++ /dev/null
2185 +++ /dev/null
2186 @@ -1,1 +0,0 @@
2186 @@ -1,1 +0,0 @@
2187 -1
2187 -1
2188 diff --git a/d1/f1 b/d1/f1
2188 diff --git a/d1/f1 b/d1/f1
2189 --- a/d1/f1
2189 --- a/d1/f1
2190 +++ b/d1/f1
2190 +++ b/d1/f1
2191 @@ -1,1 +1,2 @@
2191 @@ -1,1 +1,2 @@
2192 1
2192 1
2193 +2
2193 +2
2194 diff --git a/d1/f2 b/d1/f2
2194 diff --git a/d1/f2 b/d1/f2
2195 new file mode 100644
2195 new file mode 100644
2196 --- /dev/null
2196 --- /dev/null
2197 +++ b/d1/f2
2197 +++ b/d1/f2
2198 @@ -0,0 +1,1 @@
2198 @@ -0,0 +1,1 @@
2199 +2
2199 +2
2200
2200
2201 $ hg log -r 'wdir()' -Tjson
2201 $ hg log -r 'wdir()' -Tjson
2202 [
2202 [
2203 {
2203 {
2204 "rev": null,
2204 "bookmarks": [],
2205 "node": null,
2206 "branch": "default",
2205 "branch": "default",
2207 "phase": "draft",
2208 "user": "test",
2209 "date": [*, 0], (glob)
2206 "date": [*, 0], (glob)
2210 "desc": "",
2207 "desc": "",
2211 "bookmarks": [],
2208 "node": null,
2209 "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"],
2210 "phase": "draft",
2211 "rev": null,
2212 "tags": [],
2212 "tags": [],
2213 "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"]
2213 "user": "test"
2214 }
2214 }
2215 ]
2215 ]
2216
2216
2217 $ hg log -r 'wdir()' -Tjson -q
2217 $ hg log -r 'wdir()' -Tjson -q
2218 [
2218 [
2219 {
2219 {
2220 "rev": null,
2220 "node": null,
2221 "node": null
2221 "rev": null
2222 }
2222 }
2223 ]
2223 ]
2224
2224
2225 $ hg log -r 'wdir()' -Tjson --debug
2225 $ hg log -r 'wdir()' -Tjson --debug
2226 [
2226 [
2227 {
2227 {
2228 "rev": null,
2228 "added": ["d1/f2"],
2229 "node": null,
2229 "bookmarks": [],
2230 "branch": "default",
2230 "branch": "default",
2231 "phase": "draft",
2232 "user": "test",
2233 "date": [*, 0], (glob)
2231 "date": [*, 0], (glob)
2234 "desc": "",
2232 "desc": "",
2235 "bookmarks": [],
2233 "extra": {"branch": "default"},
2236 "tags": [],
2237 "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"],
2238 "manifest": null,
2234 "manifest": null,
2239 "extra": {"branch": "default"},
2240 "modified": ["d1/f1"],
2235 "modified": ["d1/f1"],
2241 "added": ["d1/f2"],
2236 "node": null,
2242 "removed": [".d6/f1"]
2237 "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"],
2238 "phase": "draft",
2239 "removed": [".d6/f1"],
2240 "rev": null,
2241 "tags": [],
2242 "user": "test"
2243 }
2243 }
2244 ]
2244 ]
2245
2245
2246 $ hg revert -aqC
2246 $ hg revert -aqC
2247
2247
2248 Check that adding an arbitrary name shows up in log automatically
2248 Check that adding an arbitrary name shows up in log automatically
2249
2249
2250 $ cat > ../names.py <<EOF
2250 $ cat > ../names.py <<EOF
2251 > """A small extension to test adding arbitrary names to a repo"""
2251 > """A small extension to test adding arbitrary names to a repo"""
2252 > from __future__ import absolute_import
2252 > from __future__ import absolute_import
2253 > from mercurial import namespaces
2253 > from mercurial import namespaces
2254 >
2254 >
2255 > def reposetup(ui, repo):
2255 > def reposetup(ui, repo):
2256 > foo = {b'foo': repo[0].node()}
2256 > foo = {b'foo': repo[0].node()}
2257 > names = lambda r: foo.keys()
2257 > names = lambda r: foo.keys()
2258 > namemap = lambda r, name: foo.get(name)
2258 > namemap = lambda r, name: foo.get(name)
2259 > nodemap = lambda r, node: [name for name, n in foo.items()
2259 > nodemap = lambda r, node: [name for name, n in foo.items()
2260 > if n == node]
2260 > if n == node]
2261 > ns = namespaces.namespace(
2261 > ns = namespaces.namespace(
2262 > b"bars", templatename=b"bar", logname=b"barlog",
2262 > b"bars", templatename=b"bar", logname=b"barlog",
2263 > colorname=b"barcolor", listnames=names, namemap=namemap,
2263 > colorname=b"barcolor", listnames=names, namemap=namemap,
2264 > nodemap=nodemap)
2264 > nodemap=nodemap)
2265 >
2265 >
2266 > repo.names.addnamespace(ns)
2266 > repo.names.addnamespace(ns)
2267 > EOF
2267 > EOF
2268
2268
2269 $ hg --config extensions.names=../names.py log -r 0
2269 $ hg --config extensions.names=../names.py log -r 0
2270 changeset: 0:65624cd9070a
2270 changeset: 0:65624cd9070a
2271 tag: tip
2271 tag: tip
2272 barlog: foo
2272 barlog: foo
2273 user: test
2273 user: test
2274 date: Thu Jan 01 00:00:00 1970 +0000
2274 date: Thu Jan 01 00:00:00 1970 +0000
2275 summary: a bunch of weird directories
2275 summary: a bunch of weird directories
2276
2276
2277 $ hg --config extensions.names=../names.py \
2277 $ hg --config extensions.names=../names.py \
2278 > --config extensions.color= --config color.log.barcolor=red \
2278 > --config extensions.color= --config color.log.barcolor=red \
2279 > --color=always log -r 0
2279 > --color=always log -r 0
2280 \x1b[0;33mchangeset: 0:65624cd9070a\x1b[0m (esc)
2280 \x1b[0;33mchangeset: 0:65624cd9070a\x1b[0m (esc)
2281 tag: tip
2281 tag: tip
2282 \x1b[0;31mbarlog: foo\x1b[0m (esc)
2282 \x1b[0;31mbarlog: foo\x1b[0m (esc)
2283 user: test
2283 user: test
2284 date: Thu Jan 01 00:00:00 1970 +0000
2284 date: Thu Jan 01 00:00:00 1970 +0000
2285 summary: a bunch of weird directories
2285 summary: a bunch of weird directories
2286
2286
2287 $ hg --config extensions.names=../names.py log -r 0 --template '{bars}\n'
2287 $ hg --config extensions.names=../names.py log -r 0 --template '{bars}\n'
2288 foo
2288 foo
2289
2289
2290 Templater parse errors:
2290 Templater parse errors:
2291
2291
2292 simple error
2292 simple error
2293 $ hg log -r . -T '{shortest(node}'
2293 $ hg log -r . -T '{shortest(node}'
2294 hg: parse error at 14: unexpected token: end
2294 hg: parse error at 14: unexpected token: end
2295 ({shortest(node}
2295 ({shortest(node}
2296 ^ here)
2296 ^ here)
2297 [255]
2297 [255]
2298
2298
2299 multi-line template with error
2299 multi-line template with error
2300 $ hg log -r . -T 'line 1
2300 $ hg log -r . -T 'line 1
2301 > line2
2301 > line2
2302 > {shortest(node}
2302 > {shortest(node}
2303 > line4\nline5'
2303 > line4\nline5'
2304 hg: parse error at 27: unexpected token: end
2304 hg: parse error at 27: unexpected token: end
2305 (line 1\nline2\n{shortest(node}\nline4\nline5
2305 (line 1\nline2\n{shortest(node}\nline4\nline5
2306 ^ here)
2306 ^ here)
2307 [255]
2307 [255]
2308
2308
2309 $ cd ..
2309 $ cd ..
2310
2310
2311 hg log -f dir across branches
2311 hg log -f dir across branches
2312
2312
2313 $ hg init acrossbranches
2313 $ hg init acrossbranches
2314 $ cd acrossbranches
2314 $ cd acrossbranches
2315 $ mkdir d
2315 $ mkdir d
2316 $ echo a > d/a && hg ci -Aqm a
2316 $ echo a > d/a && hg ci -Aqm a
2317 $ echo b > d/a && hg ci -Aqm b
2317 $ echo b > d/a && hg ci -Aqm b
2318 $ hg up -q 0
2318 $ hg up -q 0
2319 $ echo b > d/a && hg ci -Aqm c
2319 $ echo b > d/a && hg ci -Aqm c
2320 $ hg log -f d -T '{desc}' -G
2320 $ hg log -f d -T '{desc}' -G
2321 @ c
2321 @ c
2322 |
2322 |
2323 o a
2323 o a
2324
2324
2325 Ensure that largefiles doesn't interfere with following a normal file
2325 Ensure that largefiles doesn't interfere with following a normal file
2326 $ hg --config extensions.largefiles= log -f d -T '{desc}' -G
2326 $ hg --config extensions.largefiles= log -f d -T '{desc}' -G
2327 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
2327 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
2328 @ c
2328 @ c
2329 |
2329 |
2330 o a
2330 o a
2331
2331
2332 $ hg log -f d/a -T '{desc}' -G
2332 $ hg log -f d/a -T '{desc}' -G
2333 @ c
2333 @ c
2334 |
2334 |
2335 o a
2335 o a
2336
2336
2337 $ cd ..
2337 $ cd ..
2338
2338
2339 hg log -f with linkrev pointing to another branch
2339 hg log -f with linkrev pointing to another branch
2340 -------------------------------------------------
2340 -------------------------------------------------
2341
2341
2342 create history with a filerev whose linkrev points to another branch
2342 create history with a filerev whose linkrev points to another branch
2343
2343
2344 $ hg init branchedlinkrev
2344 $ hg init branchedlinkrev
2345 $ cd branchedlinkrev
2345 $ cd branchedlinkrev
2346 $ echo 1 > a
2346 $ echo 1 > a
2347 $ hg commit -Am 'content1'
2347 $ hg commit -Am 'content1'
2348 adding a
2348 adding a
2349 $ echo 2 > a
2349 $ echo 2 > a
2350 $ hg commit -m 'content2'
2350 $ hg commit -m 'content2'
2351 $ hg up --rev 'desc(content1)'
2351 $ hg up --rev 'desc(content1)'
2352 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2352 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2353 $ echo unrelated > unrelated
2353 $ echo unrelated > unrelated
2354 $ hg commit -Am 'unrelated'
2354 $ hg commit -Am 'unrelated'
2355 adding unrelated
2355 adding unrelated
2356 created new head
2356 created new head
2357 $ hg graft -r 'desc(content2)'
2357 $ hg graft -r 'desc(content2)'
2358 grafting 1:2294ae80ad84 "content2"
2358 grafting 1:2294ae80ad84 "content2"
2359 $ echo 3 > a
2359 $ echo 3 > a
2360 $ hg commit -m 'content3'
2360 $ hg commit -m 'content3'
2361 $ hg log -G
2361 $ hg log -G
2362 @ changeset: 4:50b9b36e9c5d
2362 @ changeset: 4:50b9b36e9c5d
2363 | tag: tip
2363 | tag: tip
2364 | user: test
2364 | user: test
2365 | date: Thu Jan 01 00:00:00 1970 +0000
2365 | date: Thu Jan 01 00:00:00 1970 +0000
2366 | summary: content3
2366 | summary: content3
2367 |
2367 |
2368 o changeset: 3:15b2327059e5
2368 o changeset: 3:15b2327059e5
2369 | user: test
2369 | user: test
2370 | date: Thu Jan 01 00:00:00 1970 +0000
2370 | date: Thu Jan 01 00:00:00 1970 +0000
2371 | summary: content2
2371 | summary: content2
2372 |
2372 |
2373 o changeset: 2:2029acd1168c
2373 o changeset: 2:2029acd1168c
2374 | parent: 0:ae0a3c9f9e95
2374 | parent: 0:ae0a3c9f9e95
2375 | user: test
2375 | user: test
2376 | date: Thu Jan 01 00:00:00 1970 +0000
2376 | date: Thu Jan 01 00:00:00 1970 +0000
2377 | summary: unrelated
2377 | summary: unrelated
2378 |
2378 |
2379 | o changeset: 1:2294ae80ad84
2379 | o changeset: 1:2294ae80ad84
2380 |/ user: test
2380 |/ user: test
2381 | date: Thu Jan 01 00:00:00 1970 +0000
2381 | date: Thu Jan 01 00:00:00 1970 +0000
2382 | summary: content2
2382 | summary: content2
2383 |
2383 |
2384 o changeset: 0:ae0a3c9f9e95
2384 o changeset: 0:ae0a3c9f9e95
2385 user: test
2385 user: test
2386 date: Thu Jan 01 00:00:00 1970 +0000
2386 date: Thu Jan 01 00:00:00 1970 +0000
2387 summary: content1
2387 summary: content1
2388
2388
2389
2389
2390 log -f on the file should list the graft result.
2390 log -f on the file should list the graft result.
2391
2391
2392 $ hg log -Gf a
2392 $ hg log -Gf a
2393 @ changeset: 4:50b9b36e9c5d
2393 @ changeset: 4:50b9b36e9c5d
2394 | tag: tip
2394 | tag: tip
2395 | user: test
2395 | user: test
2396 | date: Thu Jan 01 00:00:00 1970 +0000
2396 | date: Thu Jan 01 00:00:00 1970 +0000
2397 | summary: content3
2397 | summary: content3
2398 |
2398 |
2399 o changeset: 3:15b2327059e5
2399 o changeset: 3:15b2327059e5
2400 : user: test
2400 : user: test
2401 : date: Thu Jan 01 00:00:00 1970 +0000
2401 : date: Thu Jan 01 00:00:00 1970 +0000
2402 : summary: content2
2402 : summary: content2
2403 :
2403 :
2404 o changeset: 0:ae0a3c9f9e95
2404 o changeset: 0:ae0a3c9f9e95
2405 user: test
2405 user: test
2406 date: Thu Jan 01 00:00:00 1970 +0000
2406 date: Thu Jan 01 00:00:00 1970 +0000
2407 summary: content1
2407 summary: content1
2408
2408
2409
2409
2410 plain log lists the original version
2410 plain log lists the original version
2411 (XXX we should probably list both)
2411 (XXX we should probably list both)
2412
2412
2413 $ hg log -G a
2413 $ hg log -G a
2414 @ changeset: 4:50b9b36e9c5d
2414 @ changeset: 4:50b9b36e9c5d
2415 : tag: tip
2415 : tag: tip
2416 : user: test
2416 : user: test
2417 : date: Thu Jan 01 00:00:00 1970 +0000
2417 : date: Thu Jan 01 00:00:00 1970 +0000
2418 : summary: content3
2418 : summary: content3
2419 :
2419 :
2420 : o changeset: 1:2294ae80ad84
2420 : o changeset: 1:2294ae80ad84
2421 :/ user: test
2421 :/ user: test
2422 : date: Thu Jan 01 00:00:00 1970 +0000
2422 : date: Thu Jan 01 00:00:00 1970 +0000
2423 : summary: content2
2423 : summary: content2
2424 :
2424 :
2425 o changeset: 0:ae0a3c9f9e95
2425 o changeset: 0:ae0a3c9f9e95
2426 user: test
2426 user: test
2427 date: Thu Jan 01 00:00:00 1970 +0000
2427 date: Thu Jan 01 00:00:00 1970 +0000
2428 summary: content1
2428 summary: content1
2429
2429
2430
2430
2431 hg log -f from the grafted changeset
2431 hg log -f from the grafted changeset
2432 (The bootstrap should properly take the topology in account)
2432 (The bootstrap should properly take the topology in account)
2433
2433
2434 $ hg up 'desc(content3)^'
2434 $ hg up 'desc(content3)^'
2435 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2435 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2436 $ hg log -Gf a
2436 $ hg log -Gf a
2437 @ changeset: 3:15b2327059e5
2437 @ changeset: 3:15b2327059e5
2438 : user: test
2438 : user: test
2439 : date: Thu Jan 01 00:00:00 1970 +0000
2439 : date: Thu Jan 01 00:00:00 1970 +0000
2440 : summary: content2
2440 : summary: content2
2441 :
2441 :
2442 o changeset: 0:ae0a3c9f9e95
2442 o changeset: 0:ae0a3c9f9e95
2443 user: test
2443 user: test
2444 date: Thu Jan 01 00:00:00 1970 +0000
2444 date: Thu Jan 01 00:00:00 1970 +0000
2445 summary: content1
2445 summary: content1
2446
2446
2447
2447
2448 Test that we use the first non-hidden changeset in that case.
2448 Test that we use the first non-hidden changeset in that case.
2449
2449
2450 (hide the changeset)
2450 (hide the changeset)
2451
2451
2452 $ hg log -T '{node}\n' -r 1
2452 $ hg log -T '{node}\n' -r 1
2453 2294ae80ad8447bc78383182eeac50cb049df623
2453 2294ae80ad8447bc78383182eeac50cb049df623
2454 $ hg debugobsolete 2294ae80ad8447bc78383182eeac50cb049df623
2454 $ hg debugobsolete 2294ae80ad8447bc78383182eeac50cb049df623
2455 obsoleted 1 changesets
2455 obsoleted 1 changesets
2456 $ hg log -G
2456 $ hg log -G
2457 o changeset: 4:50b9b36e9c5d
2457 o changeset: 4:50b9b36e9c5d
2458 | tag: tip
2458 | tag: tip
2459 | user: test
2459 | user: test
2460 | date: Thu Jan 01 00:00:00 1970 +0000
2460 | date: Thu Jan 01 00:00:00 1970 +0000
2461 | summary: content3
2461 | summary: content3
2462 |
2462 |
2463 @ changeset: 3:15b2327059e5
2463 @ changeset: 3:15b2327059e5
2464 | user: test
2464 | user: test
2465 | date: Thu Jan 01 00:00:00 1970 +0000
2465 | date: Thu Jan 01 00:00:00 1970 +0000
2466 | summary: content2
2466 | summary: content2
2467 |
2467 |
2468 o changeset: 2:2029acd1168c
2468 o changeset: 2:2029acd1168c
2469 | parent: 0:ae0a3c9f9e95
2469 | parent: 0:ae0a3c9f9e95
2470 | user: test
2470 | user: test
2471 | date: Thu Jan 01 00:00:00 1970 +0000
2471 | date: Thu Jan 01 00:00:00 1970 +0000
2472 | summary: unrelated
2472 | summary: unrelated
2473 |
2473 |
2474 o changeset: 0:ae0a3c9f9e95
2474 o changeset: 0:ae0a3c9f9e95
2475 user: test
2475 user: test
2476 date: Thu Jan 01 00:00:00 1970 +0000
2476 date: Thu Jan 01 00:00:00 1970 +0000
2477 summary: content1
2477 summary: content1
2478
2478
2479
2479
2480 Check that log on the file does not drop the file revision.
2480 Check that log on the file does not drop the file revision.
2481
2481
2482 $ hg log -G a
2482 $ hg log -G a
2483 o changeset: 4:50b9b36e9c5d
2483 o changeset: 4:50b9b36e9c5d
2484 | tag: tip
2484 | tag: tip
2485 | user: test
2485 | user: test
2486 | date: Thu Jan 01 00:00:00 1970 +0000
2486 | date: Thu Jan 01 00:00:00 1970 +0000
2487 | summary: content3
2487 | summary: content3
2488 |
2488 |
2489 @ changeset: 3:15b2327059e5
2489 @ changeset: 3:15b2327059e5
2490 : user: test
2490 : user: test
2491 : date: Thu Jan 01 00:00:00 1970 +0000
2491 : date: Thu Jan 01 00:00:00 1970 +0000
2492 : summary: content2
2492 : summary: content2
2493 :
2493 :
2494 o changeset: 0:ae0a3c9f9e95
2494 o changeset: 0:ae0a3c9f9e95
2495 user: test
2495 user: test
2496 date: Thu Jan 01 00:00:00 1970 +0000
2496 date: Thu Jan 01 00:00:00 1970 +0000
2497 summary: content1
2497 summary: content1
2498
2498
2499
2499
2500 Even when a head revision is linkrev-shadowed.
2500 Even when a head revision is linkrev-shadowed.
2501
2501
2502 $ hg log -T '{node}\n' -r 4
2502 $ hg log -T '{node}\n' -r 4
2503 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
2503 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
2504 $ hg debugobsolete 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
2504 $ hg debugobsolete 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
2505 obsoleted 1 changesets
2505 obsoleted 1 changesets
2506 $ hg log -G a
2506 $ hg log -G a
2507 @ changeset: 3:15b2327059e5
2507 @ changeset: 3:15b2327059e5
2508 : tag: tip
2508 : tag: tip
2509 : user: test
2509 : user: test
2510 : date: Thu Jan 01 00:00:00 1970 +0000
2510 : date: Thu Jan 01 00:00:00 1970 +0000
2511 : summary: content2
2511 : summary: content2
2512 :
2512 :
2513 o changeset: 0:ae0a3c9f9e95
2513 o changeset: 0:ae0a3c9f9e95
2514 user: test
2514 user: test
2515 date: Thu Jan 01 00:00:00 1970 +0000
2515 date: Thu Jan 01 00:00:00 1970 +0000
2516 summary: content1
2516 summary: content1
2517
2517
2518
2518
2519 $ cd ..
2519 $ cd ..
2520
2520
2521 Even when the file revision is missing from some head:
2521 Even when the file revision is missing from some head:
2522
2522
2523 $ hg init issue4490
2523 $ hg init issue4490
2524 $ cd issue4490
2524 $ cd issue4490
2525 $ echo '[experimental]' >> .hg/hgrc
2525 $ echo '[experimental]' >> .hg/hgrc
2526 $ echo 'evolution.createmarkers=True' >> .hg/hgrc
2526 $ echo 'evolution.createmarkers=True' >> .hg/hgrc
2527 $ echo a > a
2527 $ echo a > a
2528 $ hg ci -Am0
2528 $ hg ci -Am0
2529 adding a
2529 adding a
2530 $ echo b > b
2530 $ echo b > b
2531 $ hg ci -Am1
2531 $ hg ci -Am1
2532 adding b
2532 adding b
2533 $ echo B > b
2533 $ echo B > b
2534 $ hg ci --amend -m 1
2534 $ hg ci --amend -m 1
2535 $ hg up 0
2535 $ hg up 0
2536 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2536 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2537 $ echo c > c
2537 $ echo c > c
2538 $ hg ci -Am2
2538 $ hg ci -Am2
2539 adding c
2539 adding c
2540 created new head
2540 created new head
2541 $ hg up 'head() and not .'
2541 $ hg up 'head() and not .'
2542 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
2542 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
2543 $ hg log -G
2543 $ hg log -G
2544 o changeset: 3:db815d6d32e6
2544 o changeset: 3:db815d6d32e6
2545 | tag: tip
2545 | tag: tip
2546 | parent: 0:f7b1eb17ad24
2546 | parent: 0:f7b1eb17ad24
2547 | user: test
2547 | user: test
2548 | date: Thu Jan 01 00:00:00 1970 +0000
2548 | date: Thu Jan 01 00:00:00 1970 +0000
2549 | summary: 2
2549 | summary: 2
2550 |
2550 |
2551 | @ changeset: 2:9bc8ce7f9356
2551 | @ changeset: 2:9bc8ce7f9356
2552 |/ parent: 0:f7b1eb17ad24
2552 |/ parent: 0:f7b1eb17ad24
2553 | user: test
2553 | user: test
2554 | date: Thu Jan 01 00:00:00 1970 +0000
2554 | date: Thu Jan 01 00:00:00 1970 +0000
2555 | summary: 1
2555 | summary: 1
2556 |
2556 |
2557 o changeset: 0:f7b1eb17ad24
2557 o changeset: 0:f7b1eb17ad24
2558 user: test
2558 user: test
2559 date: Thu Jan 01 00:00:00 1970 +0000
2559 date: Thu Jan 01 00:00:00 1970 +0000
2560 summary: 0
2560 summary: 0
2561
2561
2562 $ hg log -f -G b
2562 $ hg log -f -G b
2563 @ changeset: 2:9bc8ce7f9356
2563 @ changeset: 2:9bc8ce7f9356
2564 | parent: 0:f7b1eb17ad24
2564 | parent: 0:f7b1eb17ad24
2565 ~ user: test
2565 ~ user: test
2566 date: Thu Jan 01 00:00:00 1970 +0000
2566 date: Thu Jan 01 00:00:00 1970 +0000
2567 summary: 1
2567 summary: 1
2568
2568
2569 $ hg log -G b
2569 $ hg log -G b
2570 @ changeset: 2:9bc8ce7f9356
2570 @ changeset: 2:9bc8ce7f9356
2571 | parent: 0:f7b1eb17ad24
2571 | parent: 0:f7b1eb17ad24
2572 ~ user: test
2572 ~ user: test
2573 date: Thu Jan 01 00:00:00 1970 +0000
2573 date: Thu Jan 01 00:00:00 1970 +0000
2574 summary: 1
2574 summary: 1
2575
2575
2576 $ cd ..
2576 $ cd ..
2577
2577
2578 Check proper report when the manifest changes but not the file issue4499
2578 Check proper report when the manifest changes but not the file issue4499
2579 ------------------------------------------------------------------------
2579 ------------------------------------------------------------------------
2580
2580
2581 $ hg init issue4499
2581 $ hg init issue4499
2582 $ cd issue4499
2582 $ cd issue4499
2583 $ for f in A B C D F E G H I J K L M N O P Q R S T U; do
2583 $ for f in A B C D F E G H I J K L M N O P Q R S T U; do
2584 > echo 1 > $f;
2584 > echo 1 > $f;
2585 > hg add $f;
2585 > hg add $f;
2586 > done
2586 > done
2587 $ hg commit -m 'A1B1C1'
2587 $ hg commit -m 'A1B1C1'
2588 $ echo 2 > A
2588 $ echo 2 > A
2589 $ echo 2 > B
2589 $ echo 2 > B
2590 $ echo 2 > C
2590 $ echo 2 > C
2591 $ hg commit -m 'A2B2C2'
2591 $ hg commit -m 'A2B2C2'
2592 $ hg up 0
2592 $ hg up 0
2593 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
2593 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
2594 $ echo 3 > A
2594 $ echo 3 > A
2595 $ echo 2 > B
2595 $ echo 2 > B
2596 $ echo 2 > C
2596 $ echo 2 > C
2597 $ hg commit -m 'A3B2C2'
2597 $ hg commit -m 'A3B2C2'
2598 created new head
2598 created new head
2599
2599
2600 $ hg log -G
2600 $ hg log -G
2601 @ changeset: 2:fe5fc3d0eb17
2601 @ changeset: 2:fe5fc3d0eb17
2602 | tag: tip
2602 | tag: tip
2603 | parent: 0:abf4f0e38563
2603 | parent: 0:abf4f0e38563
2604 | user: test
2604 | user: test
2605 | date: Thu Jan 01 00:00:00 1970 +0000
2605 | date: Thu Jan 01 00:00:00 1970 +0000
2606 | summary: A3B2C2
2606 | summary: A3B2C2
2607 |
2607 |
2608 | o changeset: 1:07dcc6b312c0
2608 | o changeset: 1:07dcc6b312c0
2609 |/ user: test
2609 |/ user: test
2610 | date: Thu Jan 01 00:00:00 1970 +0000
2610 | date: Thu Jan 01 00:00:00 1970 +0000
2611 | summary: A2B2C2
2611 | summary: A2B2C2
2612 |
2612 |
2613 o changeset: 0:abf4f0e38563
2613 o changeset: 0:abf4f0e38563
2614 user: test
2614 user: test
2615 date: Thu Jan 01 00:00:00 1970 +0000
2615 date: Thu Jan 01 00:00:00 1970 +0000
2616 summary: A1B1C1
2616 summary: A1B1C1
2617
2617
2618
2618
2619 Log -f on B should reports current changesets
2619 Log -f on B should reports current changesets
2620
2620
2621 $ hg log -fG B
2621 $ hg log -fG B
2622 @ changeset: 2:fe5fc3d0eb17
2622 @ changeset: 2:fe5fc3d0eb17
2623 | tag: tip
2623 | tag: tip
2624 | parent: 0:abf4f0e38563
2624 | parent: 0:abf4f0e38563
2625 | user: test
2625 | user: test
2626 | date: Thu Jan 01 00:00:00 1970 +0000
2626 | date: Thu Jan 01 00:00:00 1970 +0000
2627 | summary: A3B2C2
2627 | summary: A3B2C2
2628 |
2628 |
2629 o changeset: 0:abf4f0e38563
2629 o changeset: 0:abf4f0e38563
2630 user: test
2630 user: test
2631 date: Thu Jan 01 00:00:00 1970 +0000
2631 date: Thu Jan 01 00:00:00 1970 +0000
2632 summary: A1B1C1
2632 summary: A1B1C1
2633
2633
2634 $ cd ..
2634 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now