##// END OF EJS Templates
templatekw: make {successorssets} always return a list (issue6342)...
Aay Jay Chan -
r46268:f95b2328 default
parent child Browse files
Show More
@@ -1,992 +1,991 b''
1 1 # templatekw.py - common changeset template keywords
2 2 #
3 3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com>
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 from __future__ import absolute_import
9 9
10 10 from .i18n import _
11 11 from .node import (
12 12 hex,
13 13 nullid,
14 14 wdirid,
15 15 wdirrev,
16 16 )
17 17
18 18 from . import (
19 19 diffutil,
20 20 encoding,
21 21 error,
22 22 hbisect,
23 23 i18n,
24 24 obsutil,
25 25 patch,
26 26 pycompat,
27 27 registrar,
28 28 scmutil,
29 29 templateutil,
30 30 util,
31 31 )
32 32 from .utils import stringutil
33 33
34 34 _hybrid = templateutil.hybrid
35 35 hybriddict = templateutil.hybriddict
36 36 hybridlist = templateutil.hybridlist
37 37 compatdict = templateutil.compatdict
38 38 compatlist = templateutil.compatlist
39 39 _showcompatlist = templateutil._showcompatlist
40 40
41 41
42 42 def getlatesttags(context, mapping, pattern=None):
43 43 '''return date, distance and name for the latest tag of rev'''
44 44 repo = context.resource(mapping, b'repo')
45 45 ctx = context.resource(mapping, b'ctx')
46 46 cache = context.resource(mapping, b'cache')
47 47
48 48 cachename = b'latesttags'
49 49 if pattern is not None:
50 50 cachename += b'-' + pattern
51 51 match = stringutil.stringmatcher(pattern)[2]
52 52 else:
53 53 match = util.always
54 54
55 55 if cachename not in cache:
56 56 # Cache mapping from rev to a tuple with tag date, tag
57 57 # distance and tag name
58 58 cache[cachename] = {-1: (0, 0, [b'null'])}
59 59 latesttags = cache[cachename]
60 60
61 61 rev = ctx.rev()
62 62 todo = [rev]
63 63 while todo:
64 64 rev = todo.pop()
65 65 if rev in latesttags:
66 66 continue
67 67 ctx = repo[rev]
68 68 tags = [
69 69 t
70 70 for t in ctx.tags()
71 71 if (repo.tagtype(t) and repo.tagtype(t) != b'local' and match(t))
72 72 ]
73 73 if tags:
74 74 latesttags[rev] = ctx.date()[0], 0, [t for t in sorted(tags)]
75 75 continue
76 76 try:
77 77 ptags = [latesttags[p.rev()] for p in ctx.parents()]
78 78 if len(ptags) > 1:
79 79 if ptags[0][2] == ptags[1][2]:
80 80 # The tuples are laid out so the right one can be found by
81 81 # comparison in this case.
82 82 pdate, pdist, ptag = max(ptags)
83 83 else:
84 84
85 85 def key(x):
86 86 tag = x[2][0]
87 87 if ctx.rev() is None:
88 88 # only() doesn't support wdir
89 89 prevs = [c.rev() for c in ctx.parents()]
90 90 changes = repo.revs(b'only(%ld, %s)', prevs, tag)
91 91 changessincetag = len(changes) + 1
92 92 else:
93 93 changes = repo.revs(b'only(%d, %s)', ctx.rev(), tag)
94 94 changessincetag = len(changes)
95 95 # Smallest number of changes since tag wins. Date is
96 96 # used as tiebreaker.
97 97 return [-changessincetag, x[0]]
98 98
99 99 pdate, pdist, ptag = max(ptags, key=key)
100 100 else:
101 101 pdate, pdist, ptag = ptags[0]
102 102 except KeyError:
103 103 # Cache miss - recurse
104 104 todo.append(rev)
105 105 todo.extend(p.rev() for p in ctx.parents())
106 106 continue
107 107 latesttags[rev] = pdate, pdist + 1, ptag
108 108 return latesttags[rev]
109 109
110 110
111 111 def getlogcolumns():
112 112 """Return a dict of log column labels"""
113 113 _ = pycompat.identity # temporarily disable gettext
114 114 # i18n: column positioning for "hg log"
115 115 columns = _(
116 116 b'bookmark: %s\n'
117 117 b'branch: %s\n'
118 118 b'changeset: %s\n'
119 119 b'copies: %s\n'
120 120 b'date: %s\n'
121 121 b'extra: %s=%s\n'
122 122 b'files+: %s\n'
123 123 b'files-: %s\n'
124 124 b'files: %s\n'
125 125 b'instability: %s\n'
126 126 b'manifest: %s\n'
127 127 b'obsolete: %s\n'
128 128 b'parent: %s\n'
129 129 b'phase: %s\n'
130 130 b'summary: %s\n'
131 131 b'tag: %s\n'
132 132 b'user: %s\n'
133 133 )
134 134 return dict(
135 135 zip(
136 136 [s.split(b':', 1)[0] for s in columns.splitlines()],
137 137 i18n._(columns).splitlines(True),
138 138 )
139 139 )
140 140
141 141
142 142 # basic internal templates
143 143 _changeidtmpl = b'{rev}:{node|formatnode}'
144 144
145 145 # default templates internally used for rendering of lists
146 146 defaulttempl = {
147 147 b'parent': _changeidtmpl + b' ',
148 148 b'manifest': _changeidtmpl,
149 149 b'file_copy': b'{name} ({source})',
150 150 b'envvar': b'{key}={value}',
151 151 b'extra': b'{key}={value|stringescape}',
152 152 }
153 153 # filecopy is preserved for compatibility reasons
154 154 defaulttempl[b'filecopy'] = defaulttempl[b'file_copy']
155 155
156 156 # keywords are callables (see registrar.templatekeyword for details)
157 157 keywords = {}
158 158 templatekeyword = registrar.templatekeyword(keywords)
159 159
160 160
161 161 @templatekeyword(b'author', requires={b'ctx'})
162 162 def showauthor(context, mapping):
163 163 """Alias for ``{user}``"""
164 164 return showuser(context, mapping)
165 165
166 166
167 167 @templatekeyword(b'bisect', requires={b'repo', b'ctx'})
168 168 def showbisect(context, mapping):
169 169 """String. The changeset bisection status."""
170 170 repo = context.resource(mapping, b'repo')
171 171 ctx = context.resource(mapping, b'ctx')
172 172 return hbisect.label(repo, ctx.node())
173 173
174 174
175 175 @templatekeyword(b'branch', requires={b'ctx'})
176 176 def showbranch(context, mapping):
177 177 """String. The name of the branch on which the changeset was
178 178 committed.
179 179 """
180 180 ctx = context.resource(mapping, b'ctx')
181 181 return ctx.branch()
182 182
183 183
184 184 @templatekeyword(b'branches', requires={b'ctx'})
185 185 def showbranches(context, mapping):
186 186 """List of strings. The name of the branch on which the
187 187 changeset was committed. Will be empty if the branch name was
188 188 default. (DEPRECATED)
189 189 """
190 190 ctx = context.resource(mapping, b'ctx')
191 191 branch = ctx.branch()
192 192 if branch != b'default':
193 193 return compatlist(
194 194 context, mapping, b'branch', [branch], plural=b'branches'
195 195 )
196 196 return compatlist(context, mapping, b'branch', [], plural=b'branches')
197 197
198 198
199 199 @templatekeyword(b'bookmarks', requires={b'repo', b'ctx'})
200 200 def showbookmarks(context, mapping):
201 201 """List of strings. Any bookmarks associated with the
202 202 changeset. Also sets 'active', the name of the active bookmark.
203 203 """
204 204 repo = context.resource(mapping, b'repo')
205 205 ctx = context.resource(mapping, b'ctx')
206 206 bookmarks = ctx.bookmarks()
207 207 active = repo._activebookmark
208 208 makemap = lambda v: {b'bookmark': v, b'active': active, b'current': active}
209 209 f = _showcompatlist(context, mapping, b'bookmark', bookmarks)
210 210 return _hybrid(f, bookmarks, makemap, pycompat.identity)
211 211
212 212
213 213 @templatekeyword(b'children', requires={b'ctx'})
214 214 def showchildren(context, mapping):
215 215 """List of strings. The children of the changeset."""
216 216 ctx = context.resource(mapping, b'ctx')
217 217 childrevs = [b'%d:%s' % (cctx.rev(), cctx) for cctx in ctx.children()]
218 218 return compatlist(
219 219 context, mapping, b'children', childrevs, element=b'child'
220 220 )
221 221
222 222
223 223 # Deprecated, but kept alive for help generation a purpose.
224 224 @templatekeyword(b'currentbookmark', requires={b'repo', b'ctx'})
225 225 def showcurrentbookmark(context, mapping):
226 226 """String. The active bookmark, if it is associated with the changeset.
227 227 (DEPRECATED)"""
228 228 return showactivebookmark(context, mapping)
229 229
230 230
231 231 @templatekeyword(b'activebookmark', requires={b'repo', b'ctx'})
232 232 def showactivebookmark(context, mapping):
233 233 """String. The active bookmark, if it is associated with the changeset."""
234 234 repo = context.resource(mapping, b'repo')
235 235 ctx = context.resource(mapping, b'ctx')
236 236 active = repo._activebookmark
237 237 if active and active in ctx.bookmarks():
238 238 return active
239 239 return b''
240 240
241 241
242 242 @templatekeyword(b'date', requires={b'ctx'})
243 243 def showdate(context, mapping):
244 244 """Date information. The date when the changeset was committed."""
245 245 ctx = context.resource(mapping, b'ctx')
246 246 # the default string format is '<float(unixtime)><tzoffset>' because
247 247 # python-hglib splits date at decimal separator.
248 248 return templateutil.date(ctx.date(), showfmt=b'%d.0%d')
249 249
250 250
251 251 @templatekeyword(b'desc', requires={b'ctx'})
252 252 def showdescription(context, mapping):
253 253 """String. The text of the changeset description."""
254 254 ctx = context.resource(mapping, b'ctx')
255 255 s = ctx.description()
256 256 if isinstance(s, encoding.localstr):
257 257 # try hard to preserve utf-8 bytes
258 258 return encoding.tolocal(encoding.fromlocal(s).strip())
259 259 elif isinstance(s, encoding.safelocalstr):
260 260 return encoding.safelocalstr(s.strip())
261 261 else:
262 262 return s.strip()
263 263
264 264
265 265 @templatekeyword(b'diffstat', requires={b'ui', b'ctx'})
266 266 def showdiffstat(context, mapping):
267 267 """String. Statistics of changes with the following format:
268 268 "modified files: +added/-removed lines"
269 269 """
270 270 ui = context.resource(mapping, b'ui')
271 271 ctx = context.resource(mapping, b'ctx')
272 272 diffopts = diffutil.diffallopts(ui, {b'noprefix': False})
273 273 diff = ctx.diff(opts=diffopts)
274 274 stats = patch.diffstatdata(util.iterlines(diff))
275 275 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
276 276 return b'%d: +%d/-%d' % (len(stats), adds, removes)
277 277
278 278
279 279 @templatekeyword(b'envvars', requires={b'ui'})
280 280 def showenvvars(context, mapping):
281 281 """A dictionary of environment variables. (EXPERIMENTAL)"""
282 282 ui = context.resource(mapping, b'ui')
283 283 env = ui.exportableenviron()
284 284 env = util.sortdict((k, env[k]) for k in sorted(env))
285 285 return compatdict(context, mapping, b'envvar', env, plural=b'envvars')
286 286
287 287
288 288 @templatekeyword(b'extras', requires={b'ctx'})
289 289 def showextras(context, mapping):
290 290 """List of dicts with key, value entries of the 'extras'
291 291 field of this changeset."""
292 292 ctx = context.resource(mapping, b'ctx')
293 293 extras = ctx.extra()
294 294 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
295 295 makemap = lambda k: {b'key': k, b'value': extras[k]}
296 296 c = [makemap(k) for k in extras]
297 297 f = _showcompatlist(context, mapping, b'extra', c, plural=b'extras')
298 298 return _hybrid(
299 299 f,
300 300 extras,
301 301 makemap,
302 302 lambda k: b'%s=%s' % (k, stringutil.escapestr(extras[k])),
303 303 )
304 304
305 305
306 306 def _getfilestatus(context, mapping, listall=False):
307 307 ctx = context.resource(mapping, b'ctx')
308 308 revcache = context.resource(mapping, b'revcache')
309 309 if b'filestatus' not in revcache or revcache[b'filestatusall'] < listall:
310 310 stat = ctx.p1().status(
311 311 ctx, listignored=listall, listclean=listall, listunknown=listall
312 312 )
313 313 revcache[b'filestatus'] = stat
314 314 revcache[b'filestatusall'] = listall
315 315 return revcache[b'filestatus']
316 316
317 317
318 318 def _getfilestatusmap(context, mapping, listall=False):
319 319 revcache = context.resource(mapping, b'revcache')
320 320 if b'filestatusmap' not in revcache or revcache[b'filestatusall'] < listall:
321 321 stat = _getfilestatus(context, mapping, listall=listall)
322 322 revcache[b'filestatusmap'] = statmap = {}
323 323 for char, files in zip(pycompat.iterbytestr(b'MAR!?IC'), stat):
324 324 statmap.update((f, char) for f in files)
325 325 return revcache[b'filestatusmap'] # {path: statchar}
326 326
327 327
328 328 @templatekeyword(
329 329 b'file_copies', requires={b'repo', b'ctx', b'cache', b'revcache'}
330 330 )
331 331 def showfilecopies(context, mapping):
332 332 """List of strings. Files copied in this changeset with
333 333 their sources.
334 334 """
335 335 repo = context.resource(mapping, b'repo')
336 336 ctx = context.resource(mapping, b'ctx')
337 337 cache = context.resource(mapping, b'cache')
338 338 copies = context.resource(mapping, b'revcache').get(b'copies')
339 339 if copies is None:
340 340 if b'getcopies' not in cache:
341 341 cache[b'getcopies'] = scmutil.getcopiesfn(repo)
342 342 getcopies = cache[b'getcopies']
343 343 copies = getcopies(ctx)
344 344 return templateutil.compatfilecopiesdict(
345 345 context, mapping, b'file_copy', copies
346 346 )
347 347
348 348
349 349 # showfilecopiesswitch() displays file copies only if copy records are
350 350 # provided before calling the templater, usually with a --copies
351 351 # command line switch.
352 352 @templatekeyword(b'file_copies_switch', requires={b'revcache'})
353 353 def showfilecopiesswitch(context, mapping):
354 354 """List of strings. Like "file_copies" but displayed
355 355 only if the --copied switch is set.
356 356 """
357 357 copies = context.resource(mapping, b'revcache').get(b'copies') or []
358 358 return templateutil.compatfilecopiesdict(
359 359 context, mapping, b'file_copy', copies
360 360 )
361 361
362 362
363 363 @templatekeyword(b'file_adds', requires={b'ctx', b'revcache'})
364 364 def showfileadds(context, mapping):
365 365 """List of strings. Files added by this changeset."""
366 366 ctx = context.resource(mapping, b'ctx')
367 367 return templateutil.compatfileslist(
368 368 context, mapping, b'file_add', ctx.filesadded()
369 369 )
370 370
371 371
372 372 @templatekeyword(b'file_dels', requires={b'ctx', b'revcache'})
373 373 def showfiledels(context, mapping):
374 374 """List of strings. Files removed by this changeset."""
375 375 ctx = context.resource(mapping, b'ctx')
376 376 return templateutil.compatfileslist(
377 377 context, mapping, b'file_del', ctx.filesremoved()
378 378 )
379 379
380 380
381 381 @templatekeyword(b'file_mods', requires={b'ctx', b'revcache'})
382 382 def showfilemods(context, mapping):
383 383 """List of strings. Files modified by this changeset."""
384 384 ctx = context.resource(mapping, b'ctx')
385 385 return templateutil.compatfileslist(
386 386 context, mapping, b'file_mod', ctx.filesmodified()
387 387 )
388 388
389 389
390 390 @templatekeyword(b'files', requires={b'ctx'})
391 391 def showfiles(context, mapping):
392 392 """List of strings. All files modified, added, or removed by this
393 393 changeset.
394 394 """
395 395 ctx = context.resource(mapping, b'ctx')
396 396 return templateutil.compatfileslist(context, mapping, b'file', ctx.files())
397 397
398 398
399 399 @templatekeyword(b'graphnode', requires={b'repo', b'ctx', b'cache'})
400 400 def showgraphnode(context, mapping):
401 401 """String. The character representing the changeset node in an ASCII
402 402 revision graph."""
403 403 repo = context.resource(mapping, b'repo')
404 404 ctx = context.resource(mapping, b'ctx')
405 405 cache = context.resource(mapping, b'cache')
406 406 return getgraphnode(repo, ctx, cache)
407 407
408 408
409 409 def getgraphnode(repo, ctx, cache):
410 410 return getgraphnodecurrent(repo, ctx, cache) or getgraphnodesymbol(ctx)
411 411
412 412
413 413 def getgraphnodecurrent(repo, ctx, cache):
414 414 wpnodes = repo.dirstate.parents()
415 415 if wpnodes[1] == nullid:
416 416 wpnodes = wpnodes[:1]
417 417 if ctx.node() in wpnodes:
418 418 return b'@'
419 419 else:
420 420 merge_nodes = cache.get(b'merge_nodes')
421 421 if merge_nodes is None:
422 422 from . import mergestate as mergestatemod
423 423
424 424 mergestate = mergestatemod.mergestate.read(repo)
425 425 if mergestate.unresolvedcount():
426 426 merge_nodes = (mergestate.local, mergestate.other)
427 427 else:
428 428 merge_nodes = ()
429 429 cache[b'merge_nodes'] = merge_nodes
430 430
431 431 if ctx.node() in merge_nodes:
432 432 return b'%'
433 433 return b''
434 434
435 435
436 436 def getgraphnodesymbol(ctx):
437 437 if ctx.obsolete():
438 438 return b'x'
439 439 elif ctx.isunstable():
440 440 return b'*'
441 441 elif ctx.closesbranch():
442 442 return b'_'
443 443 else:
444 444 return b'o'
445 445
446 446
447 447 @templatekeyword(b'graphwidth', requires=())
448 448 def showgraphwidth(context, mapping):
449 449 """Integer. The width of the graph drawn by 'log --graph' or zero."""
450 450 # just hosts documentation; should be overridden by template mapping
451 451 return 0
452 452
453 453
454 454 @templatekeyword(b'index', requires=())
455 455 def showindex(context, mapping):
456 456 """Integer. The current iteration of the loop. (0 indexed)"""
457 457 # just hosts documentation; should be overridden by template mapping
458 458 raise error.Abort(_(b"can't use index in this context"))
459 459
460 460
461 461 @templatekeyword(b'latesttag', requires={b'repo', b'ctx', b'cache'})
462 462 def showlatesttag(context, mapping):
463 463 """List of strings. The global tags on the most recent globally
464 464 tagged ancestor of this changeset. If no such tags exist, the list
465 465 consists of the single string "null".
466 466 """
467 467 return showlatesttags(context, mapping, None)
468 468
469 469
470 470 def showlatesttags(context, mapping, pattern):
471 471 """helper method for the latesttag keyword and function"""
472 472 latesttags = getlatesttags(context, mapping, pattern)
473 473
474 474 # latesttag[0] is an implementation detail for sorting csets on different
475 475 # branches in a stable manner- it is the date the tagged cset was created,
476 476 # not the date the tag was created. Therefore it isn't made visible here.
477 477 makemap = lambda v: {
478 478 b'changes': _showchangessincetag,
479 479 b'distance': latesttags[1],
480 480 b'latesttag': v, # BC with {latesttag % '{latesttag}'}
481 481 b'tag': v,
482 482 }
483 483
484 484 tags = latesttags[2]
485 485 f = _showcompatlist(context, mapping, b'latesttag', tags, separator=b':')
486 486 return _hybrid(f, tags, makemap, pycompat.identity)
487 487
488 488
489 489 @templatekeyword(b'latesttagdistance', requires={b'repo', b'ctx', b'cache'})
490 490 def showlatesttagdistance(context, mapping):
491 491 """Integer. Longest path to the latest tag."""
492 492 return getlatesttags(context, mapping)[1]
493 493
494 494
495 495 @templatekeyword(b'changessincelatesttag', requires={b'repo', b'ctx', b'cache'})
496 496 def showchangessincelatesttag(context, mapping):
497 497 """Integer. All ancestors not in the latest tag."""
498 498 tag = getlatesttags(context, mapping)[2][0]
499 499 mapping = context.overlaymap(mapping, {b'tag': tag})
500 500 return _showchangessincetag(context, mapping)
501 501
502 502
503 503 def _showchangessincetag(context, mapping):
504 504 repo = context.resource(mapping, b'repo')
505 505 ctx = context.resource(mapping, b'ctx')
506 506 offset = 0
507 507 revs = [ctx.rev()]
508 508 tag = context.symbol(mapping, b'tag')
509 509
510 510 # The only() revset doesn't currently support wdir()
511 511 if ctx.rev() is None:
512 512 offset = 1
513 513 revs = [p.rev() for p in ctx.parents()]
514 514
515 515 return len(repo.revs(b'only(%ld, %s)', revs, tag)) + offset
516 516
517 517
518 518 # teach templater latesttags.changes is switched to (context, mapping) API
519 519 _showchangessincetag._requires = {b'repo', b'ctx'}
520 520
521 521
522 522 @templatekeyword(b'manifest', requires={b'repo', b'ctx'})
523 523 def showmanifest(context, mapping):
524 524 repo = context.resource(mapping, b'repo')
525 525 ctx = context.resource(mapping, b'ctx')
526 526 mnode = ctx.manifestnode()
527 527 if mnode is None:
528 528 mnode = wdirid
529 529 mrev = wdirrev
530 530 else:
531 531 mrev = repo.manifestlog.rev(mnode)
532 532 mhex = hex(mnode)
533 533 mapping = context.overlaymap(mapping, {b'rev': mrev, b'node': mhex})
534 534 f = context.process(b'manifest', mapping)
535 535 return templateutil.hybriditem(
536 536 f, None, f, lambda x: {b'rev': mrev, b'node': mhex}
537 537 )
538 538
539 539
540 540 @templatekeyword(b'obsfate', requires={b'ui', b'repo', b'ctx'})
541 541 def showobsfate(context, mapping):
542 542 # this function returns a list containing pre-formatted obsfate strings.
543 543 #
544 544 # This function will be replaced by templates fragments when we will have
545 545 # the verbosity templatekw available.
546 546 succsandmarkers = showsuccsandmarkers(context, mapping)
547 547
548 548 ui = context.resource(mapping, b'ui')
549 549 repo = context.resource(mapping, b'repo')
550 550 values = []
551 551
552 552 for x in succsandmarkers.tovalue(context, mapping):
553 553 v = obsutil.obsfateprinter(
554 554 ui, repo, x[b'successors'], x[b'markers'], scmutil.formatchangeid
555 555 )
556 556 values.append(v)
557 557
558 558 return compatlist(context, mapping, b"fate", values)
559 559
560 560
561 561 def shownames(context, mapping, namespace):
562 562 """helper method to generate a template keyword for a namespace"""
563 563 repo = context.resource(mapping, b'repo')
564 564 ctx = context.resource(mapping, b'ctx')
565 565 ns = repo.names.get(namespace)
566 566 if ns is None:
567 567 # namespaces.addnamespace() registers new template keyword, but
568 568 # the registered namespace might not exist in the current repo.
569 569 return
570 570 names = ns.names(repo, ctx.node())
571 571 return compatlist(
572 572 context, mapping, ns.templatename, names, plural=namespace
573 573 )
574 574
575 575
576 576 @templatekeyword(b'namespaces', requires={b'repo', b'ctx'})
577 577 def shownamespaces(context, mapping):
578 578 """Dict of lists. Names attached to this changeset per
579 579 namespace."""
580 580 repo = context.resource(mapping, b'repo')
581 581 ctx = context.resource(mapping, b'ctx')
582 582
583 583 namespaces = util.sortdict()
584 584
585 585 def makensmapfn(ns):
586 586 # 'name' for iterating over namespaces, templatename for local reference
587 587 return lambda v: {b'name': v, ns.templatename: v}
588 588
589 589 for k, ns in pycompat.iteritems(repo.names):
590 590 names = ns.names(repo, ctx.node())
591 591 f = _showcompatlist(context, mapping, b'name', names)
592 592 namespaces[k] = _hybrid(f, names, makensmapfn(ns), pycompat.identity)
593 593
594 594 f = _showcompatlist(context, mapping, b'namespace', list(namespaces))
595 595
596 596 def makemap(ns):
597 597 return {
598 598 b'namespace': ns,
599 599 b'names': namespaces[ns],
600 600 b'builtin': repo.names[ns].builtin,
601 601 b'colorname': repo.names[ns].colorname,
602 602 }
603 603
604 604 return _hybrid(f, namespaces, makemap, pycompat.identity)
605 605
606 606
607 607 @templatekeyword(b'negrev', requires={b'repo', b'ctx'})
608 608 def shownegrev(context, mapping):
609 609 """Integer. The repository-local changeset negative revision number,
610 610 which counts in the opposite direction."""
611 611 ctx = context.resource(mapping, b'ctx')
612 612 rev = ctx.rev()
613 613 if rev is None or rev < 0: # wdir() or nullrev?
614 614 return None
615 615 repo = context.resource(mapping, b'repo')
616 616 return rev - len(repo)
617 617
618 618
619 619 @templatekeyword(b'node', requires={b'ctx'})
620 620 def shownode(context, mapping):
621 621 """String. The changeset identification hash, as a 40 hexadecimal
622 622 digit string.
623 623 """
624 624 ctx = context.resource(mapping, b'ctx')
625 625 return ctx.hex()
626 626
627 627
628 628 @templatekeyword(b'obsolete', requires={b'ctx'})
629 629 def showobsolete(context, mapping):
630 630 """String. Whether the changeset is obsolete. (EXPERIMENTAL)"""
631 631 ctx = context.resource(mapping, b'ctx')
632 632 if ctx.obsolete():
633 633 return b'obsolete'
634 634 return b''
635 635
636 636
637 637 @templatekeyword(b'path', requires={b'fctx'})
638 638 def showpath(context, mapping):
639 639 """String. Repository-absolute path of the current file. (EXPERIMENTAL)"""
640 640 fctx = context.resource(mapping, b'fctx')
641 641 return fctx.path()
642 642
643 643
644 644 @templatekeyword(b'peerurls', requires={b'repo'})
645 645 def showpeerurls(context, mapping):
646 646 """A dictionary of repository locations defined in the [paths] section
647 647 of your configuration file."""
648 648 repo = context.resource(mapping, b'repo')
649 649 # see commands.paths() for naming of dictionary keys
650 650 paths = repo.ui.paths
651 651 urls = util.sortdict(
652 652 (k, p.rawloc) for k, p in sorted(pycompat.iteritems(paths))
653 653 )
654 654
655 655 def makemap(k):
656 656 p = paths[k]
657 657 d = {b'name': k, b'url': p.rawloc}
658 658 d.update((o, v) for o, v in sorted(pycompat.iteritems(p.suboptions)))
659 659 return d
660 660
661 661 return _hybrid(None, urls, makemap, lambda k: b'%s=%s' % (k, urls[k]))
662 662
663 663
664 664 @templatekeyword(b"predecessors", requires={b'repo', b'ctx'})
665 665 def showpredecessors(context, mapping):
666 666 """Returns the list of the closest visible predecessors. (EXPERIMENTAL)"""
667 667 repo = context.resource(mapping, b'repo')
668 668 ctx = context.resource(mapping, b'ctx')
669 669 predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node()))
670 670 predecessors = pycompat.maplist(hex, predecessors)
671 671
672 672 return _hybrid(
673 673 None,
674 674 predecessors,
675 675 lambda x: {b'ctx': repo[x]},
676 676 lambda x: scmutil.formatchangeid(repo[x]),
677 677 )
678 678
679 679
680 680 @templatekeyword(b'reporoot', requires={b'repo'})
681 681 def showreporoot(context, mapping):
682 682 """String. The root directory of the current repository."""
683 683 repo = context.resource(mapping, b'repo')
684 684 return repo.root
685 685
686 686
687 687 @templatekeyword(b'size', requires={b'fctx'})
688 688 def showsize(context, mapping):
689 689 """Integer. Size of the current file in bytes. (EXPERIMENTAL)"""
690 690 fctx = context.resource(mapping, b'fctx')
691 691 return fctx.size()
692 692
693 693
694 694 # requires 'fctx' to denote {status} depends on (ctx, path) pair
695 695 @templatekeyword(b'status', requires={b'ctx', b'fctx', b'revcache'})
696 696 def showstatus(context, mapping):
697 697 """String. Status code of the current file. (EXPERIMENTAL)"""
698 698 path = templateutil.runsymbol(context, mapping, b'path')
699 699 path = templateutil.stringify(context, mapping, path)
700 700 if not path:
701 701 return
702 702 statmap = _getfilestatusmap(context, mapping)
703 703 if path not in statmap:
704 704 statmap = _getfilestatusmap(context, mapping, listall=True)
705 705 return statmap.get(path)
706 706
707 707
708 708 @templatekeyword(b"successorssets", requires={b'repo', b'ctx'})
709 709 def showsuccessorssets(context, mapping):
710 710 """Returns a string of sets of successors for a changectx. Format used
711 711 is: [ctx1, ctx2], [ctx3] if ctx has been split into ctx1 and ctx2
712 712 while also diverged into ctx3. (EXPERIMENTAL)"""
713 713 repo = context.resource(mapping, b'repo')
714 714 ctx = context.resource(mapping, b'ctx')
715 if not ctx.obsolete():
716 return b''
715 data = []
717 716
717 if ctx.obsolete():
718 718 ssets = obsutil.successorssets(repo, ctx.node(), closest=True)
719 719 ssets = [[hex(n) for n in ss] for ss in ssets]
720 720
721 data = []
722 721 for ss in ssets:
723 722 h = _hybrid(
724 723 None,
725 724 ss,
726 725 lambda x: {b'ctx': repo[x]},
727 726 lambda x: scmutil.formatchangeid(repo[x]),
728 727 )
729 728 data.append(h)
730 729
731 730 # Format the successorssets
732 731 def render(d):
733 732 return templateutil.stringify(context, mapping, d)
734 733
735 734 def gen(data):
736 735 yield b"; ".join(render(d) for d in data)
737 736
738 737 return _hybrid(
739 738 gen(data), data, lambda x: {b'successorset': x}, pycompat.identity
740 739 )
741 740
742 741
743 742 @templatekeyword(b"succsandmarkers", requires={b'repo', b'ctx'})
744 743 def showsuccsandmarkers(context, mapping):
745 744 """Returns a list of dict for each final successor of ctx. The dict
746 745 contains successors node id in "successors" keys and the list of
747 746 obs-markers from ctx to the set of successors in "markers".
748 747 (EXPERIMENTAL)
749 748 """
750 749 repo = context.resource(mapping, b'repo')
751 750 ctx = context.resource(mapping, b'ctx')
752 751
753 752 values = obsutil.successorsandmarkers(repo, ctx)
754 753
755 754 if values is None:
756 755 values = []
757 756
758 757 # Format successors and markers to avoid exposing binary to templates
759 758 data = []
760 759 for i in values:
761 760 # Format successors
762 761 successors = i[b'successors']
763 762
764 763 successors = [hex(n) for n in successors]
765 764 successors = _hybrid(
766 765 None,
767 766 successors,
768 767 lambda x: {b'ctx': repo[x]},
769 768 lambda x: scmutil.formatchangeid(repo[x]),
770 769 )
771 770
772 771 # Format markers
773 772 finalmarkers = []
774 773 for m in i[b'markers']:
775 774 hexprec = hex(m[0])
776 775 hexsucs = tuple(hex(n) for n in m[1])
777 776 hexparents = None
778 777 if m[5] is not None:
779 778 hexparents = tuple(hex(n) for n in m[5])
780 779 newmarker = (hexprec, hexsucs) + m[2:5] + (hexparents,) + m[6:]
781 780 finalmarkers.append(newmarker)
782 781
783 782 data.append({b'successors': successors, b'markers': finalmarkers})
784 783
785 784 return templateutil.mappinglist(data)
786 785
787 786
788 787 @templatekeyword(b'p1', requires={b'ctx'})
789 788 def showp1(context, mapping):
790 789 """Changeset. The changeset's first parent. ``{p1.rev}`` for the revision
791 790 number, and ``{p1.node}`` for the identification hash."""
792 791 ctx = context.resource(mapping, b'ctx')
793 792 return templateutil.mappingdict({b'ctx': ctx.p1()}, tmpl=_changeidtmpl)
794 793
795 794
796 795 @templatekeyword(b'p2', requires={b'ctx'})
797 796 def showp2(context, mapping):
798 797 """Changeset. The changeset's second parent. ``{p2.rev}`` for the revision
799 798 number, and ``{p2.node}`` for the identification hash."""
800 799 ctx = context.resource(mapping, b'ctx')
801 800 return templateutil.mappingdict({b'ctx': ctx.p2()}, tmpl=_changeidtmpl)
802 801
803 802
804 803 @templatekeyword(b'p1rev', requires={b'ctx'})
805 804 def showp1rev(context, mapping):
806 805 """Integer. The repository-local revision number of the changeset's
807 806 first parent, or -1 if the changeset has no parents. (DEPRECATED)"""
808 807 ctx = context.resource(mapping, b'ctx')
809 808 return ctx.p1().rev()
810 809
811 810
812 811 @templatekeyword(b'p2rev', requires={b'ctx'})
813 812 def showp2rev(context, mapping):
814 813 """Integer. The repository-local revision number of the changeset's
815 814 second parent, or -1 if the changeset has no second parent. (DEPRECATED)"""
816 815 ctx = context.resource(mapping, b'ctx')
817 816 return ctx.p2().rev()
818 817
819 818
820 819 @templatekeyword(b'p1node', requires={b'ctx'})
821 820 def showp1node(context, mapping):
822 821 """String. The identification hash of the changeset's first parent,
823 822 as a 40 digit hexadecimal string. If the changeset has no parents, all
824 823 digits are 0. (DEPRECATED)"""
825 824 ctx = context.resource(mapping, b'ctx')
826 825 return ctx.p1().hex()
827 826
828 827
829 828 @templatekeyword(b'p2node', requires={b'ctx'})
830 829 def showp2node(context, mapping):
831 830 """String. The identification hash of the changeset's second
832 831 parent, as a 40 digit hexadecimal string. If the changeset has no second
833 832 parent, all digits are 0. (DEPRECATED)"""
834 833 ctx = context.resource(mapping, b'ctx')
835 834 return ctx.p2().hex()
836 835
837 836
838 837 @templatekeyword(b'parents', requires={b'repo', b'ctx'})
839 838 def showparents(context, mapping):
840 839 """List of strings. The parents of the changeset in "rev:node"
841 840 format. If the changeset has only one "natural" parent (the predecessor
842 841 revision) nothing is shown."""
843 842 repo = context.resource(mapping, b'repo')
844 843 ctx = context.resource(mapping, b'ctx')
845 844 pctxs = scmutil.meaningfulparents(repo, ctx)
846 845 prevs = [p.rev() for p in pctxs]
847 846 parents = [
848 847 [(b'rev', p.rev()), (b'node', p.hex()), (b'phase', p.phasestr())]
849 848 for p in pctxs
850 849 ]
851 850 f = _showcompatlist(context, mapping, b'parent', parents)
852 851 return _hybrid(
853 852 f,
854 853 prevs,
855 854 lambda x: {b'ctx': repo[x]},
856 855 lambda x: scmutil.formatchangeid(repo[x]),
857 856 keytype=int,
858 857 )
859 858
860 859
861 860 @templatekeyword(b'phase', requires={b'ctx'})
862 861 def showphase(context, mapping):
863 862 """String. The changeset phase name."""
864 863 ctx = context.resource(mapping, b'ctx')
865 864 return ctx.phasestr()
866 865
867 866
868 867 @templatekeyword(b'phaseidx', requires={b'ctx'})
869 868 def showphaseidx(context, mapping):
870 869 """Integer. The changeset phase index. (ADVANCED)"""
871 870 ctx = context.resource(mapping, b'ctx')
872 871 return ctx.phase()
873 872
874 873
875 874 @templatekeyword(b'rev', requires={b'ctx'})
876 875 def showrev(context, mapping):
877 876 """Integer. The repository-local changeset revision number."""
878 877 ctx = context.resource(mapping, b'ctx')
879 878 return scmutil.intrev(ctx)
880 879
881 880
882 881 @templatekeyword(b'subrepos', requires={b'ctx'})
883 882 def showsubrepos(context, mapping):
884 883 """List of strings. Updated subrepositories in the changeset."""
885 884 ctx = context.resource(mapping, b'ctx')
886 885 substate = ctx.substate
887 886 if not substate:
888 887 return compatlist(context, mapping, b'subrepo', [])
889 888 psubstate = ctx.p1().substate or {}
890 889 subrepos = []
891 890 for sub in substate:
892 891 if sub not in psubstate or substate[sub] != psubstate[sub]:
893 892 subrepos.append(sub) # modified or newly added in ctx
894 893 for sub in psubstate:
895 894 if sub not in substate:
896 895 subrepos.append(sub) # removed in ctx
897 896 return compatlist(context, mapping, b'subrepo', sorted(subrepos))
898 897
899 898
900 899 # don't remove "showtags" definition, even though namespaces will put
901 900 # a helper function for "tags" keyword into "keywords" map automatically,
902 901 # because online help text is built without namespaces initialization
903 902 @templatekeyword(b'tags', requires={b'repo', b'ctx'})
904 903 def showtags(context, mapping):
905 904 """List of strings. Any tags associated with the changeset."""
906 905 return shownames(context, mapping, b'tags')
907 906
908 907
909 908 @templatekeyword(b'termwidth', requires={b'ui'})
910 909 def showtermwidth(context, mapping):
911 910 """Integer. The width of the current terminal."""
912 911 ui = context.resource(mapping, b'ui')
913 912 return ui.termwidth()
914 913
915 914
916 915 @templatekeyword(b'user', requires={b'ctx'})
917 916 def showuser(context, mapping):
918 917 """String. The unmodified author of the changeset."""
919 918 ctx = context.resource(mapping, b'ctx')
920 919 return ctx.user()
921 920
922 921
923 922 @templatekeyword(b'instabilities', requires={b'ctx'})
924 923 def showinstabilities(context, mapping):
925 924 """List of strings. Evolution instabilities affecting the changeset.
926 925 (EXPERIMENTAL)
927 926 """
928 927 ctx = context.resource(mapping, b'ctx')
929 928 return compatlist(
930 929 context,
931 930 mapping,
932 931 b'instability',
933 932 ctx.instabilities(),
934 933 plural=b'instabilities',
935 934 )
936 935
937 936
938 937 @templatekeyword(b'verbosity', requires={b'ui'})
939 938 def showverbosity(context, mapping):
940 939 """String. The current output verbosity in 'debug', 'quiet', 'verbose',
941 940 or ''."""
942 941 ui = context.resource(mapping, b'ui')
943 942 # see logcmdutil.changesettemplater for priority of these flags
944 943 if ui.debugflag:
945 944 return b'debug'
946 945 elif ui.quiet:
947 946 return b'quiet'
948 947 elif ui.verbose:
949 948 return b'verbose'
950 949 return b''
951 950
952 951
953 952 @templatekeyword(b'whyunstable', requires={b'repo', b'ctx'})
954 953 def showwhyunstable(context, mapping):
955 954 """List of dicts explaining all instabilities of a changeset.
956 955 (EXPERIMENTAL)
957 956 """
958 957 repo = context.resource(mapping, b'repo')
959 958 ctx = context.resource(mapping, b'ctx')
960 959
961 960 def formatnode(ctx):
962 961 return b'%s (%s)' % (scmutil.formatchangeid(ctx), ctx.phasestr())
963 962
964 963 entries = obsutil.whyunstable(repo, ctx)
965 964
966 965 for entry in entries:
967 966 if entry.get(b'divergentnodes'):
968 967 dnodes = entry[b'divergentnodes']
969 968 dnhybrid = _hybrid(
970 969 None,
971 970 [dnode.hex() for dnode in dnodes],
972 971 lambda x: {b'ctx': repo[x]},
973 972 lambda x: formatnode(repo[x]),
974 973 )
975 974 entry[b'divergentnodes'] = dnhybrid
976 975
977 976 tmpl = (
978 977 b'{instability}:{if(divergentnodes, " ")}{divergentnodes} '
979 978 b'{reason} {node|short}'
980 979 )
981 980 return templateutil.mappinglist(entries, tmpl=tmpl, sep=b'\n')
982 981
983 982
984 983 def loadkeyword(ui, extname, registrarobj):
985 984 """Load template keyword from specified registrarobj
986 985 """
987 986 for name, func in pycompat.iteritems(registrarobj._table):
988 987 keywords[name] = func
989 988
990 989
991 990 # tell hggettext to extract docstrings from these functions:
992 991 i18nfunctions = keywords.values()
@@ -1,3192 +1,3192 b''
1 1 This test file test the various templates related to obsmarkers.
2 2
3 3 Global setup
4 4 ============
5 5
6 6 $ . $TESTDIR/testlib/obsmarker-common.sh
7 7 $ cat >> $HGRCPATH <<EOF
8 8 > [ui]
9 9 > interactive = true
10 10 > [phases]
11 11 > publish=False
12 12 > [experimental]
13 13 > evolution=true
14 14 > [templates]
15 15 > obsfatesuccessors = "{if(successors, " as ")}{join(successors, ", ")}"
16 16 > obsfateverb = "{obsfateverb(successors, markers)}"
17 17 > obsfateoperations = "{if(obsfateoperations(markers), " using {join(obsfateoperations(markers), ", ")}")}"
18 18 > obsfateusers = "{if(obsfateusers(markers), " by {join(obsfateusers(markers), ", ")}")}"
19 19 > obsfatedate = "{if(obsfatedate(markers), "{ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), " (at {min(obsfatedate(markers))|isodate})", " (between {min(obsfatedate(markers))|isodate} and {max(obsfatedate(markers))|isodate})")}")}"
20 20 > obsfatetempl = "{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}; "
21 21 > [alias]
22 22 > tlog = log -G -T '{node|short}\
23 23 > \n Predecessors: {predecessors}\
24 24 > \n semi-colon: {join(predecessors, "; ")}\
25 25 > \n json: {predecessors|json}\
26 26 > \n map: {join(predecessors % "{rev}:{node}", " ")}\
27 27 > \n Successors: {successorssets}\
28 28 > \n multi-line: {join(successorssets, "\n multi-line: ")}\
29 29 > \n json: {successorssets|json}\n'
30 30 > fatelog = log -G -T '{node|short}\n{if(succsandmarkers, " Obsfate: {succsandmarkers % "{obsfatetempl}"} \n" )}'
31 31 > fatelogjson = log -G -T '{node|short}\n{if(succsandmarkers, " Obsfate: {succsandmarkers|json}\n")}'
32 32 > fatelogkw = log -G -T '{node|short}\n{if(obsfate, "{obsfate % " Obsfate: {fate}\n"}")}'
33 33 > EOF
34 34
35 35 Test templates on amended commit
36 36 ================================
37 37
38 38 Test setup
39 39 ----------
40 40
41 41 $ hg init $TESTTMP/templates-local-amend
42 42 $ cd $TESTTMP/templates-local-amend
43 43 $ mkcommit ROOT
44 44 $ mkcommit A0
45 45 $ echo 42 >> A0
46 46 $ hg commit --amend -m "A1" --config devel.default-date="1234567890 0"
47 47 $ hg commit --amend -m "A2" --config devel.default-date="987654321 0" --config devel.user.obsmarker=test2
48 48
49 49 $ hg log --hidden -G
50 50 @ changeset: 3:d004c8f274b9
51 51 | tag: tip
52 52 | parent: 0:ea207398892e
53 53 | user: test
54 54 | date: Thu Jan 01 00:00:00 1970 +0000
55 55 | summary: A2
56 56 |
57 57 | x changeset: 2:a468dc9b3633
58 58 |/ parent: 0:ea207398892e
59 59 | user: test
60 60 | date: Thu Jan 01 00:00:00 1970 +0000
61 61 | obsolete: rewritten using amend as 3:d004c8f274b9 by test2
62 62 | summary: A1
63 63 |
64 64 | x changeset: 1:471f378eab4c
65 65 |/ user: test
66 66 | date: Thu Jan 01 00:00:00 1970 +0000
67 67 | obsolete: rewritten using amend as 2:a468dc9b3633
68 68 | summary: A0
69 69 |
70 70 o changeset: 0:ea207398892e
71 71 user: test
72 72 date: Thu Jan 01 00:00:00 1970 +0000
73 73 summary: ROOT
74 74
75 75 Check templates
76 76 ---------------
77 77 $ hg up 'desc(A0)' --hidden
78 78 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 79 updated to hidden changeset 471f378eab4c
80 80 (hidden revision '471f378eab4c' was rewritten as: d004c8f274b9)
81 81
82 82 Predecessors template should show current revision as it is the working copy
83 83 $ hg tlog
84 84 o d004c8f274b9
85 85 | Predecessors: 1:471f378eab4c
86 86 | semi-colon: 1:471f378eab4c
87 87 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
88 88 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
89 89 | Successors:
90 90 | multi-line:
91 | json: ""
91 | json: []
92 92 | @ 471f378eab4c
93 93 |/ Predecessors:
94 94 | semi-colon:
95 95 | json: []
96 96 | map:
97 97 | Successors: 3:d004c8f274b9
98 98 | multi-line: 3:d004c8f274b9
99 99 | json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
100 100 o ea207398892e
101 101 Predecessors:
102 102 semi-colon:
103 103 json: []
104 104 map:
105 105 Successors:
106 106 multi-line:
107 json: ""
107 json: []
108 108
109 109 $ hg fatelog
110 110 o d004c8f274b9
111 111 |
112 112 | @ 471f378eab4c
113 113 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test, test2 (between 2001-04-19 04:25 +0000 and 2009-02-13 23:31 +0000);
114 114 o ea207398892e
115 115
116 116
117 117 $ hg fatelogkw
118 118 o d004c8f274b9
119 119 |
120 120 | @ 471f378eab4c
121 121 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test, test2
122 122 o ea207398892e
123 123
124 124
125 125 $ hg log -G --config ui.logtemplate=
126 126 o changeset: 3:d004c8f274b9
127 127 | tag: tip
128 128 | parent: 0:ea207398892e
129 129 | user: test
130 130 | date: Thu Jan 01 00:00:00 1970 +0000
131 131 | summary: A2
132 132 |
133 133 | @ changeset: 1:471f378eab4c
134 134 |/ user: test
135 135 | date: Thu Jan 01 00:00:00 1970 +0000
136 136 | obsolete: rewritten using amend as 3:d004c8f274b9 by test, test2
137 137 | summary: A0
138 138 |
139 139 o changeset: 0:ea207398892e
140 140 user: test
141 141 date: Thu Jan 01 00:00:00 1970 +0000
142 142 summary: ROOT
143 143
144 144
145 145 $ hg log -G -T "default"
146 146 o changeset: 3:d004c8f274b9
147 147 | tag: tip
148 148 | parent: 0:ea207398892e
149 149 | user: test
150 150 | date: Thu Jan 01 00:00:00 1970 +0000
151 151 | summary: A2
152 152 |
153 153 | @ changeset: 1:471f378eab4c
154 154 |/ user: test
155 155 | date: Thu Jan 01 00:00:00 1970 +0000
156 156 | obsolete: rewritten using amend as 3:d004c8f274b9 by test, test2
157 157 | summary: A0
158 158 |
159 159 o changeset: 0:ea207398892e
160 160 user: test
161 161 date: Thu Jan 01 00:00:00 1970 +0000
162 162 summary: ROOT
163 163
164 164 $ hg up 'desc(A1)' --hidden
165 165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 166 updated to hidden changeset a468dc9b3633
167 167 (hidden revision 'a468dc9b3633' was rewritten as: d004c8f274b9)
168 168
169 169 Predecessors template should show current revision as it is the working copy
170 170 $ hg tlog
171 171 o d004c8f274b9
172 172 | Predecessors: 2:a468dc9b3633
173 173 | semi-colon: 2:a468dc9b3633
174 174 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
175 175 | map: 2:a468dc9b36338b14fdb7825f55ce3df4e71517ad
176 176 | Successors:
177 177 | multi-line:
178 | json: ""
178 | json: []
179 179 | @ a468dc9b3633
180 180 |/ Predecessors:
181 181 | semi-colon:
182 182 | json: []
183 183 | map:
184 184 | Successors: 3:d004c8f274b9
185 185 | multi-line: 3:d004c8f274b9
186 186 | json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
187 187 o ea207398892e
188 188 Predecessors:
189 189 semi-colon:
190 190 json: []
191 191 map:
192 192 Successors:
193 193 multi-line:
194 json: ""
194 json: []
195 195
196 196 $ hg fatelog
197 197 o d004c8f274b9
198 198 |
199 199 | @ a468dc9b3633
200 200 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000);
201 201 o ea207398892e
202 202
203 203 Predecessors template should show all the predecessors as we force their display
204 204 with --hidden
205 205 $ hg tlog --hidden
206 206 o d004c8f274b9
207 207 | Predecessors: 2:a468dc9b3633
208 208 | semi-colon: 2:a468dc9b3633
209 209 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
210 210 | map: 2:a468dc9b36338b14fdb7825f55ce3df4e71517ad
211 211 | Successors:
212 212 | multi-line:
213 | json: ""
213 | json: []
214 214 | @ a468dc9b3633
215 215 |/ Predecessors: 1:471f378eab4c
216 216 | semi-colon: 1:471f378eab4c
217 217 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
218 218 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
219 219 | Successors: 3:d004c8f274b9
220 220 | multi-line: 3:d004c8f274b9
221 221 | json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
222 222 | x 471f378eab4c
223 223 |/ Predecessors:
224 224 | semi-colon:
225 225 | json: []
226 226 | map:
227 227 | Successors: 2:a468dc9b3633
228 228 | multi-line: 2:a468dc9b3633
229 229 | json: [["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]]
230 230 o ea207398892e
231 231 Predecessors:
232 232 semi-colon:
233 233 json: []
234 234 map:
235 235 Successors:
236 236 multi-line:
237 json: ""
237 json: []
238 238
239 239 $ hg fatelog --hidden
240 240 o d004c8f274b9
241 241 |
242 242 | @ a468dc9b3633
243 243 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000);
244 244 | x 471f378eab4c
245 245 |/ Obsfate: rewritten using amend as 2:a468dc9b3633 by test (at 2009-02-13 23:31 +0000);
246 246 o ea207398892e
247 247
248 248
249 249 Predecessors template shouldn't show anything as all obsolete commit are not
250 250 visible.
251 251 $ hg up 'desc(A2)'
252 252 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
253 253 $ hg tlog
254 254 @ d004c8f274b9
255 255 | Predecessors:
256 256 | semi-colon:
257 257 | json: []
258 258 | map:
259 259 | Successors:
260 260 | multi-line:
261 | json: ""
261 | json: []
262 262 o ea207398892e
263 263 Predecessors:
264 264 semi-colon:
265 265 json: []
266 266 map:
267 267 Successors:
268 268 multi-line:
269 json: ""
269 json: []
270 270
271 271 $ hg tlog --hidden
272 272 @ d004c8f274b9
273 273 | Predecessors: 2:a468dc9b3633
274 274 | semi-colon: 2:a468dc9b3633
275 275 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
276 276 | map: 2:a468dc9b36338b14fdb7825f55ce3df4e71517ad
277 277 | Successors:
278 278 | multi-line:
279 | json: ""
279 | json: []
280 280 | x a468dc9b3633
281 281 |/ Predecessors: 1:471f378eab4c
282 282 | semi-colon: 1:471f378eab4c
283 283 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
284 284 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
285 285 | Successors: 3:d004c8f274b9
286 286 | multi-line: 3:d004c8f274b9
287 287 | json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
288 288 | x 471f378eab4c
289 289 |/ Predecessors:
290 290 | semi-colon:
291 291 | json: []
292 292 | map:
293 293 | Successors: 2:a468dc9b3633
294 294 | multi-line: 2:a468dc9b3633
295 295 | json: [["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]]
296 296 o ea207398892e
297 297 Predecessors:
298 298 semi-colon:
299 299 json: []
300 300 map:
301 301 Successors:
302 302 multi-line:
303 json: ""
303 json: []
304 304
305 305 $ hg fatelog
306 306 @ d004c8f274b9
307 307 |
308 308 o ea207398892e
309 309
310 310
311 311 $ hg fatelog --hidden
312 312 @ d004c8f274b9
313 313 |
314 314 | x a468dc9b3633
315 315 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000);
316 316 | x 471f378eab4c
317 317 |/ Obsfate: rewritten using amend as 2:a468dc9b3633 by test (at 2009-02-13 23:31 +0000);
318 318 o ea207398892e
319 319
320 320 $ hg fatelogjson --hidden
321 321 @ d004c8f274b9
322 322 |
323 323 | x a468dc9b3633
324 324 |/ Obsfate: [{"markers": [["a468dc9b36338b14fdb7825f55ce3df4e71517ad", ["d004c8f274b9ec480a47a93c10dac5eee63adb78"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test2"]], [987654321.0, 0], null]], "successors": ["d004c8f274b9ec480a47a93c10dac5eee63adb78"]}]
325 325 | x 471f378eab4c
326 326 |/ Obsfate: [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"], 0, [["ef1", "9"], ["operation", "amend"], ["user", "test"]], [1234567890.0, 0], null]], "successors": ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]}]
327 327 o ea207398892e
328 328
329 329
330 330 Check other fatelog implementations
331 331 -----------------------------------
332 332
333 333 $ hg fatelogkw --hidden -q
334 334 @ d004c8f274b9
335 335 |
336 336 | x a468dc9b3633
337 337 |/ Obsfate: rewritten using amend as 3:d004c8f274b9
338 338 | x 471f378eab4c
339 339 |/ Obsfate: rewritten using amend as 2:a468dc9b3633
340 340 o ea207398892e
341 341
342 342 $ hg fatelogkw --hidden
343 343 @ d004c8f274b9
344 344 |
345 345 | x a468dc9b3633
346 346 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2
347 347 | x 471f378eab4c
348 348 |/ Obsfate: rewritten using amend as 2:a468dc9b3633
349 349 o ea207398892e
350 350
351 351 $ hg fatelogkw --hidden -v
352 352 @ d004c8f274b9
353 353 |
354 354 | x a468dc9b3633
355 355 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000)
356 356 | x 471f378eab4c
357 357 |/ Obsfate: rewritten using amend as 2:a468dc9b3633 by test (at 2009-02-13 23:31 +0000)
358 358 o ea207398892e
359 359
360 360
361 361 $ hg log -G -T "default" --hidden
362 362 @ changeset: 3:d004c8f274b9
363 363 | tag: tip
364 364 | parent: 0:ea207398892e
365 365 | user: test
366 366 | date: Thu Jan 01 00:00:00 1970 +0000
367 367 | summary: A2
368 368 |
369 369 | x changeset: 2:a468dc9b3633
370 370 |/ parent: 0:ea207398892e
371 371 | user: test
372 372 | date: Thu Jan 01 00:00:00 1970 +0000
373 373 | obsolete: rewritten using amend as 3:d004c8f274b9 by test2
374 374 | summary: A1
375 375 |
376 376 | x changeset: 1:471f378eab4c
377 377 |/ user: test
378 378 | date: Thu Jan 01 00:00:00 1970 +0000
379 379 | obsolete: rewritten using amend as 2:a468dc9b3633
380 380 | summary: A0
381 381 |
382 382 o changeset: 0:ea207398892e
383 383 user: test
384 384 date: Thu Jan 01 00:00:00 1970 +0000
385 385 summary: ROOT
386 386
387 387 $ hg log -G -T "default" --hidden -v
388 388 @ changeset: 3:d004c8f274b9
389 389 | tag: tip
390 390 | parent: 0:ea207398892e
391 391 | user: test
392 392 | date: Thu Jan 01 00:00:00 1970 +0000
393 393 | files: A0
394 394 | description:
395 395 | A2
396 396 |
397 397 |
398 398 | x changeset: 2:a468dc9b3633
399 399 |/ parent: 0:ea207398892e
400 400 | user: test
401 401 | date: Thu Jan 01 00:00:00 1970 +0000
402 402 | obsolete: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000)
403 403 | files: A0
404 404 | description:
405 405 | A1
406 406 |
407 407 |
408 408 | x changeset: 1:471f378eab4c
409 409 |/ user: test
410 410 | date: Thu Jan 01 00:00:00 1970 +0000
411 411 | obsolete: rewritten using amend as 2:a468dc9b3633 by test (at 2009-02-13 23:31 +0000)
412 412 | files: A0
413 413 | description:
414 414 | A0
415 415 |
416 416 |
417 417 o changeset: 0:ea207398892e
418 418 user: test
419 419 date: Thu Jan 01 00:00:00 1970 +0000
420 420 files: ROOT
421 421 description:
422 422 ROOT
423 423
424 424
425 425 Test templates with splitted commit
426 426 ===================================
427 427
428 428 $ hg init $TESTTMP/templates-local-split
429 429 $ cd $TESTTMP/templates-local-split
430 430 $ mkcommit ROOT
431 431 $ echo 42 >> a
432 432 $ echo 43 >> b
433 433 $ hg commit -A -m "A0"
434 434 adding a
435 435 adding b
436 436 $ hg log --hidden -G
437 437 @ changeset: 1:471597cad322
438 438 | tag: tip
439 439 | user: test
440 440 | date: Thu Jan 01 00:00:00 1970 +0000
441 441 | summary: A0
442 442 |
443 443 o changeset: 0:ea207398892e
444 444 user: test
445 445 date: Thu Jan 01 00:00:00 1970 +0000
446 446 summary: ROOT
447 447
448 448 # Simulate split
449 449 $ hg up -r "desc(ROOT)"
450 450 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
451 451 $ echo 42 >> a
452 452 $ hg commit -A -m "A0"
453 453 adding a
454 454 created new head
455 455 $ echo 43 >> b
456 456 $ hg commit -A -m "A0"
457 457 adding b
458 458 $ hg debugobsolete `getid "1"` `getid "2"` `getid "3"`
459 459 1 new obsolescence markers
460 460 obsoleted 1 changesets
461 461
462 462 $ hg log --hidden -G
463 463 @ changeset: 3:f257fde29c7a
464 464 | tag: tip
465 465 | user: test
466 466 | date: Thu Jan 01 00:00:00 1970 +0000
467 467 | summary: A0
468 468 |
469 469 o changeset: 2:337fec4d2edc
470 470 | parent: 0:ea207398892e
471 471 | user: test
472 472 | date: Thu Jan 01 00:00:00 1970 +0000
473 473 | summary: A0
474 474 |
475 475 | x changeset: 1:471597cad322
476 476 |/ user: test
477 477 | date: Thu Jan 01 00:00:00 1970 +0000
478 478 | obsolete: split as 2:337fec4d2edc, 3:f257fde29c7a
479 479 | summary: A0
480 480 |
481 481 o changeset: 0:ea207398892e
482 482 user: test
483 483 date: Thu Jan 01 00:00:00 1970 +0000
484 484 summary: ROOT
485 485
486 486 Check templates
487 487 ---------------
488 488
489 489 $ hg up 'obsolete()' --hidden
490 490 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
491 491 updated to hidden changeset 471597cad322
492 492 (hidden revision '471597cad322' was split as: 337fec4d2edc, f257fde29c7a)
493 493
494 494 Predecessors template should show current revision as it is the working copy
495 495 $ hg tlog
496 496 o f257fde29c7a
497 497 | Predecessors: 1:471597cad322
498 498 | semi-colon: 1:471597cad322
499 499 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
500 500 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
501 501 | Successors:
502 502 | multi-line:
503 | json: ""
503 | json: []
504 504 o 337fec4d2edc
505 505 | Predecessors: 1:471597cad322
506 506 | semi-colon: 1:471597cad322
507 507 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
508 508 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
509 509 | Successors:
510 510 | multi-line:
511 | json: ""
511 | json: []
512 512 | @ 471597cad322
513 513 |/ Predecessors:
514 514 | semi-colon:
515 515 | json: []
516 516 | map:
517 517 | Successors: 2:337fec4d2edc 3:f257fde29c7a
518 518 | multi-line: 2:337fec4d2edc 3:f257fde29c7a
519 519 | json: [["337fec4d2edcf0e7a467e35f818234bc620068b5", "f257fde29c7a847c9b607f6e958656d0df0fb15c"]]
520 520 o ea207398892e
521 521 Predecessors:
522 522 semi-colon:
523 523 json: []
524 524 map:
525 525 Successors:
526 526 multi-line:
527 json: ""
527 json: []
528 528
529 529 $ hg fatelog
530 530 o f257fde29c7a
531 531 |
532 532 o 337fec4d2edc
533 533 |
534 534 | @ 471597cad322
535 535 |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a by test (at 1970-01-01 00:00 +0000);
536 536 o ea207398892e
537 537
538 538 $ hg up f257fde29c7a
539 539 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
540 540
541 541 Predecessors template should not show a predecessor as it's not displayed in
542 542 the log
543 543 $ hg tlog
544 544 @ f257fde29c7a
545 545 | Predecessors:
546 546 | semi-colon:
547 547 | json: []
548 548 | map:
549 549 | Successors:
550 550 | multi-line:
551 | json: ""
551 | json: []
552 552 o 337fec4d2edc
553 553 | Predecessors:
554 554 | semi-colon:
555 555 | json: []
556 556 | map:
557 557 | Successors:
558 558 | multi-line:
559 | json: ""
559 | json: []
560 560 o ea207398892e
561 561 Predecessors:
562 562 semi-colon:
563 563 json: []
564 564 map:
565 565 Successors:
566 566 multi-line:
567 json: ""
567 json: []
568 568
569 569 Predecessors template should show both predecessors as we force their display
570 570 with --hidden
571 571 $ hg tlog --hidden
572 572 @ f257fde29c7a
573 573 | Predecessors: 1:471597cad322
574 574 | semi-colon: 1:471597cad322
575 575 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
576 576 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
577 577 | Successors:
578 578 | multi-line:
579 | json: ""
579 | json: []
580 580 o 337fec4d2edc
581 581 | Predecessors: 1:471597cad322
582 582 | semi-colon: 1:471597cad322
583 583 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
584 584 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
585 585 | Successors:
586 586 | multi-line:
587 | json: ""
587 | json: []
588 588 | x 471597cad322
589 589 |/ Predecessors:
590 590 | semi-colon:
591 591 | json: []
592 592 | map:
593 593 | Successors: 2:337fec4d2edc 3:f257fde29c7a
594 594 | multi-line: 2:337fec4d2edc 3:f257fde29c7a
595 595 | json: [["337fec4d2edcf0e7a467e35f818234bc620068b5", "f257fde29c7a847c9b607f6e958656d0df0fb15c"]]
596 596 o ea207398892e
597 597 Predecessors:
598 598 semi-colon:
599 599 json: []
600 600 map:
601 601 Successors:
602 602 multi-line:
603 json: ""
603 json: []
604 604
605 605 $ hg fatelog --hidden
606 606 @ f257fde29c7a
607 607 |
608 608 o 337fec4d2edc
609 609 |
610 610 | x 471597cad322
611 611 |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a by test (at 1970-01-01 00:00 +0000);
612 612 o ea207398892e
613 613
614 614 $ hg fatelogjson --hidden
615 615 @ f257fde29c7a
616 616 |
617 617 o 337fec4d2edc
618 618 |
619 619 | x 471597cad322
620 620 |/ Obsfate: [{"markers": [["471597cad322d1f659bb169751be9133dad92ef3", ["337fec4d2edcf0e7a467e35f818234bc620068b5", "f257fde29c7a847c9b607f6e958656d0df0fb15c"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["337fec4d2edcf0e7a467e35f818234bc620068b5", "f257fde29c7a847c9b607f6e958656d0df0fb15c"]}]
621 621 o ea207398892e
622 622
623 623 Check other fatelog implementations
624 624 -----------------------------------
625 625
626 626 $ hg fatelogkw --hidden -q
627 627 @ f257fde29c7a
628 628 |
629 629 o 337fec4d2edc
630 630 |
631 631 | x 471597cad322
632 632 |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a
633 633 o ea207398892e
634 634
635 635 $ hg fatelogkw --hidden
636 636 @ f257fde29c7a
637 637 |
638 638 o 337fec4d2edc
639 639 |
640 640 | x 471597cad322
641 641 |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a
642 642 o ea207398892e
643 643
644 644 $ hg fatelogkw --hidden -v
645 645 @ f257fde29c7a
646 646 |
647 647 o 337fec4d2edc
648 648 |
649 649 | x 471597cad322
650 650 |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a by test (at 1970-01-01 00:00 +0000)
651 651 o ea207398892e
652 652
653 653
654 654 $ hg log -G -T "default" --hidden
655 655 @ changeset: 3:f257fde29c7a
656 656 | tag: tip
657 657 | user: test
658 658 | date: Thu Jan 01 00:00:00 1970 +0000
659 659 | summary: A0
660 660 |
661 661 o changeset: 2:337fec4d2edc
662 662 | parent: 0:ea207398892e
663 663 | user: test
664 664 | date: Thu Jan 01 00:00:00 1970 +0000
665 665 | summary: A0
666 666 |
667 667 | x changeset: 1:471597cad322
668 668 |/ user: test
669 669 | date: Thu Jan 01 00:00:00 1970 +0000
670 670 | obsolete: split as 2:337fec4d2edc, 3:f257fde29c7a
671 671 | summary: A0
672 672 |
673 673 o changeset: 0:ea207398892e
674 674 user: test
675 675 date: Thu Jan 01 00:00:00 1970 +0000
676 676 summary: ROOT
677 677
678 678
679 679 Test templates with folded commit
680 680 =================================
681 681
682 682 Test setup
683 683 ----------
684 684
685 685 $ hg init $TESTTMP/templates-local-fold
686 686 $ cd $TESTTMP/templates-local-fold
687 687 $ mkcommit ROOT
688 688 $ mkcommit A0
689 689 $ mkcommit B0
690 690 $ hg log --hidden -G
691 691 @ changeset: 2:0dec01379d3b
692 692 | tag: tip
693 693 | user: test
694 694 | date: Thu Jan 01 00:00:00 1970 +0000
695 695 | summary: B0
696 696 |
697 697 o changeset: 1:471f378eab4c
698 698 | user: test
699 699 | date: Thu Jan 01 00:00:00 1970 +0000
700 700 | summary: A0
701 701 |
702 702 o changeset: 0:ea207398892e
703 703 user: test
704 704 date: Thu Jan 01 00:00:00 1970 +0000
705 705 summary: ROOT
706 706
707 707 Simulate a fold
708 708 $ hg up -r "desc(ROOT)"
709 709 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
710 710 $ echo "A0" > A0
711 711 $ echo "B0" > B0
712 712 $ hg commit -A -m "C0"
713 713 adding A0
714 714 adding B0
715 715 created new head
716 716 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(C0)"`
717 717 1 new obsolescence markers
718 718 obsoleted 1 changesets
719 719 1 new orphan changesets
720 720 $ hg debugobsolete `getid "desc(B0)"` `getid "desc(C0)"`
721 721 1 new obsolescence markers
722 722 obsoleted 1 changesets
723 723
724 724 $ hg log --hidden -G
725 725 @ changeset: 3:eb5a0daa2192
726 726 | tag: tip
727 727 | parent: 0:ea207398892e
728 728 | user: test
729 729 | date: Thu Jan 01 00:00:00 1970 +0000
730 730 | summary: C0
731 731 |
732 732 | x changeset: 2:0dec01379d3b
733 733 | | user: test
734 734 | | date: Thu Jan 01 00:00:00 1970 +0000
735 735 | | obsolete: rewritten as 3:eb5a0daa2192
736 736 | | summary: B0
737 737 | |
738 738 | x changeset: 1:471f378eab4c
739 739 |/ user: test
740 740 | date: Thu Jan 01 00:00:00 1970 +0000
741 741 | obsolete: rewritten as 3:eb5a0daa2192
742 742 | summary: A0
743 743 |
744 744 o changeset: 0:ea207398892e
745 745 user: test
746 746 date: Thu Jan 01 00:00:00 1970 +0000
747 747 summary: ROOT
748 748
749 749 Check templates
750 750 ---------------
751 751
752 752 $ hg up 'desc(A0)' --hidden
753 753 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
754 754 updated to hidden changeset 471f378eab4c
755 755 (hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192)
756 756
757 757 Predecessors template should show current revision as it is the working copy
758 758 $ hg tlog
759 759 o eb5a0daa2192
760 760 | Predecessors: 1:471f378eab4c
761 761 | semi-colon: 1:471f378eab4c
762 762 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
763 763 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
764 764 | Successors:
765 765 | multi-line:
766 | json: ""
766 | json: []
767 767 | @ 471f378eab4c
768 768 |/ Predecessors:
769 769 | semi-colon:
770 770 | json: []
771 771 | map:
772 772 | Successors: 3:eb5a0daa2192
773 773 | multi-line: 3:eb5a0daa2192
774 774 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
775 775 o ea207398892e
776 776 Predecessors:
777 777 semi-colon:
778 778 json: []
779 779 map:
780 780 Successors:
781 781 multi-line:
782 json: ""
782 json: []
783 783
784 784 $ hg fatelog
785 785 o eb5a0daa2192
786 786 |
787 787 | @ 471f378eab4c
788 788 |/ Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000);
789 789 o ea207398892e
790 790
791 791 $ hg up 'desc(B0)' --hidden
792 792 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
793 793 updated to hidden changeset 0dec01379d3b
794 794 (hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192)
795 795
796 796 Predecessors template should show both predecessors as they should be both
797 797 displayed
798 798 $ hg tlog
799 799 o eb5a0daa2192
800 800 | Predecessors: 2:0dec01379d3b 1:471f378eab4c
801 801 | semi-colon: 2:0dec01379d3b; 1:471f378eab4c
802 802 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
803 803 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874
804 804 | Successors:
805 805 | multi-line:
806 | json: ""
806 | json: []
807 807 | @ 0dec01379d3b
808 808 | | Predecessors:
809 809 | | semi-colon:
810 810 | | json: []
811 811 | | map:
812 812 | | Successors: 3:eb5a0daa2192
813 813 | | multi-line: 3:eb5a0daa2192
814 814 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
815 815 | x 471f378eab4c
816 816 |/ Predecessors:
817 817 | semi-colon:
818 818 | json: []
819 819 | map:
820 820 | Successors: 3:eb5a0daa2192
821 821 | multi-line: 3:eb5a0daa2192
822 822 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
823 823 o ea207398892e
824 824 Predecessors:
825 825 semi-colon:
826 826 json: []
827 827 map:
828 828 Successors:
829 829 multi-line:
830 json: ""
830 json: []
831 831
832 832 $ hg fatelog
833 833 o eb5a0daa2192
834 834 |
835 835 | @ 0dec01379d3b
836 836 | | Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000);
837 837 | x 471f378eab4c
838 838 |/ Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000);
839 839 o ea207398892e
840 840
841 841 $ hg up 'desc(C0)'
842 842 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
843 843
844 844 Predecessors template should not show predecessors as they are not displayed in
845 845 the log
846 846 $ hg tlog
847 847 @ eb5a0daa2192
848 848 | Predecessors:
849 849 | semi-colon:
850 850 | json: []
851 851 | map:
852 852 | Successors:
853 853 | multi-line:
854 | json: ""
854 | json: []
855 855 o ea207398892e
856 856 Predecessors:
857 857 semi-colon:
858 858 json: []
859 859 map:
860 860 Successors:
861 861 multi-line:
862 json: ""
862 json: []
863 863 Predecessors template should show both predecessors as we force their display
864 864 with --hidden
865 865 $ hg tlog --hidden
866 866 @ eb5a0daa2192
867 867 | Predecessors: 2:0dec01379d3b 1:471f378eab4c
868 868 | semi-colon: 2:0dec01379d3b; 1:471f378eab4c
869 869 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
870 870 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874
871 871 | Successors:
872 872 | multi-line:
873 | json: ""
873 | json: []
874 874 | x 0dec01379d3b
875 875 | | Predecessors:
876 876 | | semi-colon:
877 877 | | json: []
878 878 | | map:
879 879 | | Successors: 3:eb5a0daa2192
880 880 | | multi-line: 3:eb5a0daa2192
881 881 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
882 882 | x 471f378eab4c
883 883 |/ Predecessors:
884 884 | semi-colon:
885 885 | json: []
886 886 | map:
887 887 | Successors: 3:eb5a0daa2192
888 888 | multi-line: 3:eb5a0daa2192
889 889 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
890 890 o ea207398892e
891 891 Predecessors:
892 892 semi-colon:
893 893 json: []
894 894 map:
895 895 Successors:
896 896 multi-line:
897 json: ""
897 json: []
898 898
899 899 $ hg fatelog --hidden
900 900 @ eb5a0daa2192
901 901 |
902 902 | x 0dec01379d3b
903 903 | | Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000);
904 904 | x 471f378eab4c
905 905 |/ Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000);
906 906 o ea207398892e
907 907
908 908
909 909 $ hg fatelogjson --hidden
910 910 @ eb5a0daa2192
911 911 |
912 912 | x 0dec01379d3b
913 913 | | Obsfate: [{"markers": [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]}]
914 914 | x 471f378eab4c
915 915 |/ Obsfate: [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]}]
916 916 o ea207398892e
917 917
918 918 Check other fatelog implementations
919 919 -----------------------------------
920 920
921 921 $ hg fatelogkw --hidden -q
922 922 @ eb5a0daa2192
923 923 |
924 924 | x 0dec01379d3b
925 925 | | Obsfate: rewritten as 3:eb5a0daa2192
926 926 | x 471f378eab4c
927 927 |/ Obsfate: rewritten as 3:eb5a0daa2192
928 928 o ea207398892e
929 929
930 930 $ hg fatelogkw --hidden
931 931 @ eb5a0daa2192
932 932 |
933 933 | x 0dec01379d3b
934 934 | | Obsfate: rewritten as 3:eb5a0daa2192
935 935 | x 471f378eab4c
936 936 |/ Obsfate: rewritten as 3:eb5a0daa2192
937 937 o ea207398892e
938 938
939 939 $ hg fatelogkw --hidden -v
940 940 @ eb5a0daa2192
941 941 |
942 942 | x 0dec01379d3b
943 943 | | Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000)
944 944 | x 471f378eab4c
945 945 |/ Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000)
946 946 o ea207398892e
947 947
948 948 $ hg log -G -T "default" --hidden
949 949 @ changeset: 3:eb5a0daa2192
950 950 | tag: tip
951 951 | parent: 0:ea207398892e
952 952 | user: test
953 953 | date: Thu Jan 01 00:00:00 1970 +0000
954 954 | summary: C0
955 955 |
956 956 | x changeset: 2:0dec01379d3b
957 957 | | user: test
958 958 | | date: Thu Jan 01 00:00:00 1970 +0000
959 959 | | obsolete: rewritten as 3:eb5a0daa2192
960 960 | | summary: B0
961 961 | |
962 962 | x changeset: 1:471f378eab4c
963 963 |/ user: test
964 964 | date: Thu Jan 01 00:00:00 1970 +0000
965 965 | obsolete: rewritten as 3:eb5a0daa2192
966 966 | summary: A0
967 967 |
968 968 o changeset: 0:ea207398892e
969 969 user: test
970 970 date: Thu Jan 01 00:00:00 1970 +0000
971 971 summary: ROOT
972 972
973 973
974 974 Test templates with divergence
975 975 ==============================
976 976
977 977 Test setup
978 978 ----------
979 979
980 980 $ hg init $TESTTMP/templates-local-divergence
981 981 $ cd $TESTTMP/templates-local-divergence
982 982 $ mkcommit ROOT
983 983 $ mkcommit A0
984 984 $ hg commit --amend -m "A1"
985 985 $ hg log --hidden -G
986 986 @ changeset: 2:fdf9bde5129a
987 987 | tag: tip
988 988 | parent: 0:ea207398892e
989 989 | user: test
990 990 | date: Thu Jan 01 00:00:00 1970 +0000
991 991 | summary: A1
992 992 |
993 993 | x changeset: 1:471f378eab4c
994 994 |/ user: test
995 995 | date: Thu Jan 01 00:00:00 1970 +0000
996 996 | obsolete: rewritten using amend as 2:fdf9bde5129a
997 997 | summary: A0
998 998 |
999 999 o changeset: 0:ea207398892e
1000 1000 user: test
1001 1001 date: Thu Jan 01 00:00:00 1970 +0000
1002 1002 summary: ROOT
1003 1003
1004 1004 $ hg update --hidden 'desc(A0)'
1005 1005 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1006 1006 updated to hidden changeset 471f378eab4c
1007 1007 (hidden revision '471f378eab4c' was rewritten as: fdf9bde5129a)
1008 1008 $ hg commit --amend -m "A2"
1009 1009 2 new content-divergent changesets
1010 1010 $ hg log --hidden -G
1011 1011 @ changeset: 3:65b757b745b9
1012 1012 | tag: tip
1013 1013 | parent: 0:ea207398892e
1014 1014 | user: test
1015 1015 | date: Thu Jan 01 00:00:00 1970 +0000
1016 1016 | instability: content-divergent
1017 1017 | summary: A2
1018 1018 |
1019 1019 | * changeset: 2:fdf9bde5129a
1020 1020 |/ parent: 0:ea207398892e
1021 1021 | user: test
1022 1022 | date: Thu Jan 01 00:00:00 1970 +0000
1023 1023 | instability: content-divergent
1024 1024 | summary: A1
1025 1025 |
1026 1026 | x changeset: 1:471f378eab4c
1027 1027 |/ user: test
1028 1028 | date: Thu Jan 01 00:00:00 1970 +0000
1029 1029 | obsolete: rewritten using amend as 2:fdf9bde5129a
1030 1030 | obsolete: rewritten using amend as 3:65b757b745b9
1031 1031 | summary: A0
1032 1032 |
1033 1033 o changeset: 0:ea207398892e
1034 1034 user: test
1035 1035 date: Thu Jan 01 00:00:00 1970 +0000
1036 1036 summary: ROOT
1037 1037
1038 1038 $ hg commit --amend -m 'A3'
1039 1039 $ hg log --hidden -G
1040 1040 @ changeset: 4:019fadeab383
1041 1041 | tag: tip
1042 1042 | parent: 0:ea207398892e
1043 1043 | user: test
1044 1044 | date: Thu Jan 01 00:00:00 1970 +0000
1045 1045 | instability: content-divergent
1046 1046 | summary: A3
1047 1047 |
1048 1048 | x changeset: 3:65b757b745b9
1049 1049 |/ parent: 0:ea207398892e
1050 1050 | user: test
1051 1051 | date: Thu Jan 01 00:00:00 1970 +0000
1052 1052 | obsolete: rewritten using amend as 4:019fadeab383
1053 1053 | summary: A2
1054 1054 |
1055 1055 | * changeset: 2:fdf9bde5129a
1056 1056 |/ parent: 0:ea207398892e
1057 1057 | user: test
1058 1058 | date: Thu Jan 01 00:00:00 1970 +0000
1059 1059 | instability: content-divergent
1060 1060 | summary: A1
1061 1061 |
1062 1062 | x changeset: 1:471f378eab4c
1063 1063 |/ user: test
1064 1064 | date: Thu Jan 01 00:00:00 1970 +0000
1065 1065 | obsolete: rewritten using amend as 2:fdf9bde5129a
1066 1066 | obsolete: rewritten using amend as 3:65b757b745b9
1067 1067 | summary: A0
1068 1068 |
1069 1069 o changeset: 0:ea207398892e
1070 1070 user: test
1071 1071 date: Thu Jan 01 00:00:00 1970 +0000
1072 1072 summary: ROOT
1073 1073
1074 1074
1075 1075 Check templates
1076 1076 ---------------
1077 1077
1078 1078 $ hg up 'desc(A0)' --hidden
1079 1079 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1080 1080 updated to hidden changeset 471f378eab4c
1081 1081 (hidden revision '471f378eab4c' has diverged)
1082 1082
1083 1083 Predecessors template should show current revision as it is the working copy
1084 1084 $ hg tlog
1085 1085 * 019fadeab383
1086 1086 | Predecessors: 1:471f378eab4c
1087 1087 | semi-colon: 1:471f378eab4c
1088 1088 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
1089 1089 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
1090 1090 | Successors:
1091 1091 | multi-line:
1092 | json: ""
1092 | json: []
1093 1093 | * fdf9bde5129a
1094 1094 |/ Predecessors: 1:471f378eab4c
1095 1095 | semi-colon: 1:471f378eab4c
1096 1096 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
1097 1097 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
1098 1098 | Successors:
1099 1099 | multi-line:
1100 | json: ""
1100 | json: []
1101 1101 | @ 471f378eab4c
1102 1102 |/ Predecessors:
1103 1103 | semi-colon:
1104 1104 | json: []
1105 1105 | map:
1106 1106 | Successors: 2:fdf9bde5129a; 4:019fadeab383
1107 1107 | multi-line: 2:fdf9bde5129a
1108 1108 | multi-line: 4:019fadeab383
1109 1109 | json: [["fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"], ["019fadeab383f6699fa83ad7bdb4d82ed2c0e5ab"]]
1110 1110 o ea207398892e
1111 1111 Predecessors:
1112 1112 semi-colon:
1113 1113 json: []
1114 1114 map:
1115 1115 Successors:
1116 1116 multi-line:
1117 json: ""
1117 json: []
1118 1118 $ hg fatelog
1119 1119 * 019fadeab383
1120 1120 |
1121 1121 | * fdf9bde5129a
1122 1122 |/
1123 1123 | @ 471f378eab4c
1124 1124 |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +0000); rewritten using amend as 4:019fadeab383 by test (at 1970-01-01 00:00 +0000);
1125 1125 o ea207398892e
1126 1126
1127 1127 $ hg up 'desc(A1)'
1128 1128 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1129 1129
1130 1130 Predecessors template should not show predecessors as they are not displayed in
1131 1131 the log
1132 1132 $ hg tlog
1133 1133 * 019fadeab383
1134 1134 | Predecessors:
1135 1135 | semi-colon:
1136 1136 | json: []
1137 1137 | map:
1138 1138 | Successors:
1139 1139 | multi-line:
1140 | json: ""
1140 | json: []
1141 1141 | @ fdf9bde5129a
1142 1142 |/ Predecessors:
1143 1143 | semi-colon:
1144 1144 | json: []
1145 1145 | map:
1146 1146 | Successors:
1147 1147 | multi-line:
1148 | json: ""
1148 | json: []
1149 1149 o ea207398892e
1150 1150 Predecessors:
1151 1151 semi-colon:
1152 1152 json: []
1153 1153 map:
1154 1154 Successors:
1155 1155 multi-line:
1156 json: ""
1156 json: []
1157 1157
1158 1158 $ hg fatelog
1159 1159 * 019fadeab383
1160 1160 |
1161 1161 | @ fdf9bde5129a
1162 1162 |/
1163 1163 o ea207398892e
1164 1164
1165 1165 Predecessors template should the predecessors as we force their display with
1166 1166 --hidden
1167 1167 $ hg tlog --hidden
1168 1168 * 019fadeab383
1169 1169 | Predecessors: 3:65b757b745b9
1170 1170 | semi-colon: 3:65b757b745b9
1171 1171 | json: ["65b757b745b935093c87a2bccd877521cccffcbd"]
1172 1172 | map: 3:65b757b745b935093c87a2bccd877521cccffcbd
1173 1173 | Successors:
1174 1174 | multi-line:
1175 | json: ""
1175 | json: []
1176 1176 | x 65b757b745b9
1177 1177 |/ Predecessors: 1:471f378eab4c
1178 1178 | semi-colon: 1:471f378eab4c
1179 1179 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
1180 1180 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
1181 1181 | Successors: 4:019fadeab383
1182 1182 | multi-line: 4:019fadeab383
1183 1183 | json: [["019fadeab383f6699fa83ad7bdb4d82ed2c0e5ab"]]
1184 1184 | @ fdf9bde5129a
1185 1185 |/ Predecessors: 1:471f378eab4c
1186 1186 | semi-colon: 1:471f378eab4c
1187 1187 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
1188 1188 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
1189 1189 | Successors:
1190 1190 | multi-line:
1191 | json: ""
1191 | json: []
1192 1192 | x 471f378eab4c
1193 1193 |/ Predecessors:
1194 1194 | semi-colon:
1195 1195 | json: []
1196 1196 | map:
1197 1197 | Successors: 2:fdf9bde5129a; 3:65b757b745b9
1198 1198 | multi-line: 2:fdf9bde5129a
1199 1199 | multi-line: 3:65b757b745b9
1200 1200 | json: [["fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"], ["65b757b745b935093c87a2bccd877521cccffcbd"]]
1201 1201 o ea207398892e
1202 1202 Predecessors:
1203 1203 semi-colon:
1204 1204 json: []
1205 1205 map:
1206 1206 Successors:
1207 1207 multi-line:
1208 json: ""
1208 json: []
1209 1209
1210 1210 $ hg fatelog --hidden
1211 1211 * 019fadeab383
1212 1212 |
1213 1213 | x 65b757b745b9
1214 1214 |/ Obsfate: rewritten using amend as 4:019fadeab383 by test (at 1970-01-01 00:00 +0000);
1215 1215 | @ fdf9bde5129a
1216 1216 |/
1217 1217 | x 471f378eab4c
1218 1218 |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +0000); rewritten using amend as 3:65b757b745b9 by test (at 1970-01-01 00:00 +0000);
1219 1219 o ea207398892e
1220 1220
1221 1221
1222 1222 $ hg fatelogjson --hidden
1223 1223 * 019fadeab383
1224 1224 |
1225 1225 | x 65b757b745b9
1226 1226 |/ Obsfate: [{"markers": [["65b757b745b935093c87a2bccd877521cccffcbd", ["019fadeab383f6699fa83ad7bdb4d82ed2c0e5ab"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["019fadeab383f6699fa83ad7bdb4d82ed2c0e5ab"]}]
1227 1227 | @ fdf9bde5129a
1228 1228 |/
1229 1229 | x 471f378eab4c
1230 1230 |/ Obsfate: [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"]}, {"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["65b757b745b935093c87a2bccd877521cccffcbd"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["65b757b745b935093c87a2bccd877521cccffcbd"]}]
1231 1231 o ea207398892e
1232 1232
1233 1233
1234 1234 Check other fatelog implementations
1235 1235 -----------------------------------
1236 1236
1237 1237 $ hg fatelogkw --hidden -q
1238 1238 * 019fadeab383
1239 1239 |
1240 1240 | x 65b757b745b9
1241 1241 |/ Obsfate: rewritten using amend as 4:019fadeab383
1242 1242 | @ fdf9bde5129a
1243 1243 |/
1244 1244 | x 471f378eab4c
1245 1245 |/ Obsfate: rewritten using amend as 2:fdf9bde5129a
1246 1246 | Obsfate: rewritten using amend as 3:65b757b745b9
1247 1247 o ea207398892e
1248 1248
1249 1249 $ hg fatelogkw --hidden
1250 1250 * 019fadeab383
1251 1251 |
1252 1252 | x 65b757b745b9
1253 1253 |/ Obsfate: rewritten using amend as 4:019fadeab383
1254 1254 | @ fdf9bde5129a
1255 1255 |/
1256 1256 | x 471f378eab4c
1257 1257 |/ Obsfate: rewritten using amend as 2:fdf9bde5129a
1258 1258 | Obsfate: rewritten using amend as 3:65b757b745b9
1259 1259 o ea207398892e
1260 1260
1261 1261 $ hg fatelogkw --hidden -v
1262 1262 * 019fadeab383
1263 1263 |
1264 1264 | x 65b757b745b9
1265 1265 |/ Obsfate: rewritten using amend as 4:019fadeab383 by test (at 1970-01-01 00:00 +0000)
1266 1266 | @ fdf9bde5129a
1267 1267 |/
1268 1268 | x 471f378eab4c
1269 1269 |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +0000)
1270 1270 | Obsfate: rewritten using amend as 3:65b757b745b9 by test (at 1970-01-01 00:00 +0000)
1271 1271 o ea207398892e
1272 1272
1273 1273 $ hg log -G -T "default" --hidden
1274 1274 * changeset: 4:019fadeab383
1275 1275 | tag: tip
1276 1276 | parent: 0:ea207398892e
1277 1277 | user: test
1278 1278 | date: Thu Jan 01 00:00:00 1970 +0000
1279 1279 | instability: content-divergent
1280 1280 | summary: A3
1281 1281 |
1282 1282 | x changeset: 3:65b757b745b9
1283 1283 |/ parent: 0:ea207398892e
1284 1284 | user: test
1285 1285 | date: Thu Jan 01 00:00:00 1970 +0000
1286 1286 | obsolete: rewritten using amend as 4:019fadeab383
1287 1287 | summary: A2
1288 1288 |
1289 1289 | @ changeset: 2:fdf9bde5129a
1290 1290 |/ parent: 0:ea207398892e
1291 1291 | user: test
1292 1292 | date: Thu Jan 01 00:00:00 1970 +0000
1293 1293 | instability: content-divergent
1294 1294 | summary: A1
1295 1295 |
1296 1296 | x changeset: 1:471f378eab4c
1297 1297 |/ user: test
1298 1298 | date: Thu Jan 01 00:00:00 1970 +0000
1299 1299 | obsolete: rewritten using amend as 2:fdf9bde5129a
1300 1300 | obsolete: rewritten using amend as 3:65b757b745b9
1301 1301 | summary: A0
1302 1302 |
1303 1303 o changeset: 0:ea207398892e
1304 1304 user: test
1305 1305 date: Thu Jan 01 00:00:00 1970 +0000
1306 1306 summary: ROOT
1307 1307
1308 1308
1309 1309 Test templates with amended + folded commit
1310 1310 ===========================================
1311 1311
1312 1312 Test setup
1313 1313 ----------
1314 1314
1315 1315 $ hg init $TESTTMP/templates-local-amend-fold
1316 1316 $ cd $TESTTMP/templates-local-amend-fold
1317 1317 $ mkcommit ROOT
1318 1318 $ mkcommit A0
1319 1319 $ mkcommit B0
1320 1320 $ hg commit --amend -m "B1"
1321 1321 $ hg log --hidden -G
1322 1322 @ changeset: 3:b7ea6d14e664
1323 1323 | tag: tip
1324 1324 | parent: 1:471f378eab4c
1325 1325 | user: test
1326 1326 | date: Thu Jan 01 00:00:00 1970 +0000
1327 1327 | summary: B1
1328 1328 |
1329 1329 | x changeset: 2:0dec01379d3b
1330 1330 |/ user: test
1331 1331 | date: Thu Jan 01 00:00:00 1970 +0000
1332 1332 | obsolete: rewritten using amend as 3:b7ea6d14e664
1333 1333 | summary: B0
1334 1334 |
1335 1335 o changeset: 1:471f378eab4c
1336 1336 | user: test
1337 1337 | date: Thu Jan 01 00:00:00 1970 +0000
1338 1338 | summary: A0
1339 1339 |
1340 1340 o changeset: 0:ea207398892e
1341 1341 user: test
1342 1342 date: Thu Jan 01 00:00:00 1970 +0000
1343 1343 summary: ROOT
1344 1344
1345 1345 # Simulate a fold
1346 1346 $ hg up -r "desc(ROOT)"
1347 1347 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1348 1348 $ echo "A0" > A0
1349 1349 $ echo "B0" > B0
1350 1350 $ hg commit -A -m "C0"
1351 1351 adding A0
1352 1352 adding B0
1353 1353 created new head
1354 1354 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(C0)"`
1355 1355 1 new obsolescence markers
1356 1356 obsoleted 1 changesets
1357 1357 1 new orphan changesets
1358 1358 $ hg debugobsolete `getid "desc(B1)"` `getid "desc(C0)"`
1359 1359 1 new obsolescence markers
1360 1360 obsoleted 1 changesets
1361 1361
1362 1362 $ hg log --hidden -G
1363 1363 @ changeset: 4:eb5a0daa2192
1364 1364 | tag: tip
1365 1365 | parent: 0:ea207398892e
1366 1366 | user: test
1367 1367 | date: Thu Jan 01 00:00:00 1970 +0000
1368 1368 | summary: C0
1369 1369 |
1370 1370 | x changeset: 3:b7ea6d14e664
1371 1371 | | parent: 1:471f378eab4c
1372 1372 | | user: test
1373 1373 | | date: Thu Jan 01 00:00:00 1970 +0000
1374 1374 | | obsolete: rewritten as 4:eb5a0daa2192
1375 1375 | | summary: B1
1376 1376 | |
1377 1377 | | x changeset: 2:0dec01379d3b
1378 1378 | |/ user: test
1379 1379 | | date: Thu Jan 01 00:00:00 1970 +0000
1380 1380 | | obsolete: rewritten using amend as 3:b7ea6d14e664
1381 1381 | | summary: B0
1382 1382 | |
1383 1383 | x changeset: 1:471f378eab4c
1384 1384 |/ user: test
1385 1385 | date: Thu Jan 01 00:00:00 1970 +0000
1386 1386 | obsolete: rewritten as 4:eb5a0daa2192
1387 1387 | summary: A0
1388 1388 |
1389 1389 o changeset: 0:ea207398892e
1390 1390 user: test
1391 1391 date: Thu Jan 01 00:00:00 1970 +0000
1392 1392 summary: ROOT
1393 1393
1394 1394 Check templates
1395 1395 ---------------
1396 1396
1397 1397 $ hg up 'desc(A0)' --hidden
1398 1398 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1399 1399 updated to hidden changeset 471f378eab4c
1400 1400 (hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192)
1401 1401
1402 1402 Predecessors template should show current revision as it is the working copy
1403 1403 $ hg tlog
1404 1404 o eb5a0daa2192
1405 1405 | Predecessors: 1:471f378eab4c
1406 1406 | semi-colon: 1:471f378eab4c
1407 1407 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
1408 1408 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
1409 1409 | Successors:
1410 1410 | multi-line:
1411 | json: ""
1411 | json: []
1412 1412 | @ 471f378eab4c
1413 1413 |/ Predecessors:
1414 1414 | semi-colon:
1415 1415 | json: []
1416 1416 | map:
1417 1417 | Successors: 4:eb5a0daa2192
1418 1418 | multi-line: 4:eb5a0daa2192
1419 1419 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
1420 1420 o ea207398892e
1421 1421 Predecessors:
1422 1422 semi-colon:
1423 1423 json: []
1424 1424 map:
1425 1425 Successors:
1426 1426 multi-line:
1427 json: ""
1427 json: []
1428 1428
1429 1429 $ hg fatelog
1430 1430 o eb5a0daa2192
1431 1431 |
1432 1432 | @ 471f378eab4c
1433 1433 |/ Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000);
1434 1434 o ea207398892e
1435 1435
1436 1436 $ hg up 'desc(B0)' --hidden
1437 1437 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1438 1438 updated to hidden changeset 0dec01379d3b
1439 1439 (hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192)
1440 1440
1441 1441 Predecessors template should both predecessors as they are visible
1442 1442 $ hg tlog
1443 1443 o eb5a0daa2192
1444 1444 | Predecessors: 2:0dec01379d3b 1:471f378eab4c
1445 1445 | semi-colon: 2:0dec01379d3b; 1:471f378eab4c
1446 1446 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
1447 1447 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874
1448 1448 | Successors:
1449 1449 | multi-line:
1450 | json: ""
1450 | json: []
1451 1451 | @ 0dec01379d3b
1452 1452 | | Predecessors:
1453 1453 | | semi-colon:
1454 1454 | | json: []
1455 1455 | | map:
1456 1456 | | Successors: 4:eb5a0daa2192
1457 1457 | | multi-line: 4:eb5a0daa2192
1458 1458 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
1459 1459 | x 471f378eab4c
1460 1460 |/ Predecessors:
1461 1461 | semi-colon:
1462 1462 | json: []
1463 1463 | map:
1464 1464 | Successors: 4:eb5a0daa2192
1465 1465 | multi-line: 4:eb5a0daa2192
1466 1466 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
1467 1467 o ea207398892e
1468 1468 Predecessors:
1469 1469 semi-colon:
1470 1470 json: []
1471 1471 map:
1472 1472 Successors:
1473 1473 multi-line:
1474 json: ""
1474 json: []
1475 1475
1476 1476 $ hg fatelog
1477 1477 o eb5a0daa2192
1478 1478 |
1479 1479 | @ 0dec01379d3b
1480 1480 | | Obsfate: rewritten using amend as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000);
1481 1481 | x 471f378eab4c
1482 1482 |/ Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000);
1483 1483 o ea207398892e
1484 1484
1485 1485 $ hg up 'desc(B1)' --hidden
1486 1486 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1487 1487 updated to hidden changeset b7ea6d14e664
1488 1488 (hidden revision 'b7ea6d14e664' was rewritten as: eb5a0daa2192)
1489 1489
1490 1490 Predecessors template should both predecessors as they are visible
1491 1491 $ hg tlog
1492 1492 o eb5a0daa2192
1493 1493 | Predecessors: 1:471f378eab4c 3:b7ea6d14e664
1494 1494 | semi-colon: 1:471f378eab4c; 3:b7ea6d14e664
1495 1495 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"]
1496 1496 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 3:b7ea6d14e664bdc8922221f7992631b50da3fb07
1497 1497 | Successors:
1498 1498 | multi-line:
1499 | json: ""
1499 | json: []
1500 1500 | @ b7ea6d14e664
1501 1501 | | Predecessors:
1502 1502 | | semi-colon:
1503 1503 | | json: []
1504 1504 | | map:
1505 1505 | | Successors: 4:eb5a0daa2192
1506 1506 | | multi-line: 4:eb5a0daa2192
1507 1507 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
1508 1508 | x 471f378eab4c
1509 1509 |/ Predecessors:
1510 1510 | semi-colon:
1511 1511 | json: []
1512 1512 | map:
1513 1513 | Successors: 4:eb5a0daa2192
1514 1514 | multi-line: 4:eb5a0daa2192
1515 1515 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
1516 1516 o ea207398892e
1517 1517 Predecessors:
1518 1518 semi-colon:
1519 1519 json: []
1520 1520 map:
1521 1521 Successors:
1522 1522 multi-line:
1523 json: ""
1523 json: []
1524 1524
1525 1525 $ hg fatelog
1526 1526 o eb5a0daa2192
1527 1527 |
1528 1528 | @ b7ea6d14e664
1529 1529 | | Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000);
1530 1530 | x 471f378eab4c
1531 1531 |/ Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000);
1532 1532 o ea207398892e
1533 1533
1534 1534 $ hg up 'desc(C0)'
1535 1535 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1536 1536
1537 1537 Predecessors template should show no predecessors as they are both non visible
1538 1538 $ hg tlog
1539 1539 @ eb5a0daa2192
1540 1540 | Predecessors:
1541 1541 | semi-colon:
1542 1542 | json: []
1543 1543 | map:
1544 1544 | Successors:
1545 1545 | multi-line:
1546 | json: ""
1546 | json: []
1547 1547 o ea207398892e
1548 1548 Predecessors:
1549 1549 semi-colon:
1550 1550 json: []
1551 1551 map:
1552 1552 Successors:
1553 1553 multi-line:
1554 json: ""
1554 json: []
1555 1555
1556 1556 $ hg fatelog
1557 1557 @ eb5a0daa2192
1558 1558 |
1559 1559 o ea207398892e
1560 1560
1561 1561 Predecessors template should show all predecessors as we force their display
1562 1562 with --hidden
1563 1563 $ hg tlog --hidden
1564 1564 @ eb5a0daa2192
1565 1565 | Predecessors: 1:471f378eab4c 3:b7ea6d14e664
1566 1566 | semi-colon: 1:471f378eab4c; 3:b7ea6d14e664
1567 1567 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"]
1568 1568 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 3:b7ea6d14e664bdc8922221f7992631b50da3fb07
1569 1569 | Successors:
1570 1570 | multi-line:
1571 | json: ""
1571 | json: []
1572 1572 | x b7ea6d14e664
1573 1573 | | Predecessors: 2:0dec01379d3b
1574 1574 | | semi-colon: 2:0dec01379d3b
1575 1575 | | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
1576 1576 | | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
1577 1577 | | Successors: 4:eb5a0daa2192
1578 1578 | | multi-line: 4:eb5a0daa2192
1579 1579 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
1580 1580 | | x 0dec01379d3b
1581 1581 | |/ Predecessors:
1582 1582 | | semi-colon:
1583 1583 | | json: []
1584 1584 | | map:
1585 1585 | | Successors: 3:b7ea6d14e664
1586 1586 | | multi-line: 3:b7ea6d14e664
1587 1587 | | json: [["b7ea6d14e664bdc8922221f7992631b50da3fb07"]]
1588 1588 | x 471f378eab4c
1589 1589 |/ Predecessors:
1590 1590 | semi-colon:
1591 1591 | json: []
1592 1592 | map:
1593 1593 | Successors: 4:eb5a0daa2192
1594 1594 | multi-line: 4:eb5a0daa2192
1595 1595 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]]
1596 1596 o ea207398892e
1597 1597 Predecessors:
1598 1598 semi-colon:
1599 1599 json: []
1600 1600 map:
1601 1601 Successors:
1602 1602 multi-line:
1603 json: ""
1603 json: []
1604 1604
1605 1605 $ hg fatelog --hidden
1606 1606 @ eb5a0daa2192
1607 1607 |
1608 1608 | x b7ea6d14e664
1609 1609 | | Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000);
1610 1610 | | x 0dec01379d3b
1611 1611 | |/ Obsfate: rewritten using amend as 3:b7ea6d14e664 by test (at 1970-01-01 00:00 +0000);
1612 1612 | x 471f378eab4c
1613 1613 |/ Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000);
1614 1614 o ea207398892e
1615 1615
1616 1616
1617 1617 $ hg fatelogjson --hidden
1618 1618 @ eb5a0daa2192
1619 1619 |
1620 1620 | x b7ea6d14e664
1621 1621 | | Obsfate: [{"markers": [["b7ea6d14e664bdc8922221f7992631b50da3fb07", ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]}]
1622 1622 | | x 0dec01379d3b
1623 1623 | |/ Obsfate: [{"markers": [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", ["b7ea6d14e664bdc8922221f7992631b50da3fb07"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["b7ea6d14e664bdc8922221f7992631b50da3fb07"]}]
1624 1624 | x 471f378eab4c
1625 1625 |/ Obsfate: [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]}]
1626 1626 o ea207398892e
1627 1627
1628 1628
1629 1629 Check other fatelog implementations
1630 1630 -----------------------------------
1631 1631
1632 1632 $ hg fatelogkw --hidden -q
1633 1633 @ eb5a0daa2192
1634 1634 |
1635 1635 | x b7ea6d14e664
1636 1636 | | Obsfate: rewritten as 4:eb5a0daa2192
1637 1637 | | x 0dec01379d3b
1638 1638 | |/ Obsfate: rewritten using amend as 3:b7ea6d14e664
1639 1639 | x 471f378eab4c
1640 1640 |/ Obsfate: rewritten as 4:eb5a0daa2192
1641 1641 o ea207398892e
1642 1642
1643 1643 $ hg fatelogkw --hidden
1644 1644 @ eb5a0daa2192
1645 1645 |
1646 1646 | x b7ea6d14e664
1647 1647 | | Obsfate: rewritten as 4:eb5a0daa2192
1648 1648 | | x 0dec01379d3b
1649 1649 | |/ Obsfate: rewritten using amend as 3:b7ea6d14e664
1650 1650 | x 471f378eab4c
1651 1651 |/ Obsfate: rewritten as 4:eb5a0daa2192
1652 1652 o ea207398892e
1653 1653
1654 1654 $ hg fatelogkw --hidden -v
1655 1655 @ eb5a0daa2192
1656 1656 |
1657 1657 | x b7ea6d14e664
1658 1658 | | Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000)
1659 1659 | | x 0dec01379d3b
1660 1660 | |/ Obsfate: rewritten using amend as 3:b7ea6d14e664 by test (at 1970-01-01 00:00 +0000)
1661 1661 | x 471f378eab4c
1662 1662 |/ Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000)
1663 1663 o ea207398892e
1664 1664
1665 1665 $ hg log -G -T "default" --hidden
1666 1666 @ changeset: 4:eb5a0daa2192
1667 1667 | tag: tip
1668 1668 | parent: 0:ea207398892e
1669 1669 | user: test
1670 1670 | date: Thu Jan 01 00:00:00 1970 +0000
1671 1671 | summary: C0
1672 1672 |
1673 1673 | x changeset: 3:b7ea6d14e664
1674 1674 | | parent: 1:471f378eab4c
1675 1675 | | user: test
1676 1676 | | date: Thu Jan 01 00:00:00 1970 +0000
1677 1677 | | obsolete: rewritten as 4:eb5a0daa2192
1678 1678 | | summary: B1
1679 1679 | |
1680 1680 | | x changeset: 2:0dec01379d3b
1681 1681 | |/ user: test
1682 1682 | | date: Thu Jan 01 00:00:00 1970 +0000
1683 1683 | | obsolete: rewritten using amend as 3:b7ea6d14e664
1684 1684 | | summary: B0
1685 1685 | |
1686 1686 | x changeset: 1:471f378eab4c
1687 1687 |/ user: test
1688 1688 | date: Thu Jan 01 00:00:00 1970 +0000
1689 1689 | obsolete: rewritten as 4:eb5a0daa2192
1690 1690 | summary: A0
1691 1691 |
1692 1692 o changeset: 0:ea207398892e
1693 1693 user: test
1694 1694 date: Thu Jan 01 00:00:00 1970 +0000
1695 1695 summary: ROOT
1696 1696
1697 1697
1698 1698 Test template with pushed and pulled obs markers
1699 1699 ================================================
1700 1700
1701 1701 Test setup
1702 1702 ----------
1703 1703
1704 1704 $ hg init $TESTTMP/templates-local-remote-markers-1
1705 1705 $ cd $TESTTMP/templates-local-remote-markers-1
1706 1706 $ mkcommit ROOT
1707 1707 $ mkcommit A0
1708 1708 $ hg clone $TESTTMP/templates-local-remote-markers-1 $TESTTMP/templates-local-remote-markers-2
1709 1709 updating to branch default
1710 1710 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1711 1711 $ cd $TESTTMP/templates-local-remote-markers-2
1712 1712 $ hg log --hidden -G
1713 1713 @ changeset: 1:471f378eab4c
1714 1714 | tag: tip
1715 1715 | user: test
1716 1716 | date: Thu Jan 01 00:00:00 1970 +0000
1717 1717 | summary: A0
1718 1718 |
1719 1719 o changeset: 0:ea207398892e
1720 1720 user: test
1721 1721 date: Thu Jan 01 00:00:00 1970 +0000
1722 1722 summary: ROOT
1723 1723
1724 1724 $ cd $TESTTMP/templates-local-remote-markers-1
1725 1725 $ hg commit --amend -m "A1"
1726 1726 $ hg commit --amend -m "A2"
1727 1727 $ hg log --hidden -G
1728 1728 @ changeset: 3:7a230b46bf61
1729 1729 | tag: tip
1730 1730 | parent: 0:ea207398892e
1731 1731 | user: test
1732 1732 | date: Thu Jan 01 00:00:00 1970 +0000
1733 1733 | summary: A2
1734 1734 |
1735 1735 | x changeset: 2:fdf9bde5129a
1736 1736 |/ parent: 0:ea207398892e
1737 1737 | user: test
1738 1738 | date: Thu Jan 01 00:00:00 1970 +0000
1739 1739 | obsolete: rewritten using amend as 3:7a230b46bf61
1740 1740 | summary: A1
1741 1741 |
1742 1742 | x changeset: 1:471f378eab4c
1743 1743 |/ user: test
1744 1744 | date: Thu Jan 01 00:00:00 1970 +0000
1745 1745 | obsolete: rewritten using amend as 2:fdf9bde5129a
1746 1746 | summary: A0
1747 1747 |
1748 1748 o changeset: 0:ea207398892e
1749 1749 user: test
1750 1750 date: Thu Jan 01 00:00:00 1970 +0000
1751 1751 summary: ROOT
1752 1752
1753 1753 $ cd $TESTTMP/templates-local-remote-markers-2
1754 1754 $ hg pull
1755 1755 pulling from $TESTTMP/templates-local-remote-markers-1
1756 1756 searching for changes
1757 1757 adding changesets
1758 1758 adding manifests
1759 1759 adding file changes
1760 1760 added 1 changesets with 0 changes to 1 files (+1 heads)
1761 1761 2 new obsolescence markers
1762 1762 obsoleted 1 changesets
1763 1763 new changesets 7a230b46bf61 (1 drafts)
1764 1764 (run 'hg heads' to see heads, 'hg merge' to merge)
1765 1765 $ hg log --hidden -G
1766 1766 o changeset: 2:7a230b46bf61
1767 1767 | tag: tip
1768 1768 | parent: 0:ea207398892e
1769 1769 | user: test
1770 1770 | date: Thu Jan 01 00:00:00 1970 +0000
1771 1771 | summary: A2
1772 1772 |
1773 1773 | @ changeset: 1:471f378eab4c
1774 1774 |/ user: test
1775 1775 | date: Thu Jan 01 00:00:00 1970 +0000
1776 1776 | obsolete: rewritten using amend as 2:7a230b46bf61
1777 1777 | summary: A0
1778 1778 |
1779 1779 o changeset: 0:ea207398892e
1780 1780 user: test
1781 1781 date: Thu Jan 01 00:00:00 1970 +0000
1782 1782 summary: ROOT
1783 1783
1784 1784
1785 1785 $ hg debugobsolete
1786 1786 471f378eab4c5e25f6c77f785b27c936efb22874 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1787 1787 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 7a230b46bf61e50b30308c6cfd7bd1269ef54702 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1788 1788
1789 1789 Check templates
1790 1790 ---------------
1791 1791
1792 1792 Predecessors template should show current revision as it is the working copy
1793 1793 $ hg tlog
1794 1794 o 7a230b46bf61
1795 1795 | Predecessors: 1:471f378eab4c
1796 1796 | semi-colon: 1:471f378eab4c
1797 1797 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
1798 1798 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
1799 1799 | Successors:
1800 1800 | multi-line:
1801 | json: ""
1801 | json: []
1802 1802 | @ 471f378eab4c
1803 1803 |/ Predecessors:
1804 1804 | semi-colon:
1805 1805 | json: []
1806 1806 | map:
1807 1807 | Successors: 2:7a230b46bf61
1808 1808 | multi-line: 2:7a230b46bf61
1809 1809 | json: [["7a230b46bf61e50b30308c6cfd7bd1269ef54702"]]
1810 1810 o ea207398892e
1811 1811 Predecessors:
1812 1812 semi-colon:
1813 1813 json: []
1814 1814 map:
1815 1815 Successors:
1816 1816 multi-line:
1817 json: ""
1817 json: []
1818 1818
1819 1819 $ hg fatelog
1820 1820 o 7a230b46bf61
1821 1821 |
1822 1822 | @ 471f378eab4c
1823 1823 |/ Obsfate: rewritten using amend as 2:7a230b46bf61 by test (at 1970-01-01 00:00 +0000);
1824 1824 o ea207398892e
1825 1825
1826 1826 $ hg up 'desc(A2)'
1827 1827 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1828 1828
1829 1829 Predecessors template should show no predecessors as they are non visible
1830 1830 $ hg tlog
1831 1831 @ 7a230b46bf61
1832 1832 | Predecessors:
1833 1833 | semi-colon:
1834 1834 | json: []
1835 1835 | map:
1836 1836 | Successors:
1837 1837 | multi-line:
1838 | json: ""
1838 | json: []
1839 1839 o ea207398892e
1840 1840 Predecessors:
1841 1841 semi-colon:
1842 1842 json: []
1843 1843 map:
1844 1844 Successors:
1845 1845 multi-line:
1846 json: ""
1846 json: []
1847 1847
1848 1848 $ hg fatelog
1849 1849 @ 7a230b46bf61
1850 1850 |
1851 1851 o ea207398892e
1852 1852
1853 1853 Predecessors template should show all predecessors as we force their display
1854 1854 with --hidden
1855 1855 $ hg tlog --hidden
1856 1856 @ 7a230b46bf61
1857 1857 | Predecessors: 1:471f378eab4c
1858 1858 | semi-colon: 1:471f378eab4c
1859 1859 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
1860 1860 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
1861 1861 | Successors:
1862 1862 | multi-line:
1863 | json: ""
1863 | json: []
1864 1864 | x 471f378eab4c
1865 1865 |/ Predecessors:
1866 1866 | semi-colon:
1867 1867 | json: []
1868 1868 | map:
1869 1869 | Successors: 2:7a230b46bf61
1870 1870 | multi-line: 2:7a230b46bf61
1871 1871 | json: [["7a230b46bf61e50b30308c6cfd7bd1269ef54702"]]
1872 1872 o ea207398892e
1873 1873 Predecessors:
1874 1874 semi-colon:
1875 1875 json: []
1876 1876 map:
1877 1877 Successors:
1878 1878 multi-line:
1879 json: ""
1879 json: []
1880 1880
1881 1881 $ hg fatelog --hidden
1882 1882 @ 7a230b46bf61
1883 1883 |
1884 1884 | x 471f378eab4c
1885 1885 |/ Obsfate: rewritten using amend as 2:7a230b46bf61 by test (at 1970-01-01 00:00 +0000);
1886 1886 o ea207398892e
1887 1887
1888 1888
1889 1889 Check other fatelog implementations
1890 1890 -----------------------------------
1891 1891
1892 1892 $ hg fatelogkw --hidden -q
1893 1893 @ 7a230b46bf61
1894 1894 |
1895 1895 | x 471f378eab4c
1896 1896 |/ Obsfate: rewritten using amend as 2:7a230b46bf61
1897 1897 o ea207398892e
1898 1898
1899 1899 $ hg fatelogkw --hidden
1900 1900 @ 7a230b46bf61
1901 1901 |
1902 1902 | x 471f378eab4c
1903 1903 |/ Obsfate: rewritten using amend as 2:7a230b46bf61
1904 1904 o ea207398892e
1905 1905
1906 1906 $ hg fatelogkw --hidden -v
1907 1907 @ 7a230b46bf61
1908 1908 |
1909 1909 | x 471f378eab4c
1910 1910 |/ Obsfate: rewritten using amend as 2:7a230b46bf61 by test (at 1970-01-01 00:00 +0000)
1911 1911 o ea207398892e
1912 1912
1913 1913 $ hg log -G -T "default" --hidden
1914 1914 @ changeset: 2:7a230b46bf61
1915 1915 | tag: tip
1916 1916 | parent: 0:ea207398892e
1917 1917 | user: test
1918 1918 | date: Thu Jan 01 00:00:00 1970 +0000
1919 1919 | summary: A2
1920 1920 |
1921 1921 | x changeset: 1:471f378eab4c
1922 1922 |/ user: test
1923 1923 | date: Thu Jan 01 00:00:00 1970 +0000
1924 1924 | obsolete: rewritten using amend as 2:7a230b46bf61
1925 1925 | summary: A0
1926 1926 |
1927 1927 o changeset: 0:ea207398892e
1928 1928 user: test
1929 1929 date: Thu Jan 01 00:00:00 1970 +0000
1930 1930 summary: ROOT
1931 1931
1932 1932
1933 1933 Test template with obsmarkers cycle
1934 1934 ===================================
1935 1935
1936 1936 Test setup
1937 1937 ----------
1938 1938
1939 1939 $ hg init $TESTTMP/templates-local-cycle
1940 1940 $ cd $TESTTMP/templates-local-cycle
1941 1941 $ mkcommit ROOT
1942 1942 $ mkcommit A0
1943 1943 $ mkcommit B0
1944 1944 $ hg up -r 0
1945 1945 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1946 1946 $ mkcommit C0
1947 1947 created new head
1948 1948
1949 1949 Create the cycle
1950 1950
1951 1951 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(B0)"`
1952 1952 1 new obsolescence markers
1953 1953 obsoleted 1 changesets
1954 1954 1 new orphan changesets
1955 1955 $ hg debugobsolete `getid "desc(B0)"` `getid "desc(C0)"`
1956 1956 1 new obsolescence markers
1957 1957 obsoleted 1 changesets
1958 1958 $ hg debugobsolete `getid "desc(B0)"` `getid "desc(A0)"`
1959 1959 1 new obsolescence markers
1960 1960
1961 1961 Check templates
1962 1962 ---------------
1963 1963
1964 1964 $ hg tlog
1965 1965 @ f897c6137566
1966 1966 | Predecessors:
1967 1967 | semi-colon:
1968 1968 | json: []
1969 1969 | map:
1970 1970 | Successors:
1971 1971 | multi-line:
1972 | json: ""
1972 | json: []
1973 1973 o ea207398892e
1974 1974 Predecessors:
1975 1975 semi-colon:
1976 1976 json: []
1977 1977 map:
1978 1978 Successors:
1979 1979 multi-line:
1980 json: ""
1980 json: []
1981 1981
1982 1982 $ hg fatelog
1983 1983 @ f897c6137566
1984 1984 |
1985 1985 o ea207398892e
1986 1986
1987 1987
1988 1988 $ hg up -r "desc(B0)" --hidden
1989 1989 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1990 1990 updated to hidden changeset 0dec01379d3b
1991 1991 (hidden revision '0dec01379d3b' is pruned)
1992 1992 $ hg tlog
1993 1993 o f897c6137566
1994 1994 | Predecessors: 2:0dec01379d3b
1995 1995 | semi-colon: 2:0dec01379d3b
1996 1996 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
1997 1997 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
1998 1998 | Successors:
1999 1999 | multi-line:
2000 | json: ""
2000 | json: []
2001 2001 | @ 0dec01379d3b
2002 2002 | | Predecessors: 1:471f378eab4c
2003 2003 | | semi-colon: 1:471f378eab4c
2004 2004 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
2005 2005 | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
2006 2006 | | Successors: 3:f897c6137566; 1:471f378eab4c
2007 2007 | | multi-line: 3:f897c6137566
2008 2008 | | multi-line: 1:471f378eab4c
2009 2009 | | json: [["f897c6137566320b081514b4c7227ecc3d384b39"], ["471f378eab4c5e25f6c77f785b27c936efb22874"]]
2010 2010 | x 471f378eab4c
2011 2011 |/ Predecessors: 2:0dec01379d3b
2012 2012 | semi-colon: 2:0dec01379d3b
2013 2013 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
2014 2014 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
2015 2015 | Successors: 2:0dec01379d3b
2016 2016 | multi-line: 2:0dec01379d3b
2017 2017 | json: [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]]
2018 2018 o ea207398892e
2019 2019 Predecessors:
2020 2020 semi-colon:
2021 2021 json: []
2022 2022 map:
2023 2023 Successors:
2024 2024 multi-line:
2025 json: ""
2025 json: []
2026 2026
2027 2027 $ hg fatelog
2028 2028 o f897c6137566
2029 2029 |
2030 2030 | @ 0dec01379d3b
2031 2031 | | Obsfate: rewritten as 3:f897c6137566 by test (at 1970-01-01 00:00 +0000); rewritten as 1:471f378eab4c by test (at 1970-01-01 00:00 +0000);
2032 2032 | x 471f378eab4c
2033 2033 |/ Obsfate: rewritten as 2:0dec01379d3b by test (at 1970-01-01 00:00 +0000);
2034 2034 o ea207398892e
2035 2035
2036 2036
2037 2037 $ hg up -r "desc(A0)" --hidden
2038 2038 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2039 2039 $ hg tlog
2040 2040 o f897c6137566
2041 2041 | Predecessors: 1:471f378eab4c
2042 2042 | semi-colon: 1:471f378eab4c
2043 2043 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
2044 2044 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
2045 2045 | Successors:
2046 2046 | multi-line:
2047 | json: ""
2047 | json: []
2048 2048 | @ 471f378eab4c
2049 2049 |/ Predecessors:
2050 2050 | semi-colon:
2051 2051 | json: []
2052 2052 | map:
2053 2053 | Successors:
2054 2054 | multi-line:
2055 2055 | json: []
2056 2056 o ea207398892e
2057 2057 Predecessors:
2058 2058 semi-colon:
2059 2059 json: []
2060 2060 map:
2061 2061 Successors:
2062 2062 multi-line:
2063 json: ""
2063 json: []
2064 2064
2065 2065 $ hg fatelog
2066 2066 o f897c6137566
2067 2067 |
2068 2068 | @ 471f378eab4c
2069 2069 |/ Obsfate: pruned;
2070 2070 o ea207398892e
2071 2071
2072 2072
2073 2073 $ hg up -r "desc(ROOT)" --hidden
2074 2074 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2075 2075 $ hg tlog
2076 2076 o f897c6137566
2077 2077 | Predecessors:
2078 2078 | semi-colon:
2079 2079 | json: []
2080 2080 | map:
2081 2081 | Successors:
2082 2082 | multi-line:
2083 | json: ""
2083 | json: []
2084 2084 @ ea207398892e
2085 2085 Predecessors:
2086 2086 semi-colon:
2087 2087 json: []
2088 2088 map:
2089 2089 Successors:
2090 2090 multi-line:
2091 json: ""
2091 json: []
2092 2092
2093 2093 $ hg fatelog
2094 2094 o f897c6137566
2095 2095 |
2096 2096 @ ea207398892e
2097 2097
2098 2098
2099 2099 $ hg tlog --hidden
2100 2100 o f897c6137566
2101 2101 | Predecessors: 2:0dec01379d3b
2102 2102 | semi-colon: 2:0dec01379d3b
2103 2103 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
2104 2104 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
2105 2105 | Successors:
2106 2106 | multi-line:
2107 | json: ""
2107 | json: []
2108 2108 | x 0dec01379d3b
2109 2109 | | Predecessors: 1:471f378eab4c
2110 2110 | | semi-colon: 1:471f378eab4c
2111 2111 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
2112 2112 | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
2113 2113 | | Successors: 3:f897c6137566; 1:471f378eab4c
2114 2114 | | multi-line: 3:f897c6137566
2115 2115 | | multi-line: 1:471f378eab4c
2116 2116 | | json: [["f897c6137566320b081514b4c7227ecc3d384b39"], ["471f378eab4c5e25f6c77f785b27c936efb22874"]]
2117 2117 | x 471f378eab4c
2118 2118 |/ Predecessors: 2:0dec01379d3b
2119 2119 | semi-colon: 2:0dec01379d3b
2120 2120 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
2121 2121 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
2122 2122 | Successors: 2:0dec01379d3b
2123 2123 | multi-line: 2:0dec01379d3b
2124 2124 | json: [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]]
2125 2125 @ ea207398892e
2126 2126 Predecessors:
2127 2127 semi-colon:
2128 2128 json: []
2129 2129 map:
2130 2130 Successors:
2131 2131 multi-line:
2132 json: ""
2132 json: []
2133 2133
2134 2134 Check other fatelog implementations
2135 2135 -----------------------------------
2136 2136
2137 2137 $ hg fatelogkw --hidden -q
2138 2138 o f897c6137566
2139 2139 |
2140 2140 | x 0dec01379d3b
2141 2141 | | Obsfate: rewritten as 3:f897c6137566
2142 2142 | | Obsfate: rewritten as 1:471f378eab4c
2143 2143 | x 471f378eab4c
2144 2144 |/ Obsfate: rewritten as 2:0dec01379d3b
2145 2145 @ ea207398892e
2146 2146
2147 2147 $ hg fatelogkw --hidden
2148 2148 o f897c6137566
2149 2149 |
2150 2150 | x 0dec01379d3b
2151 2151 | | Obsfate: rewritten as 3:f897c6137566
2152 2152 | | Obsfate: rewritten as 1:471f378eab4c
2153 2153 | x 471f378eab4c
2154 2154 |/ Obsfate: rewritten as 2:0dec01379d3b
2155 2155 @ ea207398892e
2156 2156
2157 2157 $ hg fatelogkw --hidden -v
2158 2158 o f897c6137566
2159 2159 |
2160 2160 | x 0dec01379d3b
2161 2161 | | Obsfate: rewritten as 3:f897c6137566 by test (at 1970-01-01 00:00 +0000)
2162 2162 | | Obsfate: rewritten as 1:471f378eab4c by test (at 1970-01-01 00:00 +0000)
2163 2163 | x 471f378eab4c
2164 2164 |/ Obsfate: rewritten as 2:0dec01379d3b by test (at 1970-01-01 00:00 +0000)
2165 2165 @ ea207398892e
2166 2166
2167 2167 $ hg log -G -T "default" --hidden
2168 2168 o changeset: 3:f897c6137566
2169 2169 | tag: tip
2170 2170 | parent: 0:ea207398892e
2171 2171 | user: test
2172 2172 | date: Thu Jan 01 00:00:00 1970 +0000
2173 2173 | summary: C0
2174 2174 |
2175 2175 | x changeset: 2:0dec01379d3b
2176 2176 | | user: test
2177 2177 | | date: Thu Jan 01 00:00:00 1970 +0000
2178 2178 | | obsolete: rewritten as 3:f897c6137566
2179 2179 | | obsolete: rewritten as 1:471f378eab4c
2180 2180 | | summary: B0
2181 2181 | |
2182 2182 | x changeset: 1:471f378eab4c
2183 2183 |/ user: test
2184 2184 | date: Thu Jan 01 00:00:00 1970 +0000
2185 2185 | obsolete: rewritten as 2:0dec01379d3b
2186 2186 | summary: A0
2187 2187 |
2188 2188 @ changeset: 0:ea207398892e
2189 2189 user: test
2190 2190 date: Thu Jan 01 00:00:00 1970 +0000
2191 2191 summary: ROOT
2192 2192
2193 2193
2194 2194 Test template with split + divergence with cycles
2195 2195 =================================================
2196 2196
2197 2197 $ hg log -G
2198 2198 o changeset: 3:f897c6137566
2199 2199 | tag: tip
2200 2200 | parent: 0:ea207398892e
2201 2201 | user: test
2202 2202 | date: Thu Jan 01 00:00:00 1970 +0000
2203 2203 | summary: C0
2204 2204 |
2205 2205 @ changeset: 0:ea207398892e
2206 2206 user: test
2207 2207 date: Thu Jan 01 00:00:00 1970 +0000
2208 2208 summary: ROOT
2209 2209
2210 2210 $ hg up
2211 2211 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2212 2212
2213 2213 Create a commit with three files
2214 2214 $ touch A B C
2215 2215 $ hg commit -A -m "Add A,B,C" A B C
2216 2216
2217 2217 Split it
2218 2218 $ hg up 3
2219 2219 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
2220 2220 $ touch A
2221 2221 $ hg commit -A -m "Add A,B,C" A
2222 2222 created new head
2223 2223
2224 2224 $ touch B
2225 2225 $ hg commit -A -m "Add A,B,C" B
2226 2226
2227 2227 $ touch C
2228 2228 $ hg commit -A -m "Add A,B,C" C
2229 2229
2230 2230 $ hg log -G
2231 2231 @ changeset: 7:ba2ed02b0c9a
2232 2232 | tag: tip
2233 2233 | user: test
2234 2234 | date: Thu Jan 01 00:00:00 1970 +0000
2235 2235 | summary: Add A,B,C
2236 2236 |
2237 2237 o changeset: 6:4a004186e638
2238 2238 | user: test
2239 2239 | date: Thu Jan 01 00:00:00 1970 +0000
2240 2240 | summary: Add A,B,C
2241 2241 |
2242 2242 o changeset: 5:dd800401bd8c
2243 2243 | parent: 3:f897c6137566
2244 2244 | user: test
2245 2245 | date: Thu Jan 01 00:00:00 1970 +0000
2246 2246 | summary: Add A,B,C
2247 2247 |
2248 2248 | o changeset: 4:9bd10a0775e4
2249 2249 |/ user: test
2250 2250 | date: Thu Jan 01 00:00:00 1970 +0000
2251 2251 | summary: Add A,B,C
2252 2252 |
2253 2253 o changeset: 3:f897c6137566
2254 2254 | parent: 0:ea207398892e
2255 2255 | user: test
2256 2256 | date: Thu Jan 01 00:00:00 1970 +0000
2257 2257 | summary: C0
2258 2258 |
2259 2259 o changeset: 0:ea207398892e
2260 2260 user: test
2261 2261 date: Thu Jan 01 00:00:00 1970 +0000
2262 2262 summary: ROOT
2263 2263
2264 2264 $ hg debugobsolete `getid "4"` `getid "5"` `getid "6"` `getid "7"`
2265 2265 1 new obsolescence markers
2266 2266 obsoleted 1 changesets
2267 2267 $ hg log -G
2268 2268 @ changeset: 7:ba2ed02b0c9a
2269 2269 | tag: tip
2270 2270 | user: test
2271 2271 | date: Thu Jan 01 00:00:00 1970 +0000
2272 2272 | summary: Add A,B,C
2273 2273 |
2274 2274 o changeset: 6:4a004186e638
2275 2275 | user: test
2276 2276 | date: Thu Jan 01 00:00:00 1970 +0000
2277 2277 | summary: Add A,B,C
2278 2278 |
2279 2279 o changeset: 5:dd800401bd8c
2280 2280 | parent: 3:f897c6137566
2281 2281 | user: test
2282 2282 | date: Thu Jan 01 00:00:00 1970 +0000
2283 2283 | summary: Add A,B,C
2284 2284 |
2285 2285 o changeset: 3:f897c6137566
2286 2286 | parent: 0:ea207398892e
2287 2287 | user: test
2288 2288 | date: Thu Jan 01 00:00:00 1970 +0000
2289 2289 | summary: C0
2290 2290 |
2291 2291 o changeset: 0:ea207398892e
2292 2292 user: test
2293 2293 date: Thu Jan 01 00:00:00 1970 +0000
2294 2294 summary: ROOT
2295 2295
2296 2296 Diverge one of the splitted commit
2297 2297
2298 2298 $ hg up 6
2299 2299 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2300 2300 $ hg commit --amend -m "Add only B"
2301 2301 1 new orphan changesets
2302 2302
2303 2303 $ hg up 6 --hidden
2304 2304 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2305 2305 $ hg commit --amend -m "Add B only"
2306 2306 4 new content-divergent changesets
2307 2307
2308 2308 $ hg log -G
2309 2309 @ changeset: 9:0b997eb7ceee
2310 2310 | tag: tip
2311 2311 | parent: 5:dd800401bd8c
2312 2312 | user: test
2313 2313 | date: Thu Jan 01 00:00:00 1970 +0000
2314 2314 | instability: content-divergent
2315 2315 | summary: Add B only
2316 2316 |
2317 2317 | * changeset: 8:b18bc8331526
2318 2318 |/ parent: 5:dd800401bd8c
2319 2319 | user: test
2320 2320 | date: Thu Jan 01 00:00:00 1970 +0000
2321 2321 | instability: content-divergent
2322 2322 | summary: Add only B
2323 2323 |
2324 2324 | * changeset: 7:ba2ed02b0c9a
2325 2325 | | user: test
2326 2326 | | date: Thu Jan 01 00:00:00 1970 +0000
2327 2327 | | instability: orphan, content-divergent
2328 2328 | | summary: Add A,B,C
2329 2329 | |
2330 2330 | x changeset: 6:4a004186e638
2331 2331 |/ user: test
2332 2332 | date: Thu Jan 01 00:00:00 1970 +0000
2333 2333 | obsolete: rewritten using amend as 8:b18bc8331526
2334 2334 | obsolete: rewritten using amend as 9:0b997eb7ceee
2335 2335 | summary: Add A,B,C
2336 2336 |
2337 2337 * changeset: 5:dd800401bd8c
2338 2338 | parent: 3:f897c6137566
2339 2339 | user: test
2340 2340 | date: Thu Jan 01 00:00:00 1970 +0000
2341 2341 | instability: content-divergent
2342 2342 | summary: Add A,B,C
2343 2343 |
2344 2344 o changeset: 3:f897c6137566
2345 2345 | parent: 0:ea207398892e
2346 2346 | user: test
2347 2347 | date: Thu Jan 01 00:00:00 1970 +0000
2348 2348 | summary: C0
2349 2349 |
2350 2350 o changeset: 0:ea207398892e
2351 2351 user: test
2352 2352 date: Thu Jan 01 00:00:00 1970 +0000
2353 2353 summary: ROOT
2354 2354
2355 2355
2356 2356 Check templates
2357 2357 ---------------
2358 2358
2359 2359 $ hg tlog
2360 2360 @ 0b997eb7ceee
2361 2361 | Predecessors: 6:4a004186e638
2362 2362 | semi-colon: 6:4a004186e638
2363 2363 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"]
2364 2364 | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace
2365 2365 | Successors:
2366 2366 | multi-line:
2367 | json: ""
2367 | json: []
2368 2368 | * b18bc8331526
2369 2369 |/ Predecessors: 6:4a004186e638
2370 2370 | semi-colon: 6:4a004186e638
2371 2371 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"]
2372 2372 | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace
2373 2373 | Successors:
2374 2374 | multi-line:
2375 | json: ""
2375 | json: []
2376 2376 | * ba2ed02b0c9a
2377 2377 | | Predecessors:
2378 2378 | | semi-colon:
2379 2379 | | json: []
2380 2380 | | map:
2381 2381 | | Successors:
2382 2382 | | multi-line:
2383 | | json: ""
2383 | | json: []
2384 2384 | x 4a004186e638
2385 2385 |/ Predecessors:
2386 2386 | semi-colon:
2387 2387 | json: []
2388 2388 | map:
2389 2389 | Successors: 8:b18bc8331526; 9:0b997eb7ceee
2390 2390 | multi-line: 8:b18bc8331526
2391 2391 | multi-line: 9:0b997eb7ceee
2392 2392 | json: [["b18bc8331526a22cbb1801022bd1555bf291c48b"], ["0b997eb7ceeee06200a02f8aab185979092d514e"]]
2393 2393 * dd800401bd8c
2394 2394 | Predecessors:
2395 2395 | semi-colon:
2396 2396 | json: []
2397 2397 | map:
2398 2398 | Successors:
2399 2399 | multi-line:
2400 | json: ""
2400 | json: []
2401 2401 o f897c6137566
2402 2402 | Predecessors:
2403 2403 | semi-colon:
2404 2404 | json: []
2405 2405 | map:
2406 2406 | Successors:
2407 2407 | multi-line:
2408 | json: ""
2408 | json: []
2409 2409 o ea207398892e
2410 2410 Predecessors:
2411 2411 semi-colon:
2412 2412 json: []
2413 2413 map:
2414 2414 Successors:
2415 2415 multi-line:
2416 json: ""
2416 json: []
2417 2417 $ hg fatelog
2418 2418 @ 0b997eb7ceee
2419 2419 |
2420 2420 | * b18bc8331526
2421 2421 |/
2422 2422 | * ba2ed02b0c9a
2423 2423 | |
2424 2424 | x 4a004186e638
2425 2425 |/ Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000); rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000);
2426 2426 * dd800401bd8c
2427 2427 |
2428 2428 o f897c6137566
2429 2429 |
2430 2430 o ea207398892e
2431 2431
2432 2432 $ hg tlog --hidden
2433 2433 @ 0b997eb7ceee
2434 2434 | Predecessors: 6:4a004186e638
2435 2435 | semi-colon: 6:4a004186e638
2436 2436 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"]
2437 2437 | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace
2438 2438 | Successors:
2439 2439 | multi-line:
2440 | json: ""
2440 | json: []
2441 2441 | * b18bc8331526
2442 2442 |/ Predecessors: 6:4a004186e638
2443 2443 | semi-colon: 6:4a004186e638
2444 2444 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"]
2445 2445 | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace
2446 2446 | Successors:
2447 2447 | multi-line:
2448 | json: ""
2448 | json: []
2449 2449 | * ba2ed02b0c9a
2450 2450 | | Predecessors: 4:9bd10a0775e4
2451 2451 | | semi-colon: 4:9bd10a0775e4
2452 2452 | | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
2453 2453 | | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
2454 2454 | | Successors:
2455 2455 | | multi-line:
2456 | | json: ""
2456 | | json: []
2457 2457 | x 4a004186e638
2458 2458 |/ Predecessors: 4:9bd10a0775e4
2459 2459 | semi-colon: 4:9bd10a0775e4
2460 2460 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
2461 2461 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
2462 2462 | Successors: 8:b18bc8331526; 9:0b997eb7ceee
2463 2463 | multi-line: 8:b18bc8331526
2464 2464 | multi-line: 9:0b997eb7ceee
2465 2465 | json: [["b18bc8331526a22cbb1801022bd1555bf291c48b"], ["0b997eb7ceeee06200a02f8aab185979092d514e"]]
2466 2466 * dd800401bd8c
2467 2467 | Predecessors: 4:9bd10a0775e4
2468 2468 | semi-colon: 4:9bd10a0775e4
2469 2469 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
2470 2470 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
2471 2471 | Successors:
2472 2472 | multi-line:
2473 | json: ""
2473 | json: []
2474 2474 | x 9bd10a0775e4
2475 2475 |/ Predecessors:
2476 2476 | semi-colon:
2477 2477 | json: []
2478 2478 | map:
2479 2479 | Successors: 5:dd800401bd8c 6:4a004186e638 7:ba2ed02b0c9a
2480 2480 | multi-line: 5:dd800401bd8c 6:4a004186e638 7:ba2ed02b0c9a
2481 2481 | json: [["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"]]
2482 2482 o f897c6137566
2483 2483 | Predecessors: 2:0dec01379d3b
2484 2484 | semi-colon: 2:0dec01379d3b
2485 2485 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
2486 2486 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
2487 2487 | Successors:
2488 2488 | multi-line:
2489 | json: ""
2489 | json: []
2490 2490 | x 0dec01379d3b
2491 2491 | | Predecessors: 1:471f378eab4c
2492 2492 | | semi-colon: 1:471f378eab4c
2493 2493 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
2494 2494 | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
2495 2495 | | Successors: 3:f897c6137566; 1:471f378eab4c
2496 2496 | | multi-line: 3:f897c6137566
2497 2497 | | multi-line: 1:471f378eab4c
2498 2498 | | json: [["f897c6137566320b081514b4c7227ecc3d384b39"], ["471f378eab4c5e25f6c77f785b27c936efb22874"]]
2499 2499 | x 471f378eab4c
2500 2500 |/ Predecessors: 2:0dec01379d3b
2501 2501 | semi-colon: 2:0dec01379d3b
2502 2502 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
2503 2503 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
2504 2504 | Successors: 2:0dec01379d3b
2505 2505 | multi-line: 2:0dec01379d3b
2506 2506 | json: [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]]
2507 2507 o ea207398892e
2508 2508 Predecessors:
2509 2509 semi-colon:
2510 2510 json: []
2511 2511 map:
2512 2512 Successors:
2513 2513 multi-line:
2514 json: ""
2514 json: []
2515 2515 $ hg fatelog --hidden
2516 2516 @ 0b997eb7ceee
2517 2517 |
2518 2518 | * b18bc8331526
2519 2519 |/
2520 2520 | * ba2ed02b0c9a
2521 2521 | |
2522 2522 | x 4a004186e638
2523 2523 |/ Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000); rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000);
2524 2524 * dd800401bd8c
2525 2525 |
2526 2526 | x 9bd10a0775e4
2527 2527 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a by test (at 1970-01-01 00:00 +0000);
2528 2528 o f897c6137566
2529 2529 |
2530 2530 | x 0dec01379d3b
2531 2531 | | Obsfate: rewritten as 3:f897c6137566 by test (at 1970-01-01 00:00 +0000); rewritten as 1:471f378eab4c by test (at 1970-01-01 00:00 +0000);
2532 2532 | x 471f378eab4c
2533 2533 |/ Obsfate: rewritten as 2:0dec01379d3b by test (at 1970-01-01 00:00 +0000);
2534 2534 o ea207398892e
2535 2535
2536 2536 $ hg fatelogjson --hidden
2537 2537 @ 0b997eb7ceee
2538 2538 |
2539 2539 | * b18bc8331526
2540 2540 |/
2541 2541 | * ba2ed02b0c9a
2542 2542 | |
2543 2543 | x 4a004186e638
2544 2544 |/ Obsfate: [{"markers": [["4a004186e63889f20cb16434fcbd72220bd1eace", ["b18bc8331526a22cbb1801022bd1555bf291c48b"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["b18bc8331526a22cbb1801022bd1555bf291c48b"]}, {"markers": [["4a004186e63889f20cb16434fcbd72220bd1eace", ["0b997eb7ceeee06200a02f8aab185979092d514e"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["0b997eb7ceeee06200a02f8aab185979092d514e"]}]
2545 2545 * dd800401bd8c
2546 2546 |
2547 2547 | x 9bd10a0775e4
2548 2548 |/ Obsfate: [{"markers": [["9bd10a0775e478708cada5f176ec6de654359ce7", ["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"]}]
2549 2549 o f897c6137566
2550 2550 |
2551 2551 | x 0dec01379d3b
2552 2552 | | Obsfate: [{"markers": [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", ["f897c6137566320b081514b4c7227ecc3d384b39"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["f897c6137566320b081514b4c7227ecc3d384b39"]}, {"markers": [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", ["471f378eab4c5e25f6c77f785b27c936efb22874"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["471f378eab4c5e25f6c77f785b27c936efb22874"]}]
2553 2553 | x 471f378eab4c
2554 2554 |/ Obsfate: [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]}]
2555 2555 o ea207398892e
2556 2556
2557 2557 $ hg up --hidden 4
2558 2558 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2559 2559 updated to hidden changeset 9bd10a0775e4
2560 2560 (hidden revision '9bd10a0775e4' has diverged)
2561 2561 $ hg rebase -r 7 -d 8 --config extensions.rebase=
2562 2562 rebasing 7:ba2ed02b0c9a "Add A,B,C"
2563 2563 $ hg tlog
2564 2564 * eceed8f98ffc
2565 2565 | Predecessors: 4:9bd10a0775e4
2566 2566 | semi-colon: 4:9bd10a0775e4
2567 2567 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
2568 2568 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
2569 2569 | Successors:
2570 2570 | multi-line:
2571 | json: ""
2571 | json: []
2572 2572 | * 0b997eb7ceee
2573 2573 | | Predecessors: 4:9bd10a0775e4
2574 2574 | | semi-colon: 4:9bd10a0775e4
2575 2575 | | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
2576 2576 | | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
2577 2577 | | Successors:
2578 2578 | | multi-line:
2579 | | json: ""
2579 | | json: []
2580 2580 * | b18bc8331526
2581 2581 |/ Predecessors: 4:9bd10a0775e4
2582 2582 | semi-colon: 4:9bd10a0775e4
2583 2583 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
2584 2584 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
2585 2585 | Successors:
2586 2586 | multi-line:
2587 | json: ""
2587 | json: []
2588 2588 * dd800401bd8c
2589 2589 | Predecessors: 4:9bd10a0775e4
2590 2590 | semi-colon: 4:9bd10a0775e4
2591 2591 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
2592 2592 | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7
2593 2593 | Successors:
2594 2594 | multi-line:
2595 | json: ""
2595 | json: []
2596 2596 | @ 9bd10a0775e4
2597 2597 |/ Predecessors:
2598 2598 | semi-colon:
2599 2599 | json: []
2600 2600 | map:
2601 2601 | Successors: 5:dd800401bd8c 9:0b997eb7ceee 10:eceed8f98ffc; 5:dd800401bd8c 8:b18bc8331526 10:eceed8f98ffc
2602 2602 | multi-line: 5:dd800401bd8c 9:0b997eb7ceee 10:eceed8f98ffc
2603 2603 | multi-line: 5:dd800401bd8c 8:b18bc8331526 10:eceed8f98ffc
2604 2604 | json: [["dd800401bd8c79d815329277739e433e883f784e", "0b997eb7ceeee06200a02f8aab185979092d514e", "eceed8f98ffc4186032e29a6542ab98888ebf68d"], ["dd800401bd8c79d815329277739e433e883f784e", "b18bc8331526a22cbb1801022bd1555bf291c48b", "eceed8f98ffc4186032e29a6542ab98888ebf68d"]]
2605 2605 o f897c6137566
2606 2606 | Predecessors:
2607 2607 | semi-colon:
2608 2608 | json: []
2609 2609 | map:
2610 2610 | Successors:
2611 2611 | multi-line:
2612 | json: ""
2612 | json: []
2613 2613 o ea207398892e
2614 2614 Predecessors:
2615 2615 semi-colon:
2616 2616 json: []
2617 2617 map:
2618 2618 Successors:
2619 2619 multi-line:
2620 json: ""
2620 json: []
2621 2621
2622 2622 $ hg fatelog
2623 2623 * eceed8f98ffc
2624 2624 |
2625 2625 | * 0b997eb7ceee
2626 2626 | |
2627 2627 * | b18bc8331526
2628 2628 |/
2629 2629 * dd800401bd8c
2630 2630 |
2631 2631 | @ 9bd10a0775e4
2632 2632 |/ Obsfate: split using amend, rebase as 5:dd800401bd8c, 9:0b997eb7ceee, 10:eceed8f98ffc by test (at 1970-01-01 00:00 +0000); split using amend, rebase as 5:dd800401bd8c, 8:b18bc8331526, 10:eceed8f98ffc by test (at 1970-01-01 00:00 +0000);
2633 2633 o f897c6137566
2634 2634 |
2635 2635 o ea207398892e
2636 2636
2637 2637 Check other fatelog implementations
2638 2638 -----------------------------------
2639 2639
2640 2640 $ hg fatelogkw --hidden -q
2641 2641 * eceed8f98ffc
2642 2642 |
2643 2643 | * 0b997eb7ceee
2644 2644 | |
2645 2645 * | b18bc8331526
2646 2646 |/
2647 2647 | x ba2ed02b0c9a
2648 2648 | | Obsfate: rewritten using rebase as 10:eceed8f98ffc
2649 2649 | x 4a004186e638
2650 2650 |/ Obsfate: rewritten using amend as 8:b18bc8331526
2651 2651 | Obsfate: rewritten using amend as 9:0b997eb7ceee
2652 2652 * dd800401bd8c
2653 2653 |
2654 2654 | @ 9bd10a0775e4
2655 2655 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a
2656 2656 o f897c6137566
2657 2657 |
2658 2658 | x 0dec01379d3b
2659 2659 | | Obsfate: rewritten as 3:f897c6137566
2660 2660 | | Obsfate: rewritten as 1:471f378eab4c
2661 2661 | x 471f378eab4c
2662 2662 |/ Obsfate: rewritten as 2:0dec01379d3b
2663 2663 o ea207398892e
2664 2664
2665 2665 $ hg fatelogkw --hidden
2666 2666 * eceed8f98ffc
2667 2667 |
2668 2668 | * 0b997eb7ceee
2669 2669 | |
2670 2670 * | b18bc8331526
2671 2671 |/
2672 2672 | x ba2ed02b0c9a
2673 2673 | | Obsfate: rewritten using rebase as 10:eceed8f98ffc
2674 2674 | x 4a004186e638
2675 2675 |/ Obsfate: rewritten using amend as 8:b18bc8331526
2676 2676 | Obsfate: rewritten using amend as 9:0b997eb7ceee
2677 2677 * dd800401bd8c
2678 2678 |
2679 2679 | @ 9bd10a0775e4
2680 2680 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a
2681 2681 o f897c6137566
2682 2682 |
2683 2683 | x 0dec01379d3b
2684 2684 | | Obsfate: rewritten as 3:f897c6137566
2685 2685 | | Obsfate: rewritten as 1:471f378eab4c
2686 2686 | x 471f378eab4c
2687 2687 |/ Obsfate: rewritten as 2:0dec01379d3b
2688 2688 o ea207398892e
2689 2689
2690 2690 $ hg fatelogkw --hidden -v
2691 2691 * eceed8f98ffc
2692 2692 |
2693 2693 | * 0b997eb7ceee
2694 2694 | |
2695 2695 * | b18bc8331526
2696 2696 |/
2697 2697 | x ba2ed02b0c9a
2698 2698 | | Obsfate: rewritten using rebase as 10:eceed8f98ffc by test (at 1970-01-01 00:00 +0000)
2699 2699 | x 4a004186e638
2700 2700 |/ Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000)
2701 2701 | Obsfate: rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000)
2702 2702 * dd800401bd8c
2703 2703 |
2704 2704 | @ 9bd10a0775e4
2705 2705 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a by test (at 1970-01-01 00:00 +0000)
2706 2706 o f897c6137566
2707 2707 |
2708 2708 | x 0dec01379d3b
2709 2709 | | Obsfate: rewritten as 3:f897c6137566 by test (at 1970-01-01 00:00 +0000)
2710 2710 | | Obsfate: rewritten as 1:471f378eab4c by test (at 1970-01-01 00:00 +0000)
2711 2711 | x 471f378eab4c
2712 2712 |/ Obsfate: rewritten as 2:0dec01379d3b by test (at 1970-01-01 00:00 +0000)
2713 2713 o ea207398892e
2714 2714
2715 2715 $ hg log -G -T "default" --hidden
2716 2716 * changeset: 10:eceed8f98ffc
2717 2717 | tag: tip
2718 2718 | parent: 8:b18bc8331526
2719 2719 | user: test
2720 2720 | date: Thu Jan 01 00:00:00 1970 +0000
2721 2721 | instability: content-divergent
2722 2722 | summary: Add A,B,C
2723 2723 |
2724 2724 | * changeset: 9:0b997eb7ceee
2725 2725 | | parent: 5:dd800401bd8c
2726 2726 | | user: test
2727 2727 | | date: Thu Jan 01 00:00:00 1970 +0000
2728 2728 | | instability: content-divergent
2729 2729 | | summary: Add B only
2730 2730 | |
2731 2731 * | changeset: 8:b18bc8331526
2732 2732 |/ parent: 5:dd800401bd8c
2733 2733 | user: test
2734 2734 | date: Thu Jan 01 00:00:00 1970 +0000
2735 2735 | instability: content-divergent
2736 2736 | summary: Add only B
2737 2737 |
2738 2738 | x changeset: 7:ba2ed02b0c9a
2739 2739 | | user: test
2740 2740 | | date: Thu Jan 01 00:00:00 1970 +0000
2741 2741 | | obsolete: rewritten using rebase as 10:eceed8f98ffc
2742 2742 | | summary: Add A,B,C
2743 2743 | |
2744 2744 | x changeset: 6:4a004186e638
2745 2745 |/ user: test
2746 2746 | date: Thu Jan 01 00:00:00 1970 +0000
2747 2747 | obsolete: rewritten using amend as 8:b18bc8331526
2748 2748 | obsolete: rewritten using amend as 9:0b997eb7ceee
2749 2749 | summary: Add A,B,C
2750 2750 |
2751 2751 * changeset: 5:dd800401bd8c
2752 2752 | parent: 3:f897c6137566
2753 2753 | user: test
2754 2754 | date: Thu Jan 01 00:00:00 1970 +0000
2755 2755 | instability: content-divergent
2756 2756 | summary: Add A,B,C
2757 2757 |
2758 2758 | @ changeset: 4:9bd10a0775e4
2759 2759 |/ user: test
2760 2760 | date: Thu Jan 01 00:00:00 1970 +0000
2761 2761 | obsolete: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a
2762 2762 | summary: Add A,B,C
2763 2763 |
2764 2764 o changeset: 3:f897c6137566
2765 2765 | parent: 0:ea207398892e
2766 2766 | user: test
2767 2767 | date: Thu Jan 01 00:00:00 1970 +0000
2768 2768 | summary: C0
2769 2769 |
2770 2770 | x changeset: 2:0dec01379d3b
2771 2771 | | user: test
2772 2772 | | date: Thu Jan 01 00:00:00 1970 +0000
2773 2773 | | obsolete: rewritten as 3:f897c6137566
2774 2774 | | obsolete: rewritten as 1:471f378eab4c
2775 2775 | | summary: B0
2776 2776 | |
2777 2777 | x changeset: 1:471f378eab4c
2778 2778 |/ user: test
2779 2779 | date: Thu Jan 01 00:00:00 1970 +0000
2780 2780 | obsolete: rewritten as 2:0dec01379d3b
2781 2781 | summary: A0
2782 2782 |
2783 2783 o changeset: 0:ea207398892e
2784 2784 user: test
2785 2785 date: Thu Jan 01 00:00:00 1970 +0000
2786 2786 summary: ROOT
2787 2787
2788 2788
2789 2789 Test templates with pruned commits
2790 2790 ==================================
2791 2791
2792 2792 Test setup
2793 2793 ----------
2794 2794
2795 2795 $ hg init $TESTTMP/templates-local-prune
2796 2796 $ cd $TESTTMP/templates-local-prune
2797 2797 $ mkcommit ROOT
2798 2798 $ mkcommit A0
2799 2799 $ hg debugobsolete --record-parent `getid "."`
2800 2800 1 new obsolescence markers
2801 2801 obsoleted 1 changesets
2802 2802
2803 2803 Check output
2804 2804 ------------
2805 2805
2806 2806 $ hg up "desc(A0)" --hidden
2807 2807 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2808 2808 $ hg tlog
2809 2809 @ 471f378eab4c
2810 2810 | Predecessors:
2811 2811 | semi-colon:
2812 2812 | json: []
2813 2813 | map:
2814 2814 | Successors:
2815 2815 | multi-line:
2816 2816 | json: []
2817 2817 o ea207398892e
2818 2818 Predecessors:
2819 2819 semi-colon:
2820 2820 json: []
2821 2821 map:
2822 2822 Successors:
2823 2823 multi-line:
2824 json: ""
2824 json: []
2825 2825 $ hg fatelog
2826 2826 @ 471f378eab4c
2827 2827 | Obsfate: pruned by test (at 1970-01-01 00:00 +0000);
2828 2828 o ea207398892e
2829 2829
2830 2830 Test templates with multiple pruned commits
2831 2831 ===========================================
2832 2832
2833 2833 Test setup
2834 2834 ----------
2835 2835
2836 2836 $ hg init $TESTTMP/multiple-local-prune
2837 2837 $ cd $TESTTMP/multiple-local-prune
2838 2838 $ mkcommit ROOT
2839 2839 $ mkcommit A0
2840 2840 $ hg commit --amend -m "A1"
2841 2841 $ hg debugobsolete --record-parent `getid "."`
2842 2842 1 new obsolescence markers
2843 2843 obsoleted 1 changesets
2844 2844
2845 2845 $ hg up -r "desc(A0)" --hidden
2846 2846 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2847 2847 updated to hidden changeset 471f378eab4c
2848 2848 (hidden revision '471f378eab4c' is pruned)
2849 2849 $ hg commit --amend -m "A2"
2850 2850 $ hg debugobsolete --record-parent `getid "."`
2851 2851 1 new obsolescence markers
2852 2852 obsoleted 1 changesets
2853 2853
2854 2854 Check output
2855 2855 ------------
2856 2856
2857 2857 $ hg up "desc(A0)" --hidden
2858 2858 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2859 2859 updated to hidden changeset 471f378eab4c
2860 2860 (hidden revision '471f378eab4c' is pruned)
2861 2861 $ hg tlog
2862 2862 @ 471f378eab4c
2863 2863 | Predecessors:
2864 2864 | semi-colon:
2865 2865 | json: []
2866 2866 | map:
2867 2867 | Successors:
2868 2868 | multi-line:
2869 2869 | json: []
2870 2870 o ea207398892e
2871 2871 Predecessors:
2872 2872 semi-colon:
2873 2873 json: []
2874 2874 map:
2875 2875 Successors:
2876 2876 multi-line:
2877 json: ""
2877 json: []
2878 2878
2879 2879 # todo: the obsfate output is not ideal
2880 2880 $ hg fatelog
2881 2881 @ 471f378eab4c
2882 2882 | Obsfate: pruned;
2883 2883 o ea207398892e
2884 2884
2885 2885 $ hg fatelog --hidden
2886 2886 x 65b757b745b9
2887 2887 | Obsfate: pruned by test (at 1970-01-01 00:00 +0000);
2888 2888 | x fdf9bde5129a
2889 2889 |/ Obsfate: pruned by test (at 1970-01-01 00:00 +0000);
2890 2890 | @ 471f378eab4c
2891 2891 |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +0000); rewritten using amend as 3:65b757b745b9 by test (at 1970-01-01 00:00 +0000);
2892 2892 o ea207398892e
2893 2893
2894 2894 Check other fatelog implementations
2895 2895 -----------------------------------
2896 2896
2897 2897 $ hg fatelogkw --hidden -q
2898 2898 x 65b757b745b9
2899 2899 | Obsfate: pruned
2900 2900 | x fdf9bde5129a
2901 2901 |/ Obsfate: pruned
2902 2902 | @ 471f378eab4c
2903 2903 |/ Obsfate: rewritten using amend as 2:fdf9bde5129a
2904 2904 | Obsfate: rewritten using amend as 3:65b757b745b9
2905 2905 o ea207398892e
2906 2906
2907 2907 $ hg fatelogkw --hidden
2908 2908 x 65b757b745b9
2909 2909 | Obsfate: pruned
2910 2910 | x fdf9bde5129a
2911 2911 |/ Obsfate: pruned
2912 2912 | @ 471f378eab4c
2913 2913 |/ Obsfate: rewritten using amend as 2:fdf9bde5129a
2914 2914 | Obsfate: rewritten using amend as 3:65b757b745b9
2915 2915 o ea207398892e
2916 2916
2917 2917 $ hg fatelogkw --hidden -v
2918 2918 x 65b757b745b9
2919 2919 | Obsfate: pruned by test (at 1970-01-01 00:00 +0000)
2920 2920 | x fdf9bde5129a
2921 2921 |/ Obsfate: pruned by test (at 1970-01-01 00:00 +0000)
2922 2922 | @ 471f378eab4c
2923 2923 |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +0000)
2924 2924 | Obsfate: rewritten using amend as 3:65b757b745b9 by test (at 1970-01-01 00:00 +0000)
2925 2925 o ea207398892e
2926 2926
2927 2927
2928 2928 $ hg log -G -T "default" --hidden
2929 2929 x changeset: 3:65b757b745b9
2930 2930 | tag: tip
2931 2931 | parent: 0:ea207398892e
2932 2932 | user: test
2933 2933 | date: Thu Jan 01 00:00:00 1970 +0000
2934 2934 | obsolete: pruned
2935 2935 | summary: A2
2936 2936 |
2937 2937 | x changeset: 2:fdf9bde5129a
2938 2938 |/ parent: 0:ea207398892e
2939 2939 | user: test
2940 2940 | date: Thu Jan 01 00:00:00 1970 +0000
2941 2941 | obsolete: pruned
2942 2942 | summary: A1
2943 2943 |
2944 2944 | @ changeset: 1:471f378eab4c
2945 2945 |/ user: test
2946 2946 | date: Thu Jan 01 00:00:00 1970 +0000
2947 2947 | obsolete: rewritten using amend as 2:fdf9bde5129a
2948 2948 | obsolete: rewritten using amend as 3:65b757b745b9
2949 2949 | summary: A0
2950 2950 |
2951 2951 o changeset: 0:ea207398892e
2952 2952 user: test
2953 2953 date: Thu Jan 01 00:00:00 1970 +0000
2954 2954 summary: ROOT
2955 2955
2956 2956 Check that {negrev} shows usable negative revisions despite hidden commits
2957 2957
2958 2958 $ hg log -G -T "{negrev}\n"
2959 2959 @ -3
2960 2960 |
2961 2961 o -4
2962 2962
2963 2963
2964 2964 $ hg log -G -T "{negrev}\n" --hidden
2965 2965 x -1
2966 2966 |
2967 2967 | x -2
2968 2968 |/
2969 2969 | @ -3
2970 2970 |/
2971 2971 o -4
2972 2972
2973 2973
2974 2974 Test templates with splitted and pruned commit
2975 2975 ==============================================
2976 2976
2977 2977 $ hg init $TESTTMP/templates-local-split-prune
2978 2978 $ cd $TESTTMP/templates-local-split-prune
2979 2979 $ mkcommit ROOT
2980 2980 $ echo 42 >> a
2981 2981 $ echo 43 >> b
2982 2982 $ hg commit -A -m "A0"
2983 2983 adding a
2984 2984 adding b
2985 2985 $ hg log --hidden -G
2986 2986 @ changeset: 1:471597cad322
2987 2987 | tag: tip
2988 2988 | user: test
2989 2989 | date: Thu Jan 01 00:00:00 1970 +0000
2990 2990 | summary: A0
2991 2991 |
2992 2992 o changeset: 0:ea207398892e
2993 2993 user: test
2994 2994 date: Thu Jan 01 00:00:00 1970 +0000
2995 2995 summary: ROOT
2996 2996
2997 2997 # Simulate split
2998 2998 $ hg up -r "desc(ROOT)"
2999 2999 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
3000 3000 $ echo 42 >> a
3001 3001 $ hg commit -A -m "A1"
3002 3002 adding a
3003 3003 created new head
3004 3004 $ echo 43 >> b
3005 3005 $ hg commit -A -m "A2"
3006 3006 adding b
3007 3007 $ hg debugobsolete `getid "1"` `getid "2"` `getid "3"`
3008 3008 1 new obsolescence markers
3009 3009 obsoleted 1 changesets
3010 3010
3011 3011 # Simulate prune
3012 3012 $ hg debugobsolete --record-parent `getid "."`
3013 3013 1 new obsolescence markers
3014 3014 obsoleted 1 changesets
3015 3015
3016 3016 $ hg log --hidden -G
3017 3017 @ changeset: 3:0d0ef4bdf70e
3018 3018 | tag: tip
3019 3019 | user: test
3020 3020 | date: Thu Jan 01 00:00:00 1970 +0000
3021 3021 | obsolete: pruned
3022 3022 | summary: A2
3023 3023 |
3024 3024 o changeset: 2:617adc3a144c
3025 3025 | parent: 0:ea207398892e
3026 3026 | user: test
3027 3027 | date: Thu Jan 01 00:00:00 1970 +0000
3028 3028 | summary: A1
3029 3029 |
3030 3030 | x changeset: 1:471597cad322
3031 3031 |/ user: test
3032 3032 | date: Thu Jan 01 00:00:00 1970 +0000
3033 3033 | obsolete: split as 2:617adc3a144c, 3:0d0ef4bdf70e
3034 3034 | summary: A0
3035 3035 |
3036 3036 o changeset: 0:ea207398892e
3037 3037 user: test
3038 3038 date: Thu Jan 01 00:00:00 1970 +0000
3039 3039 summary: ROOT
3040 3040
3041 3041 Check templates
3042 3042 ---------------
3043 3043
3044 3044 $ hg up 'desc("A0")' --hidden
3045 3045 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
3046 3046 updated to hidden changeset 471597cad322
3047 3047 (hidden revision '471597cad322' was rewritten as: 617adc3a144c)
3048 3048
3049 3049 # todo: the obsfate output is not ideal
3050 3050 $ hg fatelog
3051 3051 o 617adc3a144c
3052 3052 |
3053 3053 | @ 471597cad322
3054 3054 |/ Obsfate: rewritten as 2:617adc3a144c by test (at 1970-01-01 00:00 +0000);
3055 3055 o ea207398892e
3056 3056
3057 3057 $ hg up -r 'desc("A2")' --hidden
3058 3058 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
3059 3059 updated to hidden changeset 0d0ef4bdf70e
3060 3060 (hidden revision '0d0ef4bdf70e' is pruned)
3061 3061
3062 3062 $ hg fatelog --hidden
3063 3063 @ 0d0ef4bdf70e
3064 3064 | Obsfate: pruned by test (at 1970-01-01 00:00 +0000);
3065 3065 o 617adc3a144c
3066 3066 |
3067 3067 | x 471597cad322
3068 3068 |/ Obsfate: split as 2:617adc3a144c, 3:0d0ef4bdf70e by test (at 1970-01-01 00:00 +0000);
3069 3069 o ea207398892e
3070 3070
3071 3071
3072 3072 Check other fatelog implementations
3073 3073 -----------------------------------
3074 3074
3075 3075 $ hg fatelogkw --hidden -q
3076 3076 @ 0d0ef4bdf70e
3077 3077 | Obsfate: pruned
3078 3078 o 617adc3a144c
3079 3079 |
3080 3080 | x 471597cad322
3081 3081 |/ Obsfate: split as 2:617adc3a144c, 3:0d0ef4bdf70e
3082 3082 o ea207398892e
3083 3083
3084 3084 $ hg fatelogkw --hidden
3085 3085 @ 0d0ef4bdf70e
3086 3086 | Obsfate: pruned
3087 3087 o 617adc3a144c
3088 3088 |
3089 3089 | x 471597cad322
3090 3090 |/ Obsfate: split as 2:617adc3a144c, 3:0d0ef4bdf70e
3091 3091 o ea207398892e
3092 3092
3093 3093 $ hg fatelogkw --hidden -v
3094 3094 @ 0d0ef4bdf70e
3095 3095 | Obsfate: pruned by test (at 1970-01-01 00:00 +0000)
3096 3096 o 617adc3a144c
3097 3097 |
3098 3098 | x 471597cad322
3099 3099 |/ Obsfate: split as 2:617adc3a144c, 3:0d0ef4bdf70e by test (at 1970-01-01 00:00 +0000)
3100 3100 o ea207398892e
3101 3101
3102 3102 $ hg log -G -T "default" --hidden
3103 3103 @ changeset: 3:0d0ef4bdf70e
3104 3104 | tag: tip
3105 3105 | user: test
3106 3106 | date: Thu Jan 01 00:00:00 1970 +0000
3107 3107 | obsolete: pruned
3108 3108 | summary: A2
3109 3109 |
3110 3110 o changeset: 2:617adc3a144c
3111 3111 | parent: 0:ea207398892e
3112 3112 | user: test
3113 3113 | date: Thu Jan 01 00:00:00 1970 +0000
3114 3114 | summary: A1
3115 3115 |
3116 3116 | x changeset: 1:471597cad322
3117 3117 |/ user: test
3118 3118 | date: Thu Jan 01 00:00:00 1970 +0000
3119 3119 | obsolete: split as 2:617adc3a144c, 3:0d0ef4bdf70e
3120 3120 | summary: A0
3121 3121 |
3122 3122 o changeset: 0:ea207398892e
3123 3123 user: test
3124 3124 date: Thu Jan 01 00:00:00 1970 +0000
3125 3125 summary: ROOT
3126 3126
3127 3127
3128 3128 Test metadata encoding (issue5754)
3129 3129 ==================================
3130 3130
3131 3131 $ hg init $TESTTMP/metadata-encoding
3132 3132 $ cd $TESTTMP/metadata-encoding
3133 3133 $ cat <<'EOF' >> .hg/hgrc
3134 3134 > [extensions]
3135 3135 > amend =
3136 3136 > EOF
3137 3137 $ "$PYTHON" <<'EOF'
3138 3138 > with open('test1', 'wb') as f:
3139 3139 > f.write(b't\xe8st1') and None
3140 3140 > with open('test2', 'wb') as f:
3141 3141 > f.write(b't\xe8st2') and None
3142 3142 > EOF
3143 3143 $ mkcommit ROOT
3144 3144 $ ( HGENCODING=latin-1 HGUSER="`cat test1`" mkcommit A0 )
3145 3145 $ echo 42 >> A0
3146 3146 $ HGENCODING=latin-1 hg amend -m "A1" --note "`cat test2`"
3147 3147 $ HGENCODING=latin-1 hg amend -m "A2" \
3148 3148 > --config devel.user.obsmarker="`cat test2`"
3149 3149 $ mkcommit B0
3150 3150 $ HGENCODING=latin-1 hg debugobsolete -u "`cat test2`" "`getid 'desc(B0)'`"
3151 3151 1 new obsolescence markers
3152 3152 obsoleted 1 changesets
3153 3153
3154 3154 metadata should be stored in UTF-8, and debugobsolete doesn't decode it to
3155 3155 local encoding since the command is supposed to show unmodified content:
3156 3156
3157 3157 $ HGENCODING=latin-1 hg debugobsolete
3158 3158 5f66a482f0bb2fcaccfc215554ad5eb9f40b50f5 718c0d00cee1429bdb73064e0d88908c601507a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'note': 't\xc3\xa8st2', 'operation': 'amend', 'user': 'test'}
3159 3159 718c0d00cee1429bdb73064e0d88908c601507a8 1132562159b35bb27e1d6b80c80ee94a1659a4da 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 't\xc3\xa8st2'}
3160 3160 8f82db6f991db367fdbb3b6dba5e187ecc3ebd96 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 't\xc3\xa8st2'}
3161 3161
3162 3162 metadata should be converted back to local encoding when displaying:
3163 3163
3164 3164 $ HGENCODING=latin-1 hg fatelog --hidden
3165 3165 @ 8f82db6f991d
3166 3166 | Obsfate: pruned by t\xe8st2 (at 1970-01-01 00:00 +0000); (esc)
3167 3167 o 1132562159b3
3168 3168 |
3169 3169 | x 718c0d00cee1
3170 3170 |/ Obsfate: rewritten using amend as 3:1132562159b3 by t\xe8st2 (at 1970-01-01 00:00 +0000); (esc)
3171 3171 | x 5f66a482f0bb
3172 3172 |/ Obsfate: rewritten using amend as 2:718c0d00cee1 by test (at 1970-01-01 00:00 +0000);
3173 3173 o ea207398892e
3174 3174
3175 3175 $ HGENCODING=utf-8 hg fatelog --hidden
3176 3176 @ 8f82db6f991d
3177 3177 | Obsfate: pruned by t\xc3\xa8st2 (at 1970-01-01 00:00 +0000); (esc)
3178 3178 o 1132562159b3
3179 3179 |
3180 3180 | x 718c0d00cee1
3181 3181 |/ Obsfate: rewritten using amend as 3:1132562159b3 by t\xc3\xa8st2 (at 1970-01-01 00:00 +0000); (esc)
3182 3182 | x 5f66a482f0bb
3183 3183 |/ Obsfate: rewritten using amend as 2:718c0d00cee1 by test (at 1970-01-01 00:00 +0000);
3184 3184 o ea207398892e
3185 3185
3186 3186 $ hg log -G -T "{negrev}\n"
3187 3187 @ -1
3188 3188 |
3189 3189 o -2
3190 3190 |
3191 3191 o -5
3192 3192
General Comments 0
You need to be logged in to leave comments. Login now