##// END OF EJS Templates
template: add successors template...
Boris Feld -
r33276:89796a25 default
parent child Browse files
Show More
@@ -1,724 +1,756
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 short,
14 short,
15 )
15 )
16
16
17 from . import (
17 from . import (
18 encoding,
18 encoding,
19 error,
19 error,
20 hbisect,
20 hbisect,
21 obsutil,
21 obsutil,
22 patch,
22 patch,
23 pycompat,
23 pycompat,
24 registrar,
24 registrar,
25 scmutil,
25 scmutil,
26 util,
26 util,
27 )
27 )
28
28
29 class _hybrid(object):
29 class _hybrid(object):
30 """Wrapper for list or dict to support legacy template
30 """Wrapper for list or dict to support legacy template
31
31
32 This class allows us to handle both:
32 This class allows us to handle both:
33 - "{files}" (legacy command-line-specific list hack) and
33 - "{files}" (legacy command-line-specific list hack) and
34 - "{files % '{file}\n'}" (hgweb-style with inlining and function support)
34 - "{files % '{file}\n'}" (hgweb-style with inlining and function support)
35 and to access raw values:
35 and to access raw values:
36 - "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
36 - "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
37 - "{get(extras, key)}"
37 - "{get(extras, key)}"
38 - "{files|json}"
38 - "{files|json}"
39 """
39 """
40
40
41 def __init__(self, gen, values, makemap, joinfmt):
41 def __init__(self, gen, values, makemap, joinfmt):
42 if gen is not None:
42 if gen is not None:
43 self.gen = gen
43 self.gen = gen
44 self._values = values
44 self._values = values
45 self._makemap = makemap
45 self._makemap = makemap
46 self.joinfmt = joinfmt
46 self.joinfmt = joinfmt
47 @util.propertycache
47 @util.propertycache
48 def gen(self):
48 def gen(self):
49 return self._defaultgen()
49 return self._defaultgen()
50 def _defaultgen(self):
50 def _defaultgen(self):
51 """Generator to stringify this as {join(self, ' ')}"""
51 """Generator to stringify this as {join(self, ' ')}"""
52 for i, d in enumerate(self.itermaps()):
52 for i, d in enumerate(self.itermaps()):
53 if i > 0:
53 if i > 0:
54 yield ' '
54 yield ' '
55 yield self.joinfmt(d)
55 yield self.joinfmt(d)
56 def itermaps(self):
56 def itermaps(self):
57 makemap = self._makemap
57 makemap = self._makemap
58 for x in self._values:
58 for x in self._values:
59 yield makemap(x)
59 yield makemap(x)
60 def __contains__(self, x):
60 def __contains__(self, x):
61 return x in self._values
61 return x in self._values
62 def __len__(self):
62 def __len__(self):
63 return len(self._values)
63 return len(self._values)
64 def __iter__(self):
64 def __iter__(self):
65 return iter(self._values)
65 return iter(self._values)
66 def __getattr__(self, name):
66 def __getattr__(self, name):
67 if name not in ('get', 'items', 'iteritems', 'iterkeys', 'itervalues',
67 if name not in ('get', 'items', 'iteritems', 'iterkeys', 'itervalues',
68 'keys', 'values'):
68 'keys', 'values'):
69 raise AttributeError(name)
69 raise AttributeError(name)
70 return getattr(self._values, name)
70 return getattr(self._values, name)
71
71
72 def hybriddict(data, key='key', value='value', fmt='%s=%s', gen=None):
72 def hybriddict(data, key='key', value='value', fmt='%s=%s', gen=None):
73 """Wrap data to support both dict-like and string-like operations"""
73 """Wrap data to support both dict-like and string-like operations"""
74 return _hybrid(gen, data, lambda k: {key: k, value: data[k]},
74 return _hybrid(gen, data, lambda k: {key: k, value: data[k]},
75 lambda d: fmt % (d[key], d[value]))
75 lambda d: fmt % (d[key], d[value]))
76
76
77 def hybridlist(data, name, fmt='%s', gen=None):
77 def hybridlist(data, name, fmt='%s', gen=None):
78 """Wrap data to support both list-like and string-like operations"""
78 """Wrap data to support both list-like and string-like operations"""
79 return _hybrid(gen, data, lambda x: {name: x}, lambda d: fmt % d[name])
79 return _hybrid(gen, data, lambda x: {name: x}, lambda d: fmt % d[name])
80
80
81 def unwraphybrid(thing):
81 def unwraphybrid(thing):
82 """Return an object which can be stringified possibly by using a legacy
82 """Return an object which can be stringified possibly by using a legacy
83 template"""
83 template"""
84 if not util.safehasattr(thing, 'gen'):
84 if not util.safehasattr(thing, 'gen'):
85 return thing
85 return thing
86 return thing.gen
86 return thing.gen
87
87
88 def showdict(name, data, mapping, plural=None, key='key', value='value',
88 def showdict(name, data, mapping, plural=None, key='key', value='value',
89 fmt='%s=%s', separator=' '):
89 fmt='%s=%s', separator=' '):
90 c = [{key: k, value: v} for k, v in data.iteritems()]
90 c = [{key: k, value: v} for k, v in data.iteritems()]
91 f = _showlist(name, c, mapping, plural, separator)
91 f = _showlist(name, c, mapping, plural, separator)
92 return hybriddict(data, key=key, value=value, fmt=fmt, gen=f)
92 return hybriddict(data, key=key, value=value, fmt=fmt, gen=f)
93
93
94 def showlist(name, values, mapping, plural=None, element=None, separator=' '):
94 def showlist(name, values, mapping, plural=None, element=None, separator=' '):
95 if not element:
95 if not element:
96 element = name
96 element = name
97 f = _showlist(name, values, mapping, plural, separator)
97 f = _showlist(name, values, mapping, plural, separator)
98 return hybridlist(values, name=element, gen=f)
98 return hybridlist(values, name=element, gen=f)
99
99
100 def _showlist(name, values, mapping, plural=None, separator=' '):
100 def _showlist(name, values, mapping, plural=None, separator=' '):
101 '''expand set of values.
101 '''expand set of values.
102 name is name of key in template map.
102 name is name of key in template map.
103 values is list of strings or dicts.
103 values is list of strings or dicts.
104 plural is plural of name, if not simply name + 's'.
104 plural is plural of name, if not simply name + 's'.
105 separator is used to join values as a string
105 separator is used to join values as a string
106
106
107 expansion works like this, given name 'foo'.
107 expansion works like this, given name 'foo'.
108
108
109 if values is empty, expand 'no_foos'.
109 if values is empty, expand 'no_foos'.
110
110
111 if 'foo' not in template map, return values as a string,
111 if 'foo' not in template map, return values as a string,
112 joined by 'separator'.
112 joined by 'separator'.
113
113
114 expand 'start_foos'.
114 expand 'start_foos'.
115
115
116 for each value, expand 'foo'. if 'last_foo' in template
116 for each value, expand 'foo'. if 'last_foo' in template
117 map, expand it instead of 'foo' for last key.
117 map, expand it instead of 'foo' for last key.
118
118
119 expand 'end_foos'.
119 expand 'end_foos'.
120 '''
120 '''
121 templ = mapping['templ']
121 templ = mapping['templ']
122 strmapping = pycompat.strkwargs(mapping)
122 strmapping = pycompat.strkwargs(mapping)
123 if not plural:
123 if not plural:
124 plural = name + 's'
124 plural = name + 's'
125 if not values:
125 if not values:
126 noname = 'no_' + plural
126 noname = 'no_' + plural
127 if noname in templ:
127 if noname in templ:
128 yield templ(noname, **strmapping)
128 yield templ(noname, **strmapping)
129 return
129 return
130 if name not in templ:
130 if name not in templ:
131 if isinstance(values[0], bytes):
131 if isinstance(values[0], bytes):
132 yield separator.join(values)
132 yield separator.join(values)
133 else:
133 else:
134 for v in values:
134 for v in values:
135 yield dict(v, **strmapping)
135 yield dict(v, **strmapping)
136 return
136 return
137 startname = 'start_' + plural
137 startname = 'start_' + plural
138 if startname in templ:
138 if startname in templ:
139 yield templ(startname, **strmapping)
139 yield templ(startname, **strmapping)
140 vmapping = mapping.copy()
140 vmapping = mapping.copy()
141 def one(v, tag=name):
141 def one(v, tag=name):
142 try:
142 try:
143 vmapping.update(v)
143 vmapping.update(v)
144 except (AttributeError, ValueError):
144 except (AttributeError, ValueError):
145 try:
145 try:
146 for a, b in v:
146 for a, b in v:
147 vmapping[a] = b
147 vmapping[a] = b
148 except ValueError:
148 except ValueError:
149 vmapping[name] = v
149 vmapping[name] = v
150 return templ(tag, **pycompat.strkwargs(vmapping))
150 return templ(tag, **pycompat.strkwargs(vmapping))
151 lastname = 'last_' + name
151 lastname = 'last_' + name
152 if lastname in templ:
152 if lastname in templ:
153 last = values.pop()
153 last = values.pop()
154 else:
154 else:
155 last = None
155 last = None
156 for v in values:
156 for v in values:
157 yield one(v)
157 yield one(v)
158 if last is not None:
158 if last is not None:
159 yield one(last, tag=lastname)
159 yield one(last, tag=lastname)
160 endname = 'end_' + plural
160 endname = 'end_' + plural
161 if endname in templ:
161 if endname in templ:
162 yield templ(endname, **strmapping)
162 yield templ(endname, **strmapping)
163
163
164 def _formatrevnode(ctx):
164 def _formatrevnode(ctx):
165 """Format changeset as '{rev}:{node|formatnode}', which is the default
165 """Format changeset as '{rev}:{node|formatnode}', which is the default
166 template provided by cmdutil.changeset_templater"""
166 template provided by cmdutil.changeset_templater"""
167 repo = ctx.repo()
167 repo = ctx.repo()
168 if repo.ui.debugflag:
168 if repo.ui.debugflag:
169 hexfunc = hex
169 hexfunc = hex
170 else:
170 else:
171 hexfunc = short
171 hexfunc = short
172 return '%d:%s' % (scmutil.intrev(ctx), hexfunc(scmutil.binnode(ctx)))
172 return '%d:%s' % (scmutil.intrev(ctx), hexfunc(scmutil.binnode(ctx)))
173
173
174 def getfiles(repo, ctx, revcache):
174 def getfiles(repo, ctx, revcache):
175 if 'files' not in revcache:
175 if 'files' not in revcache:
176 revcache['files'] = repo.status(ctx.p1(), ctx)[:3]
176 revcache['files'] = repo.status(ctx.p1(), ctx)[:3]
177 return revcache['files']
177 return revcache['files']
178
178
179 def getlatesttags(repo, ctx, cache, pattern=None):
179 def getlatesttags(repo, ctx, cache, pattern=None):
180 '''return date, distance and name for the latest tag of rev'''
180 '''return date, distance and name for the latest tag of rev'''
181
181
182 cachename = 'latesttags'
182 cachename = 'latesttags'
183 if pattern is not None:
183 if pattern is not None:
184 cachename += '-' + pattern
184 cachename += '-' + pattern
185 match = util.stringmatcher(pattern)[2]
185 match = util.stringmatcher(pattern)[2]
186 else:
186 else:
187 match = util.always
187 match = util.always
188
188
189 if cachename not in cache:
189 if cachename not in cache:
190 # Cache mapping from rev to a tuple with tag date, tag
190 # Cache mapping from rev to a tuple with tag date, tag
191 # distance and tag name
191 # distance and tag name
192 cache[cachename] = {-1: (0, 0, ['null'])}
192 cache[cachename] = {-1: (0, 0, ['null'])}
193 latesttags = cache[cachename]
193 latesttags = cache[cachename]
194
194
195 rev = ctx.rev()
195 rev = ctx.rev()
196 todo = [rev]
196 todo = [rev]
197 while todo:
197 while todo:
198 rev = todo.pop()
198 rev = todo.pop()
199 if rev in latesttags:
199 if rev in latesttags:
200 continue
200 continue
201 ctx = repo[rev]
201 ctx = repo[rev]
202 tags = [t for t in ctx.tags()
202 tags = [t for t in ctx.tags()
203 if (repo.tagtype(t) and repo.tagtype(t) != 'local'
203 if (repo.tagtype(t) and repo.tagtype(t) != 'local'
204 and match(t))]
204 and match(t))]
205 if tags:
205 if tags:
206 latesttags[rev] = ctx.date()[0], 0, [t for t in sorted(tags)]
206 latesttags[rev] = ctx.date()[0], 0, [t for t in sorted(tags)]
207 continue
207 continue
208 try:
208 try:
209 # The tuples are laid out so the right one can be found by
209 # The tuples are laid out so the right one can be found by
210 # comparison.
210 # comparison.
211 pdate, pdist, ptag = max(
211 pdate, pdist, ptag = max(
212 latesttags[p.rev()] for p in ctx.parents())
212 latesttags[p.rev()] for p in ctx.parents())
213 except KeyError:
213 except KeyError:
214 # Cache miss - recurse
214 # Cache miss - recurse
215 todo.append(rev)
215 todo.append(rev)
216 todo.extend(p.rev() for p in ctx.parents())
216 todo.extend(p.rev() for p in ctx.parents())
217 continue
217 continue
218 latesttags[rev] = pdate, pdist + 1, ptag
218 latesttags[rev] = pdate, pdist + 1, ptag
219 return latesttags[rev]
219 return latesttags[rev]
220
220
221 def getrenamedfn(repo, endrev=None):
221 def getrenamedfn(repo, endrev=None):
222 rcache = {}
222 rcache = {}
223 if endrev is None:
223 if endrev is None:
224 endrev = len(repo)
224 endrev = len(repo)
225
225
226 def getrenamed(fn, rev):
226 def getrenamed(fn, rev):
227 '''looks up all renames for a file (up to endrev) the first
227 '''looks up all renames for a file (up to endrev) the first
228 time the file is given. It indexes on the changerev and only
228 time the file is given. It indexes on the changerev and only
229 parses the manifest if linkrev != changerev.
229 parses the manifest if linkrev != changerev.
230 Returns rename info for fn at changerev rev.'''
230 Returns rename info for fn at changerev rev.'''
231 if fn not in rcache:
231 if fn not in rcache:
232 rcache[fn] = {}
232 rcache[fn] = {}
233 fl = repo.file(fn)
233 fl = repo.file(fn)
234 for i in fl:
234 for i in fl:
235 lr = fl.linkrev(i)
235 lr = fl.linkrev(i)
236 renamed = fl.renamed(fl.node(i))
236 renamed = fl.renamed(fl.node(i))
237 rcache[fn][lr] = renamed
237 rcache[fn][lr] = renamed
238 if lr >= endrev:
238 if lr >= endrev:
239 break
239 break
240 if rev in rcache[fn]:
240 if rev in rcache[fn]:
241 return rcache[fn][rev]
241 return rcache[fn][rev]
242
242
243 # If linkrev != rev (i.e. rev not found in rcache) fallback to
243 # If linkrev != rev (i.e. rev not found in rcache) fallback to
244 # filectx logic.
244 # filectx logic.
245 try:
245 try:
246 return repo[rev][fn].renamed()
246 return repo[rev][fn].renamed()
247 except error.LookupError:
247 except error.LookupError:
248 return None
248 return None
249
249
250 return getrenamed
250 return getrenamed
251
251
252 # default templates internally used for rendering of lists
252 # default templates internally used for rendering of lists
253 defaulttempl = {
253 defaulttempl = {
254 'parent': '{rev}:{node|formatnode} ',
254 'parent': '{rev}:{node|formatnode} ',
255 'manifest': '{rev}:{node|formatnode}',
255 'manifest': '{rev}:{node|formatnode}',
256 'file_copy': '{name} ({source})',
256 'file_copy': '{name} ({source})',
257 'envvar': '{key}={value}',
257 'envvar': '{key}={value}',
258 'extra': '{key}={value|stringescape}'
258 'extra': '{key}={value|stringescape}'
259 }
259 }
260 # filecopy is preserved for compatibility reasons
260 # filecopy is preserved for compatibility reasons
261 defaulttempl['filecopy'] = defaulttempl['file_copy']
261 defaulttempl['filecopy'] = defaulttempl['file_copy']
262
262
263 # keywords are callables like:
263 # keywords are callables like:
264 # fn(repo, ctx, templ, cache, revcache, **args)
264 # fn(repo, ctx, templ, cache, revcache, **args)
265 # with:
265 # with:
266 # repo - current repository instance
266 # repo - current repository instance
267 # ctx - the changectx being displayed
267 # ctx - the changectx being displayed
268 # templ - the templater instance
268 # templ - the templater instance
269 # cache - a cache dictionary for the whole templater run
269 # cache - a cache dictionary for the whole templater run
270 # revcache - a cache dictionary for the current revision
270 # revcache - a cache dictionary for the current revision
271 keywords = {}
271 keywords = {}
272
272
273 templatekeyword = registrar.templatekeyword(keywords)
273 templatekeyword = registrar.templatekeyword(keywords)
274
274
275 @templatekeyword('author')
275 @templatekeyword('author')
276 def showauthor(repo, ctx, templ, **args):
276 def showauthor(repo, ctx, templ, **args):
277 """String. The unmodified author of the changeset."""
277 """String. The unmodified author of the changeset."""
278 return ctx.user()
278 return ctx.user()
279
279
280 @templatekeyword('bisect')
280 @templatekeyword('bisect')
281 def showbisect(repo, ctx, templ, **args):
281 def showbisect(repo, ctx, templ, **args):
282 """String. The changeset bisection status."""
282 """String. The changeset bisection status."""
283 return hbisect.label(repo, ctx.node())
283 return hbisect.label(repo, ctx.node())
284
284
285 @templatekeyword('branch')
285 @templatekeyword('branch')
286 def showbranch(**args):
286 def showbranch(**args):
287 """String. The name of the branch on which the changeset was
287 """String. The name of the branch on which the changeset was
288 committed.
288 committed.
289 """
289 """
290 return args[r'ctx'].branch()
290 return args[r'ctx'].branch()
291
291
292 @templatekeyword('branches')
292 @templatekeyword('branches')
293 def showbranches(**args):
293 def showbranches(**args):
294 """List of strings. The name of the branch on which the
294 """List of strings. The name of the branch on which the
295 changeset was committed. Will be empty if the branch name was
295 changeset was committed. Will be empty if the branch name was
296 default. (DEPRECATED)
296 default. (DEPRECATED)
297 """
297 """
298 args = pycompat.byteskwargs(args)
298 args = pycompat.byteskwargs(args)
299 branch = args['ctx'].branch()
299 branch = args['ctx'].branch()
300 if branch != 'default':
300 if branch != 'default':
301 return showlist('branch', [branch], args, plural='branches')
301 return showlist('branch', [branch], args, plural='branches')
302 return showlist('branch', [], args, plural='branches')
302 return showlist('branch', [], args, plural='branches')
303
303
304 @templatekeyword('bookmarks')
304 @templatekeyword('bookmarks')
305 def showbookmarks(**args):
305 def showbookmarks(**args):
306 """List of strings. Any bookmarks associated with the
306 """List of strings. Any bookmarks associated with the
307 changeset. Also sets 'active', the name of the active bookmark.
307 changeset. Also sets 'active', the name of the active bookmark.
308 """
308 """
309 args = pycompat.byteskwargs(args)
309 args = pycompat.byteskwargs(args)
310 repo = args['ctx']._repo
310 repo = args['ctx']._repo
311 bookmarks = args['ctx'].bookmarks()
311 bookmarks = args['ctx'].bookmarks()
312 active = repo._activebookmark
312 active = repo._activebookmark
313 makemap = lambda v: {'bookmark': v, 'active': active, 'current': active}
313 makemap = lambda v: {'bookmark': v, 'active': active, 'current': active}
314 f = _showlist('bookmark', bookmarks, args)
314 f = _showlist('bookmark', bookmarks, args)
315 return _hybrid(f, bookmarks, makemap, lambda x: x['bookmark'])
315 return _hybrid(f, bookmarks, makemap, lambda x: x['bookmark'])
316
316
317 @templatekeyword('children')
317 @templatekeyword('children')
318 def showchildren(**args):
318 def showchildren(**args):
319 """List of strings. The children of the changeset."""
319 """List of strings. The children of the changeset."""
320 args = pycompat.byteskwargs(args)
320 args = pycompat.byteskwargs(args)
321 ctx = args['ctx']
321 ctx = args['ctx']
322 childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()]
322 childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()]
323 return showlist('children', childrevs, args, element='child')
323 return showlist('children', childrevs, args, element='child')
324
324
325 # Deprecated, but kept alive for help generation a purpose.
325 # Deprecated, but kept alive for help generation a purpose.
326 @templatekeyword('currentbookmark')
326 @templatekeyword('currentbookmark')
327 def showcurrentbookmark(**args):
327 def showcurrentbookmark(**args):
328 """String. The active bookmark, if it is
328 """String. The active bookmark, if it is
329 associated with the changeset (DEPRECATED)"""
329 associated with the changeset (DEPRECATED)"""
330 return showactivebookmark(**args)
330 return showactivebookmark(**args)
331
331
332 @templatekeyword('activebookmark')
332 @templatekeyword('activebookmark')
333 def showactivebookmark(**args):
333 def showactivebookmark(**args):
334 """String. The active bookmark, if it is
334 """String. The active bookmark, if it is
335 associated with the changeset"""
335 associated with the changeset"""
336 active = args[r'repo']._activebookmark
336 active = args[r'repo']._activebookmark
337 if active and active in args[r'ctx'].bookmarks():
337 if active and active in args[r'ctx'].bookmarks():
338 return active
338 return active
339 return ''
339 return ''
340
340
341 @templatekeyword('date')
341 @templatekeyword('date')
342 def showdate(repo, ctx, templ, **args):
342 def showdate(repo, ctx, templ, **args):
343 """Date information. The date when the changeset was committed."""
343 """Date information. The date when the changeset was committed."""
344 return ctx.date()
344 return ctx.date()
345
345
346 @templatekeyword('desc')
346 @templatekeyword('desc')
347 def showdescription(repo, ctx, templ, **args):
347 def showdescription(repo, ctx, templ, **args):
348 """String. The text of the changeset description."""
348 """String. The text of the changeset description."""
349 s = ctx.description()
349 s = ctx.description()
350 if isinstance(s, encoding.localstr):
350 if isinstance(s, encoding.localstr):
351 # try hard to preserve utf-8 bytes
351 # try hard to preserve utf-8 bytes
352 return encoding.tolocal(encoding.fromlocal(s).strip())
352 return encoding.tolocal(encoding.fromlocal(s).strip())
353 else:
353 else:
354 return s.strip()
354 return s.strip()
355
355
356 @templatekeyword('diffstat')
356 @templatekeyword('diffstat')
357 def showdiffstat(repo, ctx, templ, **args):
357 def showdiffstat(repo, ctx, templ, **args):
358 """String. Statistics of changes with the following format:
358 """String. Statistics of changes with the following format:
359 "modified files: +added/-removed lines"
359 "modified files: +added/-removed lines"
360 """
360 """
361 stats = patch.diffstatdata(util.iterlines(ctx.diff(noprefix=False)))
361 stats = patch.diffstatdata(util.iterlines(ctx.diff(noprefix=False)))
362 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
362 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
363 return '%s: +%s/-%s' % (len(stats), adds, removes)
363 return '%s: +%s/-%s' % (len(stats), adds, removes)
364
364
365 @templatekeyword('envvars')
365 @templatekeyword('envvars')
366 def showenvvars(repo, **args):
366 def showenvvars(repo, **args):
367 """A dictionary of environment variables. (EXPERIMENTAL)"""
367 """A dictionary of environment variables. (EXPERIMENTAL)"""
368 args = pycompat.byteskwargs(args)
368 args = pycompat.byteskwargs(args)
369 env = repo.ui.exportableenviron()
369 env = repo.ui.exportableenviron()
370 env = util.sortdict((k, env[k]) for k in sorted(env))
370 env = util.sortdict((k, env[k]) for k in sorted(env))
371 return showdict('envvar', env, args, plural='envvars')
371 return showdict('envvar', env, args, plural='envvars')
372
372
373 @templatekeyword('extras')
373 @templatekeyword('extras')
374 def showextras(**args):
374 def showextras(**args):
375 """List of dicts with key, value entries of the 'extras'
375 """List of dicts with key, value entries of the 'extras'
376 field of this changeset."""
376 field of this changeset."""
377 args = pycompat.byteskwargs(args)
377 args = pycompat.byteskwargs(args)
378 extras = args['ctx'].extra()
378 extras = args['ctx'].extra()
379 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
379 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
380 makemap = lambda k: {'key': k, 'value': extras[k]}
380 makemap = lambda k: {'key': k, 'value': extras[k]}
381 c = [makemap(k) for k in extras]
381 c = [makemap(k) for k in extras]
382 f = _showlist('extra', c, args, plural='extras')
382 f = _showlist('extra', c, args, plural='extras')
383 return _hybrid(f, extras, makemap,
383 return _hybrid(f, extras, makemap,
384 lambda x: '%s=%s' % (x['key'], util.escapestr(x['value'])))
384 lambda x: '%s=%s' % (x['key'], util.escapestr(x['value'])))
385
385
386 @templatekeyword('file_adds')
386 @templatekeyword('file_adds')
387 def showfileadds(**args):
387 def showfileadds(**args):
388 """List of strings. Files added by this changeset."""
388 """List of strings. Files added by this changeset."""
389 args = pycompat.byteskwargs(args)
389 args = pycompat.byteskwargs(args)
390 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
390 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
391 return showlist('file_add', getfiles(repo, ctx, revcache)[1], args,
391 return showlist('file_add', getfiles(repo, ctx, revcache)[1], args,
392 element='file')
392 element='file')
393
393
394 @templatekeyword('file_copies')
394 @templatekeyword('file_copies')
395 def showfilecopies(**args):
395 def showfilecopies(**args):
396 """List of strings. Files copied in this changeset with
396 """List of strings. Files copied in this changeset with
397 their sources.
397 their sources.
398 """
398 """
399 args = pycompat.byteskwargs(args)
399 args = pycompat.byteskwargs(args)
400 cache, ctx = args['cache'], args['ctx']
400 cache, ctx = args['cache'], args['ctx']
401 copies = args['revcache'].get('copies')
401 copies = args['revcache'].get('copies')
402 if copies is None:
402 if copies is None:
403 if 'getrenamed' not in cache:
403 if 'getrenamed' not in cache:
404 cache['getrenamed'] = getrenamedfn(args['repo'])
404 cache['getrenamed'] = getrenamedfn(args['repo'])
405 copies = []
405 copies = []
406 getrenamed = cache['getrenamed']
406 getrenamed = cache['getrenamed']
407 for fn in ctx.files():
407 for fn in ctx.files():
408 rename = getrenamed(fn, ctx.rev())
408 rename = getrenamed(fn, ctx.rev())
409 if rename:
409 if rename:
410 copies.append((fn, rename[0]))
410 copies.append((fn, rename[0]))
411
411
412 copies = util.sortdict(copies)
412 copies = util.sortdict(copies)
413 return showdict('file_copy', copies, args, plural='file_copies',
413 return showdict('file_copy', copies, args, plural='file_copies',
414 key='name', value='source', fmt='%s (%s)')
414 key='name', value='source', fmt='%s (%s)')
415
415
416 # showfilecopiesswitch() displays file copies only if copy records are
416 # showfilecopiesswitch() displays file copies only if copy records are
417 # provided before calling the templater, usually with a --copies
417 # provided before calling the templater, usually with a --copies
418 # command line switch.
418 # command line switch.
419 @templatekeyword('file_copies_switch')
419 @templatekeyword('file_copies_switch')
420 def showfilecopiesswitch(**args):
420 def showfilecopiesswitch(**args):
421 """List of strings. Like "file_copies" but displayed
421 """List of strings. Like "file_copies" but displayed
422 only if the --copied switch is set.
422 only if the --copied switch is set.
423 """
423 """
424 args = pycompat.byteskwargs(args)
424 args = pycompat.byteskwargs(args)
425 copies = args['revcache'].get('copies') or []
425 copies = args['revcache'].get('copies') or []
426 copies = util.sortdict(copies)
426 copies = util.sortdict(copies)
427 return showdict('file_copy', copies, args, plural='file_copies',
427 return showdict('file_copy', copies, args, plural='file_copies',
428 key='name', value='source', fmt='%s (%s)')
428 key='name', value='source', fmt='%s (%s)')
429
429
430 @templatekeyword('file_dels')
430 @templatekeyword('file_dels')
431 def showfiledels(**args):
431 def showfiledels(**args):
432 """List of strings. Files removed by this changeset."""
432 """List of strings. Files removed by this changeset."""
433 args = pycompat.byteskwargs(args)
433 args = pycompat.byteskwargs(args)
434 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
434 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
435 return showlist('file_del', getfiles(repo, ctx, revcache)[2], args,
435 return showlist('file_del', getfiles(repo, ctx, revcache)[2], args,
436 element='file')
436 element='file')
437
437
438 @templatekeyword('file_mods')
438 @templatekeyword('file_mods')
439 def showfilemods(**args):
439 def showfilemods(**args):
440 """List of strings. Files modified by this changeset."""
440 """List of strings. Files modified by this changeset."""
441 args = pycompat.byteskwargs(args)
441 args = pycompat.byteskwargs(args)
442 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
442 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
443 return showlist('file_mod', getfiles(repo, ctx, revcache)[0], args,
443 return showlist('file_mod', getfiles(repo, ctx, revcache)[0], args,
444 element='file')
444 element='file')
445
445
446 @templatekeyword('files')
446 @templatekeyword('files')
447 def showfiles(**args):
447 def showfiles(**args):
448 """List of strings. All files modified, added, or removed by this
448 """List of strings. All files modified, added, or removed by this
449 changeset.
449 changeset.
450 """
450 """
451 args = pycompat.byteskwargs(args)
451 args = pycompat.byteskwargs(args)
452 return showlist('file', args['ctx'].files(), args)
452 return showlist('file', args['ctx'].files(), args)
453
453
454 @templatekeyword('graphnode')
454 @templatekeyword('graphnode')
455 def showgraphnode(repo, ctx, **args):
455 def showgraphnode(repo, ctx, **args):
456 """String. The character representing the changeset node in
456 """String. The character representing the changeset node in
457 an ASCII revision graph"""
457 an ASCII revision graph"""
458 wpnodes = repo.dirstate.parents()
458 wpnodes = repo.dirstate.parents()
459 if wpnodes[1] == nullid:
459 if wpnodes[1] == nullid:
460 wpnodes = wpnodes[:1]
460 wpnodes = wpnodes[:1]
461 if ctx.node() in wpnodes:
461 if ctx.node() in wpnodes:
462 return '@'
462 return '@'
463 elif ctx.obsolete():
463 elif ctx.obsolete():
464 return 'x'
464 return 'x'
465 elif ctx.closesbranch():
465 elif ctx.closesbranch():
466 return '_'
466 return '_'
467 else:
467 else:
468 return 'o'
468 return 'o'
469
469
470 @templatekeyword('index')
470 @templatekeyword('index')
471 def showindex(**args):
471 def showindex(**args):
472 """Integer. The current iteration of the loop. (0 indexed)"""
472 """Integer. The current iteration of the loop. (0 indexed)"""
473 # just hosts documentation; should be overridden by template mapping
473 # just hosts documentation; should be overridden by template mapping
474 raise error.Abort(_("can't use index in this context"))
474 raise error.Abort(_("can't use index in this context"))
475
475
476 @templatekeyword('latesttag')
476 @templatekeyword('latesttag')
477 def showlatesttag(**args):
477 def showlatesttag(**args):
478 """List of strings. The global tags on the most recent globally
478 """List of strings. The global tags on the most recent globally
479 tagged ancestor of this changeset. If no such tags exist, the list
479 tagged ancestor of this changeset. If no such tags exist, the list
480 consists of the single string "null".
480 consists of the single string "null".
481 """
481 """
482 return showlatesttags(None, **args)
482 return showlatesttags(None, **args)
483
483
484 def showlatesttags(pattern, **args):
484 def showlatesttags(pattern, **args):
485 """helper method for the latesttag keyword and function"""
485 """helper method for the latesttag keyword and function"""
486 args = pycompat.byteskwargs(args)
486 args = pycompat.byteskwargs(args)
487 repo, ctx = args['repo'], args['ctx']
487 repo, ctx = args['repo'], args['ctx']
488 cache = args['cache']
488 cache = args['cache']
489 latesttags = getlatesttags(repo, ctx, cache, pattern)
489 latesttags = getlatesttags(repo, ctx, cache, pattern)
490
490
491 # latesttag[0] is an implementation detail for sorting csets on different
491 # latesttag[0] is an implementation detail for sorting csets on different
492 # branches in a stable manner- it is the date the tagged cset was created,
492 # branches in a stable manner- it is the date the tagged cset was created,
493 # not the date the tag was created. Therefore it isn't made visible here.
493 # not the date the tag was created. Therefore it isn't made visible here.
494 makemap = lambda v: {
494 makemap = lambda v: {
495 'changes': _showchangessincetag,
495 'changes': _showchangessincetag,
496 'distance': latesttags[1],
496 'distance': latesttags[1],
497 'latesttag': v, # BC with {latesttag % '{latesttag}'}
497 'latesttag': v, # BC with {latesttag % '{latesttag}'}
498 'tag': v
498 'tag': v
499 }
499 }
500
500
501 tags = latesttags[2]
501 tags = latesttags[2]
502 f = _showlist('latesttag', tags, args, separator=':')
502 f = _showlist('latesttag', tags, args, separator=':')
503 return _hybrid(f, tags, makemap, lambda x: x['latesttag'])
503 return _hybrid(f, tags, makemap, lambda x: x['latesttag'])
504
504
505 @templatekeyword('latesttagdistance')
505 @templatekeyword('latesttagdistance')
506 def showlatesttagdistance(repo, ctx, templ, cache, **args):
506 def showlatesttagdistance(repo, ctx, templ, cache, **args):
507 """Integer. Longest path to the latest tag."""
507 """Integer. Longest path to the latest tag."""
508 return getlatesttags(repo, ctx, cache)[1]
508 return getlatesttags(repo, ctx, cache)[1]
509
509
510 @templatekeyword('changessincelatesttag')
510 @templatekeyword('changessincelatesttag')
511 def showchangessincelatesttag(repo, ctx, templ, cache, **args):
511 def showchangessincelatesttag(repo, ctx, templ, cache, **args):
512 """Integer. All ancestors not in the latest tag."""
512 """Integer. All ancestors not in the latest tag."""
513 latesttag = getlatesttags(repo, ctx, cache)[2][0]
513 latesttag = getlatesttags(repo, ctx, cache)[2][0]
514
514
515 return _showchangessincetag(repo, ctx, tag=latesttag, **args)
515 return _showchangessincetag(repo, ctx, tag=latesttag, **args)
516
516
517 def _showchangessincetag(repo, ctx, **args):
517 def _showchangessincetag(repo, ctx, **args):
518 offset = 0
518 offset = 0
519 revs = [ctx.rev()]
519 revs = [ctx.rev()]
520 tag = args[r'tag']
520 tag = args[r'tag']
521
521
522 # The only() revset doesn't currently support wdir()
522 # The only() revset doesn't currently support wdir()
523 if ctx.rev() is None:
523 if ctx.rev() is None:
524 offset = 1
524 offset = 1
525 revs = [p.rev() for p in ctx.parents()]
525 revs = [p.rev() for p in ctx.parents()]
526
526
527 return len(repo.revs('only(%ld, %s)', revs, tag)) + offset
527 return len(repo.revs('only(%ld, %s)', revs, tag)) + offset
528
528
529 @templatekeyword('manifest')
529 @templatekeyword('manifest')
530 def showmanifest(**args):
530 def showmanifest(**args):
531 repo, ctx, templ = args[r'repo'], args[r'ctx'], args[r'templ']
531 repo, ctx, templ = args[r'repo'], args[r'ctx'], args[r'templ']
532 mnode = ctx.manifestnode()
532 mnode = ctx.manifestnode()
533 if mnode is None:
533 if mnode is None:
534 # just avoid crash, we might want to use the 'ff...' hash in future
534 # just avoid crash, we might want to use the 'ff...' hash in future
535 return
535 return
536 args = args.copy()
536 args = args.copy()
537 args.update({r'rev': repo.manifestlog._revlog.rev(mnode),
537 args.update({r'rev': repo.manifestlog._revlog.rev(mnode),
538 r'node': hex(mnode)})
538 r'node': hex(mnode)})
539 return templ('manifest', **args)
539 return templ('manifest', **args)
540
540
541 def shownames(namespace, **args):
541 def shownames(namespace, **args):
542 """helper method to generate a template keyword for a namespace"""
542 """helper method to generate a template keyword for a namespace"""
543 args = pycompat.byteskwargs(args)
543 args = pycompat.byteskwargs(args)
544 ctx = args['ctx']
544 ctx = args['ctx']
545 repo = ctx.repo()
545 repo = ctx.repo()
546 ns = repo.names[namespace]
546 ns = repo.names[namespace]
547 names = ns.names(repo, ctx.node())
547 names = ns.names(repo, ctx.node())
548 return showlist(ns.templatename, names, args, plural=namespace)
548 return showlist(ns.templatename, names, args, plural=namespace)
549
549
550 @templatekeyword('namespaces')
550 @templatekeyword('namespaces')
551 def shownamespaces(**args):
551 def shownamespaces(**args):
552 """Dict of lists. Names attached to this changeset per
552 """Dict of lists. Names attached to this changeset per
553 namespace."""
553 namespace."""
554 args = pycompat.byteskwargs(args)
554 args = pycompat.byteskwargs(args)
555 ctx = args['ctx']
555 ctx = args['ctx']
556 repo = ctx.repo()
556 repo = ctx.repo()
557
557
558 namespaces = util.sortdict()
558 namespaces = util.sortdict()
559 colornames = {}
559 colornames = {}
560 builtins = {}
560 builtins = {}
561
561
562 for k, ns in repo.names.iteritems():
562 for k, ns in repo.names.iteritems():
563 namespaces[k] = showlist('name', ns.names(repo, ctx.node()), args)
563 namespaces[k] = showlist('name', ns.names(repo, ctx.node()), args)
564 colornames[k] = ns.colorname
564 colornames[k] = ns.colorname
565 builtins[k] = ns.builtin
565 builtins[k] = ns.builtin
566
566
567 f = _showlist('namespace', list(namespaces), args)
567 f = _showlist('namespace', list(namespaces), args)
568
568
569 def makemap(ns):
569 def makemap(ns):
570 return {
570 return {
571 'namespace': ns,
571 'namespace': ns,
572 'names': namespaces[ns],
572 'names': namespaces[ns],
573 'builtin': builtins[ns],
573 'builtin': builtins[ns],
574 'colorname': colornames[ns],
574 'colorname': colornames[ns],
575 }
575 }
576
576
577 return _hybrid(f, namespaces, makemap, lambda x: x['namespace'])
577 return _hybrid(f, namespaces, makemap, lambda x: x['namespace'])
578
578
579 @templatekeyword('node')
579 @templatekeyword('node')
580 def shownode(repo, ctx, templ, **args):
580 def shownode(repo, ctx, templ, **args):
581 """String. The changeset identification hash, as a 40 hexadecimal
581 """String. The changeset identification hash, as a 40 hexadecimal
582 digit string.
582 digit string.
583 """
583 """
584 return ctx.hex()
584 return ctx.hex()
585
585
586 @templatekeyword('obsolete')
586 @templatekeyword('obsolete')
587 def showobsolete(repo, ctx, templ, **args):
587 def showobsolete(repo, ctx, templ, **args):
588 """String. Whether the changeset is obsolete.
588 """String. Whether the changeset is obsolete.
589 """
589 """
590 if ctx.obsolete():
590 if ctx.obsolete():
591 return 'obsolete'
591 return 'obsolete'
592 return ''
592 return ''
593
593
594 @templatekeyword("predecessors")
594 @templatekeyword("predecessors")
595 def showpredecessors(repo, ctx, **args):
595 def showpredecessors(repo, ctx, **args):
596 """Returns the list if the closest visible successors
596 """Returns the list if the closest visible successors
597 """
597 """
598 predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node()))
598 predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node()))
599 predecessors = map(hex, predecessors)
599 predecessors = map(hex, predecessors)
600
600
601 return _hybrid(None, predecessors,
601 return _hybrid(None, predecessors,
602 lambda x: {'ctx': repo[x], 'revcache': {}},
602 lambda x: {'ctx': repo[x], 'revcache': {}},
603 lambda d: _formatrevnode(d['ctx']))
603 lambda d: _formatrevnode(d['ctx']))
604
604
605 @templatekeyword("successorssets")
606 def showsuccessorssets(repo, ctx, **args):
607 """Returns a string of sets of successors for a changectx
608
609 Format used is: [ctx1, ctx2], [ctx3] if ctx has been splitted into ctx1 and
610 ctx2 while also diverged into ctx3"""
611 if not ctx.obsolete():
612 return ''
613 args = pycompat.byteskwargs(args)
614
615 ssets = obsutil.successorssets(repo, ctx.node(), closest=True)
616 ssets = [[hex(n) for n in ss] for ss in ssets]
617
618 data = []
619 for ss in ssets:
620 h = _hybrid(None, ss, lambda x: {'ctx': repo[x], 'revcache': {}},
621 lambda d: _formatrevnode(d['ctx']))
622 data.append(h)
623
624 # Format the successorssets
625 def render(d):
626 t = []
627 for i in d.gen:
628 t.append(i)
629 return "".join(t)
630
631 def gen(data):
632 yield "; ".join(render(d) for d in data)
633
634 return _hybrid(gen(data), data, lambda x: {'successorset': x},
635 lambda d: d["successorset"])
636
605 @templatekeyword('p1rev')
637 @templatekeyword('p1rev')
606 def showp1rev(repo, ctx, templ, **args):
638 def showp1rev(repo, ctx, templ, **args):
607 """Integer. The repository-local revision number of the changeset's
639 """Integer. The repository-local revision number of the changeset's
608 first parent, or -1 if the changeset has no parents."""
640 first parent, or -1 if the changeset has no parents."""
609 return ctx.p1().rev()
641 return ctx.p1().rev()
610
642
611 @templatekeyword('p2rev')
643 @templatekeyword('p2rev')
612 def showp2rev(repo, ctx, templ, **args):
644 def showp2rev(repo, ctx, templ, **args):
613 """Integer. The repository-local revision number of the changeset's
645 """Integer. The repository-local revision number of the changeset's
614 second parent, or -1 if the changeset has no second parent."""
646 second parent, or -1 if the changeset has no second parent."""
615 return ctx.p2().rev()
647 return ctx.p2().rev()
616
648
617 @templatekeyword('p1node')
649 @templatekeyword('p1node')
618 def showp1node(repo, ctx, templ, **args):
650 def showp1node(repo, ctx, templ, **args):
619 """String. The identification hash of the changeset's first parent,
651 """String. The identification hash of the changeset's first parent,
620 as a 40 digit hexadecimal string. If the changeset has no parents, all
652 as a 40 digit hexadecimal string. If the changeset has no parents, all
621 digits are 0."""
653 digits are 0."""
622 return ctx.p1().hex()
654 return ctx.p1().hex()
623
655
624 @templatekeyword('p2node')
656 @templatekeyword('p2node')
625 def showp2node(repo, ctx, templ, **args):
657 def showp2node(repo, ctx, templ, **args):
626 """String. The identification hash of the changeset's second
658 """String. The identification hash of the changeset's second
627 parent, as a 40 digit hexadecimal string. If the changeset has no second
659 parent, as a 40 digit hexadecimal string. If the changeset has no second
628 parent, all digits are 0."""
660 parent, all digits are 0."""
629 return ctx.p2().hex()
661 return ctx.p2().hex()
630
662
631 @templatekeyword('parents')
663 @templatekeyword('parents')
632 def showparents(**args):
664 def showparents(**args):
633 """List of strings. The parents of the changeset in "rev:node"
665 """List of strings. The parents of the changeset in "rev:node"
634 format. If the changeset has only one "natural" parent (the predecessor
666 format. If the changeset has only one "natural" parent (the predecessor
635 revision) nothing is shown."""
667 revision) nothing is shown."""
636 args = pycompat.byteskwargs(args)
668 args = pycompat.byteskwargs(args)
637 repo = args['repo']
669 repo = args['repo']
638 ctx = args['ctx']
670 ctx = args['ctx']
639 pctxs = scmutil.meaningfulparents(repo, ctx)
671 pctxs = scmutil.meaningfulparents(repo, ctx)
640 # ifcontains() needs a list of str
672 # ifcontains() needs a list of str
641 prevs = ["%d" % p.rev() for p in pctxs]
673 prevs = ["%d" % p.rev() for p in pctxs]
642 parents = [[('rev', p.rev()),
674 parents = [[('rev', p.rev()),
643 ('node', p.hex()),
675 ('node', p.hex()),
644 ('phase', p.phasestr())]
676 ('phase', p.phasestr())]
645 for p in pctxs]
677 for p in pctxs]
646 f = _showlist('parent', parents, args)
678 f = _showlist('parent', parents, args)
647 return _hybrid(f, prevs, lambda x: {'ctx': repo[int(x)], 'revcache': {}},
679 return _hybrid(f, prevs, lambda x: {'ctx': repo[int(x)], 'revcache': {}},
648 lambda d: _formatrevnode(d['ctx']))
680 lambda d: _formatrevnode(d['ctx']))
649
681
650 @templatekeyword('phase')
682 @templatekeyword('phase')
651 def showphase(repo, ctx, templ, **args):
683 def showphase(repo, ctx, templ, **args):
652 """String. The changeset phase name."""
684 """String. The changeset phase name."""
653 return ctx.phasestr()
685 return ctx.phasestr()
654
686
655 @templatekeyword('phaseidx')
687 @templatekeyword('phaseidx')
656 def showphaseidx(repo, ctx, templ, **args):
688 def showphaseidx(repo, ctx, templ, **args):
657 """Integer. The changeset phase index."""
689 """Integer. The changeset phase index."""
658 return ctx.phase()
690 return ctx.phase()
659
691
660 @templatekeyword('rev')
692 @templatekeyword('rev')
661 def showrev(repo, ctx, templ, **args):
693 def showrev(repo, ctx, templ, **args):
662 """Integer. The repository-local changeset revision number."""
694 """Integer. The repository-local changeset revision number."""
663 return scmutil.intrev(ctx)
695 return scmutil.intrev(ctx)
664
696
665 def showrevslist(name, revs, **args):
697 def showrevslist(name, revs, **args):
666 """helper to generate a list of revisions in which a mapped template will
698 """helper to generate a list of revisions in which a mapped template will
667 be evaluated"""
699 be evaluated"""
668 args = pycompat.byteskwargs(args)
700 args = pycompat.byteskwargs(args)
669 repo = args['ctx'].repo()
701 repo = args['ctx'].repo()
670 # ifcontains() needs a list of str
702 # ifcontains() needs a list of str
671 revs = ["%d" % r for r in revs]
703 revs = ["%d" % r for r in revs]
672 f = _showlist(name, revs, args)
704 f = _showlist(name, revs, args)
673 return _hybrid(f, revs,
705 return _hybrid(f, revs,
674 lambda x: {name: x, 'ctx': repo[int(x)], 'revcache': {}},
706 lambda x: {name: x, 'ctx': repo[int(x)], 'revcache': {}},
675 lambda d: d[name])
707 lambda d: d[name])
676
708
677 @templatekeyword('subrepos')
709 @templatekeyword('subrepos')
678 def showsubrepos(**args):
710 def showsubrepos(**args):
679 """List of strings. Updated subrepositories in the changeset."""
711 """List of strings. Updated subrepositories in the changeset."""
680 args = pycompat.byteskwargs(args)
712 args = pycompat.byteskwargs(args)
681 ctx = args['ctx']
713 ctx = args['ctx']
682 substate = ctx.substate
714 substate = ctx.substate
683 if not substate:
715 if not substate:
684 return showlist('subrepo', [], args)
716 return showlist('subrepo', [], args)
685 psubstate = ctx.parents()[0].substate or {}
717 psubstate = ctx.parents()[0].substate or {}
686 subrepos = []
718 subrepos = []
687 for sub in substate:
719 for sub in substate:
688 if sub not in psubstate or substate[sub] != psubstate[sub]:
720 if sub not in psubstate or substate[sub] != psubstate[sub]:
689 subrepos.append(sub) # modified or newly added in ctx
721 subrepos.append(sub) # modified or newly added in ctx
690 for sub in psubstate:
722 for sub in psubstate:
691 if sub not in substate:
723 if sub not in substate:
692 subrepos.append(sub) # removed in ctx
724 subrepos.append(sub) # removed in ctx
693 return showlist('subrepo', sorted(subrepos), args)
725 return showlist('subrepo', sorted(subrepos), args)
694
726
695 # don't remove "showtags" definition, even though namespaces will put
727 # don't remove "showtags" definition, even though namespaces will put
696 # a helper function for "tags" keyword into "keywords" map automatically,
728 # a helper function for "tags" keyword into "keywords" map automatically,
697 # because online help text is built without namespaces initialization
729 # because online help text is built without namespaces initialization
698 @templatekeyword('tags')
730 @templatekeyword('tags')
699 def showtags(**args):
731 def showtags(**args):
700 """List of strings. Any tags associated with the changeset."""
732 """List of strings. Any tags associated with the changeset."""
701 return shownames('tags', **args)
733 return shownames('tags', **args)
702
734
703 def loadkeyword(ui, extname, registrarobj):
735 def loadkeyword(ui, extname, registrarobj):
704 """Load template keyword from specified registrarobj
736 """Load template keyword from specified registrarobj
705 """
737 """
706 for name, func in registrarobj._table.iteritems():
738 for name, func in registrarobj._table.iteritems():
707 keywords[name] = func
739 keywords[name] = func
708
740
709 @templatekeyword('termwidth')
741 @templatekeyword('termwidth')
710 def termwidth(repo, ctx, templ, **args):
742 def termwidth(repo, ctx, templ, **args):
711 """Integer. The width of the current terminal."""
743 """Integer. The width of the current terminal."""
712 return repo.ui.termwidth()
744 return repo.ui.termwidth()
713
745
714 @templatekeyword('troubles')
746 @templatekeyword('troubles')
715 def showtroubles(**args):
747 def showtroubles(**args):
716 """List of strings. Evolution troubles affecting the changeset.
748 """List of strings. Evolution troubles affecting the changeset.
717
749
718 (EXPERIMENTAL)
750 (EXPERIMENTAL)
719 """
751 """
720 args = pycompat.byteskwargs(args)
752 args = pycompat.byteskwargs(args)
721 return showlist('trouble', args['ctx'].troubles(), args)
753 return showlist('trouble', args['ctx'].troubles(), args)
722
754
723 # tell hggettext to extract docstrings from these functions:
755 # tell hggettext to extract docstrings from these functions:
724 i18nfunctions = keywords.values()
756 i18nfunctions = keywords.values()
@@ -1,1167 +1,1261
1 This test file test the various templates related to obsmarkers.
1 This test file test the various templates related to obsmarkers.
2
2
3 Global setup
3 Global setup
4 ============
4 ============
5
5
6 $ . $TESTDIR/testlib/obsmarker-common.sh
6 $ . $TESTDIR/testlib/obsmarker-common.sh
7 $ cat >> $HGRCPATH <<EOF
7 $ cat >> $HGRCPATH <<EOF
8 > [ui]
8 > [ui]
9 > interactive = true
9 > interactive = true
10 > [phases]
10 > [phases]
11 > publish=False
11 > publish=False
12 > [experimental]
12 > [experimental]
13 > evolution=all
13 > evolution=all
14 > [alias]
14 > [alias]
15 > tlog = log -G -T '{node|short}\
15 > tlog = log -G -T '{node|short}\
16 > {if(predecessors, "\n Predecessors: {predecessors}")}\
16 > {if(predecessors, "\n Predecessors: {predecessors}")}\
17 > {if(predecessors, "\n semi-colon: {join(predecessors, "; ")}")}\
17 > {if(predecessors, "\n semi-colon: {join(predecessors, "; ")}")}\
18 > {if(predecessors, "\n json: {predecessors|json}")}\
18 > {if(predecessors, "\n json: {predecessors|json}")}\
19 > {if(predecessors, "\n map: {join(predecessors % "{rev}:{node}", " ")}")}\n'
19 > {if(predecessors, "\n map: {join(predecessors % "{rev}:{node}", " ")}")}\
20 > {if(successorssets, "\n Successors: {successorssets}")}\
21 > {if(successorssets, "\n multi-line: {join(successorssets, "\n multi-line: ")}")}\
22 > {if(successorssets, "\n json: {successorssets|json}")}\n'
20 > EOF
23 > EOF
21
24
22 Test templates on amended commit
25 Test templates on amended commit
23 ================================
26 ================================
24
27
25 Test setup
28 Test setup
26 ----------
29 ----------
27
30
28 $ hg init $TESTTMP/templates-local-amend
31 $ hg init $TESTTMP/templates-local-amend
29 $ cd $TESTTMP/templates-local-amend
32 $ cd $TESTTMP/templates-local-amend
30 $ mkcommit ROOT
33 $ mkcommit ROOT
31 $ mkcommit A0
34 $ mkcommit A0
32 $ echo 42 >> A0
35 $ echo 42 >> A0
33 $ hg commit --amend -m "A1"
36 $ hg commit --amend -m "A1"
34 $ hg commit --amend -m "A2"
37 $ hg commit --amend -m "A2"
35
38
36 $ hg log --hidden -G
39 $ hg log --hidden -G
37 @ changeset: 4:d004c8f274b9
40 @ changeset: 4:d004c8f274b9
38 | tag: tip
41 | tag: tip
39 | parent: 0:ea207398892e
42 | parent: 0:ea207398892e
40 | user: test
43 | user: test
41 | date: Thu Jan 01 00:00:00 1970 +0000
44 | date: Thu Jan 01 00:00:00 1970 +0000
42 | summary: A2
45 | summary: A2
43 |
46 |
44 | x changeset: 3:a468dc9b3633
47 | x changeset: 3:a468dc9b3633
45 |/ parent: 0:ea207398892e
48 |/ parent: 0:ea207398892e
46 | user: test
49 | user: test
47 | date: Thu Jan 01 00:00:00 1970 +0000
50 | date: Thu Jan 01 00:00:00 1970 +0000
48 | summary: A1
51 | summary: A1
49 |
52 |
50 | x changeset: 2:f137d23bb3e1
53 | x changeset: 2:f137d23bb3e1
51 | | user: test
54 | | user: test
52 | | date: Thu Jan 01 00:00:00 1970 +0000
55 | | date: Thu Jan 01 00:00:00 1970 +0000
53 | | summary: temporary amend commit for 471f378eab4c
56 | | summary: temporary amend commit for 471f378eab4c
54 | |
57 | |
55 | x changeset: 1:471f378eab4c
58 | x changeset: 1:471f378eab4c
56 |/ user: test
59 |/ user: test
57 | date: Thu Jan 01 00:00:00 1970 +0000
60 | date: Thu Jan 01 00:00:00 1970 +0000
58 | summary: A0
61 | summary: A0
59 |
62 |
60 o changeset: 0:ea207398892e
63 o changeset: 0:ea207398892e
61 user: test
64 user: test
62 date: Thu Jan 01 00:00:00 1970 +0000
65 date: Thu Jan 01 00:00:00 1970 +0000
63 summary: ROOT
66 summary: ROOT
64
67
65 Check templates
68 Check templates
66 ---------------
69 ---------------
67 $ hg up 'desc(A0)' --hidden
70 $ hg up 'desc(A0)' --hidden
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
69
72
70 Predecessors template should show current revision as it is the working copy
73 Predecessors template should show current revision as it is the working copy
71 $ hg tlog
74 $ hg tlog
72 o d004c8f274b9
75 o d004c8f274b9
73 | Predecessors: 1:471f378eab4c
76 | Predecessors: 1:471f378eab4c
74 | semi-colon: 1:471f378eab4c
77 | semi-colon: 1:471f378eab4c
75 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
78 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
76 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
79 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
77 | @ 471f378eab4c
80 | @ 471f378eab4c
78 |/
81 |/ Successors: 4:d004c8f274b9
82 | multi-line: 4:d004c8f274b9
83 | json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
79 o ea207398892e
84 o ea207398892e
80
85
81 $ hg up 'desc(A1)' --hidden
86 $ hg up 'desc(A1)' --hidden
82 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
83
88
84 Predecessors template should show current revision as it is the working copy
89 Predecessors template should show current revision as it is the working copy
85 $ hg tlog
90 $ hg tlog
86 o d004c8f274b9
91 o d004c8f274b9
87 | Predecessors: 3:a468dc9b3633
92 | Predecessors: 3:a468dc9b3633
88 | semi-colon: 3:a468dc9b3633
93 | semi-colon: 3:a468dc9b3633
89 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
94 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
90 | map: 3:a468dc9b36338b14fdb7825f55ce3df4e71517ad
95 | map: 3:a468dc9b36338b14fdb7825f55ce3df4e71517ad
91 | @ a468dc9b3633
96 | @ a468dc9b3633
92 |/
97 |/ Successors: 4:d004c8f274b9
98 | multi-line: 4:d004c8f274b9
99 | json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
93 o ea207398892e
100 o ea207398892e
94
101
95 Predecessors template should show all the predecessors as we force their display
102 Predecessors template should show all the predecessors as we force their display
96 with --hidden
103 with --hidden
97 $ hg tlog --hidden
104 $ hg tlog --hidden
98 o d004c8f274b9
105 o d004c8f274b9
99 | Predecessors: 3:a468dc9b3633
106 | Predecessors: 3:a468dc9b3633
100 | semi-colon: 3:a468dc9b3633
107 | semi-colon: 3:a468dc9b3633
101 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
108 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
102 | map: 3:a468dc9b36338b14fdb7825f55ce3df4e71517ad
109 | map: 3:a468dc9b36338b14fdb7825f55ce3df4e71517ad
103 | @ a468dc9b3633
110 | @ a468dc9b3633
104 |/ Predecessors: 1:471f378eab4c
111 |/ Predecessors: 1:471f378eab4c
105 | semi-colon: 1:471f378eab4c
112 | semi-colon: 1:471f378eab4c
106 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
113 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
107 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
114 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
115 | Successors: 4:d004c8f274b9
116 | multi-line: 4:d004c8f274b9
117 | json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
108 | x f137d23bb3e1
118 | x f137d23bb3e1
109 | |
119 | |
110 | x 471f378eab4c
120 | x 471f378eab4c
111 |/
121 |/ Successors: 3:a468dc9b3633
122 | multi-line: 3:a468dc9b3633
123 | json: [["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]]
112 o ea207398892e
124 o ea207398892e
113
125
114
126
115 Predecessors template shouldn't show anything as all obsolete commit are not
127 Predecessors template shouldn't show anything as all obsolete commit are not
116 visible.
128 visible.
117 $ hg up 'desc(A2)'
129 $ hg up 'desc(A2)'
118 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
130 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
119 $ hg tlog
131 $ hg tlog
120 @ d004c8f274b9
132 @ d004c8f274b9
121 |
133 |
122 o ea207398892e
134 o ea207398892e
123
135
124 $ hg tlog --hidden
136 $ hg tlog --hidden
125 @ d004c8f274b9
137 @ d004c8f274b9
126 | Predecessors: 3:a468dc9b3633
138 | Predecessors: 3:a468dc9b3633
127 | semi-colon: 3:a468dc9b3633
139 | semi-colon: 3:a468dc9b3633
128 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
140 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
129 | map: 3:a468dc9b36338b14fdb7825f55ce3df4e71517ad
141 | map: 3:a468dc9b36338b14fdb7825f55ce3df4e71517ad
130 | x a468dc9b3633
142 | x a468dc9b3633
131 |/ Predecessors: 1:471f378eab4c
143 |/ Predecessors: 1:471f378eab4c
132 | semi-colon: 1:471f378eab4c
144 | semi-colon: 1:471f378eab4c
133 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
145 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
134 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
146 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
147 | Successors: 4:d004c8f274b9
148 | multi-line: 4:d004c8f274b9
149 | json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
135 | x f137d23bb3e1
150 | x f137d23bb3e1
136 | |
151 | |
137 | x 471f378eab4c
152 | x 471f378eab4c
138 |/
153 |/ Successors: 3:a468dc9b3633
154 | multi-line: 3:a468dc9b3633
155 | json: [["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]]
139 o ea207398892e
156 o ea207398892e
140
157
141
158
142 Test templates with splitted commit
159 Test templates with splitted commit
143 ===================================
160 ===================================
144
161
145 $ hg init $TESTTMP/templates-local-split
162 $ hg init $TESTTMP/templates-local-split
146 $ cd $TESTTMP/templates-local-split
163 $ cd $TESTTMP/templates-local-split
147 $ mkcommit ROOT
164 $ mkcommit ROOT
148 $ echo 42 >> a
165 $ echo 42 >> a
149 $ echo 43 >> b
166 $ echo 43 >> b
150 $ hg commit -A -m "A0"
167 $ hg commit -A -m "A0"
151 adding a
168 adding a
152 adding b
169 adding b
153 $ hg log --hidden -G
170 $ hg log --hidden -G
154 @ changeset: 1:471597cad322
171 @ changeset: 1:471597cad322
155 | tag: tip
172 | tag: tip
156 | user: test
173 | user: test
157 | date: Thu Jan 01 00:00:00 1970 +0000
174 | date: Thu Jan 01 00:00:00 1970 +0000
158 | summary: A0
175 | summary: A0
159 |
176 |
160 o changeset: 0:ea207398892e
177 o changeset: 0:ea207398892e
161 user: test
178 user: test
162 date: Thu Jan 01 00:00:00 1970 +0000
179 date: Thu Jan 01 00:00:00 1970 +0000
163 summary: ROOT
180 summary: ROOT
164
181
165 # Simulate split
182 # Simulate split
166 $ hg up -r "desc(ROOT)"
183 $ hg up -r "desc(ROOT)"
167 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
184 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
168 $ echo 42 >> a
185 $ echo 42 >> a
169 $ hg commit -A -m "A0"
186 $ hg commit -A -m "A0"
170 adding a
187 adding a
171 created new head
188 created new head
172 $ echo 43 >> b
189 $ echo 43 >> b
173 $ hg commit -A -m "A0"
190 $ hg commit -A -m "A0"
174 adding b
191 adding b
175 $ hg debugobsolete `getid "1"` `getid "2"` `getid "3"`
192 $ hg debugobsolete `getid "1"` `getid "2"` `getid "3"`
176
193
177 $ hg log --hidden -G
194 $ hg log --hidden -G
178 @ changeset: 3:f257fde29c7a
195 @ changeset: 3:f257fde29c7a
179 | tag: tip
196 | tag: tip
180 | user: test
197 | user: test
181 | date: Thu Jan 01 00:00:00 1970 +0000
198 | date: Thu Jan 01 00:00:00 1970 +0000
182 | summary: A0
199 | summary: A0
183 |
200 |
184 o changeset: 2:337fec4d2edc
201 o changeset: 2:337fec4d2edc
185 | parent: 0:ea207398892e
202 | parent: 0:ea207398892e
186 | user: test
203 | user: test
187 | date: Thu Jan 01 00:00:00 1970 +0000
204 | date: Thu Jan 01 00:00:00 1970 +0000
188 | summary: A0
205 | summary: A0
189 |
206 |
190 | x changeset: 1:471597cad322
207 | x changeset: 1:471597cad322
191 |/ user: test
208 |/ user: test
192 | date: Thu Jan 01 00:00:00 1970 +0000
209 | date: Thu Jan 01 00:00:00 1970 +0000
193 | summary: A0
210 | summary: A0
194 |
211 |
195 o changeset: 0:ea207398892e
212 o changeset: 0:ea207398892e
196 user: test
213 user: test
197 date: Thu Jan 01 00:00:00 1970 +0000
214 date: Thu Jan 01 00:00:00 1970 +0000
198 summary: ROOT
215 summary: ROOT
199
216
200 Check templates
217 Check templates
201 ---------------
218 ---------------
202
219
203 $ hg up 'obsolete()' --hidden
220 $ hg up 'obsolete()' --hidden
204 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
221 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
205
222
206 Predecessors template should show current revision as it is the working copy
223 Predecessors template should show current revision as it is the working copy
207 $ hg tlog
224 $ hg tlog
208 o f257fde29c7a
225 o f257fde29c7a
209 | Predecessors: 1:471597cad322
226 | Predecessors: 1:471597cad322
210 | semi-colon: 1:471597cad322
227 | semi-colon: 1:471597cad322
211 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
228 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
212 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
229 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
213 o 337fec4d2edc
230 o 337fec4d2edc
214 | Predecessors: 1:471597cad322
231 | Predecessors: 1:471597cad322
215 | semi-colon: 1:471597cad322
232 | semi-colon: 1:471597cad322
216 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
233 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
217 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
234 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
218 | @ 471597cad322
235 | @ 471597cad322
219 |/
236 |/ Successors: 2:337fec4d2edc 3:f257fde29c7a
237 | multi-line: 2:337fec4d2edc 3:f257fde29c7a
238 | json: [["337fec4d2edcf0e7a467e35f818234bc620068b5", "f257fde29c7a847c9b607f6e958656d0df0fb15c"]]
220 o ea207398892e
239 o ea207398892e
221
240
222 $ hg up f257fde29c7a
241 $ hg up f257fde29c7a
223 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
242 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
224
243
225 Predecessors template should not show a predecessor as it's not displayed in
244 Predecessors template should not show a predecessor as it's not displayed in
226 the log
245 the log
227 $ hg tlog
246 $ hg tlog
228 @ f257fde29c7a
247 @ f257fde29c7a
229 |
248 |
230 o 337fec4d2edc
249 o 337fec4d2edc
231 |
250 |
232 o ea207398892e
251 o ea207398892e
233
252
234 Predecessors template should show both predecessors as we force their display
253 Predecessors template should show both predecessors as we force their display
235 with --hidden
254 with --hidden
236 $ hg tlog --hidden
255 $ hg tlog --hidden
237 @ f257fde29c7a
256 @ f257fde29c7a
238 | Predecessors: 1:471597cad322
257 | Predecessors: 1:471597cad322
239 | semi-colon: 1:471597cad322
258 | semi-colon: 1:471597cad322
240 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
259 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
241 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
260 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
242 o 337fec4d2edc
261 o 337fec4d2edc
243 | Predecessors: 1:471597cad322
262 | Predecessors: 1:471597cad322
244 | semi-colon: 1:471597cad322
263 | semi-colon: 1:471597cad322
245 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
264 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
246 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
265 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
247 | x 471597cad322
266 | x 471597cad322
248 |/
267 |/ Successors: 2:337fec4d2edc 3:f257fde29c7a
268 | multi-line: 2:337fec4d2edc 3:f257fde29c7a
269 | json: [["337fec4d2edcf0e7a467e35f818234bc620068b5", "f257fde29c7a847c9b607f6e958656d0df0fb15c"]]
249 o ea207398892e
270 o ea207398892e
250
271
251 Test templates with folded commit
272 Test templates with folded commit
252 =================================
273 =================================
253
274
254 Test setup
275 Test setup
255 ----------
276 ----------
256
277
257 $ hg init $TESTTMP/templates-local-fold
278 $ hg init $TESTTMP/templates-local-fold
258 $ cd $TESTTMP/templates-local-fold
279 $ cd $TESTTMP/templates-local-fold
259 $ mkcommit ROOT
280 $ mkcommit ROOT
260 $ mkcommit A0
281 $ mkcommit A0
261 $ mkcommit B0
282 $ mkcommit B0
262 $ hg log --hidden -G
283 $ hg log --hidden -G
263 @ changeset: 2:0dec01379d3b
284 @ changeset: 2:0dec01379d3b
264 | tag: tip
285 | tag: tip
265 | user: test
286 | user: test
266 | date: Thu Jan 01 00:00:00 1970 +0000
287 | date: Thu Jan 01 00:00:00 1970 +0000
267 | summary: B0
288 | summary: B0
268 |
289 |
269 o changeset: 1:471f378eab4c
290 o changeset: 1:471f378eab4c
270 | user: test
291 | user: test
271 | date: Thu Jan 01 00:00:00 1970 +0000
292 | date: Thu Jan 01 00:00:00 1970 +0000
272 | summary: A0
293 | summary: A0
273 |
294 |
274 o changeset: 0:ea207398892e
295 o changeset: 0:ea207398892e
275 user: test
296 user: test
276 date: Thu Jan 01 00:00:00 1970 +0000
297 date: Thu Jan 01 00:00:00 1970 +0000
277 summary: ROOT
298 summary: ROOT
278
299
279 Simulate a fold
300 Simulate a fold
280 $ hg up -r "desc(ROOT)"
301 $ hg up -r "desc(ROOT)"
281 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
302 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
282 $ echo "A0" > A0
303 $ echo "A0" > A0
283 $ echo "B0" > B0
304 $ echo "B0" > B0
284 $ hg commit -A -m "C0"
305 $ hg commit -A -m "C0"
285 adding A0
306 adding A0
286 adding B0
307 adding B0
287 created new head
308 created new head
288 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(C0)"`
309 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(C0)"`
289 $ hg debugobsolete `getid "desc(B0)"` `getid "desc(C0)"`
310 $ hg debugobsolete `getid "desc(B0)"` `getid "desc(C0)"`
290
311
291 $ hg log --hidden -G
312 $ hg log --hidden -G
292 @ changeset: 3:eb5a0daa2192
313 @ changeset: 3:eb5a0daa2192
293 | tag: tip
314 | tag: tip
294 | parent: 0:ea207398892e
315 | parent: 0:ea207398892e
295 | user: test
316 | user: test
296 | date: Thu Jan 01 00:00:00 1970 +0000
317 | date: Thu Jan 01 00:00:00 1970 +0000
297 | summary: C0
318 | summary: C0
298 |
319 |
299 | x changeset: 2:0dec01379d3b
320 | x changeset: 2:0dec01379d3b
300 | | user: test
321 | | user: test
301 | | date: Thu Jan 01 00:00:00 1970 +0000
322 | | date: Thu Jan 01 00:00:00 1970 +0000
302 | | summary: B0
323 | | summary: B0
303 | |
324 | |
304 | x changeset: 1:471f378eab4c
325 | x changeset: 1:471f378eab4c
305 |/ user: test
326 |/ user: test
306 | date: Thu Jan 01 00:00:00 1970 +0000
327 | date: Thu Jan 01 00:00:00 1970 +0000
307 | summary: A0
328 | summary: A0
308 |
329 |
309 o changeset: 0:ea207398892e
330 o changeset: 0:ea207398892e
310 user: test
331 user: test
311 date: Thu Jan 01 00:00:00 1970 +0000
332 date: Thu Jan 01 00:00:00 1970 +0000
312 summary: ROOT
333 summary: ROOT
313
334
314 Check templates
335 Check templates
315 ---------------
336 ---------------
316
337
317 $ hg up 'desc(A0)' --hidden
338 $ hg up 'desc(A0)' --hidden
318 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
339 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
319
340
320 Predecessors template should show current revision as it is the working copy
341 Predecessors template should show current revision as it is the working copy
321 $ hg tlog
342 $ hg tlog
322 o eb5a0daa2192
343 o eb5a0daa2192
323 | Predecessors: 1:471f378eab4c
344 | Predecessors: 1:471f378eab4c
324 | semi-colon: 1:471f378eab4c
345 | semi-colon: 1:471f378eab4c
325 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
346 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
326 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
347 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
327 | @ 471f378eab4c
348 | @ 471f378eab4c
328 |/
349 |/ Successors: 3:eb5a0daa2192
350 | multi-line: 3:eb5a0daa2192
351 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
329 o ea207398892e
352 o ea207398892e
330
353
331 $ hg up 'desc(B0)' --hidden
354 $ hg up 'desc(B0)' --hidden
332 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
355 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
333
356
334 Predecessors template should show both predecessors as they should be both
357 Predecessors template should show both predecessors as they should be both
335 displayed
358 displayed
336 $ hg tlog
359 $ hg tlog
337 o eb5a0daa2192
360 o eb5a0daa2192
338 | Predecessors: 2:0dec01379d3b 1:471f378eab4c
361 | Predecessors: 2:0dec01379d3b 1:471f378eab4c
339 | semi-colon: 2:0dec01379d3b; 1:471f378eab4c
362 | semi-colon: 2:0dec01379d3b; 1:471f378eab4c
340 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
363 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
341 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874
364 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874
342 | @ 0dec01379d3b
365 | @ 0dec01379d3b
343 | |
366 | | Successors: 3:eb5a0daa2192
367 | | multi-line: 3:eb5a0daa2192
368 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
344 | x 471f378eab4c
369 | x 471f378eab4c
345 |/
370 |/ Successors: 3:eb5a0daa2192
371 | multi-line: 3:eb5a0daa2192
372 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
346 o ea207398892e
373 o ea207398892e
347
374
348 $ hg up 'desc(C0)'
375 $ hg up 'desc(C0)'
349 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
376 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
350
377
351 Predecessors template should not show predecessors as they are not displayed in
378 Predecessors template should not show predecessors as they are not displayed in
352 the log
379 the log
353 $ hg tlog
380 $ hg tlog
354 @ eb5a0daa2192
381 @ eb5a0daa2192
355 |
382 |
356 o ea207398892e
383 o ea207398892e
357
384
358 Predecessors template should show both predecessors as we force their display
385 Predecessors template should show both predecessors as we force their display
359 with --hidden
386 with --hidden
360 $ hg tlog --hidden
387 $ hg tlog --hidden
361 @ eb5a0daa2192
388 @ eb5a0daa2192
362 | Predecessors: 2:0dec01379d3b 1:471f378eab4c
389 | Predecessors: 2:0dec01379d3b 1:471f378eab4c
363 | semi-colon: 2:0dec01379d3b; 1:471f378eab4c
390 | semi-colon: 2:0dec01379d3b; 1:471f378eab4c
364 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
391 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
365 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874
392 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874
366 | x 0dec01379d3b
393 | x 0dec01379d3b
367 | |
394 | | Successors: 3:eb5a0daa2192
395 | | multi-line: 3:eb5a0daa2192
396 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
368 | x 471f378eab4c
397 | x 471f378eab4c
369 |/
398 |/ Successors: 3:eb5a0daa2192
399 | multi-line: 3:eb5a0daa2192
400 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
370 o ea207398892e
401 o ea207398892e
371
402
372
403
373 Test templates with divergence
404 Test templates with divergence
374 ==============================
405 ==============================
375
406
376 Test setup
407 Test setup
377 ----------
408 ----------
378
409
379 $ hg init $TESTTMP/templates-local-divergence
410 $ hg init $TESTTMP/templates-local-divergence
380 $ cd $TESTTMP/templates-local-divergence
411 $ cd $TESTTMP/templates-local-divergence
381 $ mkcommit ROOT
412 $ mkcommit ROOT
382 $ mkcommit A0
413 $ mkcommit A0
383 $ hg commit --amend -m "A1"
414 $ hg commit --amend -m "A1"
384 $ hg log --hidden -G
415 $ hg log --hidden -G
385 @ changeset: 2:fdf9bde5129a
416 @ changeset: 2:fdf9bde5129a
386 | tag: tip
417 | tag: tip
387 | parent: 0:ea207398892e
418 | parent: 0:ea207398892e
388 | user: test
419 | user: test
389 | date: Thu Jan 01 00:00:00 1970 +0000
420 | date: Thu Jan 01 00:00:00 1970 +0000
390 | summary: A1
421 | summary: A1
391 |
422 |
392 | x changeset: 1:471f378eab4c
423 | x changeset: 1:471f378eab4c
393 |/ user: test
424 |/ user: test
394 | date: Thu Jan 01 00:00:00 1970 +0000
425 | date: Thu Jan 01 00:00:00 1970 +0000
395 | summary: A0
426 | summary: A0
396 |
427 |
397 o changeset: 0:ea207398892e
428 o changeset: 0:ea207398892e
398 user: test
429 user: test
399 date: Thu Jan 01 00:00:00 1970 +0000
430 date: Thu Jan 01 00:00:00 1970 +0000
400 summary: ROOT
431 summary: ROOT
401
432
402 $ hg update --hidden 'desc(A0)'
433 $ hg update --hidden 'desc(A0)'
403 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
434 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
404 $ hg commit --amend -m "A2"
435 $ hg commit --amend -m "A2"
405 $ hg log --hidden -G
436 $ hg log --hidden -G
406 @ changeset: 3:65b757b745b9
437 @ changeset: 3:65b757b745b9
407 | tag: tip
438 | tag: tip
408 | parent: 0:ea207398892e
439 | parent: 0:ea207398892e
409 | user: test
440 | user: test
410 | date: Thu Jan 01 00:00:00 1970 +0000
441 | date: Thu Jan 01 00:00:00 1970 +0000
411 | trouble: divergent
442 | trouble: divergent
412 | summary: A2
443 | summary: A2
413 |
444 |
414 | o changeset: 2:fdf9bde5129a
445 | o changeset: 2:fdf9bde5129a
415 |/ parent: 0:ea207398892e
446 |/ parent: 0:ea207398892e
416 | user: test
447 | user: test
417 | date: Thu Jan 01 00:00:00 1970 +0000
448 | date: Thu Jan 01 00:00:00 1970 +0000
418 | trouble: divergent
449 | trouble: divergent
419 | summary: A1
450 | summary: A1
420 |
451 |
421 | x changeset: 1:471f378eab4c
452 | x changeset: 1:471f378eab4c
422 |/ user: test
453 |/ user: test
423 | date: Thu Jan 01 00:00:00 1970 +0000
454 | date: Thu Jan 01 00:00:00 1970 +0000
424 | summary: A0
455 | summary: A0
425 |
456 |
426 o changeset: 0:ea207398892e
457 o changeset: 0:ea207398892e
427 user: test
458 user: test
428 date: Thu Jan 01 00:00:00 1970 +0000
459 date: Thu Jan 01 00:00:00 1970 +0000
429 summary: ROOT
460 summary: ROOT
430
461
431 $ hg commit --amend -m 'A3'
462 $ hg commit --amend -m 'A3'
432 $ hg log --hidden -G
463 $ hg log --hidden -G
433 @ changeset: 4:019fadeab383
464 @ changeset: 4:019fadeab383
434 | tag: tip
465 | tag: tip
435 | parent: 0:ea207398892e
466 | parent: 0:ea207398892e
436 | user: test
467 | user: test
437 | date: Thu Jan 01 00:00:00 1970 +0000
468 | date: Thu Jan 01 00:00:00 1970 +0000
438 | trouble: divergent
469 | trouble: divergent
439 | summary: A3
470 | summary: A3
440 |
471 |
441 | x changeset: 3:65b757b745b9
472 | x changeset: 3:65b757b745b9
442 |/ parent: 0:ea207398892e
473 |/ parent: 0:ea207398892e
443 | user: test
474 | user: test
444 | date: Thu Jan 01 00:00:00 1970 +0000
475 | date: Thu Jan 01 00:00:00 1970 +0000
445 | summary: A2
476 | summary: A2
446 |
477 |
447 | o changeset: 2:fdf9bde5129a
478 | o changeset: 2:fdf9bde5129a
448 |/ parent: 0:ea207398892e
479 |/ parent: 0:ea207398892e
449 | user: test
480 | user: test
450 | date: Thu Jan 01 00:00:00 1970 +0000
481 | date: Thu Jan 01 00:00:00 1970 +0000
451 | trouble: divergent
482 | trouble: divergent
452 | summary: A1
483 | summary: A1
453 |
484 |
454 | x changeset: 1:471f378eab4c
485 | x changeset: 1:471f378eab4c
455 |/ user: test
486 |/ user: test
456 | date: Thu Jan 01 00:00:00 1970 +0000
487 | date: Thu Jan 01 00:00:00 1970 +0000
457 | summary: A0
488 | summary: A0
458 |
489 |
459 o changeset: 0:ea207398892e
490 o changeset: 0:ea207398892e
460 user: test
491 user: test
461 date: Thu Jan 01 00:00:00 1970 +0000
492 date: Thu Jan 01 00:00:00 1970 +0000
462 summary: ROOT
493 summary: ROOT
463
494
464
495
465 Check templates
496 Check templates
466 ---------------
497 ---------------
467
498
468 $ hg up 'desc(A0)' --hidden
499 $ hg up 'desc(A0)' --hidden
469 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
500 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
470
501
471 Predecessors template should show current revision as it is the working copy
502 Predecessors template should show current revision as it is the working copy
472 $ hg tlog
503 $ hg tlog
473 o 019fadeab383
504 o 019fadeab383
474 | Predecessors: 1:471f378eab4c
505 | Predecessors: 1:471f378eab4c
475 | semi-colon: 1:471f378eab4c
506 | semi-colon: 1:471f378eab4c
476 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
507 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
477 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
508 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
478 | o fdf9bde5129a
509 | o fdf9bde5129a
479 |/ Predecessors: 1:471f378eab4c
510 |/ Predecessors: 1:471f378eab4c
480 | semi-colon: 1:471f378eab4c
511 | semi-colon: 1:471f378eab4c
481 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
512 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
482 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
513 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
483 | @ 471f378eab4c
514 | @ 471f378eab4c
484 |/
515 |/ Successors: 2:fdf9bde5129a; 4:019fadeab383
516 | multi-line: 2:fdf9bde5129a
517 | multi-line: 4:019fadeab383
518 | json: [["fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"], ["019fadeab383f6699fa83ad7bdb4d82ed2c0e5ab"]]
485 o ea207398892e
519 o ea207398892e
486
520
487 $ hg up 'desc(A1)'
521 $ hg up 'desc(A1)'
488 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
522 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
489
523
490 Predecessors template should not show predecessors as they are not displayed in
524 Predecessors template should not show predecessors as they are not displayed in
491 the log
525 the log
492 $ hg tlog
526 $ hg tlog
493 o 019fadeab383
527 o 019fadeab383
494 |
528 |
495 | @ fdf9bde5129a
529 | @ fdf9bde5129a
496 |/
530 |/
497 o ea207398892e
531 o ea207398892e
498
532
499 Predecessors template should the predecessors as we force their display with
533 Predecessors template should the predecessors as we force their display with
500 --hidden
534 --hidden
501 $ hg tlog --hidden
535 $ hg tlog --hidden
502 o 019fadeab383
536 o 019fadeab383
503 | Predecessors: 3:65b757b745b9
537 | Predecessors: 3:65b757b745b9
504 | semi-colon: 3:65b757b745b9
538 | semi-colon: 3:65b757b745b9
505 | json: ["65b757b745b935093c87a2bccd877521cccffcbd"]
539 | json: ["65b757b745b935093c87a2bccd877521cccffcbd"]
506 | map: 3:65b757b745b935093c87a2bccd877521cccffcbd
540 | map: 3:65b757b745b935093c87a2bccd877521cccffcbd
507 | x 65b757b745b9
541 | x 65b757b745b9
508 |/ Predecessors: 1:471f378eab4c
542 |/ Predecessors: 1:471f378eab4c
509 | semi-colon: 1:471f378eab4c
543 | semi-colon: 1:471f378eab4c
510 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
544 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
511 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
545 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
546 | Successors: 4:019fadeab383
547 | multi-line: 4:019fadeab383
548 | json: [["019fadeab383f6699fa83ad7bdb4d82ed2c0e5ab"]]
512 | @ fdf9bde5129a
549 | @ fdf9bde5129a
513 |/ Predecessors: 1:471f378eab4c
550 |/ Predecessors: 1:471f378eab4c
514 | semi-colon: 1:471f378eab4c
551 | semi-colon: 1:471f378eab4c
515 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
552 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
516 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
553 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
517 | x 471f378eab4c
554 | x 471f378eab4c
518 |/
555 |/ Successors: 2:fdf9bde5129a; 3:65b757b745b9
556 | multi-line: 2:fdf9bde5129a
557 | multi-line: 3:65b757b745b9
558 | json: [["fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"], ["65b757b745b935093c87a2bccd877521cccffcbd"]]
519 o ea207398892e
559 o ea207398892e
520
560
521
561
522 Test templates with amended + folded commit
562 Test templates with amended + folded commit
523 ===========================================
563 ===========================================
524
564
525 Test setup
565 Test setup
526 ----------
566 ----------
527
567
528 $ hg init $TESTTMP/templates-local-amend-fold
568 $ hg init $TESTTMP/templates-local-amend-fold
529 $ cd $TESTTMP/templates-local-amend-fold
569 $ cd $TESTTMP/templates-local-amend-fold
530 $ mkcommit ROOT
570 $ mkcommit ROOT
531 $ mkcommit A0
571 $ mkcommit A0
532 $ mkcommit B0
572 $ mkcommit B0
533 $ hg commit --amend -m "B1"
573 $ hg commit --amend -m "B1"
534 $ hg log --hidden -G
574 $ hg log --hidden -G
535 @ changeset: 3:b7ea6d14e664
575 @ changeset: 3:b7ea6d14e664
536 | tag: tip
576 | tag: tip
537 | parent: 1:471f378eab4c
577 | parent: 1:471f378eab4c
538 | user: test
578 | user: test
539 | date: Thu Jan 01 00:00:00 1970 +0000
579 | date: Thu Jan 01 00:00:00 1970 +0000
540 | summary: B1
580 | summary: B1
541 |
581 |
542 | x changeset: 2:0dec01379d3b
582 | x changeset: 2:0dec01379d3b
543 |/ user: test
583 |/ user: test
544 | date: Thu Jan 01 00:00:00 1970 +0000
584 | date: Thu Jan 01 00:00:00 1970 +0000
545 | summary: B0
585 | summary: B0
546 |
586 |
547 o changeset: 1:471f378eab4c
587 o changeset: 1:471f378eab4c
548 | user: test
588 | user: test
549 | date: Thu Jan 01 00:00:00 1970 +0000
589 | date: Thu Jan 01 00:00:00 1970 +0000
550 | summary: A0
590 | summary: A0
551 |
591 |
552 o changeset: 0:ea207398892e
592 o changeset: 0:ea207398892e
553 user: test
593 user: test
554 date: Thu Jan 01 00:00:00 1970 +0000
594 date: Thu Jan 01 00:00:00 1970 +0000
555 summary: ROOT
595 summary: ROOT
556
596
557 # Simulate a fold
597 # Simulate a fold
558 $ hg up -r "desc(ROOT)"
598 $ hg up -r "desc(ROOT)"
559 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
599 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
560 $ echo "A0" > A0
600 $ echo "A0" > A0
561 $ echo "B0" > B0
601 $ echo "B0" > B0
562 $ hg commit -A -m "C0"
602 $ hg commit -A -m "C0"
563 adding A0
603 adding A0
564 adding B0
604 adding B0
565 created new head
605 created new head
566 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(C0)"`
606 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(C0)"`
567 $ hg debugobsolete `getid "desc(B1)"` `getid "desc(C0)"`
607 $ hg debugobsolete `getid "desc(B1)"` `getid "desc(C0)"`
568
608
569 $ hg log --hidden -G
609 $ hg log --hidden -G
570 @ changeset: 4:eb5a0daa2192
610 @ changeset: 4:eb5a0daa2192
571 | tag: tip
611 | tag: tip
572 | parent: 0:ea207398892e
612 | parent: 0:ea207398892e
573 | user: test
613 | user: test
574 | date: Thu Jan 01 00:00:00 1970 +0000
614 | date: Thu Jan 01 00:00:00 1970 +0000
575 | summary: C0
615 | summary: C0
576 |
616 |
577 | x changeset: 3:b7ea6d14e664
617 | x changeset: 3:b7ea6d14e664
578 | | parent: 1:471f378eab4c
618 | | parent: 1:471f378eab4c
579 | | user: test
619 | | user: test
580 | | date: Thu Jan 01 00:00:00 1970 +0000
620 | | date: Thu Jan 01 00:00:00 1970 +0000
581 | | summary: B1
621 | | summary: B1
582 | |
622 | |
583 | | x changeset: 2:0dec01379d3b
623 | | x changeset: 2:0dec01379d3b
584 | |/ user: test
624 | |/ user: test
585 | | date: Thu Jan 01 00:00:00 1970 +0000
625 | | date: Thu Jan 01 00:00:00 1970 +0000
586 | | summary: B0
626 | | summary: B0
587 | |
627 | |
588 | x changeset: 1:471f378eab4c
628 | x changeset: 1:471f378eab4c
589 |/ user: test
629 |/ user: test
590 | date: Thu Jan 01 00:00:00 1970 +0000
630 | date: Thu Jan 01 00:00:00 1970 +0000
591 | summary: A0
631 | summary: A0
592 |
632 |
593 o changeset: 0:ea207398892e
633 o changeset: 0:ea207398892e
594 user: test
634 user: test
595 date: Thu Jan 01 00:00:00 1970 +0000
635 date: Thu Jan 01 00:00:00 1970 +0000
596 summary: ROOT
636 summary: ROOT
597
637
598 Check templates
638 Check templates
599 ---------------
639 ---------------
600
640
601 $ hg up 'desc(A0)' --hidden
641 $ hg up 'desc(A0)' --hidden
602 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
642 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
603
643
604 Predecessors template should show current revision as it is the working copy
644 Predecessors template should show current revision as it is the working copy
605 $ hg tlog
645 $ hg tlog
606 o eb5a0daa2192
646 o eb5a0daa2192
607 | Predecessors: 1:471f378eab4c
647 | Predecessors: 1:471f378eab4c
608 | semi-colon: 1:471f378eab4c
648 | semi-colon: 1:471f378eab4c
609 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
649 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
610 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
650 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
611 | @ 471f378eab4c
651 | @ 471f378eab4c
612 |/
652 |/ Successors: 4:eb5a0daa2192
653 | multi-line: 4:eb5a0daa2192
654 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
613 o ea207398892e
655 o ea207398892e
614
656
615 $ hg up 'desc(B0)' --hidden
657 $ hg up 'desc(B0)' --hidden
616 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
658 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
617
659
618 Predecessors template should both predecessors as they are visible
660 Predecessors template should both predecessors as they are visible
619 $ hg tlog
661 $ hg tlog
620 o eb5a0daa2192
662 o eb5a0daa2192
621 | Predecessors: 2:0dec01379d3b 1:471f378eab4c
663 | Predecessors: 2:0dec01379d3b 1:471f378eab4c
622 | semi-colon: 2:0dec01379d3b; 1:471f378eab4c
664 | semi-colon: 2:0dec01379d3b; 1:471f378eab4c
623 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
665 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
624 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874
666 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874
625 | @ 0dec01379d3b
667 | @ 0dec01379d3b
626 | |
668 | | Successors: 4:eb5a0daa2192
669 | | multi-line: 4:eb5a0daa2192
670 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
627 | x 471f378eab4c
671 | x 471f378eab4c
628 |/
672 |/ Successors: 4:eb5a0daa2192
673 | multi-line: 4:eb5a0daa2192
674 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
629 o ea207398892e
675 o ea207398892e
630
676
631 $ hg up 'desc(B1)' --hidden
677 $ hg up 'desc(B1)' --hidden
632 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
678 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
633
679
634 Predecessors template should both predecessors as they are visible
680 Predecessors template should both predecessors as they are visible
635 $ hg tlog
681 $ hg tlog
636 o eb5a0daa2192
682 o eb5a0daa2192
637 | Predecessors: 1:471f378eab4c 3:b7ea6d14e664
683 | Predecessors: 1:471f378eab4c 3:b7ea6d14e664
638 | semi-colon: 1:471f378eab4c; 3:b7ea6d14e664
684 | semi-colon: 1:471f378eab4c; 3:b7ea6d14e664
639 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"]
685 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"]
640 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 3:b7ea6d14e664bdc8922221f7992631b50da3fb07
686 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 3:b7ea6d14e664bdc8922221f7992631b50da3fb07
641 | @ b7ea6d14e664
687 | @ b7ea6d14e664
642 | |
688 | | Successors: 4:eb5a0daa2192
689 | | multi-line: 4:eb5a0daa2192
690 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
643 | x 471f378eab4c
691 | x 471f378eab4c
644 |/
692 |/ Successors: 4:eb5a0daa2192
693 | multi-line: 4:eb5a0daa2192
694 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
645 o ea207398892e
695 o ea207398892e
646
696
647 $ hg up 'desc(C0)'
697 $ hg up 'desc(C0)'
648 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
698 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
649
699
650 Predecessors template should show no predecessors as they are both non visible
700 Predecessors template should show no predecessors as they are both non visible
651 $ hg tlog
701 $ hg tlog
652 @ eb5a0daa2192
702 @ eb5a0daa2192
653 |
703 |
654 o ea207398892e
704 o ea207398892e
655
705
656 Predecessors template should show all predecessors as we force their display
706 Predecessors template should show all predecessors as we force their display
657 with --hidden
707 with --hidden
658 $ hg tlog --hidden
708 $ hg tlog --hidden
659 @ eb5a0daa2192
709 @ eb5a0daa2192
660 | Predecessors: 1:471f378eab4c 3:b7ea6d14e664
710 | Predecessors: 1:471f378eab4c 3:b7ea6d14e664
661 | semi-colon: 1:471f378eab4c; 3:b7ea6d14e664
711 | semi-colon: 1:471f378eab4c; 3:b7ea6d14e664
662 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"]
712 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"]
663 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 3:b7ea6d14e664bdc8922221f7992631b50da3fb07
713 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 3:b7ea6d14e664bdc8922221f7992631b50da3fb07
664 | x b7ea6d14e664
714 | x b7ea6d14e664
665 | | Predecessors: 2:0dec01379d3b
715 | | Predecessors: 2:0dec01379d3b
666 | | semi-colon: 2:0dec01379d3b
716 | | semi-colon: 2:0dec01379d3b
667 | | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
717 | | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
668 | | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
718 | | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
719 | | Successors: 4:eb5a0daa2192
720 | | multi-line: 4:eb5a0daa2192
721 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
669 | | x 0dec01379d3b
722 | | x 0dec01379d3b
670 | |/
723 | |/ Successors: 3:b7ea6d14e664
724 | | multi-line: 3:b7ea6d14e664
725 | | json: [["b7ea6d14e664bdc8922221f7992631b50da3fb07"]]
671 | x 471f378eab4c
726 | x 471f378eab4c
672 |/
727 |/ Successors: 4:eb5a0daa2192
728 | multi-line: 4:eb5a0daa2192
729 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
673 o ea207398892e
730 o ea207398892e
674
731
675
732
676 Test template with pushed and pulled obs markers
733 Test template with pushed and pulled obs markers
677 ================================================
734 ================================================
678
735
679 Test setup
736 Test setup
680 ----------
737 ----------
681
738
682 $ hg init $TESTTMP/templates-local-remote-markers-1
739 $ hg init $TESTTMP/templates-local-remote-markers-1
683 $ cd $TESTTMP/templates-local-remote-markers-1
740 $ cd $TESTTMP/templates-local-remote-markers-1
684 $ mkcommit ROOT
741 $ mkcommit ROOT
685 $ mkcommit A0
742 $ mkcommit A0
686 $ hg clone $TESTTMP/templates-local-remote-markers-1 $TESTTMP/templates-local-remote-markers-2
743 $ hg clone $TESTTMP/templates-local-remote-markers-1 $TESTTMP/templates-local-remote-markers-2
687 updating to branch default
744 updating to branch default
688 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
745 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
689 $ cd $TESTTMP/templates-local-remote-markers-2
746 $ cd $TESTTMP/templates-local-remote-markers-2
690 $ hg log --hidden -G
747 $ hg log --hidden -G
691 @ changeset: 1:471f378eab4c
748 @ changeset: 1:471f378eab4c
692 | tag: tip
749 | tag: tip
693 | user: test
750 | user: test
694 | date: Thu Jan 01 00:00:00 1970 +0000
751 | date: Thu Jan 01 00:00:00 1970 +0000
695 | summary: A0
752 | summary: A0
696 |
753 |
697 o changeset: 0:ea207398892e
754 o changeset: 0:ea207398892e
698 user: test
755 user: test
699 date: Thu Jan 01 00:00:00 1970 +0000
756 date: Thu Jan 01 00:00:00 1970 +0000
700 summary: ROOT
757 summary: ROOT
701
758
702 $ cd $TESTTMP/templates-local-remote-markers-1
759 $ cd $TESTTMP/templates-local-remote-markers-1
703 $ hg commit --amend -m "A1"
760 $ hg commit --amend -m "A1"
704 $ hg commit --amend -m "A2"
761 $ hg commit --amend -m "A2"
705 $ hg log --hidden -G
762 $ hg log --hidden -G
706 @ changeset: 3:7a230b46bf61
763 @ changeset: 3:7a230b46bf61
707 | tag: tip
764 | tag: tip
708 | parent: 0:ea207398892e
765 | parent: 0:ea207398892e
709 | user: test
766 | user: test
710 | date: Thu Jan 01 00:00:00 1970 +0000
767 | date: Thu Jan 01 00:00:00 1970 +0000
711 | summary: A2
768 | summary: A2
712 |
769 |
713 | x changeset: 2:fdf9bde5129a
770 | x changeset: 2:fdf9bde5129a
714 |/ parent: 0:ea207398892e
771 |/ parent: 0:ea207398892e
715 | user: test
772 | user: test
716 | date: Thu Jan 01 00:00:00 1970 +0000
773 | date: Thu Jan 01 00:00:00 1970 +0000
717 | summary: A1
774 | summary: A1
718 |
775 |
719 | x changeset: 1:471f378eab4c
776 | x changeset: 1:471f378eab4c
720 |/ user: test
777 |/ user: test
721 | date: Thu Jan 01 00:00:00 1970 +0000
778 | date: Thu Jan 01 00:00:00 1970 +0000
722 | summary: A0
779 | summary: A0
723 |
780 |
724 o changeset: 0:ea207398892e
781 o changeset: 0:ea207398892e
725 user: test
782 user: test
726 date: Thu Jan 01 00:00:00 1970 +0000
783 date: Thu Jan 01 00:00:00 1970 +0000
727 summary: ROOT
784 summary: ROOT
728
785
729 $ cd $TESTTMP/templates-local-remote-markers-2
786 $ cd $TESTTMP/templates-local-remote-markers-2
730 $ hg pull
787 $ hg pull
731 pulling from $TESTTMP/templates-local-remote-markers-1 (glob)
788 pulling from $TESTTMP/templates-local-remote-markers-1 (glob)
732 searching for changes
789 searching for changes
733 adding changesets
790 adding changesets
734 adding manifests
791 adding manifests
735 adding file changes
792 adding file changes
736 added 1 changesets with 0 changes to 1 files (+1 heads)
793 added 1 changesets with 0 changes to 1 files (+1 heads)
737 2 new obsolescence markers
794 2 new obsolescence markers
738 obsoleted 1 changesets
795 obsoleted 1 changesets
739 (run 'hg heads' to see heads, 'hg merge' to merge)
796 (run 'hg heads' to see heads, 'hg merge' to merge)
740 $ hg log --hidden -G
797 $ hg log --hidden -G
741 o changeset: 2:7a230b46bf61
798 o changeset: 2:7a230b46bf61
742 | tag: tip
799 | tag: tip
743 | parent: 0:ea207398892e
800 | parent: 0:ea207398892e
744 | user: test
801 | user: test
745 | date: Thu Jan 01 00:00:00 1970 +0000
802 | date: Thu Jan 01 00:00:00 1970 +0000
746 | summary: A2
803 | summary: A2
747 |
804 |
748 | @ changeset: 1:471f378eab4c
805 | @ changeset: 1:471f378eab4c
749 |/ user: test
806 |/ user: test
750 | date: Thu Jan 01 00:00:00 1970 +0000
807 | date: Thu Jan 01 00:00:00 1970 +0000
751 | summary: A0
808 | summary: A0
752 |
809 |
753 o changeset: 0:ea207398892e
810 o changeset: 0:ea207398892e
754 user: test
811 user: test
755 date: Thu Jan 01 00:00:00 1970 +0000
812 date: Thu Jan 01 00:00:00 1970 +0000
756 summary: ROOT
813 summary: ROOT
757
814
758
815
759 $ hg debugobsolete
816 $ hg debugobsolete
760 471f378eab4c5e25f6c77f785b27c936efb22874 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
817 471f378eab4c5e25f6c77f785b27c936efb22874 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
761 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 7a230b46bf61e50b30308c6cfd7bd1269ef54702 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
818 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 7a230b46bf61e50b30308c6cfd7bd1269ef54702 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
762
819
763 Check templates
820 Check templates
764 ---------------
821 ---------------
765
822
766 Predecessors template should show current revision as it is the working copy
823 Predecessors template should show current revision as it is the working copy
767 $ hg tlog
824 $ hg tlog
768 o 7a230b46bf61
825 o 7a230b46bf61
769 | Predecessors: 1:471f378eab4c
826 | Predecessors: 1:471f378eab4c
770 | semi-colon: 1:471f378eab4c
827 | semi-colon: 1:471f378eab4c
771 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
828 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
772 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
829 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
773 | @ 471f378eab4c
830 | @ 471f378eab4c
774 |/
831 |/ Successors: 2:7a230b46bf61
832 | multi-line: 2:7a230b46bf61
833 | json: [["7a230b46bf61e50b30308c6cfd7bd1269ef54702"]]
775 o ea207398892e
834 o ea207398892e
776
835
777 $ hg up 'desc(A2)'
836 $ hg up 'desc(A2)'
778 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
837 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
779
838
780 Predecessors template should show no predecessors as they are non visible
839 Predecessors template should show no predecessors as they are non visible
781 $ hg tlog
840 $ hg tlog
782 @ 7a230b46bf61
841 @ 7a230b46bf61
783 |
842 |
784 o ea207398892e
843 o ea207398892e
785
844
786 Predecessors template should show all predecessors as we force their display
845 Predecessors template should show all predecessors as we force their display
787 with --hidden
846 with --hidden
788 $ hg tlog --hidden
847 $ hg tlog --hidden
789 @ 7a230b46bf61
848 @ 7a230b46bf61
790 | Predecessors: 1:471f378eab4c
849 | Predecessors: 1:471f378eab4c
791 | semi-colon: 1:471f378eab4c
850 | semi-colon: 1:471f378eab4c
792 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
851 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
793 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
852 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
794 | x 471f378eab4c
853 | x 471f378eab4c
795 |/
854 |/ Successors: 2:7a230b46bf61
855 | multi-line: 2:7a230b46bf61
856 | json: [["7a230b46bf61e50b30308c6cfd7bd1269ef54702"]]
796 o ea207398892e
857 o ea207398892e
797
858
798
859
799 Test template with obsmarkers cycle
860 Test template with obsmarkers cycle
800 ===================================
861 ===================================
801
862
802 Test setup
863 Test setup
803 ----------
864 ----------
804
865
805 $ hg init $TESTTMP/templates-local-cycle
866 $ hg init $TESTTMP/templates-local-cycle
806 $ cd $TESTTMP/templates-local-cycle
867 $ cd $TESTTMP/templates-local-cycle
807 $ mkcommit ROOT
868 $ mkcommit ROOT
808 $ mkcommit A0
869 $ mkcommit A0
809 $ mkcommit B0
870 $ mkcommit B0
810 $ hg up -r 0
871 $ hg up -r 0
811 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
872 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
812 $ mkcommit C0
873 $ mkcommit C0
813 created new head
874 created new head
814
875
815 Create the cycle
876 Create the cycle
816
877
817 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(B0)"`
878 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(B0)"`
818 $ hg debugobsolete `getid "desc(B0)"` `getid "desc(C0)"`
879 $ hg debugobsolete `getid "desc(B0)"` `getid "desc(C0)"`
819 $ hg debugobsolete `getid "desc(B0)"` `getid "desc(A0)"`
880 $ hg debugobsolete `getid "desc(B0)"` `getid "desc(A0)"`
820
881
821 Check templates
882 Check templates
822 ---------------
883 ---------------
823
884
824 $ hg tlog
885 $ hg tlog
825 @ f897c6137566
886 @ f897c6137566
826 |
887 |
827 o ea207398892e
888 o ea207398892e
828
889
829
890
830 $ hg up -r "desc(B0)" --hidden
891 $ hg up -r "desc(B0)" --hidden
831 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
892 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
832 $ hg tlog
893 $ hg tlog
833 o f897c6137566
894 o f897c6137566
834 | Predecessors: 2:0dec01379d3b
895 | Predecessors: 2:0dec01379d3b
835 | semi-colon: 2:0dec01379d3b
896 | semi-colon: 2:0dec01379d3b
836 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
897 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
837 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
898 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
838 | @ 0dec01379d3b
899 | @ 0dec01379d3b
839 | | Predecessors: 1:471f378eab4c
900 | | Predecessors: 1:471f378eab4c
840 | | semi-colon: 1:471f378eab4c
901 | | semi-colon: 1:471f378eab4c
841 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
902 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
842 | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
903 | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
904 | | Successors: 3:f897c6137566; 1:471f378eab4c
905 | | multi-line: 3:f897c6137566
906 | | multi-line: 1:471f378eab4c
907 | | json: [["f897c6137566320b081514b4c7227ecc3d384b39"], ["471f378eab4c5e25f6c77f785b27c936efb22874"]]
843 | x 471f378eab4c
908 | x 471f378eab4c
844 |/ Predecessors: 2:0dec01379d3b
909 |/ Predecessors: 2:0dec01379d3b
845 | semi-colon: 2:0dec01379d3b
910 | semi-colon: 2:0dec01379d3b
846 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
911 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
847 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
912 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
913 | Successors: 2:0dec01379d3b
914 | multi-line: 2:0dec01379d3b
915 | json: [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]]
848 o ea207398892e
916 o ea207398892e
849
917
850
918
851 $ hg up -r "desc(A0)" --hidden
919 $ hg up -r "desc(A0)" --hidden
852 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
920 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
853 $ hg tlog
921 $ hg tlog
854 o f897c6137566
922 o f897c6137566
855 | Predecessors: 1:471f378eab4c
923 | Predecessors: 1:471f378eab4c
856 | semi-colon: 1:471f378eab4c
924 | semi-colon: 1:471f378eab4c
857 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
925 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
858 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
926 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
859 | @ 471f378eab4c
927 | @ 471f378eab4c
860 |/
928 |/
861 o ea207398892e
929 o ea207398892e
862
930
863
931
864 $ hg up -r "desc(ROOT)" --hidden
932 $ hg up -r "desc(ROOT)" --hidden
865 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
933 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
866 $ hg tlog
934 $ hg tlog
867 o f897c6137566
935 o f897c6137566
868 |
936 |
869 @ ea207398892e
937 @ ea207398892e
870
938
871
939
872 $ hg tlog --hidden
940 $ hg tlog --hidden
873 o f897c6137566
941 o f897c6137566
874 | Predecessors: 2:0dec01379d3b
942 | Predecessors: 2:0dec01379d3b
875 | semi-colon: 2:0dec01379d3b
943 | semi-colon: 2:0dec01379d3b
876 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
944 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
877 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
945 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
878 | x 0dec01379d3b
946 | x 0dec01379d3b
879 | | Predecessors: 1:471f378eab4c
947 | | Predecessors: 1:471f378eab4c
880 | | semi-colon: 1:471f378eab4c
948 | | semi-colon: 1:471f378eab4c
881 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
949 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
882 | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
950 | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
951 | | Successors: 3:f897c6137566; 1:471f378eab4c
952 | | multi-line: 3:f897c6137566
953 | | multi-line: 1:471f378eab4c
954 | | json: [["f897c6137566320b081514b4c7227ecc3d384b39"], ["471f378eab4c5e25f6c77f785b27c936efb22874"]]
883 | x 471f378eab4c
955 | x 471f378eab4c
884 |/ Predecessors: 2:0dec01379d3b
956 |/ Predecessors: 2:0dec01379d3b
885 | semi-colon: 2:0dec01379d3b
957 | semi-colon: 2:0dec01379d3b
886 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
958 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
887 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
959 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
960 | Successors: 2:0dec01379d3b
961 | multi-line: 2:0dec01379d3b
962 | json: [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]]
888 @ ea207398892e
963 @ ea207398892e
889
964
890 Test template with split + divergence with cycles
965 Test template with split + divergence with cycles
891 =================================================
966 =================================================
892
967
893 $ hg log -G
968 $ hg log -G
894 o changeset: 3:f897c6137566
969 o changeset: 3:f897c6137566
895 | tag: tip
970 | tag: tip
896 | parent: 0:ea207398892e
971 | parent: 0:ea207398892e
897 | user: test
972 | user: test
898 | date: Thu Jan 01 00:00:00 1970 +0000
973 | date: Thu Jan 01 00:00:00 1970 +0000
899 | summary: C0
974 | summary: C0
900 |
975 |
901 @ changeset: 0:ea207398892e
976 @ changeset: 0:ea207398892e
902 user: test
977 user: test
903 date: Thu Jan 01 00:00:00 1970 +0000
978 date: Thu Jan 01 00:00:00 1970 +0000
904 summary: ROOT
979 summary: ROOT
905
980
906 $ hg up
981 $ hg up
907 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
982 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
908
983
909 Create a commit with three files
984 Create a commit with three files
910 $ touch A B C
985 $ touch A B C
911 $ hg commit -A -m "Add A,B,C" A B C
986 $ hg commit -A -m "Add A,B,C" A B C
912
987
913 Split it
988 Split it
914 $ hg up 3
989 $ hg up 3
915 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
990 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
916 $ touch A
991 $ touch A
917 $ hg commit -A -m "Add A,B,C" A
992 $ hg commit -A -m "Add A,B,C" A
918 created new head
993 created new head
919
994
920 $ touch B
995 $ touch B
921 $ hg commit -A -m "Add A,B,C" B
996 $ hg commit -A -m "Add A,B,C" B
922
997
923 $ touch C
998 $ touch C
924 $ hg commit -A -m "Add A,B,C" C
999 $ hg commit -A -m "Add A,B,C" C
925
1000
926 $ hg log -G
1001 $ hg log -G
927 @ changeset: 7:ba2ed02b0c9a
1002 @ changeset: 7:ba2ed02b0c9a
928 | tag: tip
1003 | tag: tip
929 | user: test
1004 | user: test
930 | date: Thu Jan 01 00:00:00 1970 +0000
1005 | date: Thu Jan 01 00:00:00 1970 +0000
931 | summary: Add A,B,C
1006 | summary: Add A,B,C
932 |
1007 |
933 o changeset: 6:4a004186e638
1008 o changeset: 6:4a004186e638
934 | user: test
1009 | user: test
935 | date: Thu Jan 01 00:00:00 1970 +0000
1010 | date: Thu Jan 01 00:00:00 1970 +0000
936 | summary: Add A,B,C
1011 | summary: Add A,B,C
937 |
1012 |
938 o changeset: 5:dd800401bd8c
1013 o changeset: 5:dd800401bd8c
939 | parent: 3:f897c6137566
1014 | parent: 3:f897c6137566
940 | user: test
1015 | user: test
941 | date: Thu Jan 01 00:00:00 1970 +0000
1016 | date: Thu Jan 01 00:00:00 1970 +0000
942 | summary: Add A,B,C
1017 | summary: Add A,B,C
943 |
1018 |
944 | o changeset: 4:9bd10a0775e4
1019 | o changeset: 4:9bd10a0775e4
945 |/ user: test
1020 |/ user: test
946 | date: Thu Jan 01 00:00:00 1970 +0000
1021 | date: Thu Jan 01 00:00:00 1970 +0000
947 | summary: Add A,B,C
1022 | summary: Add A,B,C
948 |
1023 |
949 o changeset: 3:f897c6137566
1024 o changeset: 3:f897c6137566
950 | parent: 0:ea207398892e
1025 | parent: 0:ea207398892e
951 | user: test
1026 | user: test
952 | date: Thu Jan 01 00:00:00 1970 +0000
1027 | date: Thu Jan 01 00:00:00 1970 +0000
953 | summary: C0
1028 | summary: C0
954 |
1029 |
955 o changeset: 0:ea207398892e
1030 o changeset: 0:ea207398892e
956 user: test
1031 user: test
957 date: Thu Jan 01 00:00:00 1970 +0000
1032 date: Thu Jan 01 00:00:00 1970 +0000
958 summary: ROOT
1033 summary: ROOT
959
1034
960 $ hg debugobsolete `getid "4"` `getid "5"` `getid "6"` `getid "7"`
1035 $ hg debugobsolete `getid "4"` `getid "5"` `getid "6"` `getid "7"`
961 $ hg log -G
1036 $ hg log -G
962 @ changeset: 7:ba2ed02b0c9a
1037 @ changeset: 7:ba2ed02b0c9a
963 | tag: tip
1038 | tag: tip
964 | user: test
1039 | user: test
965 | date: Thu Jan 01 00:00:00 1970 +0000
1040 | date: Thu Jan 01 00:00:00 1970 +0000
966 | summary: Add A,B,C
1041 | summary: Add A,B,C
967 |
1042 |
968 o changeset: 6:4a004186e638
1043 o changeset: 6:4a004186e638
969 | user: test
1044 | user: test
970 | date: Thu Jan 01 00:00:00 1970 +0000
1045 | date: Thu Jan 01 00:00:00 1970 +0000
971 | summary: Add A,B,C
1046 | summary: Add A,B,C
972 |
1047 |
973 o changeset: 5:dd800401bd8c
1048 o changeset: 5:dd800401bd8c
974 | parent: 3:f897c6137566
1049 | parent: 3:f897c6137566
975 | user: test
1050 | user: test
976 | date: Thu Jan 01 00:00:00 1970 +0000
1051 | date: Thu Jan 01 00:00:00 1970 +0000
977 | summary: Add A,B,C
1052 | summary: Add A,B,C
978 |
1053 |
979 o changeset: 3:f897c6137566
1054 o changeset: 3:f897c6137566
980 | parent: 0:ea207398892e
1055 | parent: 0:ea207398892e
981 | user: test
1056 | user: test
982 | date: Thu Jan 01 00:00:00 1970 +0000
1057 | date: Thu Jan 01 00:00:00 1970 +0000
983 | summary: C0
1058 | summary: C0
984 |
1059 |
985 o changeset: 0:ea207398892e
1060 o changeset: 0:ea207398892e
986 user: test
1061 user: test
987 date: Thu Jan 01 00:00:00 1970 +0000
1062 date: Thu Jan 01 00:00:00 1970 +0000
988 summary: ROOT
1063 summary: ROOT
989
1064
990 Diverge one of the splitted commit
1065 Diverge one of the splitted commit
991
1066
992 $ hg up 6
1067 $ hg up 6
993 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1068 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
994 $ hg commit --amend -m "Add only B"
1069 $ hg commit --amend -m "Add only B"
995
1070
996 $ hg up 6 --hidden
1071 $ hg up 6 --hidden
997 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1072 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
998 $ hg commit --amend -m "Add B only"
1073 $ hg commit --amend -m "Add B only"
999
1074
1000 $ hg log -G
1075 $ hg log -G
1001 @ changeset: 9:0b997eb7ceee
1076 @ changeset: 9:0b997eb7ceee
1002 | tag: tip
1077 | tag: tip
1003 | parent: 5:dd800401bd8c
1078 | parent: 5:dd800401bd8c
1004 | user: test
1079 | user: test
1005 | date: Thu Jan 01 00:00:00 1970 +0000
1080 | date: Thu Jan 01 00:00:00 1970 +0000
1006 | trouble: divergent
1081 | trouble: divergent
1007 | summary: Add B only
1082 | summary: Add B only
1008 |
1083 |
1009 | o changeset: 8:b18bc8331526
1084 | o changeset: 8:b18bc8331526
1010 |/ parent: 5:dd800401bd8c
1085 |/ parent: 5:dd800401bd8c
1011 | user: test
1086 | user: test
1012 | date: Thu Jan 01 00:00:00 1970 +0000
1087 | date: Thu Jan 01 00:00:00 1970 +0000
1013 | trouble: divergent
1088 | trouble: divergent
1014 | summary: Add only B
1089 | summary: Add only B
1015 |
1090 |
1016 | o changeset: 7:ba2ed02b0c9a
1091 | o changeset: 7:ba2ed02b0c9a
1017 | | user: test
1092 | | user: test
1018 | | date: Thu Jan 01 00:00:00 1970 +0000
1093 | | date: Thu Jan 01 00:00:00 1970 +0000
1019 | | trouble: unstable, divergent
1094 | | trouble: unstable, divergent
1020 | | summary: Add A,B,C
1095 | | summary: Add A,B,C
1021 | |
1096 | |
1022 | x changeset: 6:4a004186e638
1097 | x changeset: 6:4a004186e638
1023 |/ user: test
1098 |/ user: test
1024 | date: Thu Jan 01 00:00:00 1970 +0000
1099 | date: Thu Jan 01 00:00:00 1970 +0000
1025 | summary: Add A,B,C
1100 | summary: Add A,B,C
1026 |
1101 |
1027 o changeset: 5:dd800401bd8c
1102 o changeset: 5:dd800401bd8c
1028 | parent: 3:f897c6137566
1103 | parent: 3:f897c6137566
1029 | user: test
1104 | user: test
1030 | date: Thu Jan 01 00:00:00 1970 +0000
1105 | date: Thu Jan 01 00:00:00 1970 +0000
1031 | trouble: divergent
1106 | trouble: divergent
1032 | summary: Add A,B,C
1107 | summary: Add A,B,C
1033 |
1108 |
1034 o changeset: 3:f897c6137566
1109 o changeset: 3:f897c6137566
1035 | parent: 0:ea207398892e
1110 | parent: 0:ea207398892e
1036 | user: test
1111 | user: test
1037 | date: Thu Jan 01 00:00:00 1970 +0000
1112 | date: Thu Jan 01 00:00:00 1970 +0000
1038 | summary: C0
1113 | summary: C0
1039 |
1114 |
1040 o changeset: 0:ea207398892e
1115 o changeset: 0:ea207398892e
1041 user: test
1116 user: test
1042 date: Thu Jan 01 00:00:00 1970 +0000
1117 date: Thu Jan 01 00:00:00 1970 +0000
1043 summary: ROOT
1118 summary: ROOT
1044
1119
1045
1120
1046 Check templates
1121 Check templates
1047 ---------------
1122 ---------------
1048
1123
1049 $ hg tlog
1124 $ hg tlog
1050 @ 0b997eb7ceee
1125 @ 0b997eb7ceee
1051 | Predecessors: 6:4a004186e638
1126 | Predecessors: 6:4a004186e638
1052 | semi-colon: 6:4a004186e638
1127 | semi-colon: 6:4a004186e638
1053 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"]
1128 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"]
1054 | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace
1129 | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace
1055 | o b18bc8331526
1130 | o b18bc8331526
1056 |/ Predecessors: 6:4a004186e638
1131 |/ Predecessors: 6:4a004186e638
1057 | semi-colon: 6:4a004186e638
1132 | semi-colon: 6:4a004186e638
1058 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"]
1133 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"]
1059 | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace
1134 | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace
1060 | o ba2ed02b0c9a
1135 | o ba2ed02b0c9a
1061 | |
1136 | |
1062 | x 4a004186e638
1137 | x 4a004186e638
1063 |/
1138 |/ Successors: 8:b18bc8331526; 9:0b997eb7ceee
1139 | multi-line: 8:b18bc8331526
1140 | multi-line: 9:0b997eb7ceee
1141 | json: [["b18bc8331526a22cbb1801022bd1555bf291c48b"], ["0b997eb7ceeee06200a02f8aab185979092d514e"]]
1064 o dd800401bd8c
1142 o dd800401bd8c
1065 |
1143 |
1066 o f897c6137566
1144 o f897c6137566
1067 |
1145 |
1068 o ea207398892e
1146 o ea207398892e
1069
1147
1070 $ hg tlog --hidden
1148 $ hg tlog --hidden
1071 @ 0b997eb7ceee
1149 @ 0b997eb7ceee
1072 | Predecessors: 6:4a004186e638
1150 | Predecessors: 6:4a004186e638
1073 | semi-colon: 6:4a004186e638
1151 | semi-colon: 6:4a004186e638
1074 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"]
1152 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"]
1075 | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace
1153 | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace
1076 | o b18bc8331526
1154 | o b18bc8331526
1077 |/ Predecessors: 6:4a004186e638
1155 |/ Predecessors: 6:4a004186e638
1078 | semi-colon: 6:4a004186e638
1156 | semi-colon: 6:4a004186e638
1079 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"]
1157 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"]
1080 | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace
1158 | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace
1081 | o ba2ed02b0c9a
1159 | o ba2ed02b0c9a
1082 | | Predecessors: 4:9bd10a0775e4
1160 | | Predecessors: 4:9bd10a0775e4
1083 | | semi-colon: 4:9bd10a0775e4
1161 | | semi-colon: 4:9bd10a0775e4
1084 | | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1162 | | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1085 | | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1163 | | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1086 | x 4a004186e638
1164 | x 4a004186e638
1087 |/ Predecessors: 4:9bd10a0775e4
1165 |/ Predecessors: 4:9bd10a0775e4
1088 | semi-colon: 4:9bd10a0775e4
1166 | semi-colon: 4:9bd10a0775e4
1089 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1167 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1090 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1168 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1169 | Successors: 8:b18bc8331526; 9:0b997eb7ceee
1170 | multi-line: 8:b18bc8331526
1171 | multi-line: 9:0b997eb7ceee
1172 | json: [["b18bc8331526a22cbb1801022bd1555bf291c48b"], ["0b997eb7ceeee06200a02f8aab185979092d514e"]]
1091 o dd800401bd8c
1173 o dd800401bd8c
1092 | Predecessors: 4:9bd10a0775e4
1174 | Predecessors: 4:9bd10a0775e4
1093 | semi-colon: 4:9bd10a0775e4
1175 | semi-colon: 4:9bd10a0775e4
1094 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1176 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1095 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1177 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1096 | x 9bd10a0775e4
1178 | x 9bd10a0775e4
1097 |/
1179 |/ Successors: 5:dd800401bd8c 6:4a004186e638 7:ba2ed02b0c9a
1180 | multi-line: 5:dd800401bd8c 6:4a004186e638 7:ba2ed02b0c9a
1181 | json: [["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"]]
1098 o f897c6137566
1182 o f897c6137566
1099 | Predecessors: 2:0dec01379d3b
1183 | Predecessors: 2:0dec01379d3b
1100 | semi-colon: 2:0dec01379d3b
1184 | semi-colon: 2:0dec01379d3b
1101 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
1185 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
1102 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
1186 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
1103 | x 0dec01379d3b
1187 | x 0dec01379d3b
1104 | | Predecessors: 1:471f378eab4c
1188 | | Predecessors: 1:471f378eab4c
1105 | | semi-colon: 1:471f378eab4c
1189 | | semi-colon: 1:471f378eab4c
1106 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
1190 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
1107 | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
1191 | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
1192 | | Successors: 3:f897c6137566; 1:471f378eab4c
1193 | | multi-line: 3:f897c6137566
1194 | | multi-line: 1:471f378eab4c
1195 | | json: [["f897c6137566320b081514b4c7227ecc3d384b39"], ["471f378eab4c5e25f6c77f785b27c936efb22874"]]
1108 | x 471f378eab4c
1196 | x 471f378eab4c
1109 |/ Predecessors: 2:0dec01379d3b
1197 |/ Predecessors: 2:0dec01379d3b
1110 | semi-colon: 2:0dec01379d3b
1198 | semi-colon: 2:0dec01379d3b
1111 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
1199 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
1112 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
1200 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
1201 | Successors: 2:0dec01379d3b
1202 | multi-line: 2:0dec01379d3b
1203 | json: [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]]
1113 o ea207398892e
1204 o ea207398892e
1114
1205
1115 $ hg up --hidden 4
1206 $ hg up --hidden 4
1116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1207 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1117 $ hg rebase -r 7 -d 8 --config extensions.rebase=
1208 $ hg rebase -r 7 -d 8 --config extensions.rebase=
1118 rebasing 7:ba2ed02b0c9a "Add A,B,C"
1209 rebasing 7:ba2ed02b0c9a "Add A,B,C"
1119 $ hg tlog
1210 $ hg tlog
1120 o eceed8f98ffc
1211 o eceed8f98ffc
1121 | Predecessors: 4:9bd10a0775e4
1212 | Predecessors: 4:9bd10a0775e4
1122 | semi-colon: 4:9bd10a0775e4
1213 | semi-colon: 4:9bd10a0775e4
1123 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1214 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1124 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1215 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1125 | o 0b997eb7ceee
1216 | o 0b997eb7ceee
1126 | | Predecessors: 4:9bd10a0775e4
1217 | | Predecessors: 4:9bd10a0775e4
1127 | | semi-colon: 4:9bd10a0775e4
1218 | | semi-colon: 4:9bd10a0775e4
1128 | | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1219 | | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1129 | | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1220 | | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1130 o | b18bc8331526
1221 o | b18bc8331526
1131 |/ Predecessors: 4:9bd10a0775e4
1222 |/ Predecessors: 4:9bd10a0775e4
1132 | semi-colon: 4:9bd10a0775e4
1223 | semi-colon: 4:9bd10a0775e4
1133 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1224 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1134 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1225 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1135 o dd800401bd8c
1226 o dd800401bd8c
1136 | Predecessors: 4:9bd10a0775e4
1227 | Predecessors: 4:9bd10a0775e4
1137 | semi-colon: 4:9bd10a0775e4
1228 | semi-colon: 4:9bd10a0775e4
1138 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1229 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
1139 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1230 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
1140 | @ 9bd10a0775e4
1231 | @ 9bd10a0775e4
1141 |/
1232 |/ Successors: 5:dd800401bd8c 9:0b997eb7ceee 10:eceed8f98ffc; 5:dd800401bd8c 8:b18bc8331526 10:eceed8f98ffc
1233 | multi-line: 5:dd800401bd8c 9:0b997eb7ceee 10:eceed8f98ffc
1234 | multi-line: 5:dd800401bd8c 8:b18bc8331526 10:eceed8f98ffc
1235 | json: [["dd800401bd8c79d815329277739e433e883f784e", "0b997eb7ceeee06200a02f8aab185979092d514e", "eceed8f98ffc4186032e29a6542ab98888ebf68d"], ["dd800401bd8c79d815329277739e433e883f784e", "b18bc8331526a22cbb1801022bd1555bf291c48b", "eceed8f98ffc4186032e29a6542ab98888ebf68d"]]
1142 o f897c6137566
1236 o f897c6137566
1143 |
1237 |
1144 o ea207398892e
1238 o ea207398892e
1145
1239
1146 Test templates with pruned commits
1240 Test templates with pruned commits
1147 ==================================
1241 ==================================
1148
1242
1149 Test setup
1243 Test setup
1150 ----------
1244 ----------
1151
1245
1152 $ hg init $TESTTMP/templates-local-prune
1246 $ hg init $TESTTMP/templates-local-prune
1153 $ cd $TESTTMP/templates-local-prune
1247 $ cd $TESTTMP/templates-local-prune
1154 $ mkcommit ROOT
1248 $ mkcommit ROOT
1155 $ mkcommit A0
1249 $ mkcommit A0
1156 $ hg debugobsolete --record-parent `getid "."`
1250 $ hg debugobsolete --record-parent `getid "."`
1157
1251
1158 Check output
1252 Check output
1159 ------------
1253 ------------
1160
1254
1161 $ hg up "desc(A0)" --hidden
1255 $ hg up "desc(A0)" --hidden
1162 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1256 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1163 $ hg tlog
1257 $ hg tlog
1164 @ 471f378eab4c
1258 @ 471f378eab4c
1165 |
1259 |
1166 o ea207398892e
1260 o ea207398892e
1167
1261
General Comments 0
You need to be logged in to leave comments. Login now