##// END OF EJS Templates
templatekw: add p1/p2 keywords which switches the current ctx...
Yuya Nishihara -
r40510:539efc88 default
parent child Browse files
Show More
@@ -1,860 +1,874 b''
1 # templatekw.py - common changeset template keywords
1 # templatekw.py - common changeset template keywords
2 #
2 #
3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 from .i18n import _
10 from .i18n import _
11 from .node import (
11 from .node import (
12 hex,
12 hex,
13 nullid,
13 nullid,
14 wdirid,
14 wdirid,
15 wdirrev,
15 wdirrev,
16 )
16 )
17
17
18 from . import (
18 from . import (
19 diffutil,
19 diffutil,
20 encoding,
20 encoding,
21 error,
21 error,
22 hbisect,
22 hbisect,
23 i18n,
23 i18n,
24 obsutil,
24 obsutil,
25 patch,
25 patch,
26 pycompat,
26 pycompat,
27 registrar,
27 registrar,
28 scmutil,
28 scmutil,
29 templateutil,
29 templateutil,
30 util,
30 util,
31 )
31 )
32 from .utils import (
32 from .utils import (
33 stringutil,
33 stringutil,
34 )
34 )
35
35
36 _hybrid = templateutil.hybrid
36 _hybrid = templateutil.hybrid
37 hybriddict = templateutil.hybriddict
37 hybriddict = templateutil.hybriddict
38 hybridlist = templateutil.hybridlist
38 hybridlist = templateutil.hybridlist
39 compatdict = templateutil.compatdict
39 compatdict = templateutil.compatdict
40 compatlist = templateutil.compatlist
40 compatlist = templateutil.compatlist
41 _showcompatlist = templateutil._showcompatlist
41 _showcompatlist = templateutil._showcompatlist
42
42
43 def getlatesttags(context, mapping, pattern=None):
43 def getlatesttags(context, mapping, pattern=None):
44 '''return date, distance and name for the latest tag of rev'''
44 '''return date, distance and name for the latest tag of rev'''
45 repo = context.resource(mapping, 'repo')
45 repo = context.resource(mapping, 'repo')
46 ctx = context.resource(mapping, 'ctx')
46 ctx = context.resource(mapping, 'ctx')
47 cache = context.resource(mapping, 'cache')
47 cache = context.resource(mapping, 'cache')
48
48
49 cachename = 'latesttags'
49 cachename = 'latesttags'
50 if pattern is not None:
50 if pattern is not None:
51 cachename += '-' + pattern
51 cachename += '-' + pattern
52 match = stringutil.stringmatcher(pattern)[2]
52 match = stringutil.stringmatcher(pattern)[2]
53 else:
53 else:
54 match = util.always
54 match = util.always
55
55
56 if cachename not in cache:
56 if cachename not in cache:
57 # Cache mapping from rev to a tuple with tag date, tag
57 # Cache mapping from rev to a tuple with tag date, tag
58 # distance and tag name
58 # distance and tag name
59 cache[cachename] = {-1: (0, 0, ['null'])}
59 cache[cachename] = {-1: (0, 0, ['null'])}
60 latesttags = cache[cachename]
60 latesttags = cache[cachename]
61
61
62 rev = ctx.rev()
62 rev = ctx.rev()
63 todo = [rev]
63 todo = [rev]
64 while todo:
64 while todo:
65 rev = todo.pop()
65 rev = todo.pop()
66 if rev in latesttags:
66 if rev in latesttags:
67 continue
67 continue
68 ctx = repo[rev]
68 ctx = repo[rev]
69 tags = [t for t in ctx.tags()
69 tags = [t for t in ctx.tags()
70 if (repo.tagtype(t) and repo.tagtype(t) != 'local'
70 if (repo.tagtype(t) and repo.tagtype(t) != 'local'
71 and match(t))]
71 and match(t))]
72 if tags:
72 if tags:
73 latesttags[rev] = ctx.date()[0], 0, [t for t in sorted(tags)]
73 latesttags[rev] = ctx.date()[0], 0, [t for t in sorted(tags)]
74 continue
74 continue
75 try:
75 try:
76 ptags = [latesttags[p.rev()] for p in ctx.parents()]
76 ptags = [latesttags[p.rev()] for p in ctx.parents()]
77 if len(ptags) > 1:
77 if len(ptags) > 1:
78 if ptags[0][2] == ptags[1][2]:
78 if ptags[0][2] == ptags[1][2]:
79 # The tuples are laid out so the right one can be found by
79 # The tuples are laid out so the right one can be found by
80 # comparison in this case.
80 # comparison in this case.
81 pdate, pdist, ptag = max(ptags)
81 pdate, pdist, ptag = max(ptags)
82 else:
82 else:
83 def key(x):
83 def key(x):
84 changessincetag = len(repo.revs('only(%d, %s)',
84 changessincetag = len(repo.revs('only(%d, %s)',
85 ctx.rev(), x[2][0]))
85 ctx.rev(), x[2][0]))
86 # Smallest number of changes since tag wins. Date is
86 # Smallest number of changes since tag wins. Date is
87 # used as tiebreaker.
87 # used as tiebreaker.
88 return [-changessincetag, x[0]]
88 return [-changessincetag, x[0]]
89 pdate, pdist, ptag = max(ptags, key=key)
89 pdate, pdist, ptag = max(ptags, key=key)
90 else:
90 else:
91 pdate, pdist, ptag = ptags[0]
91 pdate, pdist, ptag = ptags[0]
92 except KeyError:
92 except KeyError:
93 # Cache miss - recurse
93 # Cache miss - recurse
94 todo.append(rev)
94 todo.append(rev)
95 todo.extend(p.rev() for p in ctx.parents())
95 todo.extend(p.rev() for p in ctx.parents())
96 continue
96 continue
97 latesttags[rev] = pdate, pdist + 1, ptag
97 latesttags[rev] = pdate, pdist + 1, ptag
98 return latesttags[rev]
98 return latesttags[rev]
99
99
100 def getrenamedfn(repo, endrev=None):
100 def getrenamedfn(repo, endrev=None):
101 rcache = {}
101 rcache = {}
102 if endrev is None:
102 if endrev is None:
103 endrev = len(repo)
103 endrev = len(repo)
104
104
105 def getrenamed(fn, rev):
105 def getrenamed(fn, rev):
106 '''looks up all renames for a file (up to endrev) the first
106 '''looks up all renames for a file (up to endrev) the first
107 time the file is given. It indexes on the changerev and only
107 time the file is given. It indexes on the changerev and only
108 parses the manifest if linkrev != changerev.
108 parses the manifest if linkrev != changerev.
109 Returns rename info for fn at changerev rev.'''
109 Returns rename info for fn at changerev rev.'''
110 if fn not in rcache:
110 if fn not in rcache:
111 rcache[fn] = {}
111 rcache[fn] = {}
112 fl = repo.file(fn)
112 fl = repo.file(fn)
113 for i in fl:
113 for i in fl:
114 lr = fl.linkrev(i)
114 lr = fl.linkrev(i)
115 renamed = fl.renamed(fl.node(i))
115 renamed = fl.renamed(fl.node(i))
116 rcache[fn][lr] = renamed and renamed[0]
116 rcache[fn][lr] = renamed and renamed[0]
117 if lr >= endrev:
117 if lr >= endrev:
118 break
118 break
119 if rev in rcache[fn]:
119 if rev in rcache[fn]:
120 return rcache[fn][rev]
120 return rcache[fn][rev]
121
121
122 # If linkrev != rev (i.e. rev not found in rcache) fallback to
122 # If linkrev != rev (i.e. rev not found in rcache) fallback to
123 # filectx logic.
123 # filectx logic.
124 try:
124 try:
125 renamed = repo[rev][fn].renamed()
125 renamed = repo[rev][fn].renamed()
126 return renamed and renamed[0]
126 return renamed and renamed[0]
127 except error.LookupError:
127 except error.LookupError:
128 return None
128 return None
129
129
130 return getrenamed
130 return getrenamed
131
131
132 def getlogcolumns():
132 def getlogcolumns():
133 """Return a dict of log column labels"""
133 """Return a dict of log column labels"""
134 _ = pycompat.identity # temporarily disable gettext
134 _ = pycompat.identity # temporarily disable gettext
135 # i18n: column positioning for "hg log"
135 # i18n: column positioning for "hg log"
136 columns = _('bookmark: %s\n'
136 columns = _('bookmark: %s\n'
137 'branch: %s\n'
137 'branch: %s\n'
138 'changeset: %s\n'
138 'changeset: %s\n'
139 'copies: %s\n'
139 'copies: %s\n'
140 'date: %s\n'
140 'date: %s\n'
141 'extra: %s=%s\n'
141 'extra: %s=%s\n'
142 'files+: %s\n'
142 'files+: %s\n'
143 'files-: %s\n'
143 'files-: %s\n'
144 'files: %s\n'
144 'files: %s\n'
145 'instability: %s\n'
145 'instability: %s\n'
146 'manifest: %s\n'
146 'manifest: %s\n'
147 'obsolete: %s\n'
147 'obsolete: %s\n'
148 'parent: %s\n'
148 'parent: %s\n'
149 'phase: %s\n'
149 'phase: %s\n'
150 'summary: %s\n'
150 'summary: %s\n'
151 'tag: %s\n'
151 'tag: %s\n'
152 'user: %s\n')
152 'user: %s\n')
153 return dict(zip([s.split(':', 1)[0] for s in columns.splitlines()],
153 return dict(zip([s.split(':', 1)[0] for s in columns.splitlines()],
154 i18n._(columns).splitlines(True)))
154 i18n._(columns).splitlines(True)))
155
155
156 # basic internal templates
156 # basic internal templates
157 _changeidtmpl = '{rev}:{node|formatnode}'
157 _changeidtmpl = '{rev}:{node|formatnode}'
158
158
159 # default templates internally used for rendering of lists
159 # default templates internally used for rendering of lists
160 defaulttempl = {
160 defaulttempl = {
161 'parent': _changeidtmpl + ' ',
161 'parent': _changeidtmpl + ' ',
162 'manifest': _changeidtmpl,
162 'manifest': _changeidtmpl,
163 'file_copy': '{name} ({source})',
163 'file_copy': '{name} ({source})',
164 'envvar': '{key}={value}',
164 'envvar': '{key}={value}',
165 'extra': '{key}={value|stringescape}'
165 'extra': '{key}={value|stringescape}'
166 }
166 }
167 # filecopy is preserved for compatibility reasons
167 # filecopy is preserved for compatibility reasons
168 defaulttempl['filecopy'] = defaulttempl['file_copy']
168 defaulttempl['filecopy'] = defaulttempl['file_copy']
169
169
170 # keywords are callables (see registrar.templatekeyword for details)
170 # keywords are callables (see registrar.templatekeyword for details)
171 keywords = {}
171 keywords = {}
172 templatekeyword = registrar.templatekeyword(keywords)
172 templatekeyword = registrar.templatekeyword(keywords)
173
173
174 @templatekeyword('author', requires={'ctx'})
174 @templatekeyword('author', requires={'ctx'})
175 def showauthor(context, mapping):
175 def showauthor(context, mapping):
176 """Alias for ``{user}``"""
176 """Alias for ``{user}``"""
177 return showuser(context, mapping)
177 return showuser(context, mapping)
178
178
179 @templatekeyword('bisect', requires={'repo', 'ctx'})
179 @templatekeyword('bisect', requires={'repo', 'ctx'})
180 def showbisect(context, mapping):
180 def showbisect(context, mapping):
181 """String. The changeset bisection status."""
181 """String. The changeset bisection status."""
182 repo = context.resource(mapping, 'repo')
182 repo = context.resource(mapping, 'repo')
183 ctx = context.resource(mapping, 'ctx')
183 ctx = context.resource(mapping, 'ctx')
184 return hbisect.label(repo, ctx.node())
184 return hbisect.label(repo, ctx.node())
185
185
186 @templatekeyword('branch', requires={'ctx'})
186 @templatekeyword('branch', requires={'ctx'})
187 def showbranch(context, mapping):
187 def showbranch(context, mapping):
188 """String. The name of the branch on which the changeset was
188 """String. The name of the branch on which the changeset was
189 committed.
189 committed.
190 """
190 """
191 ctx = context.resource(mapping, 'ctx')
191 ctx = context.resource(mapping, 'ctx')
192 return ctx.branch()
192 return ctx.branch()
193
193
194 @templatekeyword('branches', requires={'ctx'})
194 @templatekeyword('branches', requires={'ctx'})
195 def showbranches(context, mapping):
195 def showbranches(context, mapping):
196 """List of strings. The name of the branch on which the
196 """List of strings. The name of the branch on which the
197 changeset was committed. Will be empty if the branch name was
197 changeset was committed. Will be empty if the branch name was
198 default. (DEPRECATED)
198 default. (DEPRECATED)
199 """
199 """
200 ctx = context.resource(mapping, 'ctx')
200 ctx = context.resource(mapping, 'ctx')
201 branch = ctx.branch()
201 branch = ctx.branch()
202 if branch != 'default':
202 if branch != 'default':
203 return compatlist(context, mapping, 'branch', [branch],
203 return compatlist(context, mapping, 'branch', [branch],
204 plural='branches')
204 plural='branches')
205 return compatlist(context, mapping, 'branch', [], plural='branches')
205 return compatlist(context, mapping, 'branch', [], plural='branches')
206
206
207 @templatekeyword('bookmarks', requires={'repo', 'ctx'})
207 @templatekeyword('bookmarks', requires={'repo', 'ctx'})
208 def showbookmarks(context, mapping):
208 def showbookmarks(context, mapping):
209 """List of strings. Any bookmarks associated with the
209 """List of strings. Any bookmarks associated with the
210 changeset. Also sets 'active', the name of the active bookmark.
210 changeset. Also sets 'active', the name of the active bookmark.
211 """
211 """
212 repo = context.resource(mapping, 'repo')
212 repo = context.resource(mapping, 'repo')
213 ctx = context.resource(mapping, 'ctx')
213 ctx = context.resource(mapping, 'ctx')
214 bookmarks = ctx.bookmarks()
214 bookmarks = ctx.bookmarks()
215 active = repo._activebookmark
215 active = repo._activebookmark
216 makemap = lambda v: {'bookmark': v, 'active': active, 'current': active}
216 makemap = lambda v: {'bookmark': v, 'active': active, 'current': active}
217 f = _showcompatlist(context, mapping, 'bookmark', bookmarks)
217 f = _showcompatlist(context, mapping, 'bookmark', bookmarks)
218 return _hybrid(f, bookmarks, makemap, pycompat.identity)
218 return _hybrid(f, bookmarks, makemap, pycompat.identity)
219
219
220 @templatekeyword('children', requires={'ctx'})
220 @templatekeyword('children', requires={'ctx'})
221 def showchildren(context, mapping):
221 def showchildren(context, mapping):
222 """List of strings. The children of the changeset."""
222 """List of strings. The children of the changeset."""
223 ctx = context.resource(mapping, 'ctx')
223 ctx = context.resource(mapping, 'ctx')
224 childrevs = ['%d:%s' % (cctx.rev(), cctx) for cctx in ctx.children()]
224 childrevs = ['%d:%s' % (cctx.rev(), cctx) for cctx in ctx.children()]
225 return compatlist(context, mapping, 'children', childrevs, element='child')
225 return compatlist(context, mapping, 'children', childrevs, element='child')
226
226
227 # Deprecated, but kept alive for help generation a purpose.
227 # Deprecated, but kept alive for help generation a purpose.
228 @templatekeyword('currentbookmark', requires={'repo', 'ctx'})
228 @templatekeyword('currentbookmark', requires={'repo', 'ctx'})
229 def showcurrentbookmark(context, mapping):
229 def showcurrentbookmark(context, mapping):
230 """String. The active bookmark, if it is associated with the changeset.
230 """String. The active bookmark, if it is associated with the changeset.
231 (DEPRECATED)"""
231 (DEPRECATED)"""
232 return showactivebookmark(context, mapping)
232 return showactivebookmark(context, mapping)
233
233
234 @templatekeyword('activebookmark', requires={'repo', 'ctx'})
234 @templatekeyword('activebookmark', requires={'repo', 'ctx'})
235 def showactivebookmark(context, mapping):
235 def showactivebookmark(context, mapping):
236 """String. The active bookmark, if it is associated with the changeset."""
236 """String. The active bookmark, if it is associated with the changeset."""
237 repo = context.resource(mapping, 'repo')
237 repo = context.resource(mapping, 'repo')
238 ctx = context.resource(mapping, 'ctx')
238 ctx = context.resource(mapping, 'ctx')
239 active = repo._activebookmark
239 active = repo._activebookmark
240 if active and active in ctx.bookmarks():
240 if active and active in ctx.bookmarks():
241 return active
241 return active
242 return ''
242 return ''
243
243
244 @templatekeyword('date', requires={'ctx'})
244 @templatekeyword('date', requires={'ctx'})
245 def showdate(context, mapping):
245 def showdate(context, mapping):
246 """Date information. The date when the changeset was committed."""
246 """Date information. The date when the changeset was committed."""
247 ctx = context.resource(mapping, 'ctx')
247 ctx = context.resource(mapping, 'ctx')
248 # the default string format is '<float(unixtime)><tzoffset>' because
248 # the default string format is '<float(unixtime)><tzoffset>' because
249 # python-hglib splits date at decimal separator.
249 # python-hglib splits date at decimal separator.
250 return templateutil.date(ctx.date(), showfmt='%d.0%d')
250 return templateutil.date(ctx.date(), showfmt='%d.0%d')
251
251
252 @templatekeyword('desc', requires={'ctx'})
252 @templatekeyword('desc', requires={'ctx'})
253 def showdescription(context, mapping):
253 def showdescription(context, mapping):
254 """String. The text of the changeset description."""
254 """String. The text of the changeset description."""
255 ctx = context.resource(mapping, 'ctx')
255 ctx = context.resource(mapping, 'ctx')
256 s = ctx.description()
256 s = ctx.description()
257 if isinstance(s, encoding.localstr):
257 if isinstance(s, encoding.localstr):
258 # try hard to preserve utf-8 bytes
258 # try hard to preserve utf-8 bytes
259 return encoding.tolocal(encoding.fromlocal(s).strip())
259 return encoding.tolocal(encoding.fromlocal(s).strip())
260 elif isinstance(s, encoding.safelocalstr):
260 elif isinstance(s, encoding.safelocalstr):
261 return encoding.safelocalstr(s.strip())
261 return encoding.safelocalstr(s.strip())
262 else:
262 else:
263 return s.strip()
263 return s.strip()
264
264
265 @templatekeyword('diffstat', requires={'ui', 'ctx'})
265 @templatekeyword('diffstat', requires={'ui', 'ctx'})
266 def showdiffstat(context, mapping):
266 def showdiffstat(context, mapping):
267 """String. Statistics of changes with the following format:
267 """String. Statistics of changes with the following format:
268 "modified files: +added/-removed lines"
268 "modified files: +added/-removed lines"
269 """
269 """
270 ui = context.resource(mapping, 'ui')
270 ui = context.resource(mapping, 'ui')
271 ctx = context.resource(mapping, 'ctx')
271 ctx = context.resource(mapping, 'ctx')
272 diffopts = diffutil.diffallopts(ui, {'noprefix': False})
272 diffopts = diffutil.diffallopts(ui, {'noprefix': False})
273 diff = ctx.diff(opts=diffopts)
273 diff = ctx.diff(opts=diffopts)
274 stats = patch.diffstatdata(util.iterlines(diff))
274 stats = patch.diffstatdata(util.iterlines(diff))
275 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
275 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
276 return '%d: +%d/-%d' % (len(stats), adds, removes)
276 return '%d: +%d/-%d' % (len(stats), adds, removes)
277
277
278 @templatekeyword('envvars', requires={'ui'})
278 @templatekeyword('envvars', requires={'ui'})
279 def showenvvars(context, mapping):
279 def showenvvars(context, mapping):
280 """A dictionary of environment variables. (EXPERIMENTAL)"""
280 """A dictionary of environment variables. (EXPERIMENTAL)"""
281 ui = context.resource(mapping, 'ui')
281 ui = context.resource(mapping, 'ui')
282 env = ui.exportableenviron()
282 env = ui.exportableenviron()
283 env = util.sortdict((k, env[k]) for k in sorted(env))
283 env = util.sortdict((k, env[k]) for k in sorted(env))
284 return compatdict(context, mapping, 'envvar', env, plural='envvars')
284 return compatdict(context, mapping, 'envvar', env, plural='envvars')
285
285
286 @templatekeyword('extras', requires={'ctx'})
286 @templatekeyword('extras', requires={'ctx'})
287 def showextras(context, mapping):
287 def showextras(context, mapping):
288 """List of dicts with key, value entries of the 'extras'
288 """List of dicts with key, value entries of the 'extras'
289 field of this changeset."""
289 field of this changeset."""
290 ctx = context.resource(mapping, 'ctx')
290 ctx = context.resource(mapping, 'ctx')
291 extras = ctx.extra()
291 extras = ctx.extra()
292 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
292 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
293 makemap = lambda k: {'key': k, 'value': extras[k]}
293 makemap = lambda k: {'key': k, 'value': extras[k]}
294 c = [makemap(k) for k in extras]
294 c = [makemap(k) for k in extras]
295 f = _showcompatlist(context, mapping, 'extra', c, plural='extras')
295 f = _showcompatlist(context, mapping, 'extra', c, plural='extras')
296 return _hybrid(f, extras, makemap,
296 return _hybrid(f, extras, makemap,
297 lambda k: '%s=%s' % (k, stringutil.escapestr(extras[k])))
297 lambda k: '%s=%s' % (k, stringutil.escapestr(extras[k])))
298
298
299 def _getfilestatus(context, mapping, listall=False):
299 def _getfilestatus(context, mapping, listall=False):
300 ctx = context.resource(mapping, 'ctx')
300 ctx = context.resource(mapping, 'ctx')
301 revcache = context.resource(mapping, 'revcache')
301 revcache = context.resource(mapping, 'revcache')
302 if 'filestatus' not in revcache or revcache['filestatusall'] < listall:
302 if 'filestatus' not in revcache or revcache['filestatusall'] < listall:
303 stat = ctx.p1().status(ctx, listignored=listall, listclean=listall,
303 stat = ctx.p1().status(ctx, listignored=listall, listclean=listall,
304 listunknown=listall)
304 listunknown=listall)
305 revcache['filestatus'] = stat
305 revcache['filestatus'] = stat
306 revcache['filestatusall'] = listall
306 revcache['filestatusall'] = listall
307 return revcache['filestatus']
307 return revcache['filestatus']
308
308
309 def _getfilestatusmap(context, mapping, listall=False):
309 def _getfilestatusmap(context, mapping, listall=False):
310 revcache = context.resource(mapping, 'revcache')
310 revcache = context.resource(mapping, 'revcache')
311 if 'filestatusmap' not in revcache or revcache['filestatusall'] < listall:
311 if 'filestatusmap' not in revcache or revcache['filestatusall'] < listall:
312 stat = _getfilestatus(context, mapping, listall=listall)
312 stat = _getfilestatus(context, mapping, listall=listall)
313 revcache['filestatusmap'] = statmap = {}
313 revcache['filestatusmap'] = statmap = {}
314 for char, files in zip(pycompat.iterbytestr('MAR!?IC'), stat):
314 for char, files in zip(pycompat.iterbytestr('MAR!?IC'), stat):
315 statmap.update((f, char) for f in files)
315 statmap.update((f, char) for f in files)
316 return revcache['filestatusmap'] # {path: statchar}
316 return revcache['filestatusmap'] # {path: statchar}
317
317
318 def _showfilesbystat(context, mapping, name, index):
318 def _showfilesbystat(context, mapping, name, index):
319 stat = _getfilestatus(context, mapping)
319 stat = _getfilestatus(context, mapping)
320 files = stat[index]
320 files = stat[index]
321 return templateutil.compatfileslist(context, mapping, name, files)
321 return templateutil.compatfileslist(context, mapping, name, files)
322
322
323 @templatekeyword('file_adds', requires={'ctx', 'revcache'})
323 @templatekeyword('file_adds', requires={'ctx', 'revcache'})
324 def showfileadds(context, mapping):
324 def showfileadds(context, mapping):
325 """List of strings. Files added by this changeset."""
325 """List of strings. Files added by this changeset."""
326 return _showfilesbystat(context, mapping, 'file_add', 1)
326 return _showfilesbystat(context, mapping, 'file_add', 1)
327
327
328 @templatekeyword('file_copies',
328 @templatekeyword('file_copies',
329 requires={'repo', 'ctx', 'cache', 'revcache'})
329 requires={'repo', 'ctx', 'cache', 'revcache'})
330 def showfilecopies(context, mapping):
330 def showfilecopies(context, mapping):
331 """List of strings. Files copied in this changeset with
331 """List of strings. Files copied in this changeset with
332 their sources.
332 their sources.
333 """
333 """
334 repo = context.resource(mapping, 'repo')
334 repo = context.resource(mapping, 'repo')
335 ctx = context.resource(mapping, 'ctx')
335 ctx = context.resource(mapping, 'ctx')
336 cache = context.resource(mapping, 'cache')
336 cache = context.resource(mapping, 'cache')
337 copies = context.resource(mapping, 'revcache').get('copies')
337 copies = context.resource(mapping, 'revcache').get('copies')
338 if copies is None:
338 if copies is None:
339 if 'getrenamed' not in cache:
339 if 'getrenamed' not in cache:
340 cache['getrenamed'] = getrenamedfn(repo)
340 cache['getrenamed'] = getrenamedfn(repo)
341 copies = []
341 copies = []
342 getrenamed = cache['getrenamed']
342 getrenamed = cache['getrenamed']
343 for fn in ctx.files():
343 for fn in ctx.files():
344 rename = getrenamed(fn, ctx.rev())
344 rename = getrenamed(fn, ctx.rev())
345 if rename:
345 if rename:
346 copies.append((fn, rename))
346 copies.append((fn, rename))
347 return templateutil.compatfilecopiesdict(context, mapping, 'file_copy',
347 return templateutil.compatfilecopiesdict(context, mapping, 'file_copy',
348 copies)
348 copies)
349
349
350 # showfilecopiesswitch() displays file copies only if copy records are
350 # showfilecopiesswitch() displays file copies only if copy records are
351 # provided before calling the templater, usually with a --copies
351 # provided before calling the templater, usually with a --copies
352 # command line switch.
352 # command line switch.
353 @templatekeyword('file_copies_switch', requires={'revcache'})
353 @templatekeyword('file_copies_switch', requires={'revcache'})
354 def showfilecopiesswitch(context, mapping):
354 def showfilecopiesswitch(context, mapping):
355 """List of strings. Like "file_copies" but displayed
355 """List of strings. Like "file_copies" but displayed
356 only if the --copied switch is set.
356 only if the --copied switch is set.
357 """
357 """
358 copies = context.resource(mapping, 'revcache').get('copies') or []
358 copies = context.resource(mapping, 'revcache').get('copies') or []
359 return templateutil.compatfilecopiesdict(context, mapping, 'file_copy',
359 return templateutil.compatfilecopiesdict(context, mapping, 'file_copy',
360 copies)
360 copies)
361
361
362 @templatekeyword('file_dels', requires={'ctx', 'revcache'})
362 @templatekeyword('file_dels', requires={'ctx', 'revcache'})
363 def showfiledels(context, mapping):
363 def showfiledels(context, mapping):
364 """List of strings. Files removed by this changeset."""
364 """List of strings. Files removed by this changeset."""
365 return _showfilesbystat(context, mapping, 'file_del', 2)
365 return _showfilesbystat(context, mapping, 'file_del', 2)
366
366
367 @templatekeyword('file_mods', requires={'ctx', 'revcache'})
367 @templatekeyword('file_mods', requires={'ctx', 'revcache'})
368 def showfilemods(context, mapping):
368 def showfilemods(context, mapping):
369 """List of strings. Files modified by this changeset."""
369 """List of strings. Files modified by this changeset."""
370 return _showfilesbystat(context, mapping, 'file_mod', 0)
370 return _showfilesbystat(context, mapping, 'file_mod', 0)
371
371
372 @templatekeyword('files', requires={'ctx'})
372 @templatekeyword('files', requires={'ctx'})
373 def showfiles(context, mapping):
373 def showfiles(context, mapping):
374 """List of strings. All files modified, added, or removed by this
374 """List of strings. All files modified, added, or removed by this
375 changeset.
375 changeset.
376 """
376 """
377 ctx = context.resource(mapping, 'ctx')
377 ctx = context.resource(mapping, 'ctx')
378 return templateutil.compatfileslist(context, mapping, 'file', ctx.files())
378 return templateutil.compatfileslist(context, mapping, 'file', ctx.files())
379
379
380 @templatekeyword('graphnode', requires={'repo', 'ctx'})
380 @templatekeyword('graphnode', requires={'repo', 'ctx'})
381 def showgraphnode(context, mapping):
381 def showgraphnode(context, mapping):
382 """String. The character representing the changeset node in an ASCII
382 """String. The character representing the changeset node in an ASCII
383 revision graph."""
383 revision graph."""
384 repo = context.resource(mapping, 'repo')
384 repo = context.resource(mapping, 'repo')
385 ctx = context.resource(mapping, 'ctx')
385 ctx = context.resource(mapping, 'ctx')
386 return getgraphnode(repo, ctx)
386 return getgraphnode(repo, ctx)
387
387
388 def getgraphnode(repo, ctx):
388 def getgraphnode(repo, ctx):
389 return getgraphnodecurrent(repo, ctx) or getgraphnodesymbol(ctx)
389 return getgraphnodecurrent(repo, ctx) or getgraphnodesymbol(ctx)
390
390
391 def getgraphnodecurrent(repo, ctx):
391 def getgraphnodecurrent(repo, ctx):
392 wpnodes = repo.dirstate.parents()
392 wpnodes = repo.dirstate.parents()
393 if wpnodes[1] == nullid:
393 if wpnodes[1] == nullid:
394 wpnodes = wpnodes[:1]
394 wpnodes = wpnodes[:1]
395 if ctx.node() in wpnodes:
395 if ctx.node() in wpnodes:
396 return '@'
396 return '@'
397 else:
397 else:
398 return ''
398 return ''
399
399
400 def getgraphnodesymbol(ctx):
400 def getgraphnodesymbol(ctx):
401 if ctx.obsolete():
401 if ctx.obsolete():
402 return 'x'
402 return 'x'
403 elif ctx.isunstable():
403 elif ctx.isunstable():
404 return '*'
404 return '*'
405 elif ctx.closesbranch():
405 elif ctx.closesbranch():
406 return '_'
406 return '_'
407 else:
407 else:
408 return 'o'
408 return 'o'
409
409
410 @templatekeyword('graphwidth', requires=())
410 @templatekeyword('graphwidth', requires=())
411 def showgraphwidth(context, mapping):
411 def showgraphwidth(context, mapping):
412 """Integer. The width of the graph drawn by 'log --graph' or zero."""
412 """Integer. The width of the graph drawn by 'log --graph' or zero."""
413 # just hosts documentation; should be overridden by template mapping
413 # just hosts documentation; should be overridden by template mapping
414 return 0
414 return 0
415
415
416 @templatekeyword('index', requires=())
416 @templatekeyword('index', requires=())
417 def showindex(context, mapping):
417 def showindex(context, mapping):
418 """Integer. The current iteration of the loop. (0 indexed)"""
418 """Integer. The current iteration of the loop. (0 indexed)"""
419 # just hosts documentation; should be overridden by template mapping
419 # just hosts documentation; should be overridden by template mapping
420 raise error.Abort(_("can't use index in this context"))
420 raise error.Abort(_("can't use index in this context"))
421
421
422 @templatekeyword('latesttag', requires={'repo', 'ctx', 'cache'})
422 @templatekeyword('latesttag', requires={'repo', 'ctx', 'cache'})
423 def showlatesttag(context, mapping):
423 def showlatesttag(context, mapping):
424 """List of strings. The global tags on the most recent globally
424 """List of strings. The global tags on the most recent globally
425 tagged ancestor of this changeset. If no such tags exist, the list
425 tagged ancestor of this changeset. If no such tags exist, the list
426 consists of the single string "null".
426 consists of the single string "null".
427 """
427 """
428 return showlatesttags(context, mapping, None)
428 return showlatesttags(context, mapping, None)
429
429
430 def showlatesttags(context, mapping, pattern):
430 def showlatesttags(context, mapping, pattern):
431 """helper method for the latesttag keyword and function"""
431 """helper method for the latesttag keyword and function"""
432 latesttags = getlatesttags(context, mapping, pattern)
432 latesttags = getlatesttags(context, mapping, pattern)
433
433
434 # latesttag[0] is an implementation detail for sorting csets on different
434 # latesttag[0] is an implementation detail for sorting csets on different
435 # branches in a stable manner- it is the date the tagged cset was created,
435 # branches in a stable manner- it is the date the tagged cset was created,
436 # not the date the tag was created. Therefore it isn't made visible here.
436 # not the date the tag was created. Therefore it isn't made visible here.
437 makemap = lambda v: {
437 makemap = lambda v: {
438 'changes': _showchangessincetag,
438 'changes': _showchangessincetag,
439 'distance': latesttags[1],
439 'distance': latesttags[1],
440 'latesttag': v, # BC with {latesttag % '{latesttag}'}
440 'latesttag': v, # BC with {latesttag % '{latesttag}'}
441 'tag': v
441 'tag': v
442 }
442 }
443
443
444 tags = latesttags[2]
444 tags = latesttags[2]
445 f = _showcompatlist(context, mapping, 'latesttag', tags, separator=':')
445 f = _showcompatlist(context, mapping, 'latesttag', tags, separator=':')
446 return _hybrid(f, tags, makemap, pycompat.identity)
446 return _hybrid(f, tags, makemap, pycompat.identity)
447
447
448 @templatekeyword('latesttagdistance', requires={'repo', 'ctx', 'cache'})
448 @templatekeyword('latesttagdistance', requires={'repo', 'ctx', 'cache'})
449 def showlatesttagdistance(context, mapping):
449 def showlatesttagdistance(context, mapping):
450 """Integer. Longest path to the latest tag."""
450 """Integer. Longest path to the latest tag."""
451 return getlatesttags(context, mapping)[1]
451 return getlatesttags(context, mapping)[1]
452
452
453 @templatekeyword('changessincelatesttag', requires={'repo', 'ctx', 'cache'})
453 @templatekeyword('changessincelatesttag', requires={'repo', 'ctx', 'cache'})
454 def showchangessincelatesttag(context, mapping):
454 def showchangessincelatesttag(context, mapping):
455 """Integer. All ancestors not in the latest tag."""
455 """Integer. All ancestors not in the latest tag."""
456 tag = getlatesttags(context, mapping)[2][0]
456 tag = getlatesttags(context, mapping)[2][0]
457 mapping = context.overlaymap(mapping, {'tag': tag})
457 mapping = context.overlaymap(mapping, {'tag': tag})
458 return _showchangessincetag(context, mapping)
458 return _showchangessincetag(context, mapping)
459
459
460 def _showchangessincetag(context, mapping):
460 def _showchangessincetag(context, mapping):
461 repo = context.resource(mapping, 'repo')
461 repo = context.resource(mapping, 'repo')
462 ctx = context.resource(mapping, 'ctx')
462 ctx = context.resource(mapping, 'ctx')
463 offset = 0
463 offset = 0
464 revs = [ctx.rev()]
464 revs = [ctx.rev()]
465 tag = context.symbol(mapping, 'tag')
465 tag = context.symbol(mapping, 'tag')
466
466
467 # The only() revset doesn't currently support wdir()
467 # The only() revset doesn't currently support wdir()
468 if ctx.rev() is None:
468 if ctx.rev() is None:
469 offset = 1
469 offset = 1
470 revs = [p.rev() for p in ctx.parents()]
470 revs = [p.rev() for p in ctx.parents()]
471
471
472 return len(repo.revs('only(%ld, %s)', revs, tag)) + offset
472 return len(repo.revs('only(%ld, %s)', revs, tag)) + offset
473
473
474 # teach templater latesttags.changes is switched to (context, mapping) API
474 # teach templater latesttags.changes is switched to (context, mapping) API
475 _showchangessincetag._requires = {'repo', 'ctx'}
475 _showchangessincetag._requires = {'repo', 'ctx'}
476
476
477 @templatekeyword('manifest', requires={'repo', 'ctx'})
477 @templatekeyword('manifest', requires={'repo', 'ctx'})
478 def showmanifest(context, mapping):
478 def showmanifest(context, mapping):
479 repo = context.resource(mapping, 'repo')
479 repo = context.resource(mapping, 'repo')
480 ctx = context.resource(mapping, 'ctx')
480 ctx = context.resource(mapping, 'ctx')
481 mnode = ctx.manifestnode()
481 mnode = ctx.manifestnode()
482 if mnode is None:
482 if mnode is None:
483 mnode = wdirid
483 mnode = wdirid
484 mrev = wdirrev
484 mrev = wdirrev
485 else:
485 else:
486 mrev = repo.manifestlog.rev(mnode)
486 mrev = repo.manifestlog.rev(mnode)
487 mhex = hex(mnode)
487 mhex = hex(mnode)
488 mapping = context.overlaymap(mapping, {'rev': mrev, 'node': mhex})
488 mapping = context.overlaymap(mapping, {'rev': mrev, 'node': mhex})
489 f = context.process('manifest', mapping)
489 f = context.process('manifest', mapping)
490 return templateutil.hybriditem(f, None, f,
490 return templateutil.hybriditem(f, None, f,
491 lambda x: {'rev': mrev, 'node': mhex})
491 lambda x: {'rev': mrev, 'node': mhex})
492
492
493 @templatekeyword('obsfate', requires={'ui', 'repo', 'ctx'})
493 @templatekeyword('obsfate', requires={'ui', 'repo', 'ctx'})
494 def showobsfate(context, mapping):
494 def showobsfate(context, mapping):
495 # this function returns a list containing pre-formatted obsfate strings.
495 # this function returns a list containing pre-formatted obsfate strings.
496 #
496 #
497 # This function will be replaced by templates fragments when we will have
497 # This function will be replaced by templates fragments when we will have
498 # the verbosity templatekw available.
498 # the verbosity templatekw available.
499 succsandmarkers = showsuccsandmarkers(context, mapping)
499 succsandmarkers = showsuccsandmarkers(context, mapping)
500
500
501 ui = context.resource(mapping, 'ui')
501 ui = context.resource(mapping, 'ui')
502 repo = context.resource(mapping, 'repo')
502 repo = context.resource(mapping, 'repo')
503 values = []
503 values = []
504
504
505 for x in succsandmarkers.tovalue(context, mapping):
505 for x in succsandmarkers.tovalue(context, mapping):
506 v = obsutil.obsfateprinter(ui, repo, x['successors'], x['markers'],
506 v = obsutil.obsfateprinter(ui, repo, x['successors'], x['markers'],
507 scmutil.formatchangeid)
507 scmutil.formatchangeid)
508 values.append(v)
508 values.append(v)
509
509
510 return compatlist(context, mapping, "fate", values)
510 return compatlist(context, mapping, "fate", values)
511
511
512 def shownames(context, mapping, namespace):
512 def shownames(context, mapping, namespace):
513 """helper method to generate a template keyword for a namespace"""
513 """helper method to generate a template keyword for a namespace"""
514 repo = context.resource(mapping, 'repo')
514 repo = context.resource(mapping, 'repo')
515 ctx = context.resource(mapping, 'ctx')
515 ctx = context.resource(mapping, 'ctx')
516 ns = repo.names[namespace]
516 ns = repo.names[namespace]
517 names = ns.names(repo, ctx.node())
517 names = ns.names(repo, ctx.node())
518 return compatlist(context, mapping, ns.templatename, names,
518 return compatlist(context, mapping, ns.templatename, names,
519 plural=namespace)
519 plural=namespace)
520
520
521 @templatekeyword('namespaces', requires={'repo', 'ctx'})
521 @templatekeyword('namespaces', requires={'repo', 'ctx'})
522 def shownamespaces(context, mapping):
522 def shownamespaces(context, mapping):
523 """Dict of lists. Names attached to this changeset per
523 """Dict of lists. Names attached to this changeset per
524 namespace."""
524 namespace."""
525 repo = context.resource(mapping, 'repo')
525 repo = context.resource(mapping, 'repo')
526 ctx = context.resource(mapping, 'ctx')
526 ctx = context.resource(mapping, 'ctx')
527
527
528 namespaces = util.sortdict()
528 namespaces = util.sortdict()
529 def makensmapfn(ns):
529 def makensmapfn(ns):
530 # 'name' for iterating over namespaces, templatename for local reference
530 # 'name' for iterating over namespaces, templatename for local reference
531 return lambda v: {'name': v, ns.templatename: v}
531 return lambda v: {'name': v, ns.templatename: v}
532
532
533 for k, ns in repo.names.iteritems():
533 for k, ns in repo.names.iteritems():
534 names = ns.names(repo, ctx.node())
534 names = ns.names(repo, ctx.node())
535 f = _showcompatlist(context, mapping, 'name', names)
535 f = _showcompatlist(context, mapping, 'name', names)
536 namespaces[k] = _hybrid(f, names, makensmapfn(ns), pycompat.identity)
536 namespaces[k] = _hybrid(f, names, makensmapfn(ns), pycompat.identity)
537
537
538 f = _showcompatlist(context, mapping, 'namespace', list(namespaces))
538 f = _showcompatlist(context, mapping, 'namespace', list(namespaces))
539
539
540 def makemap(ns):
540 def makemap(ns):
541 return {
541 return {
542 'namespace': ns,
542 'namespace': ns,
543 'names': namespaces[ns],
543 'names': namespaces[ns],
544 'builtin': repo.names[ns].builtin,
544 'builtin': repo.names[ns].builtin,
545 'colorname': repo.names[ns].colorname,
545 'colorname': repo.names[ns].colorname,
546 }
546 }
547
547
548 return _hybrid(f, namespaces, makemap, pycompat.identity)
548 return _hybrid(f, namespaces, makemap, pycompat.identity)
549
549
550 @templatekeyword('node', requires={'ctx'})
550 @templatekeyword('node', requires={'ctx'})
551 def shownode(context, mapping):
551 def shownode(context, mapping):
552 """String. The changeset identification hash, as a 40 hexadecimal
552 """String. The changeset identification hash, as a 40 hexadecimal
553 digit string.
553 digit string.
554 """
554 """
555 ctx = context.resource(mapping, 'ctx')
555 ctx = context.resource(mapping, 'ctx')
556 return ctx.hex()
556 return ctx.hex()
557
557
558 @templatekeyword('obsolete', requires={'ctx'})
558 @templatekeyword('obsolete', requires={'ctx'})
559 def showobsolete(context, mapping):
559 def showobsolete(context, mapping):
560 """String. Whether the changeset is obsolete. (EXPERIMENTAL)"""
560 """String. Whether the changeset is obsolete. (EXPERIMENTAL)"""
561 ctx = context.resource(mapping, 'ctx')
561 ctx = context.resource(mapping, 'ctx')
562 if ctx.obsolete():
562 if ctx.obsolete():
563 return 'obsolete'
563 return 'obsolete'
564 return ''
564 return ''
565
565
566 @templatekeyword('path', requires={'fctx'})
566 @templatekeyword('path', requires={'fctx'})
567 def showpath(context, mapping):
567 def showpath(context, mapping):
568 """String. Repository-absolute path of the current file. (EXPERIMENTAL)"""
568 """String. Repository-absolute path of the current file. (EXPERIMENTAL)"""
569 fctx = context.resource(mapping, 'fctx')
569 fctx = context.resource(mapping, 'fctx')
570 return fctx.path()
570 return fctx.path()
571
571
572 @templatekeyword('peerurls', requires={'repo'})
572 @templatekeyword('peerurls', requires={'repo'})
573 def showpeerurls(context, mapping):
573 def showpeerurls(context, mapping):
574 """A dictionary of repository locations defined in the [paths] section
574 """A dictionary of repository locations defined in the [paths] section
575 of your configuration file."""
575 of your configuration file."""
576 repo = context.resource(mapping, 'repo')
576 repo = context.resource(mapping, 'repo')
577 # see commands.paths() for naming of dictionary keys
577 # see commands.paths() for naming of dictionary keys
578 paths = repo.ui.paths
578 paths = repo.ui.paths
579 urls = util.sortdict((k, p.rawloc) for k, p in sorted(paths.iteritems()))
579 urls = util.sortdict((k, p.rawloc) for k, p in sorted(paths.iteritems()))
580 def makemap(k):
580 def makemap(k):
581 p = paths[k]
581 p = paths[k]
582 d = {'name': k, 'url': p.rawloc}
582 d = {'name': k, 'url': p.rawloc}
583 d.update((o, v) for o, v in sorted(p.suboptions.iteritems()))
583 d.update((o, v) for o, v in sorted(p.suboptions.iteritems()))
584 return d
584 return d
585 return _hybrid(None, urls, makemap, lambda k: '%s=%s' % (k, urls[k]))
585 return _hybrid(None, urls, makemap, lambda k: '%s=%s' % (k, urls[k]))
586
586
587 @templatekeyword("predecessors", requires={'repo', 'ctx'})
587 @templatekeyword("predecessors", requires={'repo', 'ctx'})
588 def showpredecessors(context, mapping):
588 def showpredecessors(context, mapping):
589 """Returns the list if the closest visible successors. (EXPERIMENTAL)"""
589 """Returns the list if the closest visible successors. (EXPERIMENTAL)"""
590 repo = context.resource(mapping, 'repo')
590 repo = context.resource(mapping, 'repo')
591 ctx = context.resource(mapping, 'ctx')
591 ctx = context.resource(mapping, 'ctx')
592 predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node()))
592 predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node()))
593 predecessors = pycompat.maplist(hex, predecessors)
593 predecessors = pycompat.maplist(hex, predecessors)
594
594
595 return _hybrid(None, predecessors,
595 return _hybrid(None, predecessors,
596 lambda x: {'ctx': repo[x]},
596 lambda x: {'ctx': repo[x]},
597 lambda x: scmutil.formatchangeid(repo[x]))
597 lambda x: scmutil.formatchangeid(repo[x]))
598
598
599 @templatekeyword('reporoot', requires={'repo'})
599 @templatekeyword('reporoot', requires={'repo'})
600 def showreporoot(context, mapping):
600 def showreporoot(context, mapping):
601 """String. The root directory of the current repository."""
601 """String. The root directory of the current repository."""
602 repo = context.resource(mapping, 'repo')
602 repo = context.resource(mapping, 'repo')
603 return repo.root
603 return repo.root
604
604
605 @templatekeyword('size', requires={'fctx'})
605 @templatekeyword('size', requires={'fctx'})
606 def showsize(context, mapping):
606 def showsize(context, mapping):
607 """Integer. Size of the current file in bytes. (EXPERIMENTAL)"""
607 """Integer. Size of the current file in bytes. (EXPERIMENTAL)"""
608 fctx = context.resource(mapping, 'fctx')
608 fctx = context.resource(mapping, 'fctx')
609 return fctx.size()
609 return fctx.size()
610
610
611 # requires 'fctx' to denote {status} depends on (ctx, path) pair
611 # requires 'fctx' to denote {status} depends on (ctx, path) pair
612 @templatekeyword('status', requires={'ctx', 'fctx', 'revcache'})
612 @templatekeyword('status', requires={'ctx', 'fctx', 'revcache'})
613 def showstatus(context, mapping):
613 def showstatus(context, mapping):
614 """String. Status code of the current file. (EXPERIMENTAL)"""
614 """String. Status code of the current file. (EXPERIMENTAL)"""
615 path = templateutil.runsymbol(context, mapping, 'path')
615 path = templateutil.runsymbol(context, mapping, 'path')
616 path = templateutil.stringify(context, mapping, path)
616 path = templateutil.stringify(context, mapping, path)
617 if not path:
617 if not path:
618 return
618 return
619 statmap = _getfilestatusmap(context, mapping)
619 statmap = _getfilestatusmap(context, mapping)
620 if path not in statmap:
620 if path not in statmap:
621 statmap = _getfilestatusmap(context, mapping, listall=True)
621 statmap = _getfilestatusmap(context, mapping, listall=True)
622 return statmap.get(path)
622 return statmap.get(path)
623
623
624 @templatekeyword("successorssets", requires={'repo', 'ctx'})
624 @templatekeyword("successorssets", requires={'repo', 'ctx'})
625 def showsuccessorssets(context, mapping):
625 def showsuccessorssets(context, mapping):
626 """Returns a string of sets of successors for a changectx. Format used
626 """Returns a string of sets of successors for a changectx. Format used
627 is: [ctx1, ctx2], [ctx3] if ctx has been splitted into ctx1 and ctx2
627 is: [ctx1, ctx2], [ctx3] if ctx has been splitted into ctx1 and ctx2
628 while also diverged into ctx3. (EXPERIMENTAL)"""
628 while also diverged into ctx3. (EXPERIMENTAL)"""
629 repo = context.resource(mapping, 'repo')
629 repo = context.resource(mapping, 'repo')
630 ctx = context.resource(mapping, 'ctx')
630 ctx = context.resource(mapping, 'ctx')
631 if not ctx.obsolete():
631 if not ctx.obsolete():
632 return ''
632 return ''
633
633
634 ssets = obsutil.successorssets(repo, ctx.node(), closest=True)
634 ssets = obsutil.successorssets(repo, ctx.node(), closest=True)
635 ssets = [[hex(n) for n in ss] for ss in ssets]
635 ssets = [[hex(n) for n in ss] for ss in ssets]
636
636
637 data = []
637 data = []
638 for ss in ssets:
638 for ss in ssets:
639 h = _hybrid(None, ss, lambda x: {'ctx': repo[x]},
639 h = _hybrid(None, ss, lambda x: {'ctx': repo[x]},
640 lambda x: scmutil.formatchangeid(repo[x]))
640 lambda x: scmutil.formatchangeid(repo[x]))
641 data.append(h)
641 data.append(h)
642
642
643 # Format the successorssets
643 # Format the successorssets
644 def render(d):
644 def render(d):
645 return templateutil.stringify(context, mapping, d)
645 return templateutil.stringify(context, mapping, d)
646
646
647 def gen(data):
647 def gen(data):
648 yield "; ".join(render(d) for d in data)
648 yield "; ".join(render(d) for d in data)
649
649
650 return _hybrid(gen(data), data, lambda x: {'successorset': x},
650 return _hybrid(gen(data), data, lambda x: {'successorset': x},
651 pycompat.identity)
651 pycompat.identity)
652
652
653 @templatekeyword("succsandmarkers", requires={'repo', 'ctx'})
653 @templatekeyword("succsandmarkers", requires={'repo', 'ctx'})
654 def showsuccsandmarkers(context, mapping):
654 def showsuccsandmarkers(context, mapping):
655 """Returns a list of dict for each final successor of ctx. The dict
655 """Returns a list of dict for each final successor of ctx. The dict
656 contains successors node id in "successors" keys and the list of
656 contains successors node id in "successors" keys and the list of
657 obs-markers from ctx to the set of successors in "markers".
657 obs-markers from ctx to the set of successors in "markers".
658 (EXPERIMENTAL)
658 (EXPERIMENTAL)
659 """
659 """
660 repo = context.resource(mapping, 'repo')
660 repo = context.resource(mapping, 'repo')
661 ctx = context.resource(mapping, 'ctx')
661 ctx = context.resource(mapping, 'ctx')
662
662
663 values = obsutil.successorsandmarkers(repo, ctx)
663 values = obsutil.successorsandmarkers(repo, ctx)
664
664
665 if values is None:
665 if values is None:
666 values = []
666 values = []
667
667
668 # Format successors and markers to avoid exposing binary to templates
668 # Format successors and markers to avoid exposing binary to templates
669 data = []
669 data = []
670 for i in values:
670 for i in values:
671 # Format successors
671 # Format successors
672 successors = i['successors']
672 successors = i['successors']
673
673
674 successors = [hex(n) for n in successors]
674 successors = [hex(n) for n in successors]
675 successors = _hybrid(None, successors,
675 successors = _hybrid(None, successors,
676 lambda x: {'ctx': repo[x]},
676 lambda x: {'ctx': repo[x]},
677 lambda x: scmutil.formatchangeid(repo[x]))
677 lambda x: scmutil.formatchangeid(repo[x]))
678
678
679 # Format markers
679 # Format markers
680 finalmarkers = []
680 finalmarkers = []
681 for m in i['markers']:
681 for m in i['markers']:
682 hexprec = hex(m[0])
682 hexprec = hex(m[0])
683 hexsucs = tuple(hex(n) for n in m[1])
683 hexsucs = tuple(hex(n) for n in m[1])
684 hexparents = None
684 hexparents = None
685 if m[5] is not None:
685 if m[5] is not None:
686 hexparents = tuple(hex(n) for n in m[5])
686 hexparents = tuple(hex(n) for n in m[5])
687 newmarker = (hexprec, hexsucs) + m[2:5] + (hexparents,) + m[6:]
687 newmarker = (hexprec, hexsucs) + m[2:5] + (hexparents,) + m[6:]
688 finalmarkers.append(newmarker)
688 finalmarkers.append(newmarker)
689
689
690 data.append({'successors': successors, 'markers': finalmarkers})
690 data.append({'successors': successors, 'markers': finalmarkers})
691
691
692 return templateutil.mappinglist(data)
692 return templateutil.mappinglist(data)
693
693
694 @templatekeyword('p1', requires={'ctx'})
695 def showp1(context, mapping):
696 """Changeset. The changeset's first parent. ``{p1.rev}`` for the revision
697 number, and ``{p1.node}`` for the identification hash."""
698 ctx = context.resource(mapping, 'ctx')
699 return templateutil.mappingdict({'ctx': ctx.p1()}, tmpl=_changeidtmpl)
700
701 @templatekeyword('p2', requires={'ctx'})
702 def showp2(context, mapping):
703 """Changeset. The changeset's second parent. ``{p2.rev}`` for the revision
704 number, and ``{p2.node}`` for the identification hash."""
705 ctx = context.resource(mapping, 'ctx')
706 return templateutil.mappingdict({'ctx': ctx.p2()}, tmpl=_changeidtmpl)
707
694 @templatekeyword('p1rev', requires={'ctx'})
708 @templatekeyword('p1rev', requires={'ctx'})
695 def showp1rev(context, mapping):
709 def showp1rev(context, mapping):
696 """Integer. The repository-local revision number of the changeset's
710 """Integer. The repository-local revision number of the changeset's
697 first parent, or -1 if the changeset has no parents."""
711 first parent, or -1 if the changeset has no parents."""
698 ctx = context.resource(mapping, 'ctx')
712 ctx = context.resource(mapping, 'ctx')
699 return ctx.p1().rev()
713 return ctx.p1().rev()
700
714
701 @templatekeyword('p2rev', requires={'ctx'})
715 @templatekeyword('p2rev', requires={'ctx'})
702 def showp2rev(context, mapping):
716 def showp2rev(context, mapping):
703 """Integer. The repository-local revision number of the changeset's
717 """Integer. The repository-local revision number of the changeset's
704 second parent, or -1 if the changeset has no second parent."""
718 second parent, or -1 if the changeset has no second parent."""
705 ctx = context.resource(mapping, 'ctx')
719 ctx = context.resource(mapping, 'ctx')
706 return ctx.p2().rev()
720 return ctx.p2().rev()
707
721
708 @templatekeyword('p1node', requires={'ctx'})
722 @templatekeyword('p1node', requires={'ctx'})
709 def showp1node(context, mapping):
723 def showp1node(context, mapping):
710 """String. The identification hash of the changeset's first parent,
724 """String. The identification hash of the changeset's first parent,
711 as a 40 digit hexadecimal string. If the changeset has no parents, all
725 as a 40 digit hexadecimal string. If the changeset has no parents, all
712 digits are 0."""
726 digits are 0."""
713 ctx = context.resource(mapping, 'ctx')
727 ctx = context.resource(mapping, 'ctx')
714 return ctx.p1().hex()
728 return ctx.p1().hex()
715
729
716 @templatekeyword('p2node', requires={'ctx'})
730 @templatekeyword('p2node', requires={'ctx'})
717 def showp2node(context, mapping):
731 def showp2node(context, mapping):
718 """String. The identification hash of the changeset's second
732 """String. The identification hash of the changeset's second
719 parent, as a 40 digit hexadecimal string. If the changeset has no second
733 parent, as a 40 digit hexadecimal string. If the changeset has no second
720 parent, all digits are 0."""
734 parent, all digits are 0."""
721 ctx = context.resource(mapping, 'ctx')
735 ctx = context.resource(mapping, 'ctx')
722 return ctx.p2().hex()
736 return ctx.p2().hex()
723
737
724 @templatekeyword('parents', requires={'repo', 'ctx'})
738 @templatekeyword('parents', requires={'repo', 'ctx'})
725 def showparents(context, mapping):
739 def showparents(context, mapping):
726 """List of strings. The parents of the changeset in "rev:node"
740 """List of strings. The parents of the changeset in "rev:node"
727 format. If the changeset has only one "natural" parent (the predecessor
741 format. If the changeset has only one "natural" parent (the predecessor
728 revision) nothing is shown."""
742 revision) nothing is shown."""
729 repo = context.resource(mapping, 'repo')
743 repo = context.resource(mapping, 'repo')
730 ctx = context.resource(mapping, 'ctx')
744 ctx = context.resource(mapping, 'ctx')
731 pctxs = scmutil.meaningfulparents(repo, ctx)
745 pctxs = scmutil.meaningfulparents(repo, ctx)
732 prevs = [p.rev() for p in pctxs]
746 prevs = [p.rev() for p in pctxs]
733 parents = [[('rev', p.rev()),
747 parents = [[('rev', p.rev()),
734 ('node', p.hex()),
748 ('node', p.hex()),
735 ('phase', p.phasestr())]
749 ('phase', p.phasestr())]
736 for p in pctxs]
750 for p in pctxs]
737 f = _showcompatlist(context, mapping, 'parent', parents)
751 f = _showcompatlist(context, mapping, 'parent', parents)
738 return _hybrid(f, prevs, lambda x: {'ctx': repo[x]},
752 return _hybrid(f, prevs, lambda x: {'ctx': repo[x]},
739 lambda x: scmutil.formatchangeid(repo[x]), keytype=int)
753 lambda x: scmutil.formatchangeid(repo[x]), keytype=int)
740
754
741 @templatekeyword('phase', requires={'ctx'})
755 @templatekeyword('phase', requires={'ctx'})
742 def showphase(context, mapping):
756 def showphase(context, mapping):
743 """String. The changeset phase name."""
757 """String. The changeset phase name."""
744 ctx = context.resource(mapping, 'ctx')
758 ctx = context.resource(mapping, 'ctx')
745 return ctx.phasestr()
759 return ctx.phasestr()
746
760
747 @templatekeyword('phaseidx', requires={'ctx'})
761 @templatekeyword('phaseidx', requires={'ctx'})
748 def showphaseidx(context, mapping):
762 def showphaseidx(context, mapping):
749 """Integer. The changeset phase index. (ADVANCED)"""
763 """Integer. The changeset phase index. (ADVANCED)"""
750 ctx = context.resource(mapping, 'ctx')
764 ctx = context.resource(mapping, 'ctx')
751 return ctx.phase()
765 return ctx.phase()
752
766
753 @templatekeyword('rev', requires={'ctx'})
767 @templatekeyword('rev', requires={'ctx'})
754 def showrev(context, mapping):
768 def showrev(context, mapping):
755 """Integer. The repository-local changeset revision number."""
769 """Integer. The repository-local changeset revision number."""
756 ctx = context.resource(mapping, 'ctx')
770 ctx = context.resource(mapping, 'ctx')
757 return scmutil.intrev(ctx)
771 return scmutil.intrev(ctx)
758
772
759 def showrevslist(context, mapping, name, revs):
773 def showrevslist(context, mapping, name, revs):
760 """helper to generate a list of revisions in which a mapped template will
774 """helper to generate a list of revisions in which a mapped template will
761 be evaluated"""
775 be evaluated"""
762 repo = context.resource(mapping, 'repo')
776 repo = context.resource(mapping, 'repo')
763 f = _showcompatlist(context, mapping, name, ['%d' % r for r in revs])
777 f = _showcompatlist(context, mapping, name, ['%d' % r for r in revs])
764 return _hybrid(f, revs,
778 return _hybrid(f, revs,
765 lambda x: {name: x, 'ctx': repo[x]},
779 lambda x: {name: x, 'ctx': repo[x]},
766 pycompat.identity, keytype=int)
780 pycompat.identity, keytype=int)
767
781
768 @templatekeyword('subrepos', requires={'ctx'})
782 @templatekeyword('subrepos', requires={'ctx'})
769 def showsubrepos(context, mapping):
783 def showsubrepos(context, mapping):
770 """List of strings. Updated subrepositories in the changeset."""
784 """List of strings. Updated subrepositories in the changeset."""
771 ctx = context.resource(mapping, 'ctx')
785 ctx = context.resource(mapping, 'ctx')
772 substate = ctx.substate
786 substate = ctx.substate
773 if not substate:
787 if not substate:
774 return compatlist(context, mapping, 'subrepo', [])
788 return compatlist(context, mapping, 'subrepo', [])
775 psubstate = ctx.parents()[0].substate or {}
789 psubstate = ctx.parents()[0].substate or {}
776 subrepos = []
790 subrepos = []
777 for sub in substate:
791 for sub in substate:
778 if sub not in psubstate or substate[sub] != psubstate[sub]:
792 if sub not in psubstate or substate[sub] != psubstate[sub]:
779 subrepos.append(sub) # modified or newly added in ctx
793 subrepos.append(sub) # modified or newly added in ctx
780 for sub in psubstate:
794 for sub in psubstate:
781 if sub not in substate:
795 if sub not in substate:
782 subrepos.append(sub) # removed in ctx
796 subrepos.append(sub) # removed in ctx
783 return compatlist(context, mapping, 'subrepo', sorted(subrepos))
797 return compatlist(context, mapping, 'subrepo', sorted(subrepos))
784
798
785 # don't remove "showtags" definition, even though namespaces will put
799 # don't remove "showtags" definition, even though namespaces will put
786 # a helper function for "tags" keyword into "keywords" map automatically,
800 # a helper function for "tags" keyword into "keywords" map automatically,
787 # because online help text is built without namespaces initialization
801 # because online help text is built without namespaces initialization
788 @templatekeyword('tags', requires={'repo', 'ctx'})
802 @templatekeyword('tags', requires={'repo', 'ctx'})
789 def showtags(context, mapping):
803 def showtags(context, mapping):
790 """List of strings. Any tags associated with the changeset."""
804 """List of strings. Any tags associated with the changeset."""
791 return shownames(context, mapping, 'tags')
805 return shownames(context, mapping, 'tags')
792
806
793 @templatekeyword('termwidth', requires={'ui'})
807 @templatekeyword('termwidth', requires={'ui'})
794 def showtermwidth(context, mapping):
808 def showtermwidth(context, mapping):
795 """Integer. The width of the current terminal."""
809 """Integer. The width of the current terminal."""
796 ui = context.resource(mapping, 'ui')
810 ui = context.resource(mapping, 'ui')
797 return ui.termwidth()
811 return ui.termwidth()
798
812
799 @templatekeyword('user', requires={'ctx'})
813 @templatekeyword('user', requires={'ctx'})
800 def showuser(context, mapping):
814 def showuser(context, mapping):
801 """String. The unmodified author of the changeset."""
815 """String. The unmodified author of the changeset."""
802 ctx = context.resource(mapping, 'ctx')
816 ctx = context.resource(mapping, 'ctx')
803 return ctx.user()
817 return ctx.user()
804
818
805 @templatekeyword('instabilities', requires={'ctx'})
819 @templatekeyword('instabilities', requires={'ctx'})
806 def showinstabilities(context, mapping):
820 def showinstabilities(context, mapping):
807 """List of strings. Evolution instabilities affecting the changeset.
821 """List of strings. Evolution instabilities affecting the changeset.
808 (EXPERIMENTAL)
822 (EXPERIMENTAL)
809 """
823 """
810 ctx = context.resource(mapping, 'ctx')
824 ctx = context.resource(mapping, 'ctx')
811 return compatlist(context, mapping, 'instability', ctx.instabilities(),
825 return compatlist(context, mapping, 'instability', ctx.instabilities(),
812 plural='instabilities')
826 plural='instabilities')
813
827
814 @templatekeyword('verbosity', requires={'ui'})
828 @templatekeyword('verbosity', requires={'ui'})
815 def showverbosity(context, mapping):
829 def showverbosity(context, mapping):
816 """String. The current output verbosity in 'debug', 'quiet', 'verbose',
830 """String. The current output verbosity in 'debug', 'quiet', 'verbose',
817 or ''."""
831 or ''."""
818 ui = context.resource(mapping, 'ui')
832 ui = context.resource(mapping, 'ui')
819 # see logcmdutil.changesettemplater for priority of these flags
833 # see logcmdutil.changesettemplater for priority of these flags
820 if ui.debugflag:
834 if ui.debugflag:
821 return 'debug'
835 return 'debug'
822 elif ui.quiet:
836 elif ui.quiet:
823 return 'quiet'
837 return 'quiet'
824 elif ui.verbose:
838 elif ui.verbose:
825 return 'verbose'
839 return 'verbose'
826 return ''
840 return ''
827
841
828 @templatekeyword('whyunstable', requires={'repo', 'ctx'})
842 @templatekeyword('whyunstable', requires={'repo', 'ctx'})
829 def showwhyunstable(context, mapping):
843 def showwhyunstable(context, mapping):
830 """List of dicts explaining all instabilities of a changeset.
844 """List of dicts explaining all instabilities of a changeset.
831 (EXPERIMENTAL)
845 (EXPERIMENTAL)
832 """
846 """
833 repo = context.resource(mapping, 'repo')
847 repo = context.resource(mapping, 'repo')
834 ctx = context.resource(mapping, 'ctx')
848 ctx = context.resource(mapping, 'ctx')
835
849
836 def formatnode(ctx):
850 def formatnode(ctx):
837 return '%s (%s)' % (scmutil.formatchangeid(ctx), ctx.phasestr())
851 return '%s (%s)' % (scmutil.formatchangeid(ctx), ctx.phasestr())
838
852
839 entries = obsutil.whyunstable(repo, ctx)
853 entries = obsutil.whyunstable(repo, ctx)
840
854
841 for entry in entries:
855 for entry in entries:
842 if entry.get('divergentnodes'):
856 if entry.get('divergentnodes'):
843 dnodes = entry['divergentnodes']
857 dnodes = entry['divergentnodes']
844 dnhybrid = _hybrid(None, [dnode.hex() for dnode in dnodes],
858 dnhybrid = _hybrid(None, [dnode.hex() for dnode in dnodes],
845 lambda x: {'ctx': repo[x]},
859 lambda x: {'ctx': repo[x]},
846 lambda x: formatnode(repo[x]))
860 lambda x: formatnode(repo[x]))
847 entry['divergentnodes'] = dnhybrid
861 entry['divergentnodes'] = dnhybrid
848
862
849 tmpl = ('{instability}:{if(divergentnodes, " ")}{divergentnodes} '
863 tmpl = ('{instability}:{if(divergentnodes, " ")}{divergentnodes} '
850 '{reason} {node|short}')
864 '{reason} {node|short}')
851 return templateutil.mappinglist(entries, tmpl=tmpl, sep='\n')
865 return templateutil.mappinglist(entries, tmpl=tmpl, sep='\n')
852
866
853 def loadkeyword(ui, extname, registrarobj):
867 def loadkeyword(ui, extname, registrarobj):
854 """Load template keyword from specified registrarobj
868 """Load template keyword from specified registrarobj
855 """
869 """
856 for name, func in registrarobj._table.iteritems():
870 for name, func in registrarobj._table.iteritems():
857 keywords[name] = func
871 keywords[name] = func
858
872
859 # tell hggettext to extract docstrings from these functions:
873 # tell hggettext to extract docstrings from these functions:
860 i18nfunctions = keywords.values()
874 i18nfunctions = keywords.values()
@@ -1,1303 +1,1322 b''
1 Test template keywords
1 Test template keywords
2 ======================
2 ======================
3
3
4 $ hg init a
4 $ hg init a
5 $ cd a
5 $ cd a
6 $ echo a > a
6 $ echo a > a
7 $ hg add a
7 $ hg add a
8 $ echo line 1 > b
8 $ echo line 1 > b
9 $ echo line 2 >> b
9 $ echo line 2 >> b
10 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
10 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
11
11
12 $ hg add b
12 $ hg add b
13 $ echo other 1 > c
13 $ echo other 1 > c
14 $ echo other 2 >> c
14 $ echo other 2 >> c
15 $ echo >> c
15 $ echo >> c
16 $ echo other 3 >> c
16 $ echo other 3 >> c
17 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
17 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
18
18
19 $ hg add c
19 $ hg add c
20 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
20 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
21 $ echo c >> c
21 $ echo c >> c
22 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
22 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
23
23
24 $ echo foo > .hg/branch
24 $ echo foo > .hg/branch
25 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
25 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
26
26
27 $ hg co -q 3
27 $ hg co -q 3
28 $ echo other 4 >> d
28 $ echo other 4 >> d
29 $ hg add d
29 $ hg add d
30 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
30 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
31
31
32 $ hg merge -q foo
32 $ hg merge -q foo
33 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
33 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
34
34
35 Second branch starting at nullrev:
35 Second branch starting at nullrev:
36
36
37 $ hg update null
37 $ hg update null
38 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
38 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
39 $ echo second > second
39 $ echo second > second
40 $ hg add second
40 $ hg add second
41 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
41 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
42 created new head
42 created new head
43
43
44 $ echo third > third
44 $ echo third > third
45 $ hg add third
45 $ hg add third
46 $ hg mv second fourth
46 $ hg mv second fourth
47 $ hg commit -m third -d "2020-01-01 10:01"
47 $ hg commit -m third -d "2020-01-01 10:01"
48
48
49 Working-directory revision has special identifiers, though they are still
49 Working-directory revision has special identifiers, though they are still
50 experimental:
50 experimental:
51
51
52 $ hg log -r 'wdir()' -T '{rev}:{node}\n'
52 $ hg log -r 'wdir()' -T '{rev}:{node}\n'
53 2147483647:ffffffffffffffffffffffffffffffffffffffff
53 2147483647:ffffffffffffffffffffffffffffffffffffffff
54
54
55 $ hg log -r 'wdir()' -Tjson --debug
55 $ hg log -r 'wdir()' -Tjson --debug
56 [
56 [
57 {
57 {
58 "added": [],
58 "added": [],
59 "bookmarks": [],
59 "bookmarks": [],
60 "branch": "default",
60 "branch": "default",
61 "date": [0, 0],
61 "date": [0, 0],
62 "desc": "",
62 "desc": "",
63 "extra": {"branch": "default"},
63 "extra": {"branch": "default"},
64 "manifest": "ffffffffffffffffffffffffffffffffffffffff",
64 "manifest": "ffffffffffffffffffffffffffffffffffffffff",
65 "modified": [],
65 "modified": [],
66 "node": "ffffffffffffffffffffffffffffffffffffffff",
66 "node": "ffffffffffffffffffffffffffffffffffffffff",
67 "parents": ["95c24699272ef57d062b8bccc32c878bf841784a"],
67 "parents": ["95c24699272ef57d062b8bccc32c878bf841784a"],
68 "phase": "draft",
68 "phase": "draft",
69 "removed": [],
69 "removed": [],
70 "rev": 2147483647,
70 "rev": 2147483647,
71 "tags": [],
71 "tags": [],
72 "user": "test"
72 "user": "test"
73 }
73 }
74 ]
74 ]
75
75
76 $ hg log -r 'wdir()' -T '{manifest}\n'
76 $ hg log -r 'wdir()' -T '{manifest}\n'
77 2147483647:ffffffffffff
77 2147483647:ffffffffffff
78
78
79 Changectx-derived keywords are disabled within {manifest} as {node} changes:
79 Changectx-derived keywords are disabled within {manifest} as {node} changes:
80
80
81 $ hg log -r0 -T 'outer:{p1node} {manifest % "inner:{p1node}"}\n'
81 $ hg log -r0 -T 'outer:{p1node} {manifest % "inner:{p1node}"}\n'
82 outer:0000000000000000000000000000000000000000 inner:
82 outer:0000000000000000000000000000000000000000 inner:
83
83
84 Check that {phase} works correctly on parents:
84 Check that {phase} works correctly on parents:
85
85
86 $ cat << EOF > parentphase
86 $ cat << EOF > parentphase
87 > changeset_debug = '{rev} ({phase}):{parents}\n'
87 > changeset_debug = '{rev} ({phase}):{parents}\n'
88 > parent = ' {rev} ({phase})'
88 > parent = ' {rev} ({phase})'
89 > EOF
89 > EOF
90 $ hg phase -r 5 --public
90 $ hg phase -r 5 --public
91 $ hg phase -r 7 --secret --force
91 $ hg phase -r 7 --secret --force
92 $ hg log --debug -G --style ./parentphase
92 $ hg log --debug -G --style ./parentphase
93 @ 8 (secret): 7 (secret) -1 (public)
93 @ 8 (secret): 7 (secret) -1 (public)
94 |
94 |
95 o 7 (secret): -1 (public) -1 (public)
95 o 7 (secret): -1 (public) -1 (public)
96
96
97 o 6 (draft): 5 (public) 4 (draft)
97 o 6 (draft): 5 (public) 4 (draft)
98 |\
98 |\
99 | o 5 (public): 3 (public) -1 (public)
99 | o 5 (public): 3 (public) -1 (public)
100 | |
100 | |
101 o | 4 (draft): 3 (public) -1 (public)
101 o | 4 (draft): 3 (public) -1 (public)
102 |/
102 |/
103 o 3 (public): 2 (public) -1 (public)
103 o 3 (public): 2 (public) -1 (public)
104 |
104 |
105 o 2 (public): 1 (public) -1 (public)
105 o 2 (public): 1 (public) -1 (public)
106 |
106 |
107 o 1 (public): 0 (public) -1 (public)
107 o 1 (public): 0 (public) -1 (public)
108 |
108 |
109 o 0 (public): -1 (public) -1 (public)
109 o 0 (public): -1 (public) -1 (public)
110
110
111
111
112 Keys work:
112 Keys work:
113
113
114 $ for key in author branch branches date desc file_adds file_dels file_mods \
114 $ for key in author branch branches date desc file_adds file_dels file_mods \
115 > file_copies file_copies_switch files \
115 > file_copies file_copies_switch files \
116 > manifest node parents rev tags diffstat extras \
116 > manifest node parents rev tags diffstat extras \
117 > p1rev p2rev p1node p2node user; do
117 > p1rev p2rev p1node p2node user; do
118 > for mode in '' --verbose --debug; do
118 > for mode in '' --verbose --debug; do
119 > hg log $mode --template "$key$mode: {$key}\n"
119 > hg log $mode --template "$key$mode: {$key}\n"
120 > done
120 > done
121 > done
121 > done
122 author: test
122 author: test
123 author: User Name <user@hostname>
123 author: User Name <user@hostname>
124 author: person
124 author: person
125 author: person
125 author: person
126 author: person
126 author: person
127 author: person
127 author: person
128 author: other@place
128 author: other@place
129 author: A. N. Other <other@place>
129 author: A. N. Other <other@place>
130 author: User Name <user@hostname>
130 author: User Name <user@hostname>
131 author--verbose: test
131 author--verbose: test
132 author--verbose: User Name <user@hostname>
132 author--verbose: User Name <user@hostname>
133 author--verbose: person
133 author--verbose: person
134 author--verbose: person
134 author--verbose: person
135 author--verbose: person
135 author--verbose: person
136 author--verbose: person
136 author--verbose: person
137 author--verbose: other@place
137 author--verbose: other@place
138 author--verbose: A. N. Other <other@place>
138 author--verbose: A. N. Other <other@place>
139 author--verbose: User Name <user@hostname>
139 author--verbose: User Name <user@hostname>
140 author--debug: test
140 author--debug: test
141 author--debug: User Name <user@hostname>
141 author--debug: User Name <user@hostname>
142 author--debug: person
142 author--debug: person
143 author--debug: person
143 author--debug: person
144 author--debug: person
144 author--debug: person
145 author--debug: person
145 author--debug: person
146 author--debug: other@place
146 author--debug: other@place
147 author--debug: A. N. Other <other@place>
147 author--debug: A. N. Other <other@place>
148 author--debug: User Name <user@hostname>
148 author--debug: User Name <user@hostname>
149 branch: default
149 branch: default
150 branch: default
150 branch: default
151 branch: default
151 branch: default
152 branch: default
152 branch: default
153 branch: foo
153 branch: foo
154 branch: default
154 branch: default
155 branch: default
155 branch: default
156 branch: default
156 branch: default
157 branch: default
157 branch: default
158 branch--verbose: default
158 branch--verbose: default
159 branch--verbose: default
159 branch--verbose: default
160 branch--verbose: default
160 branch--verbose: default
161 branch--verbose: default
161 branch--verbose: default
162 branch--verbose: foo
162 branch--verbose: foo
163 branch--verbose: default
163 branch--verbose: default
164 branch--verbose: default
164 branch--verbose: default
165 branch--verbose: default
165 branch--verbose: default
166 branch--verbose: default
166 branch--verbose: default
167 branch--debug: default
167 branch--debug: default
168 branch--debug: default
168 branch--debug: default
169 branch--debug: default
169 branch--debug: default
170 branch--debug: default
170 branch--debug: default
171 branch--debug: foo
171 branch--debug: foo
172 branch--debug: default
172 branch--debug: default
173 branch--debug: default
173 branch--debug: default
174 branch--debug: default
174 branch--debug: default
175 branch--debug: default
175 branch--debug: default
176 branches:
176 branches:
177 branches:
177 branches:
178 branches:
178 branches:
179 branches:
179 branches:
180 branches: foo
180 branches: foo
181 branches:
181 branches:
182 branches:
182 branches:
183 branches:
183 branches:
184 branches:
184 branches:
185 branches--verbose:
185 branches--verbose:
186 branches--verbose:
186 branches--verbose:
187 branches--verbose:
187 branches--verbose:
188 branches--verbose:
188 branches--verbose:
189 branches--verbose: foo
189 branches--verbose: foo
190 branches--verbose:
190 branches--verbose:
191 branches--verbose:
191 branches--verbose:
192 branches--verbose:
192 branches--verbose:
193 branches--verbose:
193 branches--verbose:
194 branches--debug:
194 branches--debug:
195 branches--debug:
195 branches--debug:
196 branches--debug:
196 branches--debug:
197 branches--debug:
197 branches--debug:
198 branches--debug: foo
198 branches--debug: foo
199 branches--debug:
199 branches--debug:
200 branches--debug:
200 branches--debug:
201 branches--debug:
201 branches--debug:
202 branches--debug:
202 branches--debug:
203 date: 1577872860.00
203 date: 1577872860.00
204 date: 1000000.00
204 date: 1000000.00
205 date: 1500001.00
205 date: 1500001.00
206 date: 1500000.00
206 date: 1500000.00
207 date: 1400000.00
207 date: 1400000.00
208 date: 1300000.00
208 date: 1300000.00
209 date: 1200000.00
209 date: 1200000.00
210 date: 1100000.00
210 date: 1100000.00
211 date: 1000000.00
211 date: 1000000.00
212 date--verbose: 1577872860.00
212 date--verbose: 1577872860.00
213 date--verbose: 1000000.00
213 date--verbose: 1000000.00
214 date--verbose: 1500001.00
214 date--verbose: 1500001.00
215 date--verbose: 1500000.00
215 date--verbose: 1500000.00
216 date--verbose: 1400000.00
216 date--verbose: 1400000.00
217 date--verbose: 1300000.00
217 date--verbose: 1300000.00
218 date--verbose: 1200000.00
218 date--verbose: 1200000.00
219 date--verbose: 1100000.00
219 date--verbose: 1100000.00
220 date--verbose: 1000000.00
220 date--verbose: 1000000.00
221 date--debug: 1577872860.00
221 date--debug: 1577872860.00
222 date--debug: 1000000.00
222 date--debug: 1000000.00
223 date--debug: 1500001.00
223 date--debug: 1500001.00
224 date--debug: 1500000.00
224 date--debug: 1500000.00
225 date--debug: 1400000.00
225 date--debug: 1400000.00
226 date--debug: 1300000.00
226 date--debug: 1300000.00
227 date--debug: 1200000.00
227 date--debug: 1200000.00
228 date--debug: 1100000.00
228 date--debug: 1100000.00
229 date--debug: 1000000.00
229 date--debug: 1000000.00
230 desc: third
230 desc: third
231 desc: second
231 desc: second
232 desc: merge
232 desc: merge
233 desc: new head
233 desc: new head
234 desc: new branch
234 desc: new branch
235 desc: no user, no domain
235 desc: no user, no domain
236 desc: no person
236 desc: no person
237 desc: other 1
237 desc: other 1
238 other 2
238 other 2
239
239
240 other 3
240 other 3
241 desc: line 1
241 desc: line 1
242 line 2
242 line 2
243 desc--verbose: third
243 desc--verbose: third
244 desc--verbose: second
244 desc--verbose: second
245 desc--verbose: merge
245 desc--verbose: merge
246 desc--verbose: new head
246 desc--verbose: new head
247 desc--verbose: new branch
247 desc--verbose: new branch
248 desc--verbose: no user, no domain
248 desc--verbose: no user, no domain
249 desc--verbose: no person
249 desc--verbose: no person
250 desc--verbose: other 1
250 desc--verbose: other 1
251 other 2
251 other 2
252
252
253 other 3
253 other 3
254 desc--verbose: line 1
254 desc--verbose: line 1
255 line 2
255 line 2
256 desc--debug: third
256 desc--debug: third
257 desc--debug: second
257 desc--debug: second
258 desc--debug: merge
258 desc--debug: merge
259 desc--debug: new head
259 desc--debug: new head
260 desc--debug: new branch
260 desc--debug: new branch
261 desc--debug: no user, no domain
261 desc--debug: no user, no domain
262 desc--debug: no person
262 desc--debug: no person
263 desc--debug: other 1
263 desc--debug: other 1
264 other 2
264 other 2
265
265
266 other 3
266 other 3
267 desc--debug: line 1
267 desc--debug: line 1
268 line 2
268 line 2
269 file_adds: fourth third
269 file_adds: fourth third
270 file_adds: second
270 file_adds: second
271 file_adds:
271 file_adds:
272 file_adds: d
272 file_adds: d
273 file_adds:
273 file_adds:
274 file_adds:
274 file_adds:
275 file_adds: c
275 file_adds: c
276 file_adds: b
276 file_adds: b
277 file_adds: a
277 file_adds: a
278 file_adds--verbose: fourth third
278 file_adds--verbose: fourth third
279 file_adds--verbose: second
279 file_adds--verbose: second
280 file_adds--verbose:
280 file_adds--verbose:
281 file_adds--verbose: d
281 file_adds--verbose: d
282 file_adds--verbose:
282 file_adds--verbose:
283 file_adds--verbose:
283 file_adds--verbose:
284 file_adds--verbose: c
284 file_adds--verbose: c
285 file_adds--verbose: b
285 file_adds--verbose: b
286 file_adds--verbose: a
286 file_adds--verbose: a
287 file_adds--debug: fourth third
287 file_adds--debug: fourth third
288 file_adds--debug: second
288 file_adds--debug: second
289 file_adds--debug:
289 file_adds--debug:
290 file_adds--debug: d
290 file_adds--debug: d
291 file_adds--debug:
291 file_adds--debug:
292 file_adds--debug:
292 file_adds--debug:
293 file_adds--debug: c
293 file_adds--debug: c
294 file_adds--debug: b
294 file_adds--debug: b
295 file_adds--debug: a
295 file_adds--debug: a
296 file_dels: second
296 file_dels: second
297 file_dels:
297 file_dels:
298 file_dels:
298 file_dels:
299 file_dels:
299 file_dels:
300 file_dels:
300 file_dels:
301 file_dels:
301 file_dels:
302 file_dels:
302 file_dels:
303 file_dels:
303 file_dels:
304 file_dels:
304 file_dels:
305 file_dels--verbose: second
305 file_dels--verbose: second
306 file_dels--verbose:
306 file_dels--verbose:
307 file_dels--verbose:
307 file_dels--verbose:
308 file_dels--verbose:
308 file_dels--verbose:
309 file_dels--verbose:
309 file_dels--verbose:
310 file_dels--verbose:
310 file_dels--verbose:
311 file_dels--verbose:
311 file_dels--verbose:
312 file_dels--verbose:
312 file_dels--verbose:
313 file_dels--verbose:
313 file_dels--verbose:
314 file_dels--debug: second
314 file_dels--debug: second
315 file_dels--debug:
315 file_dels--debug:
316 file_dels--debug:
316 file_dels--debug:
317 file_dels--debug:
317 file_dels--debug:
318 file_dels--debug:
318 file_dels--debug:
319 file_dels--debug:
319 file_dels--debug:
320 file_dels--debug:
320 file_dels--debug:
321 file_dels--debug:
321 file_dels--debug:
322 file_dels--debug:
322 file_dels--debug:
323 file_mods:
323 file_mods:
324 file_mods:
324 file_mods:
325 file_mods:
325 file_mods:
326 file_mods:
326 file_mods:
327 file_mods:
327 file_mods:
328 file_mods: c
328 file_mods: c
329 file_mods:
329 file_mods:
330 file_mods:
330 file_mods:
331 file_mods:
331 file_mods:
332 file_mods--verbose:
332 file_mods--verbose:
333 file_mods--verbose:
333 file_mods--verbose:
334 file_mods--verbose:
334 file_mods--verbose:
335 file_mods--verbose:
335 file_mods--verbose:
336 file_mods--verbose:
336 file_mods--verbose:
337 file_mods--verbose: c
337 file_mods--verbose: c
338 file_mods--verbose:
338 file_mods--verbose:
339 file_mods--verbose:
339 file_mods--verbose:
340 file_mods--verbose:
340 file_mods--verbose:
341 file_mods--debug:
341 file_mods--debug:
342 file_mods--debug:
342 file_mods--debug:
343 file_mods--debug:
343 file_mods--debug:
344 file_mods--debug:
344 file_mods--debug:
345 file_mods--debug:
345 file_mods--debug:
346 file_mods--debug: c
346 file_mods--debug: c
347 file_mods--debug:
347 file_mods--debug:
348 file_mods--debug:
348 file_mods--debug:
349 file_mods--debug:
349 file_mods--debug:
350 file_copies: fourth (second)
350 file_copies: fourth (second)
351 file_copies:
351 file_copies:
352 file_copies:
352 file_copies:
353 file_copies:
353 file_copies:
354 file_copies:
354 file_copies:
355 file_copies:
355 file_copies:
356 file_copies:
356 file_copies:
357 file_copies:
357 file_copies:
358 file_copies:
358 file_copies:
359 file_copies--verbose: fourth (second)
359 file_copies--verbose: fourth (second)
360 file_copies--verbose:
360 file_copies--verbose:
361 file_copies--verbose:
361 file_copies--verbose:
362 file_copies--verbose:
362 file_copies--verbose:
363 file_copies--verbose:
363 file_copies--verbose:
364 file_copies--verbose:
364 file_copies--verbose:
365 file_copies--verbose:
365 file_copies--verbose:
366 file_copies--verbose:
366 file_copies--verbose:
367 file_copies--verbose:
367 file_copies--verbose:
368 file_copies--debug: fourth (second)
368 file_copies--debug: fourth (second)
369 file_copies--debug:
369 file_copies--debug:
370 file_copies--debug:
370 file_copies--debug:
371 file_copies--debug:
371 file_copies--debug:
372 file_copies--debug:
372 file_copies--debug:
373 file_copies--debug:
373 file_copies--debug:
374 file_copies--debug:
374 file_copies--debug:
375 file_copies--debug:
375 file_copies--debug:
376 file_copies--debug:
376 file_copies--debug:
377 file_copies_switch:
377 file_copies_switch:
378 file_copies_switch:
378 file_copies_switch:
379 file_copies_switch:
379 file_copies_switch:
380 file_copies_switch:
380 file_copies_switch:
381 file_copies_switch:
381 file_copies_switch:
382 file_copies_switch:
382 file_copies_switch:
383 file_copies_switch:
383 file_copies_switch:
384 file_copies_switch:
384 file_copies_switch:
385 file_copies_switch:
385 file_copies_switch:
386 file_copies_switch--verbose:
386 file_copies_switch--verbose:
387 file_copies_switch--verbose:
387 file_copies_switch--verbose:
388 file_copies_switch--verbose:
388 file_copies_switch--verbose:
389 file_copies_switch--verbose:
389 file_copies_switch--verbose:
390 file_copies_switch--verbose:
390 file_copies_switch--verbose:
391 file_copies_switch--verbose:
391 file_copies_switch--verbose:
392 file_copies_switch--verbose:
392 file_copies_switch--verbose:
393 file_copies_switch--verbose:
393 file_copies_switch--verbose:
394 file_copies_switch--verbose:
394 file_copies_switch--verbose:
395 file_copies_switch--debug:
395 file_copies_switch--debug:
396 file_copies_switch--debug:
396 file_copies_switch--debug:
397 file_copies_switch--debug:
397 file_copies_switch--debug:
398 file_copies_switch--debug:
398 file_copies_switch--debug:
399 file_copies_switch--debug:
399 file_copies_switch--debug:
400 file_copies_switch--debug:
400 file_copies_switch--debug:
401 file_copies_switch--debug:
401 file_copies_switch--debug:
402 file_copies_switch--debug:
402 file_copies_switch--debug:
403 file_copies_switch--debug:
403 file_copies_switch--debug:
404 files: fourth second third
404 files: fourth second third
405 files: second
405 files: second
406 files:
406 files:
407 files: d
407 files: d
408 files:
408 files:
409 files: c
409 files: c
410 files: c
410 files: c
411 files: b
411 files: b
412 files: a
412 files: a
413 files--verbose: fourth second third
413 files--verbose: fourth second third
414 files--verbose: second
414 files--verbose: second
415 files--verbose:
415 files--verbose:
416 files--verbose: d
416 files--verbose: d
417 files--verbose:
417 files--verbose:
418 files--verbose: c
418 files--verbose: c
419 files--verbose: c
419 files--verbose: c
420 files--verbose: b
420 files--verbose: b
421 files--verbose: a
421 files--verbose: a
422 files--debug: fourth second third
422 files--debug: fourth second third
423 files--debug: second
423 files--debug: second
424 files--debug:
424 files--debug:
425 files--debug: d
425 files--debug: d
426 files--debug:
426 files--debug:
427 files--debug: c
427 files--debug: c
428 files--debug: c
428 files--debug: c
429 files--debug: b
429 files--debug: b
430 files--debug: a
430 files--debug: a
431 manifest: 6:94961b75a2da
431 manifest: 6:94961b75a2da
432 manifest: 5:f2dbc354b94e
432 manifest: 5:f2dbc354b94e
433 manifest: 4:4dc3def4f9b4
433 manifest: 4:4dc3def4f9b4
434 manifest: 4:4dc3def4f9b4
434 manifest: 4:4dc3def4f9b4
435 manifest: 3:cb5a1327723b
435 manifest: 3:cb5a1327723b
436 manifest: 3:cb5a1327723b
436 manifest: 3:cb5a1327723b
437 manifest: 2:6e0e82995c35
437 manifest: 2:6e0e82995c35
438 manifest: 1:4e8d705b1e53
438 manifest: 1:4e8d705b1e53
439 manifest: 0:a0c8bcbbb45c
439 manifest: 0:a0c8bcbbb45c
440 manifest--verbose: 6:94961b75a2da
440 manifest--verbose: 6:94961b75a2da
441 manifest--verbose: 5:f2dbc354b94e
441 manifest--verbose: 5:f2dbc354b94e
442 manifest--verbose: 4:4dc3def4f9b4
442 manifest--verbose: 4:4dc3def4f9b4
443 manifest--verbose: 4:4dc3def4f9b4
443 manifest--verbose: 4:4dc3def4f9b4
444 manifest--verbose: 3:cb5a1327723b
444 manifest--verbose: 3:cb5a1327723b
445 manifest--verbose: 3:cb5a1327723b
445 manifest--verbose: 3:cb5a1327723b
446 manifest--verbose: 2:6e0e82995c35
446 manifest--verbose: 2:6e0e82995c35
447 manifest--verbose: 1:4e8d705b1e53
447 manifest--verbose: 1:4e8d705b1e53
448 manifest--verbose: 0:a0c8bcbbb45c
448 manifest--verbose: 0:a0c8bcbbb45c
449 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
449 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
450 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
450 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
451 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
451 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
452 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
452 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
453 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
453 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
454 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
454 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
455 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
455 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
456 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
456 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
457 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
457 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
458 node: 95c24699272ef57d062b8bccc32c878bf841784a
458 node: 95c24699272ef57d062b8bccc32c878bf841784a
459 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
459 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
460 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
460 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
461 node: 13207e5a10d9fd28ec424934298e176197f2c67f
461 node: 13207e5a10d9fd28ec424934298e176197f2c67f
462 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
462 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
463 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
463 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
464 node: 97054abb4ab824450e9164180baf491ae0078465
464 node: 97054abb4ab824450e9164180baf491ae0078465
465 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
465 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
466 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
466 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
467 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
467 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
468 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
468 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
469 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
469 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
470 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
470 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
471 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
471 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
472 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
472 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
473 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
473 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
474 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
474 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
475 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
475 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
476 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
476 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
477 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
477 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
478 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
478 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
479 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
479 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
480 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
480 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
481 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
481 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
482 node--debug: 97054abb4ab824450e9164180baf491ae0078465
482 node--debug: 97054abb4ab824450e9164180baf491ae0078465
483 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
483 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
484 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
484 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
485 parents:
485 parents:
486 parents: -1:000000000000
486 parents: -1:000000000000
487 parents: 5:13207e5a10d9 4:bbe44766e73d
487 parents: 5:13207e5a10d9 4:bbe44766e73d
488 parents: 3:10e46f2dcbf4
488 parents: 3:10e46f2dcbf4
489 parents:
489 parents:
490 parents:
490 parents:
491 parents:
491 parents:
492 parents:
492 parents:
493 parents:
493 parents:
494 parents--verbose:
494 parents--verbose:
495 parents--verbose: -1:000000000000
495 parents--verbose: -1:000000000000
496 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
496 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
497 parents--verbose: 3:10e46f2dcbf4
497 parents--verbose: 3:10e46f2dcbf4
498 parents--verbose:
498 parents--verbose:
499 parents--verbose:
499 parents--verbose:
500 parents--verbose:
500 parents--verbose:
501 parents--verbose:
501 parents--verbose:
502 parents--verbose:
502 parents--verbose:
503 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
503 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
504 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
504 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
505 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
505 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
506 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
506 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
507 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
507 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
508 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
508 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
509 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
509 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
510 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
510 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
511 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
511 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
512 rev: 8
512 rev: 8
513 rev: 7
513 rev: 7
514 rev: 6
514 rev: 6
515 rev: 5
515 rev: 5
516 rev: 4
516 rev: 4
517 rev: 3
517 rev: 3
518 rev: 2
518 rev: 2
519 rev: 1
519 rev: 1
520 rev: 0
520 rev: 0
521 rev--verbose: 8
521 rev--verbose: 8
522 rev--verbose: 7
522 rev--verbose: 7
523 rev--verbose: 6
523 rev--verbose: 6
524 rev--verbose: 5
524 rev--verbose: 5
525 rev--verbose: 4
525 rev--verbose: 4
526 rev--verbose: 3
526 rev--verbose: 3
527 rev--verbose: 2
527 rev--verbose: 2
528 rev--verbose: 1
528 rev--verbose: 1
529 rev--verbose: 0
529 rev--verbose: 0
530 rev--debug: 8
530 rev--debug: 8
531 rev--debug: 7
531 rev--debug: 7
532 rev--debug: 6
532 rev--debug: 6
533 rev--debug: 5
533 rev--debug: 5
534 rev--debug: 4
534 rev--debug: 4
535 rev--debug: 3
535 rev--debug: 3
536 rev--debug: 2
536 rev--debug: 2
537 rev--debug: 1
537 rev--debug: 1
538 rev--debug: 0
538 rev--debug: 0
539 tags: tip
539 tags: tip
540 tags:
540 tags:
541 tags:
541 tags:
542 tags:
542 tags:
543 tags:
543 tags:
544 tags:
544 tags:
545 tags:
545 tags:
546 tags:
546 tags:
547 tags:
547 tags:
548 tags--verbose: tip
548 tags--verbose: tip
549 tags--verbose:
549 tags--verbose:
550 tags--verbose:
550 tags--verbose:
551 tags--verbose:
551 tags--verbose:
552 tags--verbose:
552 tags--verbose:
553 tags--verbose:
553 tags--verbose:
554 tags--verbose:
554 tags--verbose:
555 tags--verbose:
555 tags--verbose:
556 tags--verbose:
556 tags--verbose:
557 tags--debug: tip
557 tags--debug: tip
558 tags--debug:
558 tags--debug:
559 tags--debug:
559 tags--debug:
560 tags--debug:
560 tags--debug:
561 tags--debug:
561 tags--debug:
562 tags--debug:
562 tags--debug:
563 tags--debug:
563 tags--debug:
564 tags--debug:
564 tags--debug:
565 tags--debug:
565 tags--debug:
566 diffstat: 3: +2/-1
566 diffstat: 3: +2/-1
567 diffstat: 1: +1/-0
567 diffstat: 1: +1/-0
568 diffstat: 0: +0/-0
568 diffstat: 0: +0/-0
569 diffstat: 1: +1/-0
569 diffstat: 1: +1/-0
570 diffstat: 0: +0/-0
570 diffstat: 0: +0/-0
571 diffstat: 1: +1/-0
571 diffstat: 1: +1/-0
572 diffstat: 1: +4/-0
572 diffstat: 1: +4/-0
573 diffstat: 1: +2/-0
573 diffstat: 1: +2/-0
574 diffstat: 1: +1/-0
574 diffstat: 1: +1/-0
575 diffstat--verbose: 3: +2/-1
575 diffstat--verbose: 3: +2/-1
576 diffstat--verbose: 1: +1/-0
576 diffstat--verbose: 1: +1/-0
577 diffstat--verbose: 0: +0/-0
577 diffstat--verbose: 0: +0/-0
578 diffstat--verbose: 1: +1/-0
578 diffstat--verbose: 1: +1/-0
579 diffstat--verbose: 0: +0/-0
579 diffstat--verbose: 0: +0/-0
580 diffstat--verbose: 1: +1/-0
580 diffstat--verbose: 1: +1/-0
581 diffstat--verbose: 1: +4/-0
581 diffstat--verbose: 1: +4/-0
582 diffstat--verbose: 1: +2/-0
582 diffstat--verbose: 1: +2/-0
583 diffstat--verbose: 1: +1/-0
583 diffstat--verbose: 1: +1/-0
584 diffstat--debug: 3: +2/-1
584 diffstat--debug: 3: +2/-1
585 diffstat--debug: 1: +1/-0
585 diffstat--debug: 1: +1/-0
586 diffstat--debug: 0: +0/-0
586 diffstat--debug: 0: +0/-0
587 diffstat--debug: 1: +1/-0
587 diffstat--debug: 1: +1/-0
588 diffstat--debug: 0: +0/-0
588 diffstat--debug: 0: +0/-0
589 diffstat--debug: 1: +1/-0
589 diffstat--debug: 1: +1/-0
590 diffstat--debug: 1: +4/-0
590 diffstat--debug: 1: +4/-0
591 diffstat--debug: 1: +2/-0
591 diffstat--debug: 1: +2/-0
592 diffstat--debug: 1: +1/-0
592 diffstat--debug: 1: +1/-0
593 extras: branch=default
593 extras: branch=default
594 extras: branch=default
594 extras: branch=default
595 extras: branch=default
595 extras: branch=default
596 extras: branch=default
596 extras: branch=default
597 extras: branch=foo
597 extras: branch=foo
598 extras: branch=default
598 extras: branch=default
599 extras: branch=default
599 extras: branch=default
600 extras: branch=default
600 extras: branch=default
601 extras: branch=default
601 extras: branch=default
602 extras--verbose: branch=default
602 extras--verbose: branch=default
603 extras--verbose: branch=default
603 extras--verbose: branch=default
604 extras--verbose: branch=default
604 extras--verbose: branch=default
605 extras--verbose: branch=default
605 extras--verbose: branch=default
606 extras--verbose: branch=foo
606 extras--verbose: branch=foo
607 extras--verbose: branch=default
607 extras--verbose: branch=default
608 extras--verbose: branch=default
608 extras--verbose: branch=default
609 extras--verbose: branch=default
609 extras--verbose: branch=default
610 extras--verbose: branch=default
610 extras--verbose: branch=default
611 extras--debug: branch=default
611 extras--debug: branch=default
612 extras--debug: branch=default
612 extras--debug: branch=default
613 extras--debug: branch=default
613 extras--debug: branch=default
614 extras--debug: branch=default
614 extras--debug: branch=default
615 extras--debug: branch=foo
615 extras--debug: branch=foo
616 extras--debug: branch=default
616 extras--debug: branch=default
617 extras--debug: branch=default
617 extras--debug: branch=default
618 extras--debug: branch=default
618 extras--debug: branch=default
619 extras--debug: branch=default
619 extras--debug: branch=default
620 p1rev: 7
620 p1rev: 7
621 p1rev: -1
621 p1rev: -1
622 p1rev: 5
622 p1rev: 5
623 p1rev: 3
623 p1rev: 3
624 p1rev: 3
624 p1rev: 3
625 p1rev: 2
625 p1rev: 2
626 p1rev: 1
626 p1rev: 1
627 p1rev: 0
627 p1rev: 0
628 p1rev: -1
628 p1rev: -1
629 p1rev--verbose: 7
629 p1rev--verbose: 7
630 p1rev--verbose: -1
630 p1rev--verbose: -1
631 p1rev--verbose: 5
631 p1rev--verbose: 5
632 p1rev--verbose: 3
632 p1rev--verbose: 3
633 p1rev--verbose: 3
633 p1rev--verbose: 3
634 p1rev--verbose: 2
634 p1rev--verbose: 2
635 p1rev--verbose: 1
635 p1rev--verbose: 1
636 p1rev--verbose: 0
636 p1rev--verbose: 0
637 p1rev--verbose: -1
637 p1rev--verbose: -1
638 p1rev--debug: 7
638 p1rev--debug: 7
639 p1rev--debug: -1
639 p1rev--debug: -1
640 p1rev--debug: 5
640 p1rev--debug: 5
641 p1rev--debug: 3
641 p1rev--debug: 3
642 p1rev--debug: 3
642 p1rev--debug: 3
643 p1rev--debug: 2
643 p1rev--debug: 2
644 p1rev--debug: 1
644 p1rev--debug: 1
645 p1rev--debug: 0
645 p1rev--debug: 0
646 p1rev--debug: -1
646 p1rev--debug: -1
647 p2rev: -1
647 p2rev: -1
648 p2rev: -1
648 p2rev: -1
649 p2rev: 4
649 p2rev: 4
650 p2rev: -1
650 p2rev: -1
651 p2rev: -1
651 p2rev: -1
652 p2rev: -1
652 p2rev: -1
653 p2rev: -1
653 p2rev: -1
654 p2rev: -1
654 p2rev: -1
655 p2rev: -1
655 p2rev: -1
656 p2rev--verbose: -1
656 p2rev--verbose: -1
657 p2rev--verbose: -1
657 p2rev--verbose: -1
658 p2rev--verbose: 4
658 p2rev--verbose: 4
659 p2rev--verbose: -1
659 p2rev--verbose: -1
660 p2rev--verbose: -1
660 p2rev--verbose: -1
661 p2rev--verbose: -1
661 p2rev--verbose: -1
662 p2rev--verbose: -1
662 p2rev--verbose: -1
663 p2rev--verbose: -1
663 p2rev--verbose: -1
664 p2rev--verbose: -1
664 p2rev--verbose: -1
665 p2rev--debug: -1
665 p2rev--debug: -1
666 p2rev--debug: -1
666 p2rev--debug: -1
667 p2rev--debug: 4
667 p2rev--debug: 4
668 p2rev--debug: -1
668 p2rev--debug: -1
669 p2rev--debug: -1
669 p2rev--debug: -1
670 p2rev--debug: -1
670 p2rev--debug: -1
671 p2rev--debug: -1
671 p2rev--debug: -1
672 p2rev--debug: -1
672 p2rev--debug: -1
673 p2rev--debug: -1
673 p2rev--debug: -1
674 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
674 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
675 p1node: 0000000000000000000000000000000000000000
675 p1node: 0000000000000000000000000000000000000000
676 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
676 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
677 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
677 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
678 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
678 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
679 p1node: 97054abb4ab824450e9164180baf491ae0078465
679 p1node: 97054abb4ab824450e9164180baf491ae0078465
680 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
680 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
681 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
681 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
682 p1node: 0000000000000000000000000000000000000000
682 p1node: 0000000000000000000000000000000000000000
683 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
683 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
684 p1node--verbose: 0000000000000000000000000000000000000000
684 p1node--verbose: 0000000000000000000000000000000000000000
685 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
685 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
686 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
686 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
687 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
687 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
688 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
688 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
689 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
689 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
690 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
690 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
691 p1node--verbose: 0000000000000000000000000000000000000000
691 p1node--verbose: 0000000000000000000000000000000000000000
692 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
692 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
693 p1node--debug: 0000000000000000000000000000000000000000
693 p1node--debug: 0000000000000000000000000000000000000000
694 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
694 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
695 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
695 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
696 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
696 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
697 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
697 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
698 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
698 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
699 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
699 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
700 p1node--debug: 0000000000000000000000000000000000000000
700 p1node--debug: 0000000000000000000000000000000000000000
701 p2node: 0000000000000000000000000000000000000000
701 p2node: 0000000000000000000000000000000000000000
702 p2node: 0000000000000000000000000000000000000000
702 p2node: 0000000000000000000000000000000000000000
703 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
703 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
704 p2node: 0000000000000000000000000000000000000000
704 p2node: 0000000000000000000000000000000000000000
705 p2node: 0000000000000000000000000000000000000000
705 p2node: 0000000000000000000000000000000000000000
706 p2node: 0000000000000000000000000000000000000000
706 p2node: 0000000000000000000000000000000000000000
707 p2node: 0000000000000000000000000000000000000000
707 p2node: 0000000000000000000000000000000000000000
708 p2node: 0000000000000000000000000000000000000000
708 p2node: 0000000000000000000000000000000000000000
709 p2node: 0000000000000000000000000000000000000000
709 p2node: 0000000000000000000000000000000000000000
710 p2node--verbose: 0000000000000000000000000000000000000000
710 p2node--verbose: 0000000000000000000000000000000000000000
711 p2node--verbose: 0000000000000000000000000000000000000000
711 p2node--verbose: 0000000000000000000000000000000000000000
712 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
712 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
713 p2node--verbose: 0000000000000000000000000000000000000000
713 p2node--verbose: 0000000000000000000000000000000000000000
714 p2node--verbose: 0000000000000000000000000000000000000000
714 p2node--verbose: 0000000000000000000000000000000000000000
715 p2node--verbose: 0000000000000000000000000000000000000000
715 p2node--verbose: 0000000000000000000000000000000000000000
716 p2node--verbose: 0000000000000000000000000000000000000000
716 p2node--verbose: 0000000000000000000000000000000000000000
717 p2node--verbose: 0000000000000000000000000000000000000000
717 p2node--verbose: 0000000000000000000000000000000000000000
718 p2node--verbose: 0000000000000000000000000000000000000000
718 p2node--verbose: 0000000000000000000000000000000000000000
719 p2node--debug: 0000000000000000000000000000000000000000
719 p2node--debug: 0000000000000000000000000000000000000000
720 p2node--debug: 0000000000000000000000000000000000000000
720 p2node--debug: 0000000000000000000000000000000000000000
721 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
721 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
722 p2node--debug: 0000000000000000000000000000000000000000
722 p2node--debug: 0000000000000000000000000000000000000000
723 p2node--debug: 0000000000000000000000000000000000000000
723 p2node--debug: 0000000000000000000000000000000000000000
724 p2node--debug: 0000000000000000000000000000000000000000
724 p2node--debug: 0000000000000000000000000000000000000000
725 p2node--debug: 0000000000000000000000000000000000000000
725 p2node--debug: 0000000000000000000000000000000000000000
726 p2node--debug: 0000000000000000000000000000000000000000
726 p2node--debug: 0000000000000000000000000000000000000000
727 p2node--debug: 0000000000000000000000000000000000000000
727 p2node--debug: 0000000000000000000000000000000000000000
728 user: test
728 user: test
729 user: User Name <user@hostname>
729 user: User Name <user@hostname>
730 user: person
730 user: person
731 user: person
731 user: person
732 user: person
732 user: person
733 user: person
733 user: person
734 user: other@place
734 user: other@place
735 user: A. N. Other <other@place>
735 user: A. N. Other <other@place>
736 user: User Name <user@hostname>
736 user: User Name <user@hostname>
737 user--verbose: test
737 user--verbose: test
738 user--verbose: User Name <user@hostname>
738 user--verbose: User Name <user@hostname>
739 user--verbose: person
739 user--verbose: person
740 user--verbose: person
740 user--verbose: person
741 user--verbose: person
741 user--verbose: person
742 user--verbose: person
742 user--verbose: person
743 user--verbose: other@place
743 user--verbose: other@place
744 user--verbose: A. N. Other <other@place>
744 user--verbose: A. N. Other <other@place>
745 user--verbose: User Name <user@hostname>
745 user--verbose: User Name <user@hostname>
746 user--debug: test
746 user--debug: test
747 user--debug: User Name <user@hostname>
747 user--debug: User Name <user@hostname>
748 user--debug: person
748 user--debug: person
749 user--debug: person
749 user--debug: person
750 user--debug: person
750 user--debug: person
751 user--debug: person
751 user--debug: person
752 user--debug: other@place
752 user--debug: other@place
753 user--debug: A. N. Other <other@place>
753 user--debug: A. N. Other <other@place>
754 user--debug: User Name <user@hostname>
754 user--debug: User Name <user@hostname>
755
755
756 Add a dummy commit to make up for the instability of the above:
756 Add a dummy commit to make up for the instability of the above:
757
757
758 $ echo a > a
758 $ echo a > a
759 $ hg add a
759 $ hg add a
760 $ hg ci -m future
760 $ hg ci -m future
761
761
762 Add a commit that does all possible modifications at once
762 Add a commit that does all possible modifications at once
763
763
764 $ echo modify >> third
764 $ echo modify >> third
765 $ touch b
765 $ touch b
766 $ hg add b
766 $ hg add b
767 $ hg mv fourth fifth
767 $ hg mv fourth fifth
768 $ hg rm a
768 $ hg rm a
769 $ hg ci -m "Modify, add, remove, rename"
769 $ hg ci -m "Modify, add, remove, rename"
770
770
771 Test files list:
771 Test files list:
772
772
773 $ hg log -l1 -T '{join(file_mods, " ")}\n'
773 $ hg log -l1 -T '{join(file_mods, " ")}\n'
774 third
774 third
775 $ hg log -l1 -T '{file_mods % "{file}\n"}'
775 $ hg log -l1 -T '{file_mods % "{file}\n"}'
776 third
776 third
777 $ hg log -l1 -T '{file_mods % "{path}\n"}'
777 $ hg log -l1 -T '{file_mods % "{path}\n"}'
778 third
778 third
779
779
780 $ hg log -l1 -T '{join(files, " ")}\n'
780 $ hg log -l1 -T '{join(files, " ")}\n'
781 a b fifth fourth third
781 a b fifth fourth third
782 $ hg log -l1 -T '{files % "{file}\n"}'
782 $ hg log -l1 -T '{files % "{file}\n"}'
783 a
783 a
784 b
784 b
785 fifth
785 fifth
786 fourth
786 fourth
787 third
787 third
788 $ hg log -l1 -T '{files % "{path}\n"}'
788 $ hg log -l1 -T '{files % "{path}\n"}'
789 a
789 a
790 b
790 b
791 fifth
791 fifth
792 fourth
792 fourth
793 third
793 third
794
794
795 Test file copies dict:
795 Test file copies dict:
796
796
797 $ hg log -r8 -T '{join(file_copies, " ")}\n'
797 $ hg log -r8 -T '{join(file_copies, " ")}\n'
798 fourth (second)
798 fourth (second)
799 $ hg log -r8 -T '{file_copies % "{name} <- {source}\n"}'
799 $ hg log -r8 -T '{file_copies % "{name} <- {source}\n"}'
800 fourth <- second
800 fourth <- second
801 $ hg log -r8 -T '{file_copies % "{path} <- {source}\n"}'
801 $ hg log -r8 -T '{file_copies % "{path} <- {source}\n"}'
802 fourth <- second
802 fourth <- second
803
803
804 $ hg log -r8 -T '{join(file_copies_switch, " ")}\n'
804 $ hg log -r8 -T '{join(file_copies_switch, " ")}\n'
805
805
806 $ hg log -r8 -C -T '{join(file_copies_switch, " ")}\n'
806 $ hg log -r8 -C -T '{join(file_copies_switch, " ")}\n'
807 fourth (second)
807 fourth (second)
808 $ hg log -r8 -C -T '{file_copies_switch % "{name} <- {source}\n"}'
808 $ hg log -r8 -C -T '{file_copies_switch % "{name} <- {source}\n"}'
809 fourth <- second
809 fourth <- second
810 $ hg log -r8 -C -T '{file_copies_switch % "{path} <- {source}\n"}'
810 $ hg log -r8 -C -T '{file_copies_switch % "{path} <- {source}\n"}'
811 fourth <- second
811 fourth <- second
812
812
813 Test file attributes:
813 Test file attributes:
814
814
815 $ hg log -l1 -T '{files % "{status} {pad(size, 3, left=True)} {path}\n"}'
815 $ hg log -l1 -T '{files % "{status} {pad(size, 3, left=True)} {path}\n"}'
816 R a
816 R a
817 A 0 b
817 A 0 b
818 A 7 fifth
818 A 7 fifth
819 R fourth
819 R fourth
820 M 13 third
820 M 13 third
821
821
822 Test file status including clean ones:
822 Test file status including clean ones:
823
823
824 $ hg log -r9 -T '{files("**") % "{status} {path}\n"}'
824 $ hg log -r9 -T '{files("**") % "{status} {path}\n"}'
825 A a
825 A a
826 C fourth
826 C fourth
827 C third
827 C third
828
828
829 Test index keyword:
829 Test index keyword:
830
830
831 $ hg log -l 2 -T '{index + 10}{files % " {index}:{file}"}\n'
831 $ hg log -l 2 -T '{index + 10}{files % " {index}:{file}"}\n'
832 10 0:a 1:b 2:fifth 3:fourth 4:third
832 10 0:a 1:b 2:fifth 3:fourth 4:third
833 11 0:a
833 11 0:a
834
834
835 $ hg branches -T '{index} {branch}\n'
835 $ hg branches -T '{index} {branch}\n'
836 0 default
836 0 default
837 1 foo
837 1 foo
838
838
839 p1/p2 keywords:
840
841 $ hg log -r4:7 -GT '{rev} p1:{p1} p2:{p2} p1.rev:{p1.rev} p2.node:{p2.node}\n'
842 o 7 p1:-1:000000000000 p2:-1:000000000000 p1.rev:-1 p2.node:0000000000000000000000000000000000000000
843
844 o 6 p1:5:13207e5a10d9 p2:4:bbe44766e73d p1.rev:5 p2.node:bbe44766e73d5f11ed2177f1838de10c53ef3e74
845 |\
846 | o 5 p1:3:10e46f2dcbf4 p2:-1:000000000000 p1.rev:3 p2.node:0000000000000000000000000000000000000000
847 | |
848 | ~
849 o 4 p1:3:10e46f2dcbf4 p2:-1:000000000000 p1.rev:3 p2.node:0000000000000000000000000000000000000000
850 |
851 ~
852
853 TODO: no idea what should be displayed as a JSON representation
854 $ hg log -r6 -T 'p1:{p1|json}\np2:{p2|json}\n'
855 p1:{}
856 p2:{}
857
839 ui verbosity:
858 ui verbosity:
840
859
841 $ hg log -l1 -T '{verbosity}\n'
860 $ hg log -l1 -T '{verbosity}\n'
842
861
843 $ hg log -l1 -T '{verbosity}\n' --debug
862 $ hg log -l1 -T '{verbosity}\n' --debug
844 debug
863 debug
845 $ hg log -l1 -T '{verbosity}\n' --quiet
864 $ hg log -l1 -T '{verbosity}\n' --quiet
846 quiet
865 quiet
847 $ hg log -l1 -T '{verbosity}\n' --verbose
866 $ hg log -l1 -T '{verbosity}\n' --verbose
848 verbose
867 verbose
849
868
850 $ cd ..
869 $ cd ..
851
870
852 latesttag:
871 latesttag:
853
872
854 $ hg init latesttag
873 $ hg init latesttag
855 $ cd latesttag
874 $ cd latesttag
856
875
857 $ echo a > file
876 $ echo a > file
858 $ hg ci -Am a -d '0 0'
877 $ hg ci -Am a -d '0 0'
859 adding file
878 adding file
860
879
861 $ echo b >> file
880 $ echo b >> file
862 $ hg ci -m b -d '1 0'
881 $ hg ci -m b -d '1 0'
863
882
864 $ echo c >> head1
883 $ echo c >> head1
865 $ hg ci -Am h1c -d '2 0'
884 $ hg ci -Am h1c -d '2 0'
866 adding head1
885 adding head1
867
886
868 $ hg update -q 1
887 $ hg update -q 1
869 $ echo d >> head2
888 $ echo d >> head2
870 $ hg ci -Am h2d -d '3 0'
889 $ hg ci -Am h2d -d '3 0'
871 adding head2
890 adding head2
872 created new head
891 created new head
873
892
874 $ echo e >> head2
893 $ echo e >> head2
875 $ hg ci -m h2e -d '4 0'
894 $ hg ci -m h2e -d '4 0'
876
895
877 $ hg merge -q
896 $ hg merge -q
878 $ hg ci -m merge -d '5 -3600'
897 $ hg ci -m merge -d '5 -3600'
879
898
880 No tag set:
899 No tag set:
881
900
882 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
901 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
883 @ 5: null+5
902 @ 5: null+5
884 |\
903 |\
885 | o 4: null+4
904 | o 4: null+4
886 | |
905 | |
887 | o 3: null+3
906 | o 3: null+3
888 | |
907 | |
889 o | 2: null+3
908 o | 2: null+3
890 |/
909 |/
891 o 1: null+2
910 o 1: null+2
892 |
911 |
893 o 0: null+1
912 o 0: null+1
894
913
895
914
896 One common tag: longest path wins for {latesttagdistance}:
915 One common tag: longest path wins for {latesttagdistance}:
897
916
898 $ hg tag -r 1 -m t1 -d '6 0' t1
917 $ hg tag -r 1 -m t1 -d '6 0' t1
899 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
918 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
900 @ 6: t1+4
919 @ 6: t1+4
901 |
920 |
902 o 5: t1+3
921 o 5: t1+3
903 |\
922 |\
904 | o 4: t1+2
923 | o 4: t1+2
905 | |
924 | |
906 | o 3: t1+1
925 | o 3: t1+1
907 | |
926 | |
908 o | 2: t1+1
927 o | 2: t1+1
909 |/
928 |/
910 o 1: t1+0
929 o 1: t1+0
911 |
930 |
912 o 0: null+1
931 o 0: null+1
913
932
914
933
915 One ancestor tag: closest wins:
934 One ancestor tag: closest wins:
916
935
917 $ hg tag -r 2 -m t2 -d '7 0' t2
936 $ hg tag -r 2 -m t2 -d '7 0' t2
918 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
937 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
919 @ 7: t2+3
938 @ 7: t2+3
920 |
939 |
921 o 6: t2+2
940 o 6: t2+2
922 |
941 |
923 o 5: t2+1
942 o 5: t2+1
924 |\
943 |\
925 | o 4: t1+2
944 | o 4: t1+2
926 | |
945 | |
927 | o 3: t1+1
946 | o 3: t1+1
928 | |
947 | |
929 o | 2: t2+0
948 o | 2: t2+0
930 |/
949 |/
931 o 1: t1+0
950 o 1: t1+0
932 |
951 |
933 o 0: null+1
952 o 0: null+1
934
953
935
954
936 Two branch tags: more recent wins if same number of changes:
955 Two branch tags: more recent wins if same number of changes:
937
956
938 $ hg tag -r 3 -m t3 -d '8 0' t3
957 $ hg tag -r 3 -m t3 -d '8 0' t3
939 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
958 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
940 @ 8: t3+5
959 @ 8: t3+5
941 |
960 |
942 o 7: t3+4
961 o 7: t3+4
943 |
962 |
944 o 6: t3+3
963 o 6: t3+3
945 |
964 |
946 o 5: t3+2
965 o 5: t3+2
947 |\
966 |\
948 | o 4: t3+1
967 | o 4: t3+1
949 | |
968 | |
950 | o 3: t3+0
969 | o 3: t3+0
951 | |
970 | |
952 o | 2: t2+0
971 o | 2: t2+0
953 |/
972 |/
954 o 1: t1+0
973 o 1: t1+0
955 |
974 |
956 o 0: null+1
975 o 0: null+1
957
976
958
977
959 Two branch tags: fewest changes wins:
978 Two branch tags: fewest changes wins:
960
979
961 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter
980 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter
962 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
981 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
963 @ 9: t4+5,6
982 @ 9: t4+5,6
964 |
983 |
965 o 8: t4+4,5
984 o 8: t4+4,5
966 |
985 |
967 o 7: t4+3,4
986 o 7: t4+3,4
968 |
987 |
969 o 6: t4+2,3
988 o 6: t4+2,3
970 |
989 |
971 o 5: t4+1,2
990 o 5: t4+1,2
972 |\
991 |\
973 | o 4: t4+0,0
992 | o 4: t4+0,0
974 | |
993 | |
975 | o 3: t3+0,0
994 | o 3: t3+0,0
976 | |
995 | |
977 o | 2: t2+0,0
996 o | 2: t2+0,0
978 |/
997 |/
979 o 1: t1+0,0
998 o 1: t1+0,0
980 |
999 |
981 o 0: null+1,1
1000 o 0: null+1,1
982
1001
983
1002
984 Merged tag overrides:
1003 Merged tag overrides:
985
1004
986 $ hg tag -r 5 -m t5 -d '9 0' t5
1005 $ hg tag -r 5 -m t5 -d '9 0' t5
987 $ hg tag -r 3 -m at3 -d '10 0' at3
1006 $ hg tag -r 3 -m at3 -d '10 0' at3
988 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
1007 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n'
989 @ 11: t5+6
1008 @ 11: t5+6
990 |
1009 |
991 o 10: t5+5
1010 o 10: t5+5
992 |
1011 |
993 o 9: t5+4
1012 o 9: t5+4
994 |
1013 |
995 o 8: t5+3
1014 o 8: t5+3
996 |
1015 |
997 o 7: t5+2
1016 o 7: t5+2
998 |
1017 |
999 o 6: t5+1
1018 o 6: t5+1
1000 |
1019 |
1001 o 5: t5+0
1020 o 5: t5+0
1002 |\
1021 |\
1003 | o 4: t4+0
1022 | o 4: t4+0
1004 | |
1023 | |
1005 | o 3: at3:t3+0
1024 | o 3: at3:t3+0
1006 | |
1025 | |
1007 o | 2: t2+0
1026 o | 2: t2+0
1008 |/
1027 |/
1009 o 1: t1+0
1028 o 1: t1+0
1010 |
1029 |
1011 o 0: null+1
1030 o 0: null+1
1012
1031
1013
1032
1014 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
1033 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n"
1015 @ 11: t5+6,6
1034 @ 11: t5+6,6
1016 |
1035 |
1017 o 10: t5+5,5
1036 o 10: t5+5,5
1018 |
1037 |
1019 o 9: t5+4,4
1038 o 9: t5+4,4
1020 |
1039 |
1021 o 8: t5+3,3
1040 o 8: t5+3,3
1022 |
1041 |
1023 o 7: t5+2,2
1042 o 7: t5+2,2
1024 |
1043 |
1025 o 6: t5+1,1
1044 o 6: t5+1,1
1026 |
1045 |
1027 o 5: t5+0,0
1046 o 5: t5+0,0
1028 |\
1047 |\
1029 | o 4: t4+0,0
1048 | o 4: t4+0,0
1030 | |
1049 | |
1031 | o 3: at3+0,0 t3+0,0
1050 | o 3: at3+0,0 t3+0,0
1032 | |
1051 | |
1033 o | 2: t2+0,0
1052 o | 2: t2+0,0
1034 |/
1053 |/
1035 o 1: t1+0,0
1054 o 1: t1+0,0
1036 |
1055 |
1037 o 0: null+1,1
1056 o 0: null+1,1
1038
1057
1039
1058
1040 $ cd ..
1059 $ cd ..
1041
1060
1042 Set up repository containing template fragments in commit metadata:
1061 Set up repository containing template fragments in commit metadata:
1043
1062
1044 $ hg init r
1063 $ hg init r
1045 $ cd r
1064 $ cd r
1046 $ echo a > a
1065 $ echo a > a
1047 $ hg ci -Am '{rev}'
1066 $ hg ci -Am '{rev}'
1048 adding a
1067 adding a
1049
1068
1050 $ hg branch -q 'text.{rev}'
1069 $ hg branch -q 'text.{rev}'
1051 $ echo aa >> aa
1070 $ echo aa >> aa
1052 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
1071 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
1053
1072
1054 Test termwidth:
1073 Test termwidth:
1055
1074
1056 $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}'
1075 $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}'
1057 bcc7ff960b8e:desc to be
1076 bcc7ff960b8e:desc to be
1058 termwidth.1:wrapped desc
1077 termwidth.1:wrapped desc
1059 termwidth.1:to be wrapped (no-eol)
1078 termwidth.1:to be wrapped (no-eol)
1060
1079
1061 Just one more commit:
1080 Just one more commit:
1062
1081
1063 $ echo b > b
1082 $ echo b > b
1064 $ hg ci -qAm b
1083 $ hg ci -qAm b
1065
1084
1066 Test 'originalnode'
1085 Test 'originalnode'
1067
1086
1068 $ hg log -r 1 -T '{revset("null") % "{node|short} {originalnode|short}"}\n'
1087 $ hg log -r 1 -T '{revset("null") % "{node|short} {originalnode|short}"}\n'
1069 000000000000 bcc7ff960b8e
1088 000000000000 bcc7ff960b8e
1070 $ hg log -r 0 -T '{manifest % "{node} {originalnode}"}\n'
1089 $ hg log -r 0 -T '{manifest % "{node} {originalnode}"}\n'
1071 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 f7769ec2ab975ad19684098ad1ffd9b81ecc71a1
1090 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 f7769ec2ab975ad19684098ad1ffd9b81ecc71a1
1072
1091
1073 Test active bookmark templating
1092 Test active bookmark templating
1074
1093
1075 $ hg book foo
1094 $ hg book foo
1076 $ hg book bar
1095 $ hg book bar
1077 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
1096 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
1078 2 bar* foo
1097 2 bar* foo
1079 1
1098 1
1080 0
1099 0
1081 $ hg log --template "{rev} {activebookmark}\n"
1100 $ hg log --template "{rev} {activebookmark}\n"
1082 2 bar
1101 2 bar
1083 1
1102 1
1084 0
1103 0
1085 $ hg bookmarks --inactive bar
1104 $ hg bookmarks --inactive bar
1086 $ hg log --template "{rev} {activebookmark}\n"
1105 $ hg log --template "{rev} {activebookmark}\n"
1087 2
1106 2
1088 1
1107 1
1089 0
1108 0
1090 $ hg book -r1 baz
1109 $ hg book -r1 baz
1091 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
1110 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
1092 2 bar foo
1111 2 bar foo
1093 1 baz
1112 1 baz
1094 0
1113 0
1095 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
1114 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
1096 2 t
1115 2 t
1097 1 f
1116 1 f
1098 0 f
1117 0 f
1099
1118
1100 Test namespaces dict
1119 Test namespaces dict
1101
1120
1102 $ hg --config extensions.revnamesext=$TESTDIR/revnamesext.py log -T '{rev}\n{namespaces % " {namespace} color={colorname} builtin={builtin}\n {join(names, ",")}\n"}\n'
1121 $ hg --config extensions.revnamesext=$TESTDIR/revnamesext.py log -T '{rev}\n{namespaces % " {namespace} color={colorname} builtin={builtin}\n {join(names, ",")}\n"}\n'
1103 2
1122 2
1104 bookmarks color=bookmark builtin=True
1123 bookmarks color=bookmark builtin=True
1105 bar,foo
1124 bar,foo
1106 tags color=tag builtin=True
1125 tags color=tag builtin=True
1107 tip
1126 tip
1108 branches color=branch builtin=True
1127 branches color=branch builtin=True
1109 text.{rev}
1128 text.{rev}
1110 revnames color=revname builtin=False
1129 revnames color=revname builtin=False
1111 r2
1130 r2
1112
1131
1113 1
1132 1
1114 bookmarks color=bookmark builtin=True
1133 bookmarks color=bookmark builtin=True
1115 baz
1134 baz
1116 tags color=tag builtin=True
1135 tags color=tag builtin=True
1117
1136
1118 branches color=branch builtin=True
1137 branches color=branch builtin=True
1119 text.{rev}
1138 text.{rev}
1120 revnames color=revname builtin=False
1139 revnames color=revname builtin=False
1121 r1
1140 r1
1122
1141
1123 0
1142 0
1124 bookmarks color=bookmark builtin=True
1143 bookmarks color=bookmark builtin=True
1125
1144
1126 tags color=tag builtin=True
1145 tags color=tag builtin=True
1127
1146
1128 branches color=branch builtin=True
1147 branches color=branch builtin=True
1129 default
1148 default
1130 revnames color=revname builtin=False
1149 revnames color=revname builtin=False
1131 r0
1150 r0
1132
1151
1133 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}'
1152 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}'
1134 bookmarks: bar foo
1153 bookmarks: bar foo
1135 tags: tip
1154 tags: tip
1136 branches: text.{rev}
1155 branches: text.{rev}
1137 $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}'
1156 $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}'
1138 bookmarks:
1157 bookmarks:
1139 bar
1158 bar
1140 foo
1159 foo
1141 tags:
1160 tags:
1142 tip
1161 tip
1143 branches:
1162 branches:
1144 text.{rev}
1163 text.{rev}
1145 $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}'
1164 $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}'
1146 bar
1165 bar
1147 foo
1166 foo
1148 $ hg log -r2 -T '{namespaces.bookmarks % "{bookmark}\n"}'
1167 $ hg log -r2 -T '{namespaces.bookmarks % "{bookmark}\n"}'
1149 bar
1168 bar
1150 foo
1169 foo
1151
1170
1152 $ cd ..
1171 $ cd ..
1153
1172
1154 Test 'graphwidth' in 'hg log' on various topologies. The key here is that the
1173 Test 'graphwidth' in 'hg log' on various topologies. The key here is that the
1155 printed graphwidths 3, 5, 7, etc. should all line up in their respective
1174 printed graphwidths 3, 5, 7, etc. should all line up in their respective
1156 columns. We don't care about other aspects of the graph rendering here.
1175 columns. We don't care about other aspects of the graph rendering here.
1157
1176
1158 $ hg init graphwidth
1177 $ hg init graphwidth
1159 $ cd graphwidth
1178 $ cd graphwidth
1160
1179
1161 $ wrappabletext="a a a a a a a a a a a a"
1180 $ wrappabletext="a a a a a a a a a a a a"
1162
1181
1163 $ printf "first\n" > file
1182 $ printf "first\n" > file
1164 $ hg add file
1183 $ hg add file
1165 $ hg commit -m "$wrappabletext"
1184 $ hg commit -m "$wrappabletext"
1166
1185
1167 $ printf "first\nsecond\n" > file
1186 $ printf "first\nsecond\n" > file
1168 $ hg commit -m "$wrappabletext"
1187 $ hg commit -m "$wrappabletext"
1169
1188
1170 $ hg checkout 0
1189 $ hg checkout 0
1171 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1190 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1172 $ printf "third\nfirst\n" > file
1191 $ printf "third\nfirst\n" > file
1173 $ hg commit -m "$wrappabletext"
1192 $ hg commit -m "$wrappabletext"
1174 created new head
1193 created new head
1175
1194
1176 $ hg merge
1195 $ hg merge
1177 merging file
1196 merging file
1178 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1197 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1179 (branch merge, don't forget to commit)
1198 (branch merge, don't forget to commit)
1180
1199
1181 $ hg log --graph -T "{graphwidth}"
1200 $ hg log --graph -T "{graphwidth}"
1182 @ 3
1201 @ 3
1183 |
1202 |
1184 | @ 5
1203 | @ 5
1185 |/
1204 |/
1186 o 3
1205 o 3
1187
1206
1188 $ hg commit -m "$wrappabletext"
1207 $ hg commit -m "$wrappabletext"
1189
1208
1190 $ hg log --graph -T "{graphwidth}"
1209 $ hg log --graph -T "{graphwidth}"
1191 @ 5
1210 @ 5
1192 |\
1211 |\
1193 | o 5
1212 | o 5
1194 | |
1213 | |
1195 o | 5
1214 o | 5
1196 |/
1215 |/
1197 o 3
1216 o 3
1198
1217
1199
1218
1200 $ hg checkout 0
1219 $ hg checkout 0
1201 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1220 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1202 $ printf "third\nfirst\nsecond\n" > file
1221 $ printf "third\nfirst\nsecond\n" > file
1203 $ hg commit -m "$wrappabletext"
1222 $ hg commit -m "$wrappabletext"
1204 created new head
1223 created new head
1205
1224
1206 $ hg log --graph -T "{graphwidth}"
1225 $ hg log --graph -T "{graphwidth}"
1207 @ 3
1226 @ 3
1208 |
1227 |
1209 | o 7
1228 | o 7
1210 | |\
1229 | |\
1211 +---o 7
1230 +---o 7
1212 | |
1231 | |
1213 | o 5
1232 | o 5
1214 |/
1233 |/
1215 o 3
1234 o 3
1216
1235
1217
1236
1218 $ hg log --graph -T "{graphwidth}" -r 3
1237 $ hg log --graph -T "{graphwidth}" -r 3
1219 o 5
1238 o 5
1220 |\
1239 |\
1221 ~ ~
1240 ~ ~
1222
1241
1223 $ hg log --graph -T "{graphwidth}" -r 1
1242 $ hg log --graph -T "{graphwidth}" -r 1
1224 o 3
1243 o 3
1225 |
1244 |
1226 ~
1245 ~
1227
1246
1228 $ hg merge
1247 $ hg merge
1229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1248 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1230 (branch merge, don't forget to commit)
1249 (branch merge, don't forget to commit)
1231 $ hg commit -m "$wrappabletext"
1250 $ hg commit -m "$wrappabletext"
1232
1251
1233 $ printf "seventh\n" >> file
1252 $ printf "seventh\n" >> file
1234 $ hg commit -m "$wrappabletext"
1253 $ hg commit -m "$wrappabletext"
1235
1254
1236 $ hg log --graph -T "{graphwidth}"
1255 $ hg log --graph -T "{graphwidth}"
1237 @ 3
1256 @ 3
1238 |
1257 |
1239 o 5
1258 o 5
1240 |\
1259 |\
1241 | o 5
1260 | o 5
1242 | |
1261 | |
1243 o | 7
1262 o | 7
1244 |\ \
1263 |\ \
1245 | o | 7
1264 | o | 7
1246 | |/
1265 | |/
1247 o / 5
1266 o / 5
1248 |/
1267 |/
1249 o 3
1268 o 3
1250
1269
1251
1270
1252 The point of graphwidth is to allow wrapping that accounts for the space taken
1271 The point of graphwidth is to allow wrapping that accounts for the space taken
1253 by the graph.
1272 by the graph.
1254
1273
1255 $ COLUMNS=10 hg log --graph -T "{fill(desc, termwidth - graphwidth)}"
1274 $ COLUMNS=10 hg log --graph -T "{fill(desc, termwidth - graphwidth)}"
1256 @ a a a a
1275 @ a a a a
1257 | a a a a
1276 | a a a a
1258 | a a a a
1277 | a a a a
1259 o a a a
1278 o a a a
1260 |\ a a a
1279 |\ a a a
1261 | | a a a
1280 | | a a a
1262 | | a a a
1281 | | a a a
1263 | o a a a
1282 | o a a a
1264 | | a a a
1283 | | a a a
1265 | | a a a
1284 | | a a a
1266 | | a a a
1285 | | a a a
1267 o | a a
1286 o | a a
1268 |\ \ a a
1287 |\ \ a a
1269 | | | a a
1288 | | | a a
1270 | | | a a
1289 | | | a a
1271 | | | a a
1290 | | | a a
1272 | | | a a
1291 | | | a a
1273 | o | a a
1292 | o | a a
1274 | |/ a a
1293 | |/ a a
1275 | | a a
1294 | | a a
1276 | | a a
1295 | | a a
1277 | | a a
1296 | | a a
1278 | | a a
1297 | | a a
1279 o | a a a
1298 o | a a a
1280 |/ a a a
1299 |/ a a a
1281 | a a a
1300 | a a a
1282 | a a a
1301 | a a a
1283 o a a a a
1302 o a a a a
1284 a a a a
1303 a a a a
1285 a a a a
1304 a a a a
1286
1305
1287 Something tricky happens when there are elided nodes; the next drawn row of
1306 Something tricky happens when there are elided nodes; the next drawn row of
1288 edges can be more than one column wider, but the graph width only increases by
1307 edges can be more than one column wider, but the graph width only increases by
1289 one column. The remaining columns are added in between the nodes.
1308 one column. The remaining columns are added in between the nodes.
1290
1309
1291 $ hg log --graph -T "{graphwidth}" -r "0|2|4|5"
1310 $ hg log --graph -T "{graphwidth}" -r "0|2|4|5"
1292 o 5
1311 o 5
1293 |\
1312 |\
1294 | \
1313 | \
1295 | :\
1314 | :\
1296 o : : 7
1315 o : : 7
1297 :/ /
1316 :/ /
1298 : o 5
1317 : o 5
1299 :/
1318 :/
1300 o 3
1319 o 3
1301
1320
1302
1321
1303 $ cd ..
1322 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now