test-compat: merge mercurial-5.1 into mercurial-5.0 draft mercurial-5.0
authorAnton Shestakov <av6@dwimlabs.net>
Fri, 08 May 2020 20:36:29 +0800
branchmercurial-5.0
changeset 5364 be5aa681c122
parent 5280 90fbbc29b93a (current diff)
parent 5363 c7c37251d0e2 (diff)
child 5365 f7b4b6698e91
test-compat: merge mercurial-5.1 into mercurial-5.0
tests/test-discovery-obshashrange.t
tests/test-evolve-content-divergent-corner-cases.t
tests/test-evolve-obshistory-complex.t
tests/test-evolve-obshistory-lots-of-splits.t
tests/test-evolve-obshistory-split.t
tests/test-evolve-progress.t
tests/test-evolve-public-content-divergent-corner-cases.t
tests/test-evolve-templates.t
tests/test-pick.t
tests/test-rewind.t
tests/test-topic-stack-complex.t
tests/test-topic-stack.t
tests/test-uncommit-interactive.t
--- a/.hgtags	Wed Apr 08 01:16:54 2020 +0800
+++ b/.hgtags	Fri May 08 20:36:29 2020 +0800
@@ -85,3 +85,5 @@
 d989bab720e5f7638a9e58fda76cf3f4b40d0611 9.2.1
 ef41094c34e162eb32ef24bf66d9776d1112751a 9.2.2
 583dc6ef3eb21fbf6574021136f32b8a1163506c 9.3.0
+8d955635cf457aaa4810d77740721d4275001f74 9.3.1
+0b5d1b0b3336151bd176ced7862ec54fb9c260aa 10.0.0
--- a/CHANGELOG	Wed Apr 08 01:16:54 2020 +0800
+++ b/CHANGELOG	Fri May 08 20:36:29 2020 +0800
@@ -1,17 +1,49 @@
 Changelog
 =========
 
-9.3.1 - in progress
+10.0.0 -- 2020-05-08
+--------------------
+
+  * auto-publish: issue the capabilities in all cases
+
+  * compat: clean up old compatibility code
+  * compat: compatibility with Mercurial 5.4
+
+  * evolve: add {obsorigin}, a template keyword that works similarly to
+    {obsfate}, but shows predecessors of a changeset
+  * evolve: fix permissions of new cache files using SQLite
+  * evolve: always create commit when resolving divergence
+  * evolve: handle relocation during divergence resolution producing no changes
+  * evolve: provide cache to successorssets() in more cases
+
+  * obslog: make --all and --filternonlocal work properly with --no-graph
+  * obslog: add --origin flag to show predecessors instead of successors
+  * obslog: make --origin flag the default
+
+  * stablerangecache: sanity check subranges
+
+topic (0.18.2)
+
+  * topic: provide cache to successorssets() in one more case
+
+9.3.1 -- 2020-04-08
 -------------------
 
+  * compat: make __touch-noise__ and __rewind-hash__ extra field be bytes
+
   * obsexchange: avoid sending too large request to http server
   * obsdiscovery: server no longer aborts with a 500 error if client sends a
     request without obscommon
+  * obsdiscovery: avoid considering locally hidden changeset
+  * single-heads: ignore obsolete section when enforcing one head per branch
+
   * evolve: improved behavior when evolving above the result of a split
-  * topic: fix auto-publish=abort with server that auto-publishes bare branches
   * evolve: checking for new head on push is no longer confused by mixed
-            branches(or topics)
-  * single-heads: ignore obsolete section when enforcing one head per branch
+    branches (or topics)
+
+topic (0.18.1)
+
+  * topic: fix auto-publish=abort with server that auto-publishes bare branches
 
 9.3.0 -- 2020-03-04
 -------------------
--- a/MANIFEST.in	Wed Apr 08 01:16:54 2020 +0800
+++ b/MANIFEST.in	Fri May 08 20:36:29 2020 +0800
@@ -1,31 +1,11 @@
-prune contrib
-prune debian
-prune .gitlab
-prune hgext3rd/evolve/hack
-
-exclude .hg-format-source
-exclude .gitlab-ci.yml
-exclude hgext3rd/evolve/legacy.py
-exclude Makefile
-exclude tests/test-drop.t
-exclude tests/test-inhibit.t
-exclude tests/test-oldconvert.t
 include CHANGELOG
 include COPYING
-include hgext3rd/__init__.py
-include hgext3rd/evolve/*.py
-include hgext3rd/evolve/thirdparty/*.py
-include hgext3rd/topic/*.py
 include hgext3rd/topic/README
 include MANIFEST.in
 include README
 include setup.py
-include tests/*.py
-include tests/*.sh
-include tests/testlib/*.sh
-include tests/*.t
+recursive-include tests *.py *.sh *.t
 
-exclude docs/tutorial/.netlify
 include docs/makefile
 include docs/*.py
 include docs/README
@@ -35,3 +15,17 @@
 include docs/tutorial/standalone.html
 recursive-include docs/figures *.svg *.png
 recursive-include docs/tutorial *.css *.js *.md *.py *.rst *.sh *.t
+
+exclude docs/tutorial/.netlify
+exclude .gitlab-ci.yml
+exclude ./hgext3rd/evolve/legacy.py
+exclude .hg-format-source
+exclude Makefile
+exclude tests/test-drop.t
+exclude tests/test-inhibit.t
+exclude tests/test-oldconvert.t
+
+prune contrib
+prune debian
+prune .gitlab
+prune hgext3rd/evolve/hack
--- a/README	Wed Apr 08 01:16:54 2020 +0800
+++ b/README	Fri May 08 20:36:29 2020 +0800
@@ -139,20 +139,32 @@
     $ cd tests
     $ python $HGSRC/tests/run-tests.py
 
+When certain blocks of code need to cope with API changes in core Mercurial,
+they should have comments in the ``hg <= x.y (commit hash)`` format. For
+example, if a function needs another code path because of changes introduced in
+02802fa87b74 that was first included in Mercurial 5.3, then the comment should
+be::
+
+    # hg <= 5.2 (02802fa87b74)
+
+See also tests/test-check-compat-strings.t.
+
 Branch policy
 -------------
 
-The evolve test are highly impacted by changes in core. To deal with this, we use named branches.
+The evolve tests are highly impacted by changes in core. To deal with this, we
+use named branches.
 
-There are two main branches: "stable" and "default". Tests on these branch are
-supposed to pass with the corresponding "default" and "stable" branch from core
-Mercurial. The documentation is built from the tip of stable.
+There are two main branches: "stable" and "default". Tests on these branches
+are supposed to pass with the corresponding "default" and "stable" branch from
+core Mercurial. The documentation is built from the tip of stable.
 
-In addition, we have compatibility branches to check tests on older version of
+In addition, we have compatibility branches to check tests on older versions of
 Mercurial. They are the "mercurial-x.y" branches. They are used to apply
-expected test change only, no code change should happen there.
+expected test changes only, no code changes should happen there.
 
-test output change from a changeset in core should adds the following line to their description:
+Test output changes from a changeset in core should add the following line to
+their patch description:
 
 CORE-TEST-OUTPUT-UPDATE: <CORE-NODE-ID>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/check-compat-strings.sh	Fri May 08 20:36:29 2020 +0800
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+unset GREP_OPTIONS
+
+# This script finds compatibility-related comments with a node hash specified
+# in all files in a given directory (. by default) and looks up the hash in a
+# repo (~/hg by default) to determine if each of the comments is correct and,
+# if not, it suggests the correct release. This can prevent accidentally
+# removing a piece of code that was misattributed to a different (earlier)
+# release of core hg.
+
+# Usage: $0 WDIR HGREPO where WDIR is usually evolve/hgext3rd/ and HGREPO is
+# the place with core Mercurial repo (not just checkout). Said repo has to be
+# sufficiently up-to-date, otherwise this script may not work correctly.
+
+workdir=${1:-'.'}
+hgdir=${2:-~/hg}
+grep -Ern 'hg <= [0-9.]+ \([0-9a-f+]+\)' "$workdir" | while read -r line; do
+    bashre='hg <= ([0-9.]+) \(([0-9a-f+]+)\)'
+    if [[ $line =~ $bashre ]]; then
+        expected=${BASH_REMATCH[1]}
+        revset=${BASH_REMATCH[2]}
+        tagrevset="max(tag('re:^[0-9]\\.[0-9]$') - ($revset)::)"
+        lastrel=$(HGPLAIN=1 hg --cwd "$hgdir" log -r "$tagrevset" -T '{tags}')
+        if [[ "$lastrel" != "$expected" ]]; then
+            echo "$line"
+            echo "actual last major release without $revset is $lastrel"
+            echo
+        fi
+    fi
+done
--- a/debian/changelog	Wed Apr 08 01:16:54 2020 +0800
+++ b/debian/changelog	Fri May 08 20:36:29 2020 +0800
@@ -1,3 +1,21 @@
+mercurial-evolve (10.0.0-1) unstable; urgency=medium
+
+  * new upstream release
+
+ -- Anton Shestakov <av6@dwimlabs.net>  Fri, 08 May 2020 18:33:58 +0800
+
+mercurial-evolve (9.3.1-2) unstable; urgency=medium
+
+  * update minimum required version of mercurial in debian/control
+
+ -- Anton Shestakov <av6@dwimlabs.net>  Thu, 16 Apr 2020 18:30:35 +0800
+
+mercurial-evolve (9.3.1-1) unstable; urgency=medium
+
+  * new upstream release
+
+ -- Anton Shestakov <av6@dwimlabs.net>  Wed, 08 Apr 2020 21:04:59 +0800
+
 mercurial-evolve (9.3.0-1) unstable; urgency=medium
 
   * new upstream release
--- a/debian/control	Wed Apr 08 01:16:54 2020 +0800
+++ b/debian/control	Fri May 08 20:36:29 2020 +0800
@@ -7,7 +7,7 @@
  Pierre-Yves David <pierre-yves.david@logilab.fr>,
 Standards-Version: 3.9.3
 Build-Depends:
- mercurial (>= 4.5),
+ mercurial (>= 4.6),
  python,
  python3,
  debhelper (>= 10),
@@ -28,7 +28,7 @@
  ${python3:Depends},
  ${misc:Depends},
  ${sphinxdoc:Depends},
- mercurial (>= 4.5),
+ mercurial (>= 4.6),
 Built-Using: ${sphinxdoc:Built-Using}
 Description: evolve extension for Mercurial
  This package provides the experimental "evolve" extension for the Mercurial
--- a/hgext3rd/evolve/__init__.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/__init__.py	Fri May 08 20:36:29 2020 +0800
@@ -33,7 +33,7 @@
 backported to older version of Mercurial by this extension. Some older
 experimental protocol are also supported for a longer time in the extensions to
 help people transitioning. (The extensions is currently compatible down to
-Mercurial version 4.4).
+Mercurial version 4.6).
 
 New Config::
 
@@ -269,14 +269,12 @@
     bookmarks as bookmarksmod,
     cmdutil,
     commands,
-    context,
-    dirstate,
     error,
     help,
     hg,
     lock as lockmod,
+    logcmdutil,
     node,
-    patch,
     pycompat,
     revset,
     scmutil,
@@ -361,29 +359,6 @@
 eh.configitem(b'experimental', b'evolution.allnewcommands', None)
 eh.configitem(b'experimental', b'prunestrip', False)
 
-# pre hg 4.0 compat
-
-if not util.safehasattr(dirstate.dirstate, 'parentchange'):
-    import contextlib
-
-    @contextlib.contextmanager
-    def parentchange(self):
-        '''Context manager for handling dirstate parents.
-
-        If an exception occurs in the scope of the context manager,
-        the incoherent dirstate won't be written when wlock is
-        released.
-        '''
-        self._parentwriters += 1
-        yield
-        # Typically we want the "undo" step of a context manager in a
-        # finally block so it happens even when an exception
-        # occurs. In this case, however, we only want to decrement
-        # parentwriters if the code in the with statement exits
-        # normally, so we don't have a try/finally here on purpose.
-        self._parentwriters -= 1
-    dirstate.dirstate.parentchange = parentchange
-
 #####################################################################
 ### Option configuration                                          ###
 #####################################################################
@@ -723,38 +698,6 @@
 
     ui.warn(b"(%s)\n" % solvemsg)
 
-if util.safehasattr(context, '_filterederror'): # <= hg-4.5
-    @eh.wrapfunction(context, '_filterederror')
-    def evolve_filtererror(original, repo, changeid):
-        """build an exception to be raised about a filtered changeid
-
-        This is extracted in a function to help extensions (eg: evolve) to
-        experiment with various message variants."""
-        if repo.filtername.startswith(b'visible'):
-
-            unfilteredrepo = repo.unfiltered()
-            rev = repo[scmutil.revsingle(unfilteredrepo, changeid)]
-            reason, successors = obshistory._getobsfateandsuccs(unfilteredrepo, rev.node())
-
-            # Be more precise in case the revision is superseded
-            if reason == b'superseded':
-                reason = _(b"successor: %s") % successors[0]
-            elif reason == b'superseded_split':
-                if len(successors) <= 2:
-                    reason = _(b"successors: %s") % b", ".join(successors)
-                else:
-                    firstsuccessors = b", ".join(successors[:2])
-                    remainingnumber = len(successors) - 2
-                    successorsmsg = _(b"%s and %d more") % (firstsuccessors, remainingnumber)
-                    reason = _(b"successors: %s") % successorsmsg
-
-            msg = _(b"hidden revision '%s'") % changeid
-            hint = _(b'use --hidden to access hidden revisions; %s') % reason
-            return error.FilteredRepoLookupError(msg, hint=hint)
-        msg = _(b"filtered revision '%s' (not in '%s' subset)")
-        msg %= (changeid, repo.filtername)
-        return error.FilteredRepoLookupError(msg)
-
 @eh.wrapcommand(b"update")
 @eh.wrapcommand(b"pull")
 def wrapmayobsoletewc(origfn, ui, repo, *args, **opts):
@@ -827,21 +770,8 @@
 @eh.wrapfunction(mercurial.cmdutil, 'tryimportone')
 def tryimportone(orig, ui, repo, hunk, parents, opts, *args, **kwargs):
     expected = {b'node': None}
-    if not util.safehasattr(hunk, 'get'): # hg < 4.6
-        oldextract = patch.extract
-
-        def extract(*args, **kwargs):
-            ret = oldextract(*args, **kwargs)
-            _getnodefrompatch(ret, expected)
-            return ret
-        try:
-            patch.extract = extract
-            ret = orig(ui, repo, hunk, parents, opts, *args, **kwargs)
-        finally:
-            patch.extract = oldextract
-    else:
-        _getnodefrompatch(hunk, expected)
-        ret = orig(ui, repo, hunk, parents, opts, *args, **kwargs)
+    _getnodefrompatch(hunk, expected)
+    ret = orig(ui, repo, hunk, parents, opts, *args, **kwargs)
     created = ret[1]
     if (opts[b'obsolete'] and None not in (created, expected[b'node'])
         and created != expected[b'node']):
@@ -1019,7 +949,8 @@
         if topic and hastopic:
             template = utility.stacktemplate
 
-        displayer = compat.changesetdisplayer(ui, repo, {b'template': template})
+        displayer = logcmdutil.changesetdisplayer(ui, repo,
+                                                  {b'template': template})
 
         target, bookmark = _findprevtarget(repo, displayer,
                                            opts.get('move_bookmark'), topic)
@@ -1077,7 +1008,8 @@
             children = [ctx for ctx in children if ctx not in filtered]
             template = utility.stacktemplate
             opts['stacktemplate'] = True
-        displayer = compat.changesetdisplayer(ui, repo, {b'template': template})
+        displayer = logcmdutil.changesetdisplayer(ui, repo,
+                                                  {b'template': template})
 
         # check if we need to evolve while updating to the next child revision
         needevolve = False
@@ -1376,7 +1308,7 @@
         statemod.addunfinished(b'pick', fname=b'pickstate', continueflag=True,
                                abortfunc=cmdrewrite.hgabortpick)
     else:
-        # compat <= hg-5.0 (5f2f6912c9e6)
+        # hg <= 5.0 (5f2f6912c9e6)
         estate = (b'evolvestate', False, False, _(b'evolve in progress'),
                   _(b"use 'hg evolve --continue' or 'hg evolve --abort' to abort"))
         cmdutil.unfinishedstates.append(estate)
--- a/hgext3rd/evolve/cmdrewrite.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/cmdrewrite.py	Fri May 08 20:36:29 2020 +0800
@@ -11,7 +11,6 @@
 
 from __future__ import absolute_import
 
-import contextlib
 import random
 
 from mercurial import (
@@ -23,6 +22,7 @@
     error,
     hg,
     lock as lockmod,
+    logcmdutil,
     merge,
     node,
     obsolete,
@@ -33,6 +33,8 @@
     util,
 )
 
+from mercurial.utils import dateutil
+
 from mercurial.i18n import _
 
 from . import (
@@ -74,7 +76,7 @@
     """
     # N.B. this is extremely similar to setupheaderopts() in mq.py
     if not opts.get('date') and opts.get('current_date'):
-        opts['date'] = b'%d %d' % compat.makedate()
+        opts['date'] = b'%d %d' % dateutil.makedate()
     if not opts.get('user') and opts.get('current_user'):
         opts['user'] = ui.username()
 
@@ -216,14 +218,7 @@
 def _writepatch(ui, repo, old, fp):
     """utility function to use filestore and patchrepo to apply a patch to the
     repository with metadata being extracted from the patch"""
-    metadata = patch.extract(ui, fp)
-    if util.safehasattr(metadata, 'get'): # < hg-4.6
-        @contextlib.contextmanager
-        def patchcontext():
-            yield metadata
-        patchcontext = patchcontext()
-    else:
-        patchcontext = metadata
+    patchcontext = patch.extract(ui, fp)
     pold = old.p1()
 
     with patchcontext as metadata:
@@ -267,7 +262,7 @@
     fp.write(b"# HG changeset patch\n")
     fp.write(b"# User %s\n" % ctx.user())
     fp.write(b"# Date %d %d\n" % ctx.date())
-    fp.write(b"#      %s\n" % compat.datestr(ctx.date()))
+    fp.write(b"#      %s\n" % dateutil.datestr(ctx.date()))
     if branch and branch != b'default':
         fp.write(b"# Branch %s\n" % branch)
     fp.write(b"# Node ID %s\n" % node.hex(nodeval))
@@ -525,7 +520,8 @@
             try:
                 uipathfn = scmutil.getuipathfn(repo)
             except AttributeError:
-                uipathfn = match.rel   # <= 4.9
+                # hg <= 4.9 (e6ec0737b706)
+                uipathfn = match.rel
 
             for f in sorted(badfiles):
                 if f in s.clean:
@@ -970,7 +966,7 @@
     date = opts.get('date')
     user = opts.get('user')
     if date:
-        metadata[b'date'] = b'%i %i' % compat.parsedate(date)
+        metadata[b'date'] = b'%i %i' % dateutil.parsedate(date)
     if user:
         metadata[b'user'] = user
     return metadata
@@ -1395,7 +1391,7 @@
         with ui.configoverride(overrides, b'touch'):
             rewriteutil.precheck(repo, revs, b'touch')
     tmpl = utility.shorttemplate
-    displayer = compat.changesetdisplayer(ui, repo, {b'template': tmpl})
+    displayer = logcmdutil.changesetdisplayer(ui, repo, {b'template': tmpl})
     with repo.wlock(), repo.lock(), repo.transaction(b'touch'):
         touchnodes(ui, repo, revs, displayer, **opts)
 
@@ -1495,7 +1491,7 @@
             with ui.configoverride(overrides, b'pick'):
                 stats = merge.graft(repo, origctx, origctx.p1(),
                                     [b'local', b'destination'])
-            if compat.hasconflict(stats):
+            if stats.unresolvedcount:
                 pickstate.addopts({b'orignode': origctx.node(),
                                    b'oldpctx': pctx.node()})
                 pickstate.save()
--- a/hgext3rd/evolve/compat.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/compat.py	Fri May 08 20:36:29 2020 +0800
@@ -8,12 +8,10 @@
 
 import array
 import contextlib
-import inspect
 
 from mercurial import (
     context,
     copies,
-    mdiff,
     obsolete,
     pycompat,
     registrar,
@@ -22,7 +20,6 @@
     util,
     ui as uimod,
 )
-from mercurial.hgweb import hgweb_mod
 
 if pycompat.ispy3:
     arraytobytes = array.array.tobytes
@@ -31,21 +28,7 @@
     arraytobytes = array.array.tostring
     arrayfrombytes = array.array.fromstring
 
-# hg < 4.6 compat (c8e2d6ed1f9e)
-try:
-    from mercurial import logcmdutil
-    changesetdisplayer = logcmdutil.changesetdisplayer
-    changesetprinter = logcmdutil.changesetprinter
-    displaygraph = logcmdutil.displaygraph
-    changesetdiffer = logcmdutil.changesetdiffer
-except (AttributeError, ImportError):
-    from mercurial import cmdutil
-    changesetdisplayer = cmdutil.show_changeset  # pytype: disable=module-attr
-    changesetprinter = cmdutil.changeset_printer  # pytype: disable=module-attr
-    displaygraph = cmdutil.displaygraph  # pytype: disable=module-attr
-    changesetdiffer = None
-
-# hg <= 5.3 (c21aca51b392)
+# hg <= 5.2 (c21aca51b392)
 try:
     from mercurial import pathutil
     dirs = pathutil.dirs
@@ -95,96 +78,27 @@
                                   islink=b'l' in flags,
                                   isexec=b'x' in flags,
                                   copysource=copied.get(path))
-    # compat with hg <- 4.9
+    # hg <= 4.9 (550a172a603b)
     elif varnames[2] == r"changectx":
         mctx = context.memfilectx(repo, ctx, fctx.path(), fctx.data(),
                                   islink=b'l' in flags,
                                   isexec=b'x' in flags,
                                   copied=copied.get(path))  # pytype: disable=wrong-keyword-args
-    else:
-        mctx = context.memfilectx(repo, fctx.path(), fctx.data(),
-                                  islink=b'l' in flags,
-                                  isexec=b'x' in flags,
-                                  copied=copied.get(path))  # pytype: disable=wrong-keyword-args
     return mctx
 
-def strdiff(a, b, fn1, fn2):
-    """ A version of mdiff.unidiff for comparing two strings
-    """
-    args = [a, b'', b, b'', fn1, fn2]
-
-    # hg < 4.6 compat 8b6dd3922f70
-    if util.safehasattr(inspect, 'signature'):
-        signature = inspect.signature(mdiff.unidiff)
-        needsbinary = r'binary' in signature.parameters
-    else:
-        argspec = inspect.getargspec(mdiff.unidiff)
-        needsbinary = r'binary' in argspec.args
-
-    if needsbinary:
-        args.append(False)
-
-    return mdiff.unidiff(*args)
-
-# date related
-
-# hg <= 4.5 (c6061cadb400)
 try:
-    import mercurial.utils.dateutil
-    datestr = mercurial.utils.dateutil.datestr
-    makedate = mercurial.utils.dateutil.makedate
-    parsedate = mercurial.utils.dateutil.parsedate
-except ImportError:
-    import mercurial.util
-    datestr = mercurial.util.datestr  # pytype: disable=module-attr
-    makedate = mercurial.util.makedate  # pytype: disable=module-attr
-    parsedate = mercurial.util.parsedate  # pytype: disable=module-attr
-
-def wireprotocommand(exthelper, name, args=b'', permission=b'pull'):
-    try:
-        # Since b4d85bc1
-        from mercurial.wireprotov1server import wireprotocommand
-        return wireprotocommand(name, args, permission=permission)
-    except (ImportError, AttributeError):
-        from mercurial import wireproto
-
-    if 3 <= len(wireproto.wireprotocommand.func_defaults):
-        return wireproto.wireprotocommand(name, args, permission=permission)
-
-    # <= hg-4.5 permission must be registered in dictionnary
-    def decorator(func):
-        @eh.extsetup
-        def install(ui):
-            hgweb_mod.perms[name] = permission
-            wireproto.commands[name] = (func, args)
-    return decorator
-
-# mercurial <= 4.5 do not have the updateresult object
-try:
-    from mercurial.merge import updateresult
-except (ImportError, AttributeError):
-    updateresult = None
-
-# 46c2b19a1263f18a5829a21b7a5053019b0c5a31 in hg moved repair.stripbmrevset to
-# scmutil.bookmarkrevs
-# This change is a part of 4.7 cycle, so drop this when we drop support for 4.6
-try:
+    # hg <= 4.6 (46c2b19a1263)
     bmrevset = repair.stripbmrevset  # pytype: disable=module-attr
 except AttributeError:
     bmrevset = scmutil.bookmarkrevs
 
-def hasconflict(upres):
-    if updateresult is None:
-        return bool(upres[-1])
-    return bool(upres.unresolvedcount)
-
 hg48 = util.safehasattr(copies, 'stringutil')
 # code imported from Mercurial core at ae17555ef93f + patch
 def fixedcopytracing(repo, c1, c2, base):
     """A complete copy-patse of copies._fullcopytrace with a one line fix to
     handle when the base is not parent of both c1 and c2. This should be
     converted in a compat function once https://phab.mercurial-scm.org/D3896
-    gets in and once we drop support for 4.7, this should be removed."""
+    gets in and once we drop support for 4.6, this should be removed."""
 
     from mercurial import pathutil
 
@@ -205,7 +119,7 @@
     if util.safehasattr(base, 'isancestorof'):
         dirtyc1 = not base.isancestorof(_c1)
         dirtyc2 = not base.isancestorof(_c2)
-    else: # hg <= 4.6
+    else: # hg <= 4.6 (fbec9c0b32d3)
         dirtyc1 = not base.descendant(_c1)
         dirtyc2 = not base.descendant(_c2)
     graft = dirtyc1 or dirtyc2
@@ -213,7 +127,7 @@
     if graft:
         tca = _c1.ancestor(_c2)
 
-    # hg < 4.8 compat (dc50121126ae)
+    # hg <= 4.9 (dc50121126ae)
     try:
         limit = copies._findlimit(repo, c1, c2)  # pytype: disable=module-attr
     except (AttributeError, TypeError):
@@ -434,7 +348,7 @@
 
     return copy, movewithdir, diverge, renamedelete, dirmove
 
-# hg <= 4.9 compat (7694b685bb10)
+# hg <= 4.9 (7694b685bb10)
 fixupstreamed = util.safehasattr(scmutil, 'movedirstate')
 if not fixupstreamed:
     copies._fullcopytracing = fixedcopytracing
@@ -449,7 +363,7 @@
     return {'helpcategory': category}
 
 # nodemap.get and index.[has_node|rev|get_rev]
-# hg <= 5.3 (02802fa87b74)
+# hg <= 5.2 (02802fa87b74)
 def getgetrev(cl):
     """Returns index.get_rev or nodemap.get (for pre-5.3 Mercurial)."""
     if util.safehasattr(cl.index, 'get_rev'):
--- a/hgext3rd/evolve/depthcache.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/depthcache.py	Fri May 08 20:36:29 2020 +0800
@@ -16,11 +16,7 @@
     scmutil,
 )
 
-try:
-    from mercurial.utils.stringutil import forcebytestr
-except ImportError:
-    # hg <= 4.5 (f99d64e8a4e4)
-    from mercurial.util import forcebytestr
+from mercurial.utils.stringutil import forcebytestr
 
 from . import (
     compat,
--- a/hgext3rd/evolve/evolvecmd.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/evolvecmd.py	Fri May 08 20:36:29 2020 +0800
@@ -16,9 +16,10 @@
     cmdutil,
     commands,
     context,
+    encoding,
     error,
-    encoding,
     hg,
+    logcmdutil,
     merge,
     mergeutil,
     node as nodemod,
@@ -68,11 +69,11 @@
     assert tr is not None
     displayer = None
     if stacktmplt:
-        displayer = compat.changesetdisplayer(ui, repo,
-                                              {b'template': stacktemplate})
+        displayer = logcmdutil.changesetdisplayer(ui, repo,
+                                                  {b'template': stacktemplate})
     else:
-        displayer = compat.changesetdisplayer(ui, repo,
-                                              {b'template': shorttemplate})
+        displayer = logcmdutil.changesetdisplayer(ui, repo,
+                                                  {b'template': shorttemplate})
     if b'orphan' == category:
         result = _solveunstable(ui, repo, ctx, evolvestate, displayer,
                                 dryrun, confirm, progresscb,
@@ -443,6 +444,14 @@
 
     return (True, divergent, other, resolutionparent, relocatereq)
 
+def _relocatedivergent(repo, orig, dest, evolvestate):
+    """relocates a divergent commit and saves the evolve state"""
+    configoverride = repo.ui.configoverride(
+        {(b'ui', b'allowemptycommit'): b'true'}, b'evolve'
+    )
+    with state.saver(evolvestate, {b'current': orig.node()}), configoverride:
+        return _relocate(repo, orig, dest, evolvestate, keepbranch=True)
+
 def _solvedivergent(ui, repo, divergent, evolvestate, displayer, dryrun=False,
                     confirm=False, progresscb=None):
     """tries to solve content-divergence of a changeset
@@ -520,9 +529,8 @@
         evolvestate[b'relocating-div'] = True
         ui.status(_(b'rebasing "divergent" content-divergent changeset %s on'
                     b' %s\n' % (divergent, repo[succsdivp1])))
-        with state.saver(evolvestate, {b'current': divergent.node()}):
-            newdivergent = _relocate(repo, divergent, repo[succsdivp1],
-                                     evolvestate, keepbranch=True)
+        newdivergent = _relocatedivergent(repo, divergent, repo[succsdivp1],
+                                          evolvestate)
         evolvestate[b'old-divergent'] = divergent.node()
         divergent = repo[newdivergent]
         evolvestate[b'relocating-div'] = False
@@ -542,9 +550,7 @@
         evolvestate[b'relocating-other'] = True
         ui.status(_(b'rebasing "other" content-divergent changeset %s on'
                     b' %s\n' % (other, divergent.p1())))
-        with state.saver(evolvestate, {b'current': other.node()}):
-            newother = _relocate(repo, other, divergent.p1(), evolvestate,
-                                 keepbranch=True)
+        newother = _relocatedivergent(repo, other, divergent.p1(), evolvestate)
         evolvestate[b'old-other'] = other.node()
         other = repo[newother]
         evolvestate[b'relocating-other'] = False
@@ -608,7 +614,7 @@
         hg._showstats(repo, stats)
 
         # conflicts while merging content-divergent changesets
-        if compat.hasconflict(stats):
+        if stats.unresolvedcount:
             hint = _(b"see 'hg help evolve.interrupted'")
             raise error.InterventionRequired(_(b"unresolved merge conflicts"),
                                              hint=hint)
@@ -673,23 +679,26 @@
         else:
             date = max(divergent.date(), other.date())
 
-    # new node if any formed as the replacement
-    newnode = repo.commit(text=desc, user=user, date=date)
-    if newnode == divergent.node() or newnode is None:
-        # no changes
-        new = divergent
-        storemarker = True
-        repo.ui.status(_(b"nothing changed\n"))
-        hg.updaterepo(repo, divergent.rev(), False)
+    # We really want a new commit in order to avoid obsmarker cycles (otherwise
+    # divergence resolutions done in separate repos may create markers in the
+    # opposite directions). For that reason, we set ui.allowemptycommit and
+    # also add also add some salt to the commit extras to make sure we don't
+    # reuse an existing nodeid.
+    with repo.ui.configoverride(
+        {(b'ui', b'allowemptycommit'): b'true'}, b'evolve'
+    ):
+        extra = {
+            b'divergence_source_local': divergent.hex(),
+            b'divergence_source_other': other.hex()
+        }
+        newnode = repo.commit(text=desc, user=user, date=date, extra=extra)
+    new = repo[newnode]
+    hg.updaterepo(repo, new.rev(), False)
+    if haspubdiv and publicdiv == divergent:
+        bypassphase(repo, (divergent, new), operation=b'evolve')
     else:
-        new = repo[newnode]
-        newnode = new.node()
-        hg.updaterepo(repo, new.rev(), False)
-        if haspubdiv and publicdiv == divergent:
-            bypassphase(repo, (divergent, new), operation=b'evolve')
-        else:
-            obsolete.createmarkers(repo, [(divergent, (new,))],
-                                   operation=b'evolve')
+        obsolete.createmarkers(repo, [(divergent, (new,))],
+                               operation=b'evolve')
 
     # creating markers and moving phases post-resolution
     if haspubdiv and publicdiv == other:
@@ -780,7 +789,7 @@
             try:
                 effectflag = obsutil.geteffectflag(prec, (succ,))
             except TypeError:
-                # hg <= 4.7
+                # hg <= 4.7 (bae6f1418a95)
                 effectflag = obsutil.geteffectflag((prec, (succ,)))
             metadata[obsutil.EFFECTFLAGFIELD] = b"%d" % effectflag
 
@@ -989,10 +998,7 @@
     sha1s = re.findall(sha1re, commitmsg)
     unfi = repo.unfiltered()
     for sha1 in sha1s:
-        if util.safehasattr(scmutil, 'resolvehexnodeidprefix'): # > hg-4.6
-            fullnode = scmutil.resolvehexnodeidprefix(unfi, sha1)
-        else:
-            fullnode = unfi.changelog.index.partialmatch(sha1)
+        fullnode = scmutil.resolvehexnodeidprefix(unfi, sha1)
         if fullnode is None:
             continue
         ctx = unfi[fullnode]
@@ -1013,7 +1019,7 @@
     tr = repo.currenttransaction()
     assert tr is not None
     r = _evolvemerge(repo, orig, dest, pctx, keepbranch)
-    if compat.hasconflict(r): # some conflict
+    if r.unresolvedcount: # some conflict
         with repo.dirstate.parentchange(), compat.parentchange(repo):
             repo.setparents(dest.node(), orig.node())
             repo.dirstate.write(tr)
@@ -1200,11 +1206,12 @@
     torev = repo.changelog.rev
     dest = set()
     tovisit = list(parents(rev))
+    cache = {}
     while tovisit:
         r = tovisit.pop()
         if r == -1:
             continue
-        succsets = obsutil.successorssets(repo, tonode(r))
+        succsets = obsutil.successorssets(repo, tonode(r), cache=cache)
         if not succsets:
             tovisit.extend(parents(r))
         else:
@@ -1814,8 +1821,8 @@
     oldid = repo[b'.'].node()
     startctx = repo[b'.']
     dryrunopt = opts.get('dry_run', False)
-    displayer = compat.changesetdisplayer(ui, repo,
-                                          {b'template': shorttemplate})
+    displayer = logcmdutil.changesetdisplayer(ui, repo,
+                                              {b'template': shorttemplate})
     try:
         ctx = repo[utility._singlesuccessor(repo, repo[b'.'])]
     except utility.MultipleSuccessorsError as exc:
@@ -2060,9 +2067,8 @@
                 evolvestate[b'relocating-other'] = True
                 ui.status(_(b'rebasing "other" content-divergent changeset %s on'
                             b' %s\n' % (other, divergent.p1())))
-                with state.saver(evolvestate, {b'current': other.node()}):
-                    newother = _relocate(repo, other, divergent.p1(),
-                                         evolvestate, keepbranch=True)
+                newother = _relocatedivergent(repo, other, divergent.p1(),
+                                              evolvestate)
                 evolvestate[b'old-other'] = other.node()
                 other = repo[newother]
                 evolvestate[b'relocating-other'] = False
--- a/hgext3rd/evolve/firstmergecache.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/firstmergecache.py	Fri May 08 20:36:29 2020 +0800
@@ -16,11 +16,7 @@
     node as nodemod,
 )
 
-try:
-    from mercurial.utils.stringutil import forcebytestr
-except ImportError:
-    # hg <= 4.5 (f99d64e8a4e4)
-    from mercurial.util import forcebytestr
+from mercurial.utils.stringutil import forcebytestr
 
 from . import (
     compat,
--- a/hgext3rd/evolve/metadata.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/metadata.py	Fri May 08 20:36:29 2020 +0800
@@ -5,7 +5,7 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-__version__ = b'9.3.1.dev'
-testedwith = b'4.6.2 4.7 4.8 4.9 5.0 5.1 5.2 5.3'
+__version__ = b'10.0.0'
+testedwith = b'4.6.2 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4'
 minimumhgversion = b'4.6'
 buglink = b'https://bz.mercurial-scm.org/'
--- a/hgext3rd/evolve/obscache.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/obscache.py	Fri May 08 20:36:29 2020 +0800
@@ -19,11 +19,7 @@
     util,
 )
 
-try:
-    from mercurial.utils.stringutil import forcebytestr
-except ImportError:
-    # hg <= 4.5 (f99d64e8a4e4)
-    from mercurial.util import forcebytestr
+from mercurial.utils.stringutil import forcebytestr
 
 from . import (
     compat,
--- a/hgext3rd/evolve/obsdiscovery.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/obsdiscovery.py	Fri May 08 20:36:29 2020 +0800
@@ -17,6 +17,7 @@
 
 import hashlib
 import heapq
+import os
 import sqlite3
 import struct
 import weakref
@@ -30,15 +31,12 @@
     node,
     obsolete,
     scmutil,
+    store,
     util,
 )
 from mercurial.i18n import _
 
-try:
-    from mercurial.utils.stringutil import forcebytestr
-except ImportError:
-    # hg <= 4.5 (f99d64e8a4e4)
-    from mercurial.util import forcebytestr
+from mercurial.utils.stringutil import forcebytestr
 
 from . import (
     compat,
@@ -49,14 +47,9 @@
     stablerangecache,
 )
 
-try:
-    from mercurial import wireprototypes, wireprotov1server
-    from mercurial.wireprotov1peer import wirepeer
-    from mercurial.wireprototypes import encodelist, decodelist
-except (ImportError, AttributeError): # <= hg-4.5
-    from mercurial import wireproto as wireprototypes
-    wireprotov1server = wireprototypes
-    from mercurial.wireproto import wirepeer, encodelist, decodelist
+from mercurial import wireprototypes, wireprotov1server
+from mercurial.wireprotov1peer import wirepeer
+from mercurial.wireprototypes import encodelist, decodelist
 
 _pack = struct.pack
 _unpack = struct.unpack
@@ -352,6 +345,7 @@
         # cache status
         self._ondiskcachekey = None
         self._data = {}
+        self._createmode = store._calcmode(self._vfs)
 
     def clear(self, reset=False):
         super(_obshashcache, self).clear(reset=reset)
@@ -499,12 +493,19 @@
 
     def _db(self):
         try:
-            util.makedirs(self._vfs.dirname(self._path))
+            util.makedirs(self._vfs.dirname(self._path), self._createmode)
         except OSError:
             return None
+        if self._createmode is not None:
+            pre_existed = os.access(self._path, os.R_OK)
         con = sqlite3.connect(encoding.strfromlocal(self._path), timeout=30,
                               isolation_level=r"IMMEDIATE")
         con.text_factory = bytes
+        if self._createmode is not None and not pre_existed:
+            try:
+                os.chmod(self._path, self._createmode & 0o666)
+            except OSError:
+                pass
         return con
 
     @util.propertycache
@@ -608,6 +609,7 @@
             self._new.clear()
             self._valid = True
             self._ondiskcachekey = self._cachekey
+
 @eh.wrapfunction(obsolete.obsstore, '_addmarkers')
 def _addmarkers(orig, obsstore, *args, **kwargs):
     obsstore.rangeobshashcache.clear()
@@ -702,7 +704,7 @@
     except ValueError:
         self._abort(error.ResponseError(_(b"unexpected response:"), d))
 
-@compat.wireprotocommand(eh, b'evoext_obshashrange_v1', b'ranges')
+@wireprotov1server.wireprotocommand(b'evoext_obshashrange_v1', b'ranges', b'pull')
 def srv_obshashrange_v1(repo, proto, ranges):
     ranges = decodelist(ranges)
     ranges = [_decrange(r) for r in ranges]
@@ -726,21 +728,10 @@
     caps = orig(repo, proto)
     enabled = _useobshashrange(repo)
     if obsolete.isenabled(repo, obsolete.exchangeopt) and enabled:
-
-        # Compat hg 4.6+ (2f7290555c96)
-        bytesresponse = False
-        if util.safehasattr(caps, 'data'):
-            bytesresponse = True
-            caps = caps.data
-
-        caps = caps.split()
+        caps = caps.data.split()
         caps.append(b'_evoext_obshashrange_v1')
         caps.sort()
-        caps = b' '.join(caps)
-
-        # Compat hg 4.6+ (2f7290555c96)
-        if bytesresponse:
-            caps = wireprototypes.bytesresponse(caps)
+        caps = wireprototypes.bytesresponse(b' '.join(caps))
     return caps
 
 @eh.extsetup
--- a/hgext3rd/evolve/obsexchange.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/obsexchange.py	Fri May 08 20:36:29 2020 +0800
@@ -16,6 +16,8 @@
     obsolete,
     pushkey,
     util,
+    wireprototypes,
+    wireprotov1server
 )
 
 from mercurial.hgweb import common as hgwebcommon
@@ -44,13 +46,7 @@
 
 @eh.uisetup
 def addgetbundleargs(self):
-    try:
-        from mercurial import wireprototypes
-        gboptsmap = wireprototypes.GETBUNDLE_ARGUMENTS
-    except (ImportError, AttributeError):
-        # <= hg 4.5
-        from mercurial import wireproto
-        gboptsmap = wireproto.gboptsmap
+    gboptsmap = wireprototypes.GETBUNDLE_ARGUMENTS
     gboptsmap[b'evo_obscommon'] = b'nodes'
     gboptsmap[b'evo_missing_nodes'] = b'nodes'
 
@@ -126,34 +122,15 @@
     """wrapper to advertise new capability"""
     caps = orig(repo, proto)
     if obsolete.isenabled(repo, obsolete.exchangeopt):
-
-        # Compat hg 4.6+ (2f7290555c96)
-        bytesresponse = False
-        if util.safehasattr(caps, 'data'):
-            bytesresponse = True
-            caps = caps.data
-
-        caps = caps.split()
+        caps = caps.data.split()
         caps.append(b'_evoext_getbundle_obscommon')
         caps.sort()
-        caps = b' '.join(caps)
-
-        # Compat hg 4.6+ (2f7290555c96)
-        if bytesresponse:
-            from mercurial import wireprototypes
-            caps = wireprototypes.bytesresponse(caps)
+        caps = wireprototypes.bytesresponse(b' '.join(caps))
     return caps
 
 @eh.extsetup
 def extsetup_obscommon(ui):
-    try:
-        from mercurial import wireprototypes, wireprotov1server
-        gboptsmap = wireprototypes.GETBUNDLE_ARGUMENTS
-    except (ImportError, AttributeError):
-        # <= hg 4.5
-        from mercurial import wireproto
-        gboptsmap = wireproto.gboptsmap
-        wireprotov1server = wireproto
+    gboptsmap = wireprototypes.GETBUNDLE_ARGUMENTS
     gboptsmap[b'evo_obscommon'] = b'nodes'
 
     # wrap module content
--- a/hgext3rd/evolve/obshistory.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/obshistory.py	Fri May 08 20:36:29 2020 +0800
@@ -13,14 +13,18 @@
     commands,
     error,
     graphmod,
-    patch,
+    logcmdutil,
+    mdiff,
+    node as nodemod,
     obsutil,
-    node as nodemod,
+    patch,
     pycompat,
     scmutil,
     util,
 )
 
+from mercurial.utils import dateutil
+
 from mercurial.i18n import _
 
 from . import (
@@ -45,6 +49,8 @@
 @eh.extsetup
 def addtouchnoise(ui):
     obsutil.METABLACKLIST.append(re.compile(br'^__touch-noise__$'))
+    obsutil.METABLACKLIST.append(re.compile(br'^divergence_source_local$'))
+    obsutil.METABLACKLIST.append(re.compile(br'^divergence_source_other$'))
 
 @eh.command(
     b'obslog|olog',
@@ -53,6 +59,7 @@
      (b'a', b'all', False, _(b'show all related changesets, not only precursors')),
      (b'p', b'patch', False, _(b'show the patch between two obs versions')),
      (b'f', b'filternonlocal', False, _(b'filter out non local commits')),
+     (b'o', b'origin', True, _(b'show origin of changesets instead of fate')),
      ] + commands.formatteropts,
     _(b'hg olog [OPTION]... [[-r] REV]...'),
     **compat.helpcategorykwargs('CATEGORY_CHANGE_NAVIGATION'))
@@ -90,18 +97,15 @@
         revs = [b'.']
     revs = scmutil.revrange(repo, revs)
 
-    # Use the default template unless the user provided one, but not if
-    # -f was given, because that doesn't work with templates yet. Note
-    # that --no-graph doesn't support -f (it ignores it), so we also
-    # don't use templating with --no-graph.
-    if not opts['template'] and not (opts['filternonlocal'] and opts['graph']):
+    # Use the default template unless the user provided one.
+    if not opts['template']:
         opts['template'] = DEFAULT_TEMPLATE
 
     if opts['graph']:
-        return _debugobshistorygraph(ui, repo, revs, opts)
+        return displaygraph(ui, repo, revs, opts)
 
     revs.reverse()
-    _debugobshistoryrevs(ui, repo, revs, opts)
+    displayrevs(ui, repo, revs, opts)
 
 TEMPLATE_MISSING_NODE = b"""{label("evolve.node evolve.missing_change_ctx", node|short)}"""
 TEMPLATE_PRESENT_NODE = b"""{label("evolve.node", node|short)} {label("evolve.rev", "({rev})")} {label("evolve.short_description", desc|firstline)}"""
@@ -109,30 +113,138 @@
     b"presentnode": TEMPLATE_PRESENT_NODE,
     b"missingnode": TEMPLATE_MISSING_NODE
 }
-TEMPLATE_VERB = b"""{label("evolve.verb", verb)}"""
+TEMPLATE_PREDNODES = b"""{label("evolve.node", join(prednodes % "{prednode|short}", ", "))}"""
 TEMPLATE_SUCCNODES = b"""{label("evolve.node", join(succnodes % "{succnode|short}", ", "))}"""
-TEMPLATE_REWRITE = b"""{if(succnodes, "%(verb)s{if(effects, "({join(effects, ", ")})")} as %(succnodes)s", "pruned")}""" % {
-    b"verb": TEMPLATE_VERB,
+TEMPLATE_NODES = b"""{if(prednodes, "from %(prednodes)s")}{if(succnodes, "as %(succnodes)s")}""" % {
+    b"prednodes": TEMPLATE_PREDNODES,
     b"succnodes": TEMPLATE_SUCCNODES
 }
-TEMPLATE_OPERATION = b"""{if(operation, "using {label("evolve.operation", operation)}")}"""
-TEMPLATE_USER = b"""by {label("evolve.user", user)}"""
-TEMPLATE_DATE = b"""{label("evolve.date", "({date(date, "%a %b %d %H:%M:%S %Y %1%2")})")}"""
-TEMPLATE_NOTE = b"""{if(note, "\n    note: {label("evolve.note", note)}")}"""
+TEMPLATE_REWRITE = b"""{label("evolve.verb", verb)}{if(effects, "({join(effects, ", ")})")}"""
+TEMPLATE_OPERATIONS = b"""{if(operations, "using {label("evolve.operation", join(operations, ", "))}")}"""
+TEMPLATE_USERS = b"""by {label("evolve.user", join(users, ", "))}"""
+TEMPLATE_ONE_DATE = b"""({date(max(dates), "%a %b %d %H:%M:%S %Y %1%2")})"""
+TEMPLATE_MANY_DATES = b"""(between {date(min(dates), "%a %b %d %H:%M:%S %Y %1%2")} and {date(max(dates), "%a %b %d %H:%M:%S %Y %1%2")})"""
+TEMPLATE_DATES = b"""{label("evolve.date", ifeq(min(dates), max(dates), "%(onedate)s", "%(manydates)s"))}""" % {
+    b"onedate": TEMPLATE_ONE_DATE,
+    b"manydates": TEMPLATE_MANY_DATES
+}
+TEMPLATE_NOTES = b"""{if(notes, notes % "\n    note: {label("evolve.note", note)}")}"""
 TEMPLATE_PATCH = b"""{if(patch, "{patch}")}{if(nopatchreason, "\n(No patch available, {nopatchreason})")}"""
 DEFAULT_TEMPLATE = (b"""%(firstline)s
-{markers %% "  {separate(" ", "%(rewrite)s", "%(operation)s", "%(user)s", "%(date)s")}%(note)s{indent(descdiff, "    ")}{indent("%(patch)s", "    ")}\n"}
+{markers %% "  {separate(" ", "%(rewrite)s", "%(nodes)s", "%(operations)s", "%(users)s", "%(dates)s")}%(notes)s{indent(descdiff, "    ")}{indent("%(patch)s", "    ")}\n"}
 """) % {
     b"firstline": TEMPLATE_FIRST_LINE,
     b"rewrite": TEMPLATE_REWRITE,
-    b"operation": TEMPLATE_OPERATION,
-    b"user": TEMPLATE_USER,
-    b"date": TEMPLATE_DATE,
-    b"note": TEMPLATE_NOTE,
+    b"nodes": TEMPLATE_NODES,
+    b"operations": TEMPLATE_OPERATIONS,
+    b"users": TEMPLATE_USERS,
+    b"dates": TEMPLATE_DATES,
+    b"notes": TEMPLATE_NOTES,
     b"patch": TEMPLATE_PATCH,
 }
 
-class obsmarker_printer(compat.changesetprinter):
+def groupbyfoldid(predsets):
+    """ Group nodes and related obsmarkers by fold-id metadata.
+    """
+    groups = {}
+    for (nodes, markers) in predsets:
+        grouped = False
+        for marker in markers:
+            metadata = dict(marker[3])
+            foldid = metadata.get(b'fold-id')
+            if foldid is not None:
+                groups.setdefault(foldid, []).append((nodes, markers))
+                grouped = True
+
+        if not grouped:
+            yield (nodes, markers)
+
+    for foldid in sorted(groups):
+        groupnodes = set()
+        groupmarkers = set()
+        for (nodes, markers) in groups[foldid]:
+            groupnodes.update(nodes)
+            groupmarkers.update(markers)
+        yield (tuple(sorted(groupnodes)), tuple(sorted(groupmarkers)))
+
+def predecessorsandmarkers(repo, node):
+    """ Compute data needed for obsorigin.
+
+    Return a generator of (nodes, markers) tuples, where nodes is a tuple of
+    predecessor nodes and markers is a tuple of obsolescence markers.
+
+    Using tuples for everything means no problems with sorted().
+    """
+    predecessors = repo.obsstore.predecessors
+    stack = [(node, ())]
+    seen = {node}
+
+    while stack:
+        node, path = stack.pop()
+
+        for marker in sorted(predecessors.get(node, ())):
+            prednode = marker[0]
+
+            # Basic cycle protection
+            if prednode in seen:
+                continue
+            seen.add(prednode)
+
+            if prednode in repo:
+                yield ((prednode,), path + (marker,))
+            else:
+                stack.append((prednode, path + (marker,)))
+
+def _originmarkers(repo, ctx, filternonlocal):
+    predecessors = repo.obsstore.predecessors
+    successors = repo.obsstore.successors
+    if filternonlocal:
+        r = predecessorsandmarkers(repo, ctx.node())
+        for (nodes, markers) in sorted(groupbyfoldid(r)):
+            yield (nodes, markers)
+    else:
+        markers = predecessors.get(ctx.node(), ())
+        data = (((marker[0],), (marker,)) for marker in markers)
+        for (nodes, markers) in sorted(groupbyfoldid(data)):
+            yield (nodes, markers)
+
+    # finding prune markers
+    for marker in successors.get(ctx.node(), ()):
+        if not marker[1]:
+            yield ((), (marker,))
+
+def _fatemarkers(repo, ctx, filternonlocal):
+    successors = repo.obsstore.successors
+    if filternonlocal:
+        r = obsutil.successorsandmarkers(repo, ctx)
+        if r is None:
+            r = []
+        for succset in sorted(r):
+            if succset[b'markers']:
+                yield (succset[b'successors'], succset[b'markers'])
+    else:
+        markers = successors.get(ctx.node(), ())
+        for marker in sorted(markers):
+            yield (marker[1], [marker])
+
+def _nodesandmarkers(repo, ctx, filternonlocal, origin):
+    """ Return data for obslog and obsolescence-related template keywords.
+
+    If `filternonlocal` is True, skip filtered nodes (but still gather
+    obsolescence markers), otherwise the result will contain nodes unknown
+    locally if they are found in the obsolescence markers.
+
+    If `origin` is True, look at predecessors of ctx. Otherwise return
+    successors and appropriate obsmarkers.
+    """
+    if origin:
+        for (nodes, markers) in _originmarkers(repo, ctx, filternonlocal):
+            yield (nodes, markers)
+    else:
+        for (nodes, markers) in _fatemarkers(repo, ctx, filternonlocal):
+            yield (nodes, markers)
+
+class obsmarker_printer(logcmdutil.changesetprinter):
     """show (available) information about a node
 
     We display the node, description (if available) and various information
@@ -141,7 +253,7 @@
     def __init__(self, ui, repo, *args, **kwargs):
 
         if kwargs.pop('obspatch', False):
-            if compat.changesetdiffer is None:
+            if logcmdutil.changesetdiffer is None:
                 kwargs['matchfn'] = scmutil.matchall(repo)
             else:
                 kwargs['differ'] = scmutil.matchall(repo)
@@ -149,12 +261,13 @@
         super(obsmarker_printer, self).__init__(ui, repo, *args, **kwargs)
         diffopts = kwargs.get('diffopts', {})
 
-        # Compat 4.6
+        # hg <= 4.6 (3fe1c9263024)
         if not util.safehasattr(self, "_includediff"):
             self._includediff = diffopts and diffopts.get(b'patch')
 
         self.template = diffopts and diffopts.get(b'template')
         self.filter = diffopts and diffopts.get(b'filternonlocal')
+        self.origin = diffopts and diffopts.get(b'origin')
 
     def show(self, ctx, copies=None, matchfn=None, **props):
         if self.buffered:
@@ -165,31 +278,15 @@
             _props = {b"template": self.template}
             fm = self.ui.formatter(b'debugobshistory', _props)
 
-            _debugobshistorydisplaynode(fm, self.repo, changenode)
+            displaynode(fm, self.repo, changenode)
 
             markerfm = fm.nested(b"markers")
 
-            # Succs markers
-            if self.filter is False:
-                succs = self.repo.obsstore.successors.get(changenode, ())
-                succs = sorted(succs)
-
-                for successor in succs:
-                    _debugobshistorydisplaymarker(self.ui, markerfm, successor,
-                                                  ctx.node(), self.repo,
-                                                  self._includediff)
-
-            else:
-                r = obsutil.successorsandmarkers(self.repo, ctx)
-                if r is None:
-                    r = []
-
-                for succset in sorted(r):
-                    markers = succset[b"markers"]
-                    if not markers:
-                        continue
-                    successors = succset[b"successors"]
-                    _debugobshistorydisplaysuccsandmarkers(self.ui, markerfm, successors, markers, ctx.node(), self.repo, self._includediff)
+            data = _nodesandmarkers(self.repo, ctx, self.filter, self.origin)
+            for nodes, markers in data:
+                displaymarkers(self.ui, markerfm, nodes, markers, ctx.node(),
+                               self.repo, self._includediff,
+                               successive=not self.origin)
 
             markerfm.end()
 
@@ -208,28 +305,45 @@
         '''
         pass
 
-def patchavailable(node, repo, successors):
+def patchavailable(node, repo, candidates, successive=True):
+    """ Check if it's possible to get a diff between node and candidates.
+
+    `candidates` contains nodes, which can be either successors (`successive`
+    is True) or predecessors (`successive` is False) of `node`.
+    """
     if node not in repo:
         return False, b"context is not local"
 
-    if len(successors) == 0:
-        return False, b"no successors"
-    elif len(successors) > 1:
-        return False, b"too many successors (%d)" % len(successors)
-
-    succ = successors[0]
+    if len(candidates) == 0:
+        if successive:
+            msg = b"no successors"
+        else:
+            msg = b"no predecessors"
+        return False, msg
+    elif len(candidates) > 1:
+        if successive:
+            msg = b"too many successors (%d)"
+        else:
+            msg = b"too many predecessors (%d)"
+        return False, msg % len(candidates)
 
-    if succ not in repo:
-        return False, b"successor is unknown locally"
+    cand = candidates[0]
 
-    # Check that both node and succ have the same parents
+    if cand not in repo:
+        if successive:
+            msg = b"successor is unknown locally"
+        else:
+            msg = b"predecessor is unknown locally"
+        return False, msg
+
+    # Check that both node and cand have the same parents
     nodep1, nodep2 = repo[node].p1(), repo[node].p2()
-    succp1, succp2 = repo[succ].p1(), repo[succ].p2()
+    candp1, candp2 = repo[cand].p1(), repo[cand].p2()
 
-    if nodep1 != succp1 or nodep2 != succp2:
+    if nodep1 != candp1 or nodep2 != candp2:
         return False, b"changesets rebased"
 
-    return True, succ
+    return True, cand
 
 def getmarkerdescriptionpatch(repo, basedesc, succdesc):
     # description are stored without final new line,
@@ -241,8 +355,8 @@
     basename = b"changeset-description"
     succname = b"changeset-description"
 
-    d = compat.strdiff(basedesc, succdesc, basename, succname)
-    uheaders, hunks = d
+    uheaders, hunks = mdiff.unidiff(basedesc, b'', succdesc, b'',
+                                    basename, succname, False)
 
     # Copied from patch.diff
     text = b''.join(sum((list(hlines) for hrange, hlines in hunks), []))
@@ -361,10 +475,8 @@
                 relations = nodeprec.get(cand, ())
             else:
                 relations = obsutil.closestpredecessors(repo, cand)
-            # print("RELATIONS", relations, list(closestpred))
-            childrens = [(graphmod.PARENT, x) for x in relations]
-            # print("YIELD", changectx, childrens)
-            yield (cand, graphmod.CHANGESET, changectx, childrens)
+            parents = [(graphmod.PARENT, x) for x in relations]
+            yield (cand, graphmod.CHANGESET, changectx, parents)
 
 def _obshistorywalker_links(repo, revs, walksuccessors=False):
     """ Iterate the obs history tree starting from revs, traversing
@@ -421,7 +533,7 @@
 
     return sorted(seen), nodesucc, nodeprec
 
-def _debugobshistorygraph(ui, repo, revs, opts):
+def displaygraph(ui, repo, revs, opts):
 
     displayer = obsmarker_printer(ui, repo.unfiltered(), obspatch=True,
                                   diffopts=pycompat.byteskwargs(opts),
@@ -429,49 +541,71 @@
     edges = graphmod.asciiedges
     walker = _obshistorywalker(repo.unfiltered(), revs, opts.get('all', False),
                                opts.get('filternonlocal', False))
-    compat.displaygraph(ui, repo, walker, displayer, edges)
+    logcmdutil.displaygraph(ui, repo, walker, displayer, edges)
 
-def _debugobshistoryrevs(ui, repo, revs, opts):
+def displayrevs(ui, repo, revs, opts):
     """ Display the obsolescence history for revset
     """
     fm = ui.formatter(b'debugobshistory', pycompat.byteskwargs(opts))
-    precursors = repo.obsstore.predecessors
+    predecessors = repo.obsstore.predecessors
     successors = repo.obsstore.successors
     nodec = repo.changelog.node
     unfi = repo.unfiltered()
     nodes = [nodec(r) for r in revs]
+    seen = set(nodes)
+    toshow = []
 
-    seen = set(nodes)
+    origin = opts and opts.get('origin')
+    walksuccessors = opts and opts.get('all')
+    filternonlocal = opts and opts.get('filternonlocal')
+    includediff = opts and opts.get('patch')
 
     while nodes:
         ctxnode = nodes.pop()
 
-        _debugobshistorydisplaynode(fm, unfi, ctxnode)
-
-        succs = successors.get(ctxnode, ())
+        if ctxnode in unfi:
+            toshow.append(unfi[ctxnode])
+        else:
+            if filternonlocal is False:
+                toshow.append(missingchangectx(unfi, ctxnode))
 
-        markerfm = fm.nested(b"markers")
-        for successor in sorted(succs):
-            includediff = opts and opts.get("patch")
-            _debugobshistorydisplaymarker(ui, markerfm, successor, ctxnode, unfi, includediff)
-        markerfm.end()
-        fm.plain(b'\n')
-
-        precs = precursors.get(ctxnode, ())
-        for p in sorted(precs):
+        preds = predecessors.get(ctxnode, ())
+        for p in sorted(preds):
             # Only show nodes once
             if p[0] not in seen:
                 seen.add(p[0])
                 nodes.append(p[0])
+
+        if walksuccessors:
+            for successor in successors.get(ctxnode, ()):
+                for s in successor[1]:
+                    if s not in seen:
+                        seen.add(s)
+                        nodes.append(s)
+
+    for ctx in toshow:
+        displaynode(fm, unfi, ctx.node())
+
+        markerfm = fm.nested(b"markers")
+
+        data = _nodesandmarkers(unfi, ctx, filternonlocal, origin)
+        for nodes_, markers in data:
+            displaymarkers(ui, markerfm, nodes_, markers, ctx.node(), unfi,
+                           includediff, successive=not origin)
+
+        markerfm.end()
+
+        fm.plain(b'\n')
+
     fm.end()
 
-def _debugobshistorydisplaynode(fm, repo, node):
+def displaynode(fm, repo, node):
     if node in repo:
-        _debugobshistorydisplayctx(fm, repo[node])
+        displayctx(fm, repo[node])
     else:
-        _debugobshistorydisplaymissingctx(fm, node)
+        displaymissingctx(fm, node)
 
-def _debugobshistorydisplayctx(fm, ctx):
+def displayctx(fm, ctx):
     shortdescription = ctx.description().strip()
     if shortdescription:
         shortdescription = shortdescription.splitlines()[0]
@@ -489,64 +623,79 @@
              label=b"evolve.short_description")
     fm.plain(b'\n')
 
-def _debugobshistorydisplaymissingctx(fm, nodewithoutctx):
+def displaymissingctx(fm, nodewithoutctx):
     fm.startitem()
     fm.data(node=nodemod.hex(nodewithoutctx))
     fm.plain(nodemod.short(nodewithoutctx),
              label=b"evolve.node evolve.missing_change_ctx")
     fm.plain(b'\n')
 
-def _debugobshistorydisplaymarker(ui, fm, marker, node, repo, includediff=False):
-    succnodes = marker[1]
-    date = marker[4]
-    metadata = dict(marker[3])
-
+def displaymarkers(ui, fm, nodes, markers, node, repo, includediff=False,
+                   successive=True):
     fm.startitem()
 
-    verb = _successorsetverb(succnodes, [marker])[b"verb"]
+    if successive:
+        verb = _successorsetverb(nodes, markers)[b"verb"]
+    else:
+        verb = _predecessorsverb(nodes, markers)
 
     fm.data(verb=verb)
 
-    effects = _markerseffects([marker])
+    effects = _markerseffects(markers)
     if effects:
-        fmteffect = fm.formatlist(effects, b'effect', sep=b', ')
-        fm.write(b'effects', b'(%s)', fmteffect)
+        fmteffects = fm.formatlist(effects, b'effect', sep=b', ')
+        fm.data(effects=fmteffects)
 
-    if len(succnodes) > 0:
-        hexnodes = (nodemod.hex(succnode) for succnode in sorted(succnodes))
-        nodes = fm.formatlist(hexnodes, b'succnode')
-        fm.write(b'succnodes', b'%s', nodes)
+    if len(nodes) > 0:
+        hexnodes = (nodemod.hex(node) for node in sorted(nodes))
+        if successive:
+            nodelist = fm.formatlist(hexnodes, b'succnode')
+            fm.data(succnodes=nodelist)
+        else:
+            nodelist = fm.formatlist(hexnodes, b'prednode')
+            fm.data(prednodes=nodelist)
 
-    operation = metadata.get(b'operation')
-    if operation:
-        fm.data(operation=operation)
+    # Operations
+    operations = obsutil.markersoperations(markers)
+    if operations:
+        fm.data(operations=fm.formatlist(operations, name=b'operation', sep=b', '))
 
-    fm.data(user=metadata[b'user'])
+    # Users
+    users = obsutil.markersusers(markers)
+    fm.data(users=fm.formatlist(users, name=b'user', sep=b', '))
 
-    fm.data(date=date)
+    # Dates
+    dates = obsutil.markersdates(markers)
+    fm.data(dates=fm.formatlist(dates, name=b'date'))
 
-    # initial support for showing note
-    if metadata.get(b'note'):
-        fm.data(note=metadata[b'note'])
+    # Notes
+    notes = _markersnotes(markers)
+    if notes:
+        fm.data(notes=fm.formatlist(notes, name=b'note', sep=b'\n'))
 
     # Patch display
     if includediff is True:
-        _patchavailable = patchavailable(node, repo, marker[1])
+        _patchavailable = patchavailable(node, repo, nodes,
+                                         successive=successive)
 
         if _patchavailable[0] is True:
-            succ = _patchavailable[1]
+            diffnode = _patchavailable[1]
 
-            basectx = repo[node]
-            succctx = repo[succ]
+            if successive:
+                actx = repo[node]
+                bctx = repo[diffnode]
+            else:
+                actx = repo[diffnode]
+                bctx = repo[node]
             # Description patch
             descriptionpatch = getmarkerdescriptionpatch(repo,
-                                                         basectx.description(),
-                                                         succctx.description())
+                                                         actx.description(),
+                                                         bctx.description())
 
             if descriptionpatch:
                 # add the diffheader
                 diffheader = b"diff -r %s -r %s changeset-description\n" %\
-                             (basectx, succctx)
+                             (actx, bctx)
                 descriptionpatch = diffheader + descriptionpatch
 
                 def tolist(text):
@@ -566,8 +715,8 @@
             matchfn = scmutil.matchall(repo)
             firstline = True
             linestart = True
-            for chunk, label in patch.diffui(repo, node, succ, matchfn,
-                                             opts=diffopts):
+            for chunk, label in patch.diffui(repo, actx.node(), bctx.node(),
+                                             matchfn, opts=diffopts):
                 if firstline:
                     ui.write(b'\n')
                     firstline = False
@@ -580,120 +729,6 @@
         else:
             fm.data(nopatchreason=_patchavailable[1])
 
-def _debugobshistorydisplaysuccsandmarkers(ui, fm, succnodes, markers, node, repo, includediff=False):
-    """
-    This function is a duplication of _debugobshistorydisplaymarker modified
-    to accept multiple markers as input.
-    """
-    fm.startitem()
-    fm.plain(b'  ')
-
-    verb = _successorsetverb(succnodes, markers)[b"verb"]
-
-    fm.write(b'verb', b'%s', verb,
-             label=b"evolve.verb")
-
-    effects = _markerseffects(markers)
-    if effects:
-        fmteffect = fm.formatlist(effects, b'effect', sep=b', ')
-        fm.write(b'effects', b'(%s)', fmteffect)
-
-    if len(succnodes) > 0:
-        fm.plain(b' as ')
-
-        shortsnodes = (nodemod.short(succnode) for succnode in sorted(succnodes))
-        nodes = fm.formatlist(shortsnodes, b'succnode', sep=b', ')
-        fm.write(b'succnodes', b'%s', nodes,
-                 label=b"evolve.node")
-
-    # Operations
-    operations = obsutil.markersoperations(markers)
-    if operations:
-        fm.plain(b' using ')
-        fm.write(b'operation', b'%s', b", ".join(operations), label=b"evolve.operation")
-
-    fm.plain(b' by ')
-
-    # Users
-    users = obsutil.markersusers(markers)
-    fm.write(b'user', b'%s', b", ".join(users),
-             label=b"evolve.user")
-    fm.plain(b' ')
-
-    # Dates
-    dates = obsutil.markersdates(markers)
-    if dates:
-        min_date = min(dates)
-        max_date = max(dates)
-
-        if min_date == max_date:
-            fm.write(b"date", b"(at %s)", fm.formatdate(min_date), label=b"evolve.date")
-        else:
-            fm.write(b"date", b"(between %s and %s)", fm.formatdate(min_date),
-                     fm.formatdate(max_date), label=b"evolve.date")
-
-    # initial support for showing note
-    # if metadata.get('note'):
-    #     fm.plain('\n    note: ')
-    #     fm.write('note', "%s", metadata['note'], label="evolve.note")
-
-    # Patch display
-    if includediff is True:
-        _patchavailable = patchavailable(node, repo, succnodes)
-
-        if _patchavailable[0] is True:
-            succ = _patchavailable[1]
-
-            basectx = repo[node]
-            succctx = repo[succ]
-            # Description patch
-            descriptionpatch = getmarkerdescriptionpatch(repo,
-                                                         basectx.description(),
-                                                         succctx.description())
-
-            if descriptionpatch:
-                # add the diffheader
-                diffheader = b"diff -r %s -r %s changeset-description\n" %\
-                             (basectx, succctx)
-                descriptionpatch = diffheader + descriptionpatch
-
-                def tolist(text):
-                    return [text]
-
-                ui.pushbuffer(labeled=True)
-                ui.write(b"\n")
-
-                for chunk, label in patch.difflabel(tolist, descriptionpatch):
-                    chunk = chunk.strip(b'\t')
-                    if chunk and chunk != b'\n':
-                        ui.write(b'    ')
-                    ui.write(chunk, label=label)
-                fm.write(b'descdiff', b'%s', ui.popbuffer())
-
-            # Content patch
-            ui.pushbuffer(labeled=True)
-            diffopts = patch.diffallopts(repo.ui, {})
-            matchfn = scmutil.matchall(repo)
-            firstline = True
-            linestart = True
-            for chunk, label in patch.diffui(repo, node, succ, matchfn,
-                                             opts=diffopts):
-                if firstline:
-                    ui.write(b'\n')
-                    firstline = False
-                if linestart:
-                    ui.write(b'    ')
-                    linestart = False
-                if chunk == b'\n':
-                    linestart = True
-                ui.write(chunk, label=label)
-            fm.write(b'patch', b'%s', ui.popbuffer())
-        else:
-            fm.write(b'nopatchreason', b"\n    (No patch available, %s)",
-                     _patchavailable[1])
-
-    fm.plain(b"\n")
-
 def _prepare_hunk(hunk):
     """Drop all information but the username and patch"""
     cleanunk = []
@@ -731,6 +766,11 @@
 
     return (fate, successors)
 
+def _markersnotes(markers):
+    markersmeta = [dict(m[3]) for m in markers]
+    notes = {meta.get(b'note') for meta in markersmeta}
+    return sorted(note for note in notes if note)
+
 EFFECTMAPPING = util.sortdict([
     (obsutil.DESCCHANGED, b'description'),
     (obsutil.METACHANGED, b'meta'),
@@ -809,7 +849,85 @@
         verb = b'split'
     return {b'verb': verb}
 
+def _predecessorsverb(predecessors, markers):
+    """ Return the verb summarizing a set of predecessors and related markers.
+    """
+    verb = None
+    if not predecessors:
+        # we got successors instead of predecessors, and they are empty
+        # (this is a special case for showing prunes)
+        verb = b'pruned'
+    elif len(markers) == 1 and len(markers[0][1]) > 1:
+        # peeked at the successors to see if this is a split
+        verb = b'split'
+    elif len(predecessors) == 1:
+        verb = _markerspreciseverb(markers)
+
+        if verb is None:
+            verb = b'rewritten'
+    else:
+        verb = b'folded'
+    return verb
+
 # Use a more advanced version of obsfateverb that uses effect-flag
 @eh.wrapfunction(obsutil, 'obsfateverb')
 def obsfateverb(orig, *args, **kwargs):
     return _successorsetverb(*args, **kwargs)[b'verb']
+
+def obsoriginprinter(ui, repo, predecessors, markers):
+    """ Build an obsorigin string for a single set of predecessors.
+    """
+    quiet = ui.quiet
+    verbose = ui.verbose
+    normal = not verbose and not quiet
+
+    line = []
+
+    # Verb
+    line.append(_predecessorsverb(predecessors, markers))
+
+    # Operations
+    operations = obsutil.markersoperations(markers)
+    if operations:
+        line.append(b" using %s" % b", ".join(operations))
+
+    # Predecessors
+    if predecessors:
+        unfi = repo.unfiltered()
+
+        def formatnode(node):
+            if node in unfi:
+                return scmutil.formatchangeid(unfi[node])
+            return nodemod.short(node)
+
+        fmtpredecessors = [formatnode(pred) for pred in predecessors]
+        line.append(b" from %s" % b", ".join(sorted(fmtpredecessors)))
+
+    # Users
+    users = obsutil.markersusers(markers)
+    # Filter out current user in not verbose mode to reduce amount of
+    # information
+    if not verbose:
+        currentuser = ui.username(acceptempty=True)
+        if len(users) == 1 and currentuser in users:
+            users = None
+
+    if (verbose or normal) and users:
+        line.append(b" by %s" % b", ".join(users))
+
+    # Dates
+    dates = obsutil.markersdates(markers)
+
+    if dates and verbose:
+        min_date = min(dates)
+        max_date = max(dates)
+
+        if min_date == max_date:
+            fmtmin_date = dateutil.datestr(min_date, b'%Y-%m-%d %H:%M %1%2')
+            line.append(b" (at %s)" % fmtmin_date)
+        else:
+            fmtmin_date = dateutil.datestr(min_date, b'%Y-%m-%d %H:%M %1%2')
+            fmtmax_date = dateutil.datestr(max_date, b'%Y-%m-%d %H:%M %1%2')
+            line.append(b" (between %s and %s)" % (fmtmin_date, fmtmax_date))
+
+    return b"".join(line)
--- a/hgext3rd/evolve/rewind.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/rewind.py	Fri May 08 20:36:29 2020 +0800
@@ -12,6 +12,8 @@
     scmutil,
 )
 
+from mercurial.utils import dateutil
+
 from mercurial.i18n import _
 
 from . import (
@@ -194,7 +196,7 @@
         user = unfi.ui.username()
     date = unfi.ui.configdate(b'devel', b'default-date')
     if date is None:
-        date = compat.makedate()
+        date = dateutil.makedate()
     noise = b"%s\0%s\0%d\0%d" % (ctx.node(), user, date[0], date[1])
     extra[b'__rewind-hash__'] = hashlib.sha256(noise).hexdigest().encode('ascii')
 
--- a/hgext3rd/evolve/stablerangecache.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/stablerangecache.py	Fri May 08 20:36:29 2020 +0800
@@ -9,6 +9,7 @@
 
 import abc
 import heapq
+import os
 import random
 import sqlite3
 import time
@@ -19,14 +20,11 @@
     error,
     localrepo,
     node as nodemod,
+    store,
     util,
 )
 
-try:
-    from mercurial.utils.stringutil import forcebytestr
-except ImportError:
-    # hg <= 4.5 (f99d64e8a4e4)
-    from mercurial.util import forcebytestr
+from mercurial.utils.stringutil import forcebytestr
 
 from . import (
     compat,
@@ -189,6 +187,7 @@
         self._ondisktiprev = None
         self._ondisktipnode = None
         self._unsavedsubranges = {}
+        self._createmode = store._calcmode(self._vfs)
 
     def contains(self, repo, revs):
         con = self._con
@@ -238,17 +237,25 @@
 
     def _setsub(self, rangeid, value):
         assert rangeid not in self._unsavedsubranges
+        assert 0 <= rangeid[1] <= rangeid[0], rangeid
         self._unsavedsubranges[rangeid] = value
         super(stablerangesqlbase, self)._setsub(rangeid, value)
 
     def _db(self):
         try:
-            util.makedirs(self._vfs.dirname(self._path))
+            util.makedirs(self._vfs.dirname(self._path), self._createmode)
         except OSError:
             return None
+        if self._createmode is not None:
+            pre_existed = os.access(self._path, os.R_OK)
         con = sqlite3.connect(encoding.strfromlocal(self._path), timeout=30,
                               isolation_level=r"IMMEDIATE")
         con.text_factory = bytes
+        if self._createmode is not None and not pre_existed:
+            try:
+                os.chmod(self._path, self._createmode & 0o666)
+            except OSError:
+                pass
         return con
 
     @util.propertycache
@@ -440,18 +447,18 @@
     unfi = repo.unfiltered()
     revs = unfi.revs('all()')
     nbrevs = len(revs)
-    ui.write('number of revisions:  %12d\n' % nbrevs)
+    ui.write(b'number of revisions:  %12d\n' % nbrevs)
     heads = unfi.revs('heads(all())')
     nbheads = len(heads)
-    ui.write('number of heads:      %12d\n' % nbheads)
+    ui.write(b'number of heads:      %12d\n' % nbheads)
     merge = unfi.revs('merge()')
     nbmerge = len(merge)
-    ui.write('number of merge:      %12d (%3d%%)\n'
+    ui.write(b'number of merge:      %12d (%3d%%)\n'
              % (nbmerge, 100 * nbmerge / nbrevs))
     cache = unfi.stablerange
     allsubranges = stablerange.subrangesclosure(unfi, cache, heads)
     nbsubranges = len(allsubranges) - nbrevs # we remove leafs
-    ui.write('number of range:      %12d\n' % nbsubranges)
+    ui.write(b'number of range:      %12d\n' % nbsubranges)
     import collections
     subsizedistrib = collections.defaultdict(lambda: 0)
 
@@ -480,7 +487,7 @@
     for ss in sorted(subsizedistrib):
         ssc = subsizedistrib[ss]
         ssp = ssc * 100 // nbsubranges
-        ui.write('  with %3d subranges: %12d (%3d%%)\n' % (ss, ssc, ssp))
+        ui.write(b'  with %3d subranges: %12d (%3d%%)\n' % (ss, ssc, ssp))
 
     depth = repo.depthcache.get
     stdslice = 0
@@ -495,11 +502,11 @@
         else:
             oddslice += 1
 
-    ui.write('standard slice point cut: %12d (%3d%%)\n'
+    ui.write(b'standard slice point cut: %12d (%3d%%)\n'
              % (stdslice, stdslice * 100 // nbsubranges))
-    ui.write('other    slice point cut: %12d (%3d%%)\n'
+    ui.write(b'other    slice point cut: %12d (%3d%%)\n'
              % (oddslice, oddslice * 100 // nbsubranges))
-    ui.write('est. naive compact store: %12d bytes\n' % totalsize)
+    ui.write(b'est. naive compact store: %12d bytes\n' % totalsize)
 
 @eh.reposetup
 def setupcache(ui, repo):
--- a/hgext3rd/evolve/stablesort.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/stablesort.py	Fri May 08 20:36:29 2020 +0800
@@ -252,18 +252,15 @@
 
 from mercurial import (
     commands,
+    error,
     localrepo,
-    error,
+    logcmdutil,
     node as nodemod,
     pycompat,
     scmutil,
 )
 
-try:
-    from mercurial.utils.stringutil import forcebytestr
-except ImportError:
-    # hg <= 4.5 (f99d64e8a4e4)
-    from mercurial.util import forcebytestr
+from mercurial.utils.stringutil import forcebytestr
 
 from mercurial.i18n import _
 
@@ -318,8 +315,9 @@
         raise error.Abort(b'unknown sorting method: "%s"' % method,
                           hint=b'pick one of: %s' % valid_method)
 
-    displayer = compat.changesetdisplayer(ui, repo, pycompat.byteskwargs(opts),
-                                          buffered=True)
+    displayer = logcmdutil.changesetdisplayer(ui, repo,
+                                              pycompat.byteskwargs(opts),
+                                              buffered=True)
     kwargs = {}
     if opts['limit']:
         kwargs['limit'] = int(opts['limit'])
--- a/hgext3rd/evolve/templatekw.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/templatekw.py	Fri May 08 20:36:29 2020 +0800
@@ -11,6 +11,7 @@
 from . import (
     error,
     exthelper,
+    obshistory,
 )
 
 from mercurial import (
@@ -22,36 +23,32 @@
 
 ### template keywords
 
-if util.safehasattr(templatekw, 'compatlist'):
-    @eh.templatekeyword(b'instabilities', requires={b'ctx', b'templ'})
-    def showinstabilities(context, mapping):
-        """List of strings. Evolution instabilities affecting the changeset
-        (zero or more of "orphan", "content-divergent" or "phase-divergent")."""
-        ctx = context.resource(mapping, b'ctx')
-        return templatekw.compatlist(context, mapping, b'instability',
-                                     ctx.instabilities(),
-                                     plural=b'instabilities')
+@eh.templatekeyword(b'instabilities', requires={b'ctx', b'templ'})
+def showinstabilities(context, mapping):
+    """List of strings. Evolution instabilities affecting the changeset
+    (zero or more of "orphan", "content-divergent" or "phase-divergent")."""
+    ctx = context.resource(mapping, b'ctx')
+    return templatekw.compatlist(context, mapping, b'instability',
+                                 ctx.instabilities(),
+                                 plural=b'instabilities')
 
-    @eh.templatekeyword(b'troubles', requires={b'ctx', b'templ'})
-    def showtroubles(context, mapping):   # legacy name for instabilities
-        ctx = context.resource(mapping, b'ctx')
-        return templatekw.compatlist(context, mapping, b'trouble',
-                                     ctx.instabilities(), plural=b'troubles')
-else:
-    # older template API in hg < 4.6
-    @eh.templatekeyword(b'instabilities')
-    def showinstabilities(**args):
-        """List of strings. Evolution instabilities affecting the changeset
-        (zero or more of "orphan", "content-divergent" or "phase-divergent")."""
-        ctx = args[b'ctx']
-        return templatekw.showlist(b'instability', ctx.instabilities(), args,
-                                   plural=b'instabilities')
+@eh.templatekeyword(b'troubles', requires={b'ctx', b'templ'})
+def showtroubles(context, mapping):   # legacy name for instabilities
+    ctx = context.resource(mapping, b'ctx')
+    return templatekw.compatlist(context, mapping, b'trouble',
+                                 ctx.instabilities(), plural=b'troubles')
 
-    @eh.templatekeyword(b'troubles')
-    def showtroubles(**args):
-        ctx = args[b'ctx']
-        return templatekw.showlist(b'trouble', ctx.instabilities(), args,
-                                   plural=b'troubles')
+@eh.templatekeyword(b'obsorigin', requires={b'ui', b'repo', b'ctx'})
+def showobsorigin(context, mapping):
+    ui = context.resource(mapping, b'ui')
+    repo = context.resource(mapping, b'repo')
+    ctx = context.resource(mapping, b'ctx')
+    values = []
+    r = obshistory.predecessorsandmarkers(repo, ctx.node())
+    for (nodes, markers) in sorted(obshistory.groupbyfoldid(r)):
+        v = obshistory.obsoriginprinter(ui, repo, nodes, markers)
+        values.append(v)
+    return templatekw.compatlist(context, mapping, b'origin', values)
 
 _sp = templatekw.showpredecessors
 if util.safehasattr(_sp, '_requires'):
--- a/hgext3rd/evolve/utility.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/evolve/utility.py	Fri May 08 20:36:29 2020 +0800
@@ -112,14 +112,15 @@
         return p.rev()
     obs = repo[p]
     ui = repo.ui
-    newer = obsutil.successorssets(repo, obs.node())
+    cache = {}
+    newer = obsutil.successorssets(repo, obs.node(), cache=cache)
     # search of a parent which is not killed
     while not newer:
         ui.debug(b"stabilize target %s is plain dead,"
                  b" trying to stabilize on its parent\n" %
                  obs)
         obs = obs.p1()
-        newer = obsutil.successorssets(repo, obs.node())
+        newer = obsutil.successorssets(repo, obs.node(), cache=cache)
     if len(newer) > 1 or len(newer[0]) > 1:
         raise MultipleSuccessorsError(newer)
 
--- a/hgext3rd/pullbundle.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/pullbundle.py	Fri May 08 20:36:29 2020 +0800
@@ -640,7 +640,7 @@
         ui.progress(topic, pos, item, unit, total)
 
 # nodemap.get and index.[has_node|rev|get_rev]
-# hg <= 5.3 (02802fa87b74)
+# hg <= 5.2 (02802fa87b74)
 def getgetrev(cl):
     """Returns index.get_rev or nodemap.get (for pre-5.3 Mercurial)."""
     if util.safehasattr(cl.index, 'get_rev'):
--- a/hgext3rd/serverminitopic.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/serverminitopic.py	Fri May 08 20:36:29 2020 +0800
@@ -23,12 +23,7 @@
     util,
 )
 
-# hg <= 4.5 (b4d85bc122bd)
-try:
-    from mercurial import wireproto  # pytype: disable=import-error
-    wireproto.branchmap
-except ImportError:
-    from mercurial import wireprotov1server as wireproto
+from mercurial import wireprotov1server
 
 if util.safehasattr(registrar, 'configitem'):
 
@@ -163,7 +158,7 @@
         if util.safehasattr(self, '_entries'):
             _entries = self._entries
         else:
-            # hg <= 4.9 (624d6683c705, b137a6793c51)
+            # hg <= 4.9 (624d6683c705+b137a6793c51)
             _entries = self
         new = self.__class__(_entries, self.tipnode, self.tiprev,
                              self.filteredhash, self._closednodes)
@@ -237,11 +232,11 @@
 def uisetup(ui):
     wrapclass(branchmap, 'branchcache', _topiccache)
     try:
-        # Mercurial 4.8 and older
+        # hg <= 4.9 (3461814417f3)
         extensions.wrapfunction(branchmap, 'read', wrapread)
     except AttributeError:
-        # Mercurial 4.9; branchcache.fromfile now takes care of this
+        # Mercurial 5.0; branchcache.fromfile now takes care of this
         # which is alredy defined on _topiccache
         pass
-    extensions.wrapfunction(wireproto, '_capabilities', wireprotocaps)
+    extensions.wrapfunction(wireprotov1server, '_capabilities', wireprotocaps)
     extensions.wrapfunction(context.changectx, 'branch', topicbranch)
--- a/hgext3rd/topic/__init__.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/topic/__init__.py	Fri May 08 20:36:29 2020 +0800
@@ -156,7 +156,6 @@
     registrar,
     scmutil,
     templatefilters,
-    templatekw,
     util,
 )
 
@@ -203,9 +202,9 @@
               b'topic.active': b'green',
               }
 
-__version__ = b'0.18.1.dev'
+__version__ = b'0.18.2'
 
-testedwith = b'4.6.2 4.7 4.8 4.9 5.0 5.1 5.2 5.3'
+testedwith = b'4.6.2 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4'
 minimumhgversion = b'4.6'
 buglink = b'https://bz.mercurial-scm.org/'
 
@@ -259,10 +258,6 @@
                       default=None,
             )
 
-# we need to do old style declaration for <= 4.5
-templatekeyword = registrar.templatekeyword()
-post45template = r'requires=' in templatekeyword.__doc__
-
 def _contexttopic(self, force=False):
     if not (force or self.mutable()):
         return b''
@@ -374,9 +369,6 @@
 
     cmdutil.summaryhooks.add(b'topic', summaryhook)
 
-    if not post45template:
-        templatekw.keywords[b'topic'] = topickw
-        templatekw.keywords[b'topicidx'] = topicidxkw
     # Wrap workingctx extra to return the topic name
     extensions.wrapfunction(context.workingctx, '__init__', wrapinit)
     # Wrap changelog.add to drop empty topic
@@ -414,9 +406,14 @@
         def _restrictcapabilities(self, caps):
             caps = super(topicrepo, self)._restrictcapabilities(caps)
             caps.add(b'topics')
-            if self.ui.configbool(b'experimental',
-                                  b'topic.publish-bare-branch'):
-                caps.add(b'ext-topics-publish=auto')
+            if self.ui.configbool(b'phases', b'publish'):
+                mode = b'all'
+            elif self.ui.configbool(b'experimental',
+                                    b'topic.publish-bare-branch'):
+                mode = b'auto'
+            else:
+                mode = b'none'
+            caps.add(b'ext-topics-publish=%s' % mode)
             return caps
 
         def commit(self, *args, **kwargs):
@@ -505,38 +502,57 @@
 
             reporef = weakref.ref(self)
             if self.ui.configbool(b'experimental', b'enforce-single-head'):
-                if util.safehasattr(tr, 'validator'): # hg <= 4.7
+                if util.safehasattr(tr, 'validator'): # hg <= 4.7 (ebbba3ba3f66)
                     origvalidator = tr.validator
+                elif util.safehasattr(tr, '_validator'):
+                    # hg <= 5.3 (36f08ae87ef6)
+                    origvalidator = tr._validator
                 else:
-                    origvalidator = tr._validator
+                    origvalidator = None
+
+                def _validate(tr2):
+                    repo = reporef()
+                    flow.enforcesinglehead(repo, tr2)
 
                 def validator(tr2):
-                    repo = reporef()
-                    flow.enforcesinglehead(repo, tr2)
+                    _validate(tr2)
                     origvalidator(tr2)
 
-                if util.safehasattr(tr, 'validator'): # hg <= 4.7
+                if util.safehasattr(tr, 'validator'): # hg <= 4.7 (ebbba3ba3f66)
                     tr.validator = validator
+                elif util.safehasattr(tr, '_validator'):
+                    # hg <= 5.3 (36f08ae87ef6)
+                    tr._validator = validator
                 else:
-                    tr._validator = validator
+                    tr.addvalidator(b'000-enforce-single-head', _validate)
 
             topicmodeserver = self.ui.config(b'experimental',
                                              b'topic-mode.server', b'ignore')
             ispush = (desc.startswith(b'push') or desc.startswith(b'serve'))
             if (topicmodeserver != b'ignore' and ispush):
-                if util.safehasattr(tr, 'validator'): # hg <= 4.7
+                if util.safehasattr(tr, 'validator'): # hg <= 4.7 (ebbba3ba3f66)
                     origvalidator = tr.validator
+                elif util.safehasattr(tr, '_validator'):
+                    # hg <= 5.3 (36f08ae87ef6)
+                    origvalidator = tr._validator
                 else:
-                    origvalidator = tr._validator
+                    origvalidator = None
+
+                def _validate(tr2):
+                    repo = reporef()
+                    flow.rejectuntopicedchangeset(repo, tr2)
 
                 def validator(tr2):
-                    repo = reporef()
-                    flow.rejectuntopicedchangeset(repo, tr2)
+                    _validate(tr2)
                     return origvalidator(tr2)
-                if util.safehasattr(tr, 'validator'): # hg <= 4.7
+
+                if util.safehasattr(tr, 'validator'): # hg <= 4.7 (ebbba3ba3f66)
                     tr.validator = validator
+                elif util.safehasattr(tr, '_validator'):
+                    # hg <= 5.3 (36f08ae87ef6)
+                    tr._validator = validator
                 else:
-                    tr._validator = validator
+                    tr.addvalidator(b'000-reject-untopiced', _validate)
 
             elif (self.ui.configbool(b'experimental', b'topic.publish-bare-branch')
                     and (desc.startswith(b'push')
@@ -555,19 +571,29 @@
                                                b'topic.allow-publish',
                                                True)
             if not allow_publish:
-                if util.safehasattr(tr, 'validator'): # hg <= 4.7
+                if util.safehasattr(tr, 'validator'): # hg <= 4.7 (ebbba3ba3f66)
                     origvalidator = tr.validator
+                elif util.safehasattr(tr, '_validator'):
+                    # hg <= 5.3 (36f08ae87ef6)
+                    origvalidator = tr._validator
                 else:
-                    origvalidator = tr._validator
+                    origvalidator = None
+
+                def _validate(tr2):
+                    repo = reporef()
+                    flow.reject_publish(repo, tr2)
 
                 def validator(tr2):
-                    repo = reporef()
-                    flow.reject_publish(repo, tr2)
+                    _validate(tr2)
                     return origvalidator(tr2)
-                if util.safehasattr(tr, 'validator'): # hg <= 4.7
+
+                if util.safehasattr(tr, 'validator'): # hg <= 4.7 (ebbba3ba3f66)
                     tr.validator = validator
+                elif util.safehasattr(tr, '_validator'):
+                    # hg <= 5.3 (36f08ae87ef6)
+                    tr._validator = validator
                 else:
-                    tr._validator = validator
+                    tr.addvalidator(b'000-reject-publish', _validate)
 
             # real transaction start
             ct = self.currenttopic
@@ -608,26 +634,19 @@
             b'topics', b'topic', namemap=_namemap, nodemap=_nodemap,
             listnames=lambda repo: repo.topics))
 
-if post45template:
-    @templatekeyword(b'topic', requires={b'ctx'})
-    def topickw(context, mapping):
-        """:topic: String. The topic of the changeset"""
-        ctx = context.resource(mapping, b'ctx')
-        return ctx.topic()
+templatekeyword = registrar.templatekeyword()
 
-    @templatekeyword(b'topicidx', requires={b'ctx'})
-    def topicidxkw(context, mapping):
-        """:topicidx: Integer. Index of the changeset as a stack alias"""
-        ctx = context.resource(mapping, b'ctx')
-        return ctx.topicidx()
-else:
-    def topickw(**args):
-        """:topic: String. The topic of the changeset"""
-        return args[b'ctx'].topic()
+@templatekeyword(b'topic', requires={b'ctx'})
+def topickw(context, mapping):
+    """:topic: String. The topic of the changeset"""
+    ctx = context.resource(mapping, b'ctx')
+    return ctx.topic()
 
-    def topicidxkw(**args):
-        """:topicidx: Integer. Index of the changeset as a stack alias"""
-        return args[b'ctx'].topicidx()
+@templatekeyword(b'topicidx', requires={b'ctx'})
+def topicidxkw(context, mapping):
+    """:topicidx: Integer. Index of the changeset as a stack alias"""
+    ctx = context.resource(mapping, b'ctx')
+    return ctx.topicidx()
 
 def wrapinit(orig, self, repo, *args, **kwargs):
     orig(self, repo, *args, **kwargs)
--- a/hgext3rd/topic/compat.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/topic/compat.py	Fri May 08 20:36:29 2020 +0800
@@ -32,7 +32,7 @@
     return {'helpcategory': category}
 
 # nodemap.get and index.[has_node|rev|get_rev]
-# hg <= 5.3 (02802fa87b74)
+# hg <= 5.2 (02802fa87b74)
 def getgetrev(cl):
     """Returns index.get_rev or nodemap.get (for pre-5.3 Mercurial)."""
     if util.safehasattr(cl.index, 'get_rev'):
--- a/hgext3rd/topic/discovery.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/topic/discovery.py	Fri May 08 20:36:29 2020 +0800
@@ -17,15 +17,9 @@
     compat,
 )
 
-# hg <= 4.5 (b4d85bc122bd)
-try:
-    from mercurial import wireproto  # pytype: disable=import-error
-    wireproto.branchmap
-except (AttributeError, ImportError):
-    from mercurial import wireprotov1server as wireproto
+from mercurial import wireprotov1server
 
 def _headssummary(orig, pushop, *args, **kwargs):
-    # In mercurial > 4.3, we receive the pushop as arguments
     repo = pushop.repo.unfiltered()
     remote = pushop.remote
 
@@ -205,12 +199,13 @@
         return
     tr._prepushheads = _nbheads(op.repo)
     reporef = weakref.ref(op.repo)
-    if util.safehasattr(tr, 'validator'): # hg <= 4.7
+    if util.safehasattr(tr, 'validator'): # hg <= 4.7 (ebbba3ba3f66)
         oldvalidator = tr.validator
-    else:
+    elif util.safehasattr(tr, '_validator'):
+        # hg <= 5.3 (36f08ae87ef6)
         oldvalidator = tr._validator
 
-    def validator(tr):
+    def _validate(tr):
         repo = reporef()
         if repo is not None:
             repo.invalidatecaches()
@@ -225,11 +220,19 @@
                     msg = _(b'push create more than 1 head on new branch "%s"'
                             % branch)
                     raise error.Abort(msg)
+
+    def validator(tr):
+        _validate(tr)
         return oldvalidator(tr)
-    if util.safehasattr(tr, 'validator'): # hg <= 4.7
+
+    if util.safehasattr(tr, 'validator'): # hg <= 4.7 (ebbba3ba3f66)
         tr.validator = validator
+    elif util.safehasattr(tr, '_validator'):
+        # hg <= 5.3 (36f08ae87ef6)
+        tr._validator = validator
     else:
-        tr._validator = validator
+        tr.addvalidator(b'000-new-head-check', _validate)
+
 handlecheckheads.params = frozenset()
 
 def _pushb2phases(orig, pushop, bundler):
@@ -249,8 +252,8 @@
 def modsetup(ui):
     """run at uisetup time to install all destinations wrapping"""
     extensions.wrapfunction(discovery, '_headssummary', _headssummary)
-    extensions.wrapfunction(wireproto, 'branchmap', wireprotobranchmap)
-    extensions.wrapfunction(wireproto, '_capabilities', wireprotocaps)
+    extensions.wrapfunction(wireprotov1server, 'branchmap', wireprotobranchmap)
+    extensions.wrapfunction(wireprotov1server, '_capabilities', wireprotocaps)
     # we need a proper wrap b2 part stuff
     extensions.wrapfunction(bundle2, 'handlecheckheads', handlecheckheads)
     bundle2.handlecheckheads.params = frozenset()
--- a/hgext3rd/topic/evolvebits.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/topic/evolvebits.py	Fri May 08 20:36:29 2020 +0800
@@ -75,14 +75,15 @@
         return p.rev()
     obs = repo[p]
     ui = repo.ui
-    newer = obsutil.successorssets(repo, obs.node())
+    cache = {}
+    newer = obsutil.successorssets(repo, obs.node(), cache=cache)
     # search of a parent which is not killed
     while not newer:
         ui.debug(b"stabilize target %s is plain dead,"
                  b" trying to stabilize on its parent\n" %
                  obs)
         obs = obs.p1()
-        newer = obsutil.successorssets(repo, obs.node())
+        newer = obsutil.successorssets(repo, obs.node(), cache=cache)
     if 1 < len(newer):
         # divergence case
         # we should pick as arbitrary one
--- a/hgext3rd/topic/flow.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/topic/flow.py	Fri May 08 20:36:29 2020 +0800
@@ -7,6 +7,7 @@
     extensions,
     node,
     phases,
+    util,
 )
 
 from mercurial.i18n import _
@@ -62,10 +63,18 @@
 
 def reject_publish(repo, tr):
     """prevent a transaction to be publish anything"""
-    published = set()
-    for r, (o, n) in tr.changes[b'phases'].items():
-        if n == phases.public:
-            published.add(r)
+    if util.safehasattr(tr.changes[b'phases'], 'items'):
+        # hg <= 5.3 (fdc802f29b2c)
+        published = {
+            r for r, (o, n) in tr.changes[b'phases'].items()
+            if n == phases.public
+        }
+    else:
+        revranges = [
+            r for r, (o, n) in tr.changes[b'phases']
+            if n == phases.public
+        ]
+        published = {r for revrange in revranges for r in revrange}
     if published:
         r = min(published)
         msg = b"rejecting publishing of changeset %s" % repo[r]
@@ -101,7 +110,8 @@
 
 def installpushflag(ui):
     entry = extensions.wrapcommand(commands.table, b'push', wrappush)
-    if not any(opt for opt in entry[1] if opt[1] == b'publish'): # hg <= 4.9
+    if not any(opt for opt in entry[1] if opt[1] == b'publish'):
+        # hg <= 4.8 (9b8d1ad851f8)
         entry[1].append((b'', b'publish', False,
                          _(b'push the changeset as public')))
     extensions.wrapfunction(exchange.pushoperation, '__init__',
--- a/hgext3rd/topic/revset.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/topic/revset.py	Fri May 08 20:36:29 2020 +0800
@@ -124,6 +124,7 @@
                 b'relation subscript bounds must be integers',
                 None, None)
         else:
+            # hg <= 4.9 (431cf2c8c839+13f7a6a4f0db)
             a = b = z
 
         s = revset.getset(repo, revset.fullreposet(repo), x)
@@ -164,7 +165,10 @@
 
     def topicrel(repo, subset, x, *args):
         subset &= topicset(repo, subset, x)
-        return revset.generationsrel(repo, subset, x, *args)
+        # not using revset.generationssubrel directly because it was renamed
+        # hg <= 5.3 (8859de3e83dc)
+        generationssubrel = revset.subscriptrelations[b'generations']
+        return generationssubrel(repo, subset, x, *args)
 
     revset.subscriptrelations[b'topic'] = topicrel
     revset.subscriptrelations[b't'] = topicrel
--- a/hgext3rd/topic/server.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/topic/server.py	Fri May 08 20:36:29 2020 +0800
@@ -10,14 +10,13 @@
     wireprotov1server,
 )
 
-
 try:
     from mercurial.utils import (
         repoviewutil,
     )
     repoviewutil.subsettable
 except (AttributeError, ImportError):
-    # hg <= 4.8
+    # hg <= 4.9 (caebe5e7f4bd)
     from mercurial import branchmap as repoviewutil
 
 from . import (
@@ -54,14 +53,6 @@
         filteredrevs = frozenset(filteredrevs | extrafiltered)
     return filteredrevs
 
-def wireprotocommand(name, args=b'', permission=b'pull'):
-    try:
-        from mercurial.wireprotov1server import wireprotocommand
-    except (ImportError, AttributeError):
-        # hg <= 4.6 (b4d85bc122bd)
-        from mercurial.wireproto import wireprotocommand
-    return wireprotocommand(name, args, permission=permission)
-
 def wrapheads(orig, repo, proto):
     """wrap head to hide topic^W draft changeset to old client"""
     hidetopics = repo.ui.configbool(b'experimental', b'topic.server-gate-topic-changesets')
@@ -85,8 +76,8 @@
 def setupserver(ui):
     extensions.wrapfunction(wireprotov1server, 'heads', wrapheads)
     wireprotov1server.commands.pop(b'heads')
-    wireprotocommand(b'heads', permission=b'pull')(wireprotov1server.heads)
-    wireprotocommand(b'_exttopics_heads', permission=b'pull')(topicheads)
+    wireprotov1server.wireprotocommand(b'heads', permission=b'pull')(wireprotov1server.heads)
+    wireprotov1server.wireprotocommand(b'_exttopics_heads', permission=b'pull')(topicheads)
     extensions.wrapfunction(wireprotov1server, '_capabilities', wireprotocaps)
 
     class topicpeerexecutor(wireprotov1peer.peerexecutor):
--- a/hgext3rd/topic/topicmap.py	Wed Apr 08 01:16:54 2020 +0800
+++ b/hgext3rd/topic/topicmap.py	Fri May 08 20:36:29 2020 +0800
@@ -125,7 +125,7 @@
     branchmap.branchcache = topiccache
 
     try:
-        # Mercurial 4.9
+        # Mercurial 5.0
         class remotetopiccache(_topiccache, branchmap.remotebranchcache):
             pass
         branchmap.remotebranchcache = remotetopiccache
@@ -135,7 +135,7 @@
             return _wrapupdatebmcache(orig.__get__(self), repo)
         extensions.wrapfunction(branchmap.BranchMapCache, 'updatecache', _wrapupdatebmcachemethod)
     except AttributeError:
-        # Mercurial 4.8 and before
+        # hg <= 4.9 (3461814417f3)
         extensions.wrapfunction(branchmap, 'updatecache', _wrapupdatebmcache)
 
 
@@ -173,7 +173,7 @@
         if util.safehasattr(self, '_entries'):
             _entries = self._entries
         else:
-            # hg <= 4.9 (624d6683c705, b137a6793c51)
+            # hg <= 4.9 (624d6683c705+b137a6793c51)
             _entries = self
         new = self.__class__(_entries, self.tipnode, self.tiprev,
                              self.filteredhash, self._closednodes)
--- a/tests/test-amend-patch.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-amend-patch.t	Fri May 08 20:36:29 2020 +0800
@@ -84,18 +84,20 @@
 
 Obsolsence history is fine
 
+  $ hg debugobsolete
+  f7ad4196431346de3c33c52e75374fba45e04313 af624b221c0c0bec5d74e2650180dd3eddcb7c42 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
   $ hg obslog -p -r .
   @  af624b221c0c (1) added a
+  |    amended(content) from f7ad41964313 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff --git a/a b/a
+  |      --- a/a
+  |      +++ b/a
+  |      @@ -1,1 +1,1 @@
+  |      -foo
+  |      +Gello
+  |
   |
   x  f7ad41964313 (0) added a
-       amended(content) as af624b221c0c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff --git a/a b/a
-         --- a/a
-         +++ b/a
-         @@ -1,1 +1,1 @@
-         -foo
-         +Gello
-  
   
 Diff and status are good too
   $ hg diff
@@ -257,7 +259,8 @@
   $ hg status
   ? editor.sh
 
-  $ ls
+  $ ls -A
+  .hg
   changedfile
   editor.sh
 
--- a/tests/test-amend.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-amend.t	Fri May 08 20:36:29 2020 +0800
@@ -21,13 +21,20 @@
   $ hg amend -d '0 0' -n "this a note on the obsmarker and supported for hg>=4.4"
   $ hg debugobsolete
   07f4944404050f47db2e5c5071e0e84e7a27bba9 6a022cbb61d5ba0f03f98ff2d36319dfea1034ae 0 (*) {'ef1': '*', 'user': 'test'} (glob)
-  $ hg obslog
+  $ hg obslog --no-origin
   @  6a022cbb61d5 (1) adda
   |
   x  07f494440405 (0) adda
        branch-changed(branch) as 6a022cbb61d5 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
          note: this a note on the obsmarker and supported for hg>=4.4
   
+  $ hg obslog
+  @  6a022cbb61d5 (1) adda
+  |    branch-changed(branch) from 07f494440405 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      note: this a note on the obsmarker and supported for hg>=4.4
+  |
+  x  07f494440405 (0) adda
+  
   $ hg branch
   foo
   $ hg branches
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-check-compat-strings.t	Fri May 08 20:36:29 2020 +0800
@@ -0,0 +1,8 @@
+Enable obsolescence to avoid the warning issue when obsmarkers are found
+
+  $ cat << EOF >> $HGRCPATH
+  > [experimental]
+  > evolution = all
+  > EOF
+
+  $ $TESTDIR/../contrib/check-compat-strings.sh "$TESTDIR/../hgext3rd/" "$RUNTESTDIR/.."
--- a/tests/test-evolve-content-divergent-basic.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-content-divergent-basic.t	Fri May 08 20:36:29 2020 +0800
@@ -142,9 +142,9 @@
   with: [3] divergent
   base: [1] added b
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 45bf1312f454
+  working directory is now at 98ab969ac8fb
   $ hg log -G
-  @  4:45bf1312f454@default(draft) divergent []
+  @  4:98ab969ac8fb@default(draft) divergent []
   |
   o  0:9092f1db7931@default(draft) added a []
   
@@ -153,7 +153,7 @@
   # User test
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
-  # Node ID 45bf1312f45468b76158b33f8426e6530c8b35b1
+  # Node ID 98ab969ac8fbe315e6d2c24a8eb5eab5b81e4242
   # Parent  9092f1db7931481f93b37d5c9fbcfc341bcd7318
   divergent
   
@@ -240,10 +240,10 @@
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   content divergent changesets on different branches.
   choose branch for the resolution changeset. (a) default or (b) watwat or (c) foobar?  c
-  working directory is now at 0ac42f1bc15c
+  working directory is now at 15ee7f765bf7
 
   $ hg glog
-  @  7:0ac42f1bc15c added d
+  @  7:15ee7f765bf7 added d
   |   () [foobar] draft
   o  3:ca1b80f7960a added c
   |   () [default] draft
@@ -269,14 +269,14 @@
   $ echo bar > d
   $ hg ci -Aqm "added a d with bar in it, expect some beers"
 
-  $ hg prune -r 0ac42f1bc15c -s . --hidden
+  $ hg prune -r 'predecessors(desc("added d") - obsolete())' -s . --hidden
   1 changesets pruned
   2 new content-divergent changesets
 
   $ hg glog
   @  9:59081c9c425a added a d with bar in it, expect some beers
   |   () [default] draft
-  | *  8:f621d00f5f0e added d
+  | *  8:e6f07f2f33a9 added d
   |/    () [foobar] draft
   o  3:ca1b80f7960a added c
   |   () [default] draft
@@ -292,10 +292,10 @@
   with: [8] added d
   base: [7] added d
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at a9d6fd6b5e40
+  working directory is now at 34e78e1673c1
 
   $ hg glog
-  @  10:a9d6fd6b5e40 added a d with bar in it, expect some beers
+  @  10:34e78e1673c1 added a d with bar in it, expect some beers
   |   () [default] draft
   o  3:ca1b80f7960a added c
   |   () [default] draft
@@ -311,20 +311,20 @@
   $ echo foo > d
   $ hg amend -m "foo to d"
 
-  $ hg up a9d6fd6b5e40 --hidden
+  $ hg up 'predecessors(.)' --hidden
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  updated to hidden changeset a9d6fd6b5e40
-  (hidden revision 'a9d6fd6b5e40' was rewritten as: b10b07a394f1)
-  working directory parent is obsolete! (a9d6fd6b5e40)
-  (use 'hg evolve' to update to its successor: b10b07a394f1)
+  updated to hidden changeset 34e78e1673c1
+  (hidden revision '34e78e1673c1' was rewritten as: c9d0d72972b0)
+  working directory parent is obsolete! (34e78e1673c1)
+  (use 'hg evolve' to update to its successor: c9d0d72972b0)
   $ echo babar > d
   $ hg amend -m "foo to d"
   2 new content-divergent changesets
 
   $ hg glog
-  @  12:0bb497fed24a foo to d
+  @  12:b4dadb3b47a7 foo to d
   |   () [default] draft
-  | *  11:b10b07a394f1 foo to d
+  | *  11:c9d0d72972b0 foo to d
   |/    () [default] draft
   o  3:ca1b80f7960a added c
   |   () [default] draft
@@ -351,10 +351,10 @@
   (no more unresolved files)
   continue: hg evolve --continue
   $ hg evolve --continue
-  working directory is now at 11175423b5dc
+  working directory is now at cfd599de811a
 
   $ hg glog
-  @  13:11175423b5dc foo to d
+  @  13:cfd599de811a foo to d
   |   () [default] draft
   o  3:ca1b80f7960a added c
   |   () [default] draft
@@ -371,20 +371,20 @@
   $ echo bar > d
   $ hg amend -m "bar to d, expect beers"
 
-  $ hg up 11175423b5dc --hidden
+  $ hg up 'predecessors(.)' --hidden
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  updated to hidden changeset 11175423b5dc
-  (hidden revision '11175423b5dc' was rewritten as: 27f0463f169a)
-  working directory parent is obsolete! (11175423b5dc)
-  (use 'hg evolve' to update to its successor: 27f0463f169a)
+  updated to hidden changeset cfd599de811a
+  (hidden revision 'cfd599de811a' was rewritten as: ba0941ffb747)
+  working directory parent is obsolete! (cfd599de811a)
+  (use 'hg evolve' to update to its successor: ba0941ffb747)
   $ echo wat > d
   $ hg amend -m "wat to d, wat?"
   2 new content-divergent changesets
 
   $ hg glog
-  @  15:f542037ddf31 wat to d, wat?
+  @  15:4127dd63df67 wat to d, wat?
   |   () [default] draft
-  | *  14:27f0463f169a bar to d, expect beers
+  | *  14:ba0941ffb747 bar to d, expect beers
   |/    () [default] draft
   o  3:ca1b80f7960a added c
   |   () [default] draft
@@ -434,10 +434,10 @@
   
   **done showing editors text**
   
-  working directory is now at 89ea3eee2d69
+  working directory is now at b4c8664fa327
 
   $ hg glog
-  @  16:89ea3eee2d69 watbar to d
+  @  16:b4c8664fa327 watbar to d
   |   () [default] draft
   o  3:ca1b80f7960a added c
   |   () [default] draft
@@ -533,15 +533,15 @@
   a
   committing manifest
   committing changelog
-  working directory is now at 5bf84d1d71d1
+  working directory is now at 6aa6f90a9f68
   $ hg st
   $ glog
-  @  4:5bf84d1d71d1@default(draft) bk:[] More addition
+  @  4:6aa6f90a9f68@default(draft) bk:[] More addition
   |
   o  0:6569b5a81c7e@default(public) bk:[] root
   
   $ hg summary
-  parent: 4:5bf84d1d71d1 tip
+  parent: 4:6aa6f90a9f68 tip
    More addition
   branch: default
   commit: (clean)
@@ -552,7 +552,7 @@
   # User test
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
-  # Node ID 5bf84d1d71d12f451bfe1e09b93045eb6338cd6c
+  # Node ID 6aa6f90a9f684b8a4b698234e25c5dad7328b199
   # Parent  6569b5a81c7e307ddc076550e8c0f6d75b6effcd
   More addition
   
@@ -577,9 +577,9 @@
   $ hg up --hidden 'min(desc("More addition"))'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   updated to hidden changeset 867e43582046
-  (hidden revision '867e43582046' was rewritten as: 5bf84d1d71d1)
+  (hidden revision '867e43582046' was rewritten as: 6aa6f90a9f68)
   working directory parent is obsolete! (867e43582046)
-  (use 'hg evolve' to update to its successor: 5bf84d1d71d1)
+  (use 'hg evolve' to update to its successor: 6aa6f90a9f68)
   $ echo 'gotta break' >> a
   $ hg amend
   2 new content-divergent changesets
@@ -594,15 +594,15 @@
   $ glog
   @  6:13c1b75640a1@default(draft) bk:[] More addition (2)
   |
-  | *  4:5bf84d1d71d1@default(draft) bk:[] More addition
+  | *  4:6aa6f90a9f68@default(draft) bk:[] More addition
   |/
   o  0:6569b5a81c7e@default(public) bk:[] root
   
 
   $ hg evolve -qn --content-divergent --no-all
   hg update -c 13c1b75640a1 &&
-  hg merge 5bf84d1d71d1 &&
-  hg commit -m "auto merge resolving conflict between 13c1b75640a1 and 5bf84d1d71d1"&&
+  hg merge 6aa6f90a9f68 &&
+  hg commit -m "auto merge resolving conflict between 13c1b75640a1 and 6aa6f90a9f68"&&
   hg up -C 867e43582046 &&
   hg revert --all --rev tip &&
   hg commit -m "`hg log -r 13c1b75640a1 --template={desc}`";
@@ -633,9 +633,9 @@
   (no more unresolved files)
   continue: hg evolve --continue
   $ hg evolve --continue
-  working directory is now at 2346e1147fed
+  working directory is now at 22dc0f618f0d
   $ glog
-  @  7:2346e1147fed@default(draft) bk:[] More addition (2)
+  @  7:22dc0f618f0d@default(draft) bk:[] More addition (2)
   |
   o  0:6569b5a81c7e@default(public) bk:[] root
   
@@ -644,7 +644,7 @@
   # User test
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
-  # Node ID 2346e1147fedc8c9aa17f9ba7870dcd8be52f567
+  # Node ID 22dc0f618f0d8714c611e7a683ad229a575f167c
   # Parent  6569b5a81c7e307ddc076550e8c0f6d75b6effcd
   More addition (2)
   
@@ -895,63 +895,66 @@
   19ed1bf64a2c: E3
     content-divergent: 084ae625fa51 (draft) (precursor 4a250e5bd992)
   
+  $ hg debugobsolete
+  4a250e5bd992a897655e3b6f238e12452cf063e9 084ae625fa51ca8c441ba1d2bf0f974b21671017 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  4a250e5bd992a897655e3b6f238e12452cf063e9 19ed1bf64a2cc2a824df5ac33a436eca1ae0475d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
   $ hg obslog --all --patch
   *  084ae625fa51 (2) E2
+  |    rewritten(description, content) from 4a250e5bd992 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 4a250e5bd992 -r 084ae625fa51 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -E1
+  |      +E2
+  |
+  |      diff --git a/numbers b/numbers
+  |      --- a/numbers
+  |      +++ b/numbers
+  |      @@ -4,1 +4,1 @@
+  |      -four
+  |      +4
+  |      @@ -7,1 +7,1 @@
+  |      -7
+  |      +seven
+  |      diff --git a/romans b/romans
+  |      --- a/romans
+  |      +++ b/romans
+  |      @@ -6,1 +6,1 @@
+  |      -VI
+  |      +vi
+  |
   |
   | @  19ed1bf64a2c (3) E3
-  |/
+  |/     rewritten(description, content) from 4a250e5bd992 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        diff -r 4a250e5bd992 -r 19ed1bf64a2c changeset-description
+  |        --- a/changeset-description
+  |        +++ b/changeset-description
+  |        @@ -1,1 +1,1 @@
+  |        -E1
+  |        +E3
+  |
+  |        diff --git a/letters b/letters
+  |        --- a/letters
+  |        +++ b/letters
+  |        @@ -4,1 +4,1 @@
+  |        -D
+  |        +d
+  |        diff --git a/numbers b/numbers
+  |        --- a/numbers
+  |        +++ b/numbers
+  |        @@ -1,1 +1,1 @@
+  |        -1
+  |        +one
+  |        diff --git a/romans b/romans
+  |        --- a/romans
+  |        +++ b/romans
+  |        @@ -2,1 +2,1 @@
+  |        -II
+  |        +ii
+  |
+  |
   x  4a250e5bd992 (1) E1
-       rewritten(description, content) as 084ae625fa51 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 4a250e5bd992 -r 084ae625fa51 changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -E1
-         +E2
-  
-         diff --git a/numbers b/numbers
-         --- a/numbers
-         +++ b/numbers
-         @@ -4,1 +4,1 @@
-         -four
-         +4
-         @@ -7,1 +7,1 @@
-         -7
-         +seven
-         diff --git a/romans b/romans
-         --- a/romans
-         +++ b/romans
-         @@ -6,1 +6,1 @@
-         -VI
-         +vi
-  
-       rewritten(description, content) as 19ed1bf64a2c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 4a250e5bd992 -r 19ed1bf64a2c changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -E1
-         +E3
-  
-         diff --git a/letters b/letters
-         --- a/letters
-         +++ b/letters
-         @@ -4,1 +4,1 @@
-         -D
-         +d
-         diff --git a/numbers b/numbers
-         --- a/numbers
-         +++ b/numbers
-         @@ -1,1 +1,1 @@
-         -1
-         +one
-         diff --git a/romans b/romans
-         --- a/romans
-         +++ b/romans
-         @@ -2,1 +2,1 @@
-         -II
-         +ii
-  
   
 
   $ hg evolve --content-divergent --rev 'desc("E3")'
@@ -961,7 +964,7 @@
   merging numbers
   merging romans
   1 files updated, 2 files merged, 0 files removed, 0 files unresolved
-  working directory is now at aae293050980
+  working directory is now at e7cb08a7241a
   $ hg status
   $ hg amend -m 'E4'
   $ hg export
@@ -969,7 +972,7 @@
   # User test
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
-  # Node ID 8c2a6aae4bc5c1cc00c68276017dcef3d468e895
+  # Node ID 50bb00cad3206c79d231a621e319772302a88d8d
   # Parent  6d1fdf6de7e2d9fc9b098aa286b60785bbeaab7a
   E4
   
@@ -992,29 +995,33 @@
   -VI
   +vi
   $ hg log -G
-  @  5:8c2a6aae4bc5@default(draft) E4 []
+  @  5:50bb00cad320@default(draft) E4 []
   |
   o  0:6d1fdf6de7e2@default(draft) root []
   
+  $ hg debugobsolete
+  4a250e5bd992a897655e3b6f238e12452cf063e9 084ae625fa51ca8c441ba1d2bf0f974b21671017 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  4a250e5bd992a897655e3b6f238e12452cf063e9 19ed1bf64a2cc2a824df5ac33a436eca1ae0475d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  084ae625fa51ca8c441ba1d2bf0f974b21671017 e7cb08a7241a98c908db298b61fc033b27f648c7 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'evolve', 'user': 'test'}
+  19ed1bf64a2cc2a824df5ac33a436eca1ae0475d e7cb08a7241a98c908db298b61fc033b27f648c7 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'evolve', 'user': 'test'}
+  e7cb08a7241a98c908db298b61fc033b27f648c7 50bb00cad3206c79d231a621e319772302a88d8d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
   $ hg obslog --patch
-  @  8c2a6aae4bc5 (5) E4
+  @  50bb00cad320 (5) E4
+  |    reworded(description) from e7cb08a7241a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r e7cb08a7241a -r 50bb00cad320 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,4 +1,1 @@
+  |      -<<<<<<< divergent
+  |      -E2||||||| base
+  |      -E1=======
+  |      -E3>>>>>>> other
+  |      +E4
   |
-  x    aae293050980 (4) <<<<<<< divergent
-  |\     reworded(description) as 8c2a6aae4bc5 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-  | |      diff -r aae293050980 -r 8c2a6aae4bc5 changeset-description
-  | |      --- a/changeset-description
-  | |      +++ b/changeset-description
-  | |      @@ -1,4 +1,1 @@
-  | |      -<<<<<<< divergent
-  | |      -E2||||||| base
-  | |      -E1=======
-  | |      -E3>>>>>>> other
-  | |      +E4
-  | |
-  | |
-  x |  084ae625fa51 (2) E2
-  | |    rewritten(description, content) as aae293050980 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
-  | |      diff -r 084ae625fa51 -r aae293050980 changeset-description
+  |
+  x    e7cb08a7241a (4) <<<<<<< divergent
+  |\     rewritten(description, content) from 084ae625fa51 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |      diff -r 084ae625fa51 -r e7cb08a7241a changeset-description
   | |      --- a/changeset-description
   | |      +++ b/changeset-description
   | |      @@ -1,1 +1,4 @@
@@ -1043,86 +1050,89 @@
   | |      -II
   | |      +ii
   | |
+  | |    rewritten(description, content) from 19ed1bf64a2c using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |      diff -r 19ed1bf64a2c -r e7cb08a7241a changeset-description
+  | |      --- a/changeset-description
+  | |      +++ b/changeset-description
+  | |      @@ -1,1 +1,4 @@
+  | |      -E3
+  | |      +<<<<<<< divergent
+  | |      +E2||||||| base
+  | |      +E1=======
+  | |      +E3>>>>>>> other
+  | |
+  | |      diff --git a/numbers b/numbers
+  | |      --- a/numbers
+  | |      +++ b/numbers
+  | |      @@ -4,1 +4,1 @@
+  | |      -four
+  | |      +4
+  | |      @@ -7,1 +7,1 @@
+  | |      -7
+  | |      +seven
+  | |      diff --git a/romans b/romans
+  | |      --- a/romans
+  | |      +++ b/romans
+  | |      @@ -6,1 +6,1 @@
+  | |      -VI
+  | |      +vi
+  | |
+  | |
+  x |  084ae625fa51 (2) E2
+  | |    rewritten(description, content) from 4a250e5bd992 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |      diff -r 4a250e5bd992 -r 084ae625fa51 changeset-description
+  | |      --- a/changeset-description
+  | |      +++ b/changeset-description
+  | |      @@ -1,1 +1,1 @@
+  | |      -E1
+  | |      +E2
+  | |
+  | |      diff --git a/numbers b/numbers
+  | |      --- a/numbers
+  | |      +++ b/numbers
+  | |      @@ -4,1 +4,1 @@
+  | |      -four
+  | |      +4
+  | |      @@ -7,1 +7,1 @@
+  | |      -7
+  | |      +seven
+  | |      diff --git a/romans b/romans
+  | |      --- a/romans
+  | |      +++ b/romans
+  | |      @@ -6,1 +6,1 @@
+  | |      -VI
+  | |      +vi
+  | |
   | |
   | x  19ed1bf64a2c (3) E3
-  |/     rewritten(description, content) as aae293050980 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
-  |        diff -r 19ed1bf64a2c -r aae293050980 changeset-description
+  |/     rewritten(description, content) from 4a250e5bd992 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        diff -r 4a250e5bd992 -r 19ed1bf64a2c changeset-description
   |        --- a/changeset-description
   |        +++ b/changeset-description
-  |        @@ -1,1 +1,4 @@
-  |        -E3
-  |        +<<<<<<< divergent
-  |        +E2||||||| base
-  |        +E1=======
-  |        +E3>>>>>>> other
+  |        @@ -1,1 +1,1 @@
+  |        -E1
+  |        +E3
   |
+  |        diff --git a/letters b/letters
+  |        --- a/letters
+  |        +++ b/letters
+  |        @@ -4,1 +4,1 @@
+  |        -D
+  |        +d
   |        diff --git a/numbers b/numbers
   |        --- a/numbers
   |        +++ b/numbers
-  |        @@ -4,1 +4,1 @@
-  |        -four
-  |        +4
-  |        @@ -7,1 +7,1 @@
-  |        -7
-  |        +seven
+  |        @@ -1,1 +1,1 @@
+  |        -1
+  |        +one
   |        diff --git a/romans b/romans
   |        --- a/romans
   |        +++ b/romans
-  |        @@ -6,1 +6,1 @@
-  |        -VI
-  |        +vi
+  |        @@ -2,1 +2,1 @@
+  |        -II
+  |        +ii
   |
   |
   x  4a250e5bd992 (1) E1
-       rewritten(description, content) as 084ae625fa51 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 4a250e5bd992 -r 084ae625fa51 changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -E1
-         +E2
   
-         diff --git a/numbers b/numbers
-         --- a/numbers
-         +++ b/numbers
-         @@ -4,1 +4,1 @@
-         -four
-         +4
-         @@ -7,1 +7,1 @@
-         -7
-         +seven
-         diff --git a/romans b/romans
-         --- a/romans
-         +++ b/romans
-         @@ -6,1 +6,1 @@
-         -VI
-         +vi
-  
-       rewritten(description, content) as 19ed1bf64a2c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 4a250e5bd992 -r 19ed1bf64a2c changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -E1
-         +E3
-  
-         diff --git a/letters b/letters
-         --- a/letters
-         +++ b/letters
-         @@ -4,1 +4,1 @@
-         -D
-         +d
-         diff --git a/numbers b/numbers
-         --- a/numbers
-         +++ b/numbers
-         @@ -1,1 +1,1 @@
-         -1
-         +one
-         diff --git a/romans b/romans
-         --- a/romans
-         +++ b/romans
-         @@ -2,1 +2,1 @@
-         -II
-         +ii
-  
-  
+
--- a/tests/test-evolve-content-divergent-corner-cases.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-content-divergent-corner-cases.t	Fri May 08 20:36:29 2020 +0800
@@ -79,12 +79,31 @@
   with: [3] divergent
   base: [1] added b
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 45bf1312f454
+  working directory is now at 98ab969ac8fb
   $ hg log -G
-  @  4:45bf1312f454@default(draft) divergent []
+  @  4:98ab969ac8fb@default(draft) divergent []
   |
   o  0:9092f1db7931@default(draft) added a []
   
+  $ hg debugobsolete
+  5f6d8a4bf34ab274ccc9f631c2536964b8a3666d 8374d2ddc3a4d48428c3d2f80e4fc86f13736f96 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'prune', 'user': 'test'}
+  5f6d8a4bf34ab274ccc9f631c2536964b8a3666d 593c57f2117e33dd0884382f02789d948f548557 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'prune', 'user': 'test'}
+  593c57f2117e33dd0884382f02789d948f548557 98ab969ac8fbe315e6d2c24a8eb5eab5b81e4242 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  8374d2ddc3a4d48428c3d2f80e4fc86f13736f96 98ab969ac8fbe315e6d2c24a8eb5eab5b81e4242 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog --all
+  @    98ab969ac8fb (4) divergent
+  |\     amended(content) from 593c57f2117e using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    amended(content) from 8374d2ddc3a4 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  593c57f2117e (2) divergent
+  | |    rewritten(description, content) from 5f6d8a4bf34a using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  8374d2ddc3a4 (3) divergent
+  |/     rewritten(description, content) from 5f6d8a4bf34a using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  5f6d8a4bf34a (1) added b
+  
+
 Test divergence resolution when it yields to an empty commit (issue4950)
 cdivergent2 contains the same content than cdivergent1 and they are divergent
 versions of the revision _c
@@ -113,7 +132,7 @@
   |/
   | o  5:48819a835615@default(draft) add _c []
   |/
-  | o  4:45bf1312f454@default(draft) divergent []
+  | o  4:98ab969ac8fb@default(draft) divergent []
   |/
   o  0:9092f1db7931@default(draft) added a []
   
@@ -129,7 +148,7 @@
   |
   | *  6:e3ff64ce8d4c@default(draft) add cdivergent1 [content-divergent]
   |/
-  | o  4:45bf1312f454@default(draft) divergent []
+  | o  4:98ab969ac8fb@default(draft) divergent []
   |/
   o  0:9092f1db7931@default(draft) added a []
   
@@ -138,8 +157,37 @@
   with: [7] add _c
   base: [5] add _c
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  nothing changed
-  working directory is now at e3ff64ce8d4c
+  working directory is now at 6b3776664a25
+
+  $ hg log -G
+  @  8:6b3776664a25@default(draft) add cdivergent1 []
+  |
+  | o  4:98ab969ac8fb@default(draft) divergent []
+  |/
+  o  0:9092f1db7931@default(draft) added a []
+  
+  $ hg debugobsolete
+  5f6d8a4bf34ab274ccc9f631c2536964b8a3666d 8374d2ddc3a4d48428c3d2f80e4fc86f13736f96 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'prune', 'user': 'test'}
+  5f6d8a4bf34ab274ccc9f631c2536964b8a3666d 593c57f2117e33dd0884382f02789d948f548557 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'prune', 'user': 'test'}
+  593c57f2117e33dd0884382f02789d948f548557 98ab969ac8fbe315e6d2c24a8eb5eab5b81e4242 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  8374d2ddc3a4d48428c3d2f80e4fc86f13736f96 98ab969ac8fbe315e6d2c24a8eb5eab5b81e4242 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  48819a83561596ef0aeac4082eaaa8afe4320f3a b2ae71172042972a8e8d2bc11e2b2fe4e0c3aa49 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'prune', 'user': 'test'}
+  48819a83561596ef0aeac4082eaaa8afe4320f3a e3ff64ce8d4ce33b40d9f367a8ec472fec588ca3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'prune', 'user': 'test'}
+  e3ff64ce8d4ce33b40d9f367a8ec472fec588ca3 6b3776664a258aa4c7e13f90df20ae9170995217 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  b2ae71172042972a8e8d2bc11e2b2fe4e0c3aa49 6b3776664a258aa4c7e13f90df20ae9170995217 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog --all
+  @    6b3776664a25 (8) add cdivergent1
+  |\     reworded(description) from b2ae71172042 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten from e3ff64ce8d4c using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  b2ae71172042 (7) add _c
+  | |    amended(content) from 48819a835615 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  e3ff64ce8d4c (6) add cdivergent1
+  |/     rewritten(description, content) from 48819a835615 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  48819a835615 (5) add _c
+  
 
   $ cd ..
 
@@ -206,7 +254,31 @@
   with: [3] bdivergent
   base: [1] add _b
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 73ff357d3975
+  working directory is now at b87e0354d5cb
+
+  $ hg log -G
+  @  4:b87e0354d5cb@default(draft) bdivergent []
+  |
+  o  0:135f39f4bd78@default(draft) add _a []
+  
+  $ hg debugobsolete
+  37445b16603b50165d5eb80735fb986c72a2dac1 6b096fb450709a194b21fb9b192fe9b1572c4af0 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'prune', 'user': 'test'}
+  37445b16603b50165d5eb80735fb986c72a2dac1 05a6b6a9e633802d2bdd06e6d292982a767d930e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'prune', 'user': 'test'}
+  05a6b6a9e633802d2bdd06e6d292982a767d930e b87e0354d5cb081210298429d8b51de9871155a2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  6b096fb450709a194b21fb9b192fe9b1572c4af0 b87e0354d5cb081210298429d8b51de9871155a2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog --all
+  @    b87e0354d5cb (4) bdivergent
+  |\     amended(content) from 05a6b6a9e633 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    amended(content) from 6b096fb45070 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  05a6b6a9e633 (2) bdivergent
+  | |    rewritten(description, content) from 37445b16603b using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  6b096fb45070 (3) bdivergent
+  |/     rewritten(description, content) from 37445b16603b using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  37445b16603b (1) add _b
+  
 
   $ cd ..
 
@@ -284,13 +356,41 @@
   What do you want to do?
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-  working directory is now at eb6357cd41b6
+  working directory is now at 51ee71efed61
 
   $ hg glog -l1
-  @  9:eb6357cd41b6 updated e
+  @  9:51ee71efed61 updated e
   |   () [default] draft
   ~
 
+  $ hg debugobsolete
+  8d71eadcc9dfb21a924e75a5796c2f011bdc55a4 ff6f7cd76a7c97d938e8fe87f0fc816b66929435 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  8d71eadcc9dfb21a924e75a5796c2f011bdc55a4 de4ea3103326293994c634101e780724346ee89f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'prune', 'user': 'test'}
+  9150fe93bec603cd88d05cda9f6ff13420cb53e9 0 {155349b645beebee15325a9a22dd0c9ef8fbbbd3} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'}
+  ff6f7cd76a7c97d938e8fe87f0fc816b66929435 0ceb21ca2557a61433f097e4d64024e37cae2c10 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  de4ea3103326293994c634101e780724346ee89f a2465d1d56d1aee8ed90d2292978456d2be6f7b9 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  0ceb21ca2557a61433f097e4d64024e37cae2c10 51ee71efed6170064a7155a9a35e56af0292a203 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  a2465d1d56d1aee8ed90d2292978456d2be6f7b9 51ee71efed6170064a7155a9a35e56af0292a203 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog --all
+  @    51ee71efed61 (9) updated e
+  |\     amended(content) from 0ceb21ca2557 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten from a2465d1d56d1 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  0ceb21ca2557 (7) updated e
+  | |    rebased(parent) from ff6f7cd76a7c using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  a2465d1d56d1 (8) updated e
+  | |    rebased(parent) from de4ea3103326 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  de4ea3103326 (6) updated e
+  | |    rewritten(description, parent, content) from 8d71eadcc9df using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  ff6f7cd76a7c (5) updated e
+  |/     rewritten(description, content) from 8d71eadcc9df using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  8d71eadcc9df (4) added e
+  
+
   $ cd ..
 
 Check that canceling of file deletion are merge correctly
@@ -341,9 +441,9 @@
   with: [3] delete a
   base: [1] delete a
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 7ca6a9fafcf6
+  working directory is now at b1badc7ab394
   $ hg glog
-  @  4:7ca6a9fafcf6 delete a
+  @  4:b1badc7ab394 delete a
   |   () [default] draft
   o  0:75d2b02c4a5c initial
       () [default] draft
@@ -355,3 +455,22 @@
   +++ /dev/null
   @@ -1,1 +0,0 @@
   -a
+
+  $ hg debugobsolete
+  dff6e52f5e419381c070159c8038ac948f59283f 0825dcee2670349e749f1df45857fca34f61e350 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  dff6e52f5e419381c070159c8038ac948f59283f 92ecd58f9b05d6c0a1c3833a79359eea4b0268ff 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  0825dcee2670349e749f1df45857fca34f61e350 b1badc7ab394c2b9ed21e2961de43c71c2e2288f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  92ecd58f9b05d6c0a1c3833a79359eea4b0268ff b1badc7ab394c2b9ed21e2961de43c71c2e2288f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog --all
+  @    b1badc7ab394 (4) delete a
+  |\     amended(content) from 0825dcee2670 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    amended(content) from 92ecd58f9b05 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  0825dcee2670 (2) delete a
+  | |    amended(content) from dff6e52f5e41 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  92ecd58f9b05 (3) delete a
+  |/     amended(content) from dff6e52f5e41 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  dff6e52f5e41 (1) delete a
+  
--- a/tests/test-evolve-content-divergent-first-changeset.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-content-divergent-first-changeset.t	Fri May 08 20:36:29 2020 +0800
@@ -6,6 +6,7 @@
   > evolution.allowdivergence = True
   > EOF
 
+
 This test file tests the case of content-divergence resolution of changesets
 that have the null revision as the parent.
 
@@ -40,6 +41,6 @@
   with: [2] div2
   base: [0] test
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 12772224141b
+  working directory is now at 62fcb3488421
 
   $ hg evolve --list
--- a/tests/test-evolve-content-divergent-interrupted.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-content-divergent-interrupted.t	Fri May 08 20:36:29 2020 +0800
@@ -197,7 +197,7 @@
   merge:[5] added d
   with: [7] added d
   base: [4] added d
-  rebasing "divergent" content-divergent changeset e49523854bc8 on ddcf04e1458c
+  rebasing "divergent" content-divergent changeset e49523854bc8 on 4566502c0483
   merging d
   warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
@@ -237,15 +237,15 @@
 
   $ hg obslog -r . --all
   *  2ba73e31f264 (8) added c
+  |    amended(content) from ca1b80f7960a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   | @  491e10505bae (10) added c
+  | |    amended(content) from 7398f702a162 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   | x  7398f702a162 (9) added c
-  |/     amended(content) as 491e10505bae using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |/     amended(content) from ca1b80f7960a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  ca1b80f7960a (3) added c
-       amended(content) as 2ba73e31f264 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-       amended(content) as 7398f702a162 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ cd ..
 
--- a/tests/test-evolve-content-divergent-meta.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-content-divergent-meta.t	Fri May 08 20:36:29 2020 +0800
@@ -93,7 +93,7 @@
 
 Make sure resultant cset don't replace the initial user with user running the command:
   $ hg log -r tip
-  changeset:   5:443bd2972210
+  changeset:   5:8cabe7248d20
   tag:         tip
   parent:      1:1740ad2a1eda
   user:        foo <foo@test.com>
@@ -133,7 +133,7 @@
   with: [4] added c
   base: [2] added c
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 932d6ceb7672
+  working directory is now at 2300a271820b
 
   $ hg log -r tip | grep "^user"
   user:        foouser
@@ -154,7 +154,7 @@
   with: [5] updated c
   base: [2] added c
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 202a770d8c1f
+  working directory is now at 3d7ae55fbfe4
 
   $ hg log -r tip | grep "^user"
   user:        baruser, foouser
@@ -219,15 +219,15 @@
   with: [4] add foo.txt
   base: [1] add foo.txt
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 6c144bb30333
+  working directory is now at bbcfcd9b9e21
   $ hg log -r 'desc("add foo.txt")' -T '{rev} {node|short} {date|isodate}: {join(obsfate, "; ")}\n'
-  5 6c144bb30333 1969-12-31 23:59 -0000: 
+  5 bbcfcd9b9e21 1969-12-31 23:59 -0000: 
 
 date: updated one one side to an older value
 
   $ hg strip .
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-  saved backup bundle to $TESTTMP/divergingdate/.hg/strip-backup/6c144bb30333-72e26b88-backup.hg
+  saved backup bundle to $TESTTMP/divergingdate/.hg/strip-backup/bbcfcd9b9e21-567273f3-backup.hg
   2 new content-divergent changesets
   $ hg up tip
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -266,15 +266,15 @@
   with: [5] add foo.txt
   base: [1] add foo.txt
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 806d0024c04d
+  working directory is now at 4708538fed7d
   $ hg log -r . --hidden -T '{rev} {node|short} {date|isodate}: {join(obsfate, "; ")}\n'
-  6 806d0024c04d 1969-12-31 23:59 -0000: 
+  6 4708538fed7d 1969-12-31 23:59 -0000: 
 
 date: updated one side to an newer value
 
   $ hg strip .
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-  saved backup bundle to $TESTTMP/divergingdate/.hg/strip-backup/806d0024c04d-24cb28ad-backup.hg
+  saved backup bundle to $TESTTMP/divergingdate/.hg/strip-backup/4708538fed7d-ca550351-backup.hg
   2 new content-divergent changesets
   $ hg update a25dd7af6cf6 --hidden
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -315,15 +315,15 @@
   with: [6] add foo.txt
   base: [1] add foo.txt
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 51e08ac59670
+  working directory is now at dbea1c7e245d
   $ hg log -r . --hidden -T '{rev} {node|short} {date|isodate}: {join(obsfate, "; ")}\n'
-  7 51e08ac59670 1970-01-01 00:02 +0000: 
+  7 dbea1c7e245d 1970-01-01 00:02 +0000: 
 
 date: updated each side to a different value, newer should win
 
   $ hg strip .
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-  saved backup bundle to $TESTTMP/divergingdate/.hg/strip-backup/51e08ac59670-d8a3c2ca-backup.hg
+  saved backup bundle to $TESTTMP/divergingdate/.hg/strip-backup/dbea1c7e245d-47ae3d98-backup.hg
   2 new content-divergent changesets
   $ hg up tip
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -365,8 +365,8 @@
   with: [8] add foo.txt
   base: [1] add foo.txt
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at ab7c0a425dc9
+  working directory is now at 10c950c7c11f
   $ hg log -r . --hidden -T '{rev} {node|short} {date|isodate}: {join(obsfate, "; ")}\n'
-  9 ab7c0a425dc9 1970-01-01 00:13 +0000: 
+  9 10c950c7c11f 1970-01-01 00:13 +0000: 
 
   $ cd ..
--- a/tests/test-evolve-content-divergent-relocation.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-content-divergent-relocation.t	Fri May 08 20:36:29 2020 +0800
@@ -70,10 +70,10 @@
   base: [2] added b
   rebasing "other" content-divergent changeset da4b96f4a8d6 on c7586e2a9264
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 171614c9a791
+  working directory is now at e7fdc662d630
 
   $ hg glog
-  @  8:171614c9a791 added b
+  @  8:e7fdc662d630 added b
   |   () [default] draft
   | *  4:c41c793e0ef1 added d
   | |   () [default] draft
@@ -91,16 +91,39 @@
   # User test
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
-  # Node ID 171614c9a7914c53f531373b95632323fdbbac8d
+  # Node ID e7fdc662d6305fee2908c3f1630e0b20d6f4689a
   # Parent  c7586e2a92645e473645847a7b69a6dc52be4276
   added b
   
-  diff -r c7586e2a9264 -r 171614c9a791 b
+  diff -r c7586e2a9264 -r e7fdc662d630 b
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/b	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
   +bar
 
+  $ hg debugobsolete
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 7ed0642d644bb9ad93d252dd9ffe7b4729febe48 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 da4b96f4a8d610a85b225583138f681d67e275dd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  da4b96f4a8d610a85b225583138f681d67e275dd 11f849d7159fa30a63dbbc1a6d251a8d996baeb5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  7ed0642d644bb9ad93d252dd9ffe7b4729febe48 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  11f849d7159fa30a63dbbc1a6d251a8d996baeb5 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog --all
+  @    e7fdc662d630 (8) added b
+  |\     amended(content) from 11f849d7159f using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten from 7ed0642d644b using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  11f849d7159f (7) added b
+  | |    rebased(parent) from da4b96f4a8d6 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  7ed0642d644b (5) added b
+  | |    amended(content) from b1661037fa25 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  da4b96f4a8d6 (6) added b
+  |/     rebased(parent) from b1661037fa25 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  b1661037fa25 (2) added b
+  
+
 Resolving orphans to get back to a normal graph
 
   $ hg evolve --all
@@ -108,11 +131,11 @@
   atop:[8] added b
   move:[4] added d
   $ hg glog
-  o  10:4ae4427ee9f8 added d
+  o  10:be5a8b9faa8a added d
   |   () [default] draft
-  o  9:917281f93fcb added c
+  o  9:e2ce33033e42 added c
   |   () [default] draft
-  @  8:171614c9a791 added b
+  @  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
@@ -124,7 +147,7 @@
   $ echo x > x
   $ hg ci -Aqm "added x"
   $ hg glog -r .
-  @  11:71a392c714b5 added x
+  @  11:801b5920c7ea added x
   |   () [default] draft
   ~
 
@@ -134,26 +157,26 @@
   (branches are permanent and global, did you want a bookmark?)
   $ hg amend -m "added foo to x"
 
-  $ hg up 71a392c714b5 --hidden
+  $ hg up 'predecessors(.)' --hidden
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  updated to hidden changeset 71a392c714b5
-  (hidden revision '71a392c714b5' was rewritten as: 1e1a50385a7d)
-  working directory parent is obsolete! (71a392c714b5)
-  (use 'hg evolve' to update to its successor: 1e1a50385a7d)
-  $ hg rebase -r . -d 4ae4427ee9f8 --config experimental.evolution.allowdivergence=True
-  rebasing 11:71a392c714b5 "added x"
+  updated to hidden changeset 801b5920c7ea
+  (hidden revision '801b5920c7ea' was rewritten as: 5cf74a13db18)
+  working directory parent is obsolete! (801b5920c7ea)
+  (use 'hg evolve' to update to its successor: 5cf74a13db18)
+  $ hg rebase -r . -d 'desc("added d")' --config experimental.evolution.allowdivergence=True
+  rebasing 11:801b5920c7ea "added x"
   2 new content-divergent changesets
 
   $ hg glog
-  @  13:1e4f6b3bb39b added x
+  @  13:45e15d6e88f5 added x
   |   () [default] draft
-  | *  12:1e1a50385a7d added foo to x
+  | *  12:5cf74a13db18 added foo to x
   | |   () [bar] draft
-  o |  10:4ae4427ee9f8 added d
+  o |  10:be5a8b9faa8a added d
   | |   () [default] draft
-  o |  9:917281f93fcb added c
+  o |  9:e2ce33033e42 added c
   |/    () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
@@ -164,9 +187,9 @@
   merge:[13] added x
   with: [12] added foo to x
   base: [11] added x
-  rebasing "other" content-divergent changeset 1e1a50385a7d on 4ae4427ee9f8
+  rebasing "other" content-divergent changeset 5cf74a13db18 on be5a8b9faa8a
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at b006cf317e0e
+  working directory is now at 4e844ab5e814
 
   $ hg exp
   # HG changeset patch
@@ -174,11 +197,11 @@
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
   # Branch bar
-  # Node ID b006cf317e0ed16dbe786c439577475580f645f1
-  # Parent  4ae4427ee9f8f0935211fd66360948b77ab5aee9
+  # Node ID 4e844ab5e8142d26fb1f0990486379f2410b0358
+  # Parent  be5a8b9faa8af54f115aa168a2c8564acb40c37d
   added foo to x
   
-  diff -r 4ae4427ee9f8 -r b006cf317e0e x
+  diff -r be5a8b9faa8a -r 4e844ab5e814 x
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/x	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
@@ -187,19 +210,49 @@
 The above `hg exp` and the following log call demonstrates that message, content
 and branch change is preserved in case of relocation
   $ hg glog
-  @  15:b006cf317e0e added foo to x
+  @  15:4e844ab5e814 added foo to x
   |   () [bar] draft
-  o  10:4ae4427ee9f8 added d
+  o  10:be5a8b9faa8a added d
   |   () [default] draft
-  o  9:917281f93fcb added c
+  o  9:e2ce33033e42 added c
   |   () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
   o  0:8fa14d15e168 added hgignore
       () [default] draft
 
+  $ hg debugobsolete
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 7ed0642d644bb9ad93d252dd9ffe7b4729febe48 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 da4b96f4a8d610a85b225583138f681d67e275dd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  da4b96f4a8d610a85b225583138f681d67e275dd 11f849d7159fa30a63dbbc1a6d251a8d996baeb5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  7ed0642d644bb9ad93d252dd9ffe7b4729febe48 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  11f849d7159fa30a63dbbc1a6d251a8d996baeb5 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  ca1b80f7960aae2306287bab52b4090c59af8c29 e2ce33033e42db2e61a5f71c6dfb52a33efeaf6a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  c41c793e0ef1ddb463e85ea9491e377d01127ba2 be5a8b9faa8af54f115aa168a2c8564acb40c37d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  801b5920c7ea8d4ebdbc9cfc1e79e665dea2f211 5cf74a13db180e33dc2df8cd2aa70b21252a2a64 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '73', 'operation': 'amend', 'user': 'test'}
+  801b5920c7ea8d4ebdbc9cfc1e79e665dea2f211 45e15d6e88f5bd23ba360dff0c7591eca2d99f43 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  5cf74a13db180e33dc2df8cd2aa70b21252a2a64 911c21adca136894a2b35f0a58fae7ee94fa5e61 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  45e15d6e88f5bd23ba360dff0c7591eca2d99f43 4e844ab5e8142d26fb1f0990486379f2410b0358 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '73', 'operation': 'evolve', 'user': 'test'}
+  911c21adca136894a2b35f0a58fae7ee94fa5e61 4e844ab5e8142d26fb1f0990486379f2410b0358 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog --all
+  @    4e844ab5e814 (15) added foo to x
+  |\     rewritten(description, branch, content) from 45e15d6e88f5 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten from 911c21adca13 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  45e15d6e88f5 (13) added x
+  | |    rebased(parent) from 801b5920c7ea using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  911c21adca13 (14) added foo to x
+  | |    rebased(parent) from 5cf74a13db18 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  5cf74a13db18 (12) added foo to x
+  |/     rewritten(description, branch, content) from 801b5920c7ea using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  801b5920c7ea (11) added x
+  
+
 Testing when both the content-divergence are on different parents and resolution
 will lead to conflicts
 ---------------------------------------------------------------------------------
@@ -210,37 +263,37 @@
   $ echo y > y
   $ hg ci -Aqm "added y"
   $ hg glog -r .
-  @  16:fc6ad2bac162 added y
+  @  16:ecf1d3992eb4 added y
   |   () [default] draft
   ~
 
   $ echo bar > y
   $ hg amend
 
-  $ hg up fc6ad2bac162 --hidden
+  $ hg up 'predecessors(.)' --hidden
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  updated to hidden changeset fc6ad2bac162
-  (hidden revision 'fc6ad2bac162' was rewritten as: 2a9f6ccbdeba)
-  working directory parent is obsolete! (fc6ad2bac162)
-  (use 'hg evolve' to update to its successor: 2a9f6ccbdeba)
-  $ hg rebase -r . -d b006cf317e0e --config experimental.evolution.allowdivergence=True
-  rebasing 16:fc6ad2bac162 "added y"
+  updated to hidden changeset ecf1d3992eb4
+  (hidden revision 'ecf1d3992eb4' was rewritten as: 9c32d35206fb)
+  working directory parent is obsolete! (ecf1d3992eb4)
+  (use 'hg evolve' to update to its successor: 9c32d35206fb)
+  $ hg rebase -r . -d 'desc("added foo to x")' --config experimental.evolution.allowdivergence=True
+  rebasing 16:ecf1d3992eb4 "added y"
   2 new content-divergent changesets
   $ echo wat > y
   $ hg amend
 
   $ hg glog
-  @  19:b4575ed6fcfc added y
+  @  19:0faa43228ee7 added y
   |   () [bar] draft
-  | *  17:2a9f6ccbdeba added y
+  | *  17:9c32d35206fb added y
   | |   () [default] draft
-  o |  15:b006cf317e0e added foo to x
+  o |  15:4e844ab5e814 added foo to x
   | |   () [bar] draft
-  o |  10:4ae4427ee9f8 added d
+  o |  10:be5a8b9faa8a added d
   | |   () [default] draft
-  o |  9:917281f93fcb added c
+  o |  9:e2ce33033e42 added c
   |/    () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
@@ -251,7 +304,7 @@
   merge:[19] added y
   with: [17] added y
   base: [16] added y
-  rebasing "other" content-divergent changeset 2a9f6ccbdeba on b006cf317e0e
+  rebasing "other" content-divergent changeset 9c32d35206fb on 4e844ab5e814
   merging y
   warning: conflicts while merging y! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
@@ -264,55 +317,74 @@
   (no more unresolved files)
   continue: hg evolve --continue
   $ hg evolve --continue
-  working directory is now at 7bbcf24ddecf
+  working directory is now at ba11a9f47a2e
 
   $ hg glog
-  @  21:7bbcf24ddecf added y
+  @  21:ba11a9f47a2e added y
   |   () [bar] draft
-  o  15:b006cf317e0e added foo to x
+  o  15:4e844ab5e814 added foo to x
   |   () [bar] draft
-  o  10:4ae4427ee9f8 added d
+  o  10:be5a8b9faa8a added d
   |   () [default] draft
-  o  9:917281f93fcb added c
+  o  9:e2ce33033e42 added c
   |   () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
   o  0:8fa14d15e168 added hgignore
       () [default] draft
 
+  $ hg debugobsolete
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 7ed0642d644bb9ad93d252dd9ffe7b4729febe48 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 da4b96f4a8d610a85b225583138f681d67e275dd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  da4b96f4a8d610a85b225583138f681d67e275dd 11f849d7159fa30a63dbbc1a6d251a8d996baeb5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  7ed0642d644bb9ad93d252dd9ffe7b4729febe48 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  11f849d7159fa30a63dbbc1a6d251a8d996baeb5 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  ca1b80f7960aae2306287bab52b4090c59af8c29 e2ce33033e42db2e61a5f71c6dfb52a33efeaf6a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  c41c793e0ef1ddb463e85ea9491e377d01127ba2 be5a8b9faa8af54f115aa168a2c8564acb40c37d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  801b5920c7ea8d4ebdbc9cfc1e79e665dea2f211 5cf74a13db180e33dc2df8cd2aa70b21252a2a64 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '73', 'operation': 'amend', 'user': 'test'}
+  801b5920c7ea8d4ebdbc9cfc1e79e665dea2f211 45e15d6e88f5bd23ba360dff0c7591eca2d99f43 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  5cf74a13db180e33dc2df8cd2aa70b21252a2a64 911c21adca136894a2b35f0a58fae7ee94fa5e61 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  45e15d6e88f5bd23ba360dff0c7591eca2d99f43 4e844ab5e8142d26fb1f0990486379f2410b0358 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '73', 'operation': 'evolve', 'user': 'test'}
+  911c21adca136894a2b35f0a58fae7ee94fa5e61 4e844ab5e8142d26fb1f0990486379f2410b0358 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  ecf1d3992eb4d9700d441013fc4e89014692b461 9c32d35206fb5c3bf0ac814d410914d54a959a87 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  ecf1d3992eb4d9700d441013fc4e89014692b461 1bb9315961377c18863281be7634ec8ff9b73ea9 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '68', 'operation': 'rebase', 'user': 'test'}
+  1bb9315961377c18863281be7634ec8ff9b73ea9 0faa43228ee7fb9c993f076cef7e2ac14c85954b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  9c32d35206fb5c3bf0ac814d410914d54a959a87 0fc12918c8daa12ca83ce1e2a38e252b063b6276 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  0faa43228ee7fb9c993f076cef7e2ac14c85954b ba11a9f47a2e4a3380c4d5f80f64de41645a6681 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  0fc12918c8daa12ca83ce1e2a38e252b063b6276 ba11a9f47a2e4a3380c4d5f80f64de41645a6681 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '72', 'operation': 'evolve', 'user': 'test'}
   $ hg obslog -r . --all
-  @    7bbcf24ddecf (21) added y
-  |\
-  x |  48f745db3f53 (20) added y
-  | |    rewritten(branch, content) as 7bbcf24ddecf using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
-  | |
-  | x  b4575ed6fcfc (19) added y
-  | |    amended(content) as 7bbcf24ddecf using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  @    ba11a9f47a2e (21) added y
+  |\     amended(content) from 0faa43228ee7 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten(branch, content) from 0fc12918c8da using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
-  x |  2a9f6ccbdeba (17) added y
-  | |    rebased(parent) as 48f745db3f53 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  x |  0faa43228ee7 (19) added y
+  | |    amended(content) from 1bb931596137 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  0fc12918c8da (20) added y
+  | |    rebased(parent) from 9c32d35206fb using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
-  | x  96b677f01b81 (18) added y
-  |/     amended(content) as b4575ed6fcfc using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  x |  1bb931596137 (18) added y
+  | |    rewritten(branch, parent) from ecf1d3992eb4 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  9c32d35206fb (17) added y
+  |/     amended(content) from ecf1d3992eb4 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
-  x  fc6ad2bac162 (16) added y
-       amended(content) as 2a9f6ccbdeba using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-       rewritten(branch, parent) as 96b677f01b81 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  x  ecf1d3992eb4 (16) added y
   
 
 checking that relocated commit is there
-  $ hg exp 48f745db3f53 --hidden
+  $ hg exp 20 --hidden
   # HG changeset patch
   # User test
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
-  # Node ID 48f745db3f5300363ca248b9aeab20ff2a55fbb3
-  # Parent  b006cf317e0ed16dbe786c439577475580f645f1
+  # Node ID 0fc12918c8daa12ca83ce1e2a38e252b063b6276
+  # Parent  4e844ab5e8142d26fb1f0990486379f2410b0358
   added y
   
-  diff -r b006cf317e0e -r 48f745db3f53 y
+  diff -r 4e844ab5e814 -r 0fc12918c8da y
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
@@ -322,15 +394,15 @@
 ----------------------------------------------------------------------
 
   $ hg glog
-  @  21:7bbcf24ddecf added y
+  @  21:ba11a9f47a2e added y
   |   () [bar] draft
-  o  15:b006cf317e0e added foo to x
+  o  15:4e844ab5e814 added foo to x
   |   () [bar] draft
-  o  10:4ae4427ee9f8 added d
+  o  10:be5a8b9faa8a added d
   |   () [default] draft
-  o  9:917281f93fcb added c
+  o  9:e2ce33033e42 added c
   |   () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
@@ -343,7 +415,7 @@
   $ echo z > z
   $ hg ci -Aqm "added z"
   $ hg glog -r .
-  @  22:daf1de08f3b0 added z
+  @  22:2048a66e8834 added z
   |   () [default] draft
   ~
 
@@ -351,32 +423,32 @@
   $ hg add y
   $ hg amend
 
-  $ hg up daf1de08f3b0 --hidden
+  $ hg up 'predecessors(.)' --hidden
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  updated to hidden changeset daf1de08f3b0
-  (hidden revision 'daf1de08f3b0' was rewritten as: 3f7a1f693080)
-  working directory parent is obsolete! (daf1de08f3b0)
-  (use 'hg evolve' to update to its successor: 3f7a1f693080)
-  $ hg rebase -r . -d 7bbcf24ddecf --config experimental.evolution.allowdivergence=True
-  rebasing 22:daf1de08f3b0 "added z"
+  updated to hidden changeset 2048a66e8834
+  (hidden revision '2048a66e8834' was rewritten as: 9bc2ace42175)
+  working directory parent is obsolete! (2048a66e8834)
+  (use 'hg evolve' to update to its successor: 9bc2ace42175)
+  $ hg rebase -r . -d 'desc("added y")' --config experimental.evolution.allowdivergence=True
+  rebasing 22:2048a66e8834 "added z"
   2 new content-divergent changesets
   $ echo bar > z
   $ hg amend
 
   $ hg glog
-  @  25:53242575ffa9 added z
+  @  25:ad2ec16eca1e added z
   |   () [bar] draft
-  | *  23:3f7a1f693080 added z
+  | *  23:9bc2ace42175 added z
   | |   () [default] draft
-  o |  21:7bbcf24ddecf added y
+  o |  21:ba11a9f47a2e added y
   | |   () [bar] draft
-  o |  15:b006cf317e0e added foo to x
+  o |  15:4e844ab5e814 added foo to x
   | |   () [bar] draft
-  o |  10:4ae4427ee9f8 added d
+  o |  10:be5a8b9faa8a added d
   | |   () [default] draft
-  o |  9:917281f93fcb added c
+  o |  9:e2ce33033e42 added c
   |/    () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
@@ -387,7 +459,7 @@
   merge:[25] added z
   with: [23] added z
   base: [22] added z
-  rebasing "other" content-divergent changeset 3f7a1f693080 on 7bbcf24ddecf
+  rebasing "other" content-divergent changeset 9bc2ace42175 on ba11a9f47a2e
   merging y
   warning: conflicts while merging y! (edit, then use 'hg resolve --mark')
   unresolved merge conflicts
@@ -395,16 +467,16 @@
   [1]
 
   $ hg diff
-  diff -r 7bbcf24ddecf y
+  diff -r ba11a9f47a2e y
   --- a/y	Thu Jan 01 00:00:00 1970 +0000
   +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   @@ -1,1 +1,5 @@
-  +<<<<<<< destination: 7bbcf24ddecf bar - test: added y
+  +<<<<<<< destination: ba11a9f47a2e bar - test: added y
    watbar
   +=======
   +foo
-  +>>>>>>> evolving:    3f7a1f693080 - test: added z
-  diff -r 7bbcf24ddecf z
+  +>>>>>>> evolving:    9bc2ace42175 - test: added z
+  diff -r ba11a9f47a2e z
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/z	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
@@ -416,7 +488,7 @@
   continue: hg evolve --continue
 
   $ hg evolve --continue
-  evolving 23:3f7a1f693080 "added z"
+  evolving 23:9bc2ace42175 "added z"
   merging y
   warning: conflicts while merging y! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
@@ -425,35 +497,35 @@
   [1]
 
   $ hg diff
-  diff -r 53242575ffa9 y
+  diff -r ad2ec16eca1e y
   --- a/y	Thu Jan 01 00:00:00 1970 +0000
   +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   @@ -1,1 +1,5 @@
-  +<<<<<<< local: 53242575ffa9 bar - test: added z
+  +<<<<<<< local: ad2ec16eca1e bar - test: added z
    watbar
   +=======
   +foo
-  +>>>>>>> other: cdb0643c69fc - test: added z
+  +>>>>>>> other: a7326a078527 - test: added z
 
   $ echo foo > y
   $ hg resolve -m
   (no more unresolved files)
   continue: hg evolve --continue
   $ hg evolve --continue
-  working directory is now at 6fc7d9682de6
+  working directory is now at 45e55c9ab3d0
 
   $ hg glog
-  @  27:6fc7d9682de6 added z
+  @  27:45e55c9ab3d0 added z
   |   () [bar] draft
-  o  21:7bbcf24ddecf added y
+  o  21:ba11a9f47a2e added y
   |   () [bar] draft
-  o  15:b006cf317e0e added foo to x
+  o  15:4e844ab5e814 added foo to x
   |   () [bar] draft
-  o  10:4ae4427ee9f8 added d
+  o  10:be5a8b9faa8a added d
   |   () [default] draft
-  o  9:917281f93fcb added c
+  o  9:e2ce33033e42 added c
   |   () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
@@ -466,20 +538,172 @@
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
   # Branch bar
-  # Node ID 6fc7d9682de6e3bee6c8b1266b756ed7d522b7e4
-  # Parent  7bbcf24ddecfe97d7c2ac6fa8c07c155c8fda47b
+  # Node ID 45e55c9ab3d0b4746161fcbe5b6c062eb4647fdb
+  # Parent  ba11a9f47a2e4a3380c4d5f80f64de41645a6681
   added z
   
-  diff -r 7bbcf24ddecf -r 6fc7d9682de6 y
+  diff -r ba11a9f47a2e -r 45e55c9ab3d0 y
   --- a/y	Thu Jan 01 00:00:00 1970 +0000
   +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   @@ -1,1 +1,1 @@
   -watbar
   +foo
-  diff -r 7bbcf24ddecf -r 6fc7d9682de6 z
+  diff -r ba11a9f47a2e -r 45e55c9ab3d0 z
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/z	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
   +bar
 
+  $ hg debugobsolete
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 7ed0642d644bb9ad93d252dd9ffe7b4729febe48 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 da4b96f4a8d610a85b225583138f681d67e275dd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  da4b96f4a8d610a85b225583138f681d67e275dd 11f849d7159fa30a63dbbc1a6d251a8d996baeb5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  7ed0642d644bb9ad93d252dd9ffe7b4729febe48 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  11f849d7159fa30a63dbbc1a6d251a8d996baeb5 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  ca1b80f7960aae2306287bab52b4090c59af8c29 e2ce33033e42db2e61a5f71c6dfb52a33efeaf6a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  c41c793e0ef1ddb463e85ea9491e377d01127ba2 be5a8b9faa8af54f115aa168a2c8564acb40c37d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  801b5920c7ea8d4ebdbc9cfc1e79e665dea2f211 5cf74a13db180e33dc2df8cd2aa70b21252a2a64 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '73', 'operation': 'amend', 'user': 'test'}
+  801b5920c7ea8d4ebdbc9cfc1e79e665dea2f211 45e15d6e88f5bd23ba360dff0c7591eca2d99f43 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  5cf74a13db180e33dc2df8cd2aa70b21252a2a64 911c21adca136894a2b35f0a58fae7ee94fa5e61 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  45e15d6e88f5bd23ba360dff0c7591eca2d99f43 4e844ab5e8142d26fb1f0990486379f2410b0358 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '73', 'operation': 'evolve', 'user': 'test'}
+  911c21adca136894a2b35f0a58fae7ee94fa5e61 4e844ab5e8142d26fb1f0990486379f2410b0358 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  ecf1d3992eb4d9700d441013fc4e89014692b461 9c32d35206fb5c3bf0ac814d410914d54a959a87 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  ecf1d3992eb4d9700d441013fc4e89014692b461 1bb9315961377c18863281be7634ec8ff9b73ea9 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '68', 'operation': 'rebase', 'user': 'test'}
+  1bb9315961377c18863281be7634ec8ff9b73ea9 0faa43228ee7fb9c993f076cef7e2ac14c85954b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  9c32d35206fb5c3bf0ac814d410914d54a959a87 0fc12918c8daa12ca83ce1e2a38e252b063b6276 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  0faa43228ee7fb9c993f076cef7e2ac14c85954b ba11a9f47a2e4a3380c4d5f80f64de41645a6681 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  0fc12918c8daa12ca83ce1e2a38e252b063b6276 ba11a9f47a2e4a3380c4d5f80f64de41645a6681 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '72', 'operation': 'evolve', 'user': 'test'}
+  2048a66e8834bda866dcc8c479f091897816833e 9bc2ace42175da7380251fca97730f62ff5b9185 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  2048a66e8834bda866dcc8c479f091897816833e ee19d6cc67048a1a7469268068a1413611720975 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '68', 'operation': 'rebase', 'user': 'test'}
+  ee19d6cc67048a1a7469268068a1413611720975 ad2ec16eca1eac4cf5045b496efa6205652e9a02 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  9bc2ace42175da7380251fca97730f62ff5b9185 a7326a0785271a7bef2e812a9a742fb4256b4a3c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'evolve', 'user': 'test'}
+  ad2ec16eca1eac4cf5045b496efa6205652e9a02 45e55c9ab3d0b4746161fcbe5b6c062eb4647fdb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  a7326a0785271a7bef2e812a9a742fb4256b4a3c 45e55c9ab3d0b4746161fcbe5b6c062eb4647fdb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '72', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog --all
+  @    45e55c9ab3d0 (27) added z
+  |\     rewritten(branch, content) from a7326a078527 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    amended(content) from ad2ec16eca1e using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  a7326a078527 (26) added z
+  | |    rewritten(parent, content) from 9bc2ace42175 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  ad2ec16eca1e (25) added z
+  | |    amended(content) from ee19d6cc6704 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  9bc2ace42175 (23) added z
+  | |    amended(content) from 2048a66e8834 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  ee19d6cc6704 (24) added z
+  |/     rewritten(branch, parent) from 2048a66e8834 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  2048a66e8834 (22) added z
+  
+
   $ cd ..
+
+Testing when relocation results in nothing to commit
+----------------------------------------------------
+
+Set up a repo where relocation results in no changes to commit because the
+changes from the relocated node are already in the destination.
+
+  $ hg init nothing-to-commit
+  $ cd nothing-to-commit
+  $ echo 0 > a
+  $ hg ci -Aqm initial
+  $ echo 1 > a
+  $ hg ci -Aqm upstream
+  $ hg prev -q
+
+Create the source of divergence.
+  $ echo 0 > b
+  $ hg ci -Aqm divergent
+
+The first side of the divergence get rebased on top of upstream.
+  $ hg rebase -r . -d 'desc("upstream")'
+  rebasing 2:898ddd4443b3 "divergent" (tip)
+  $ hg --hidden co 2 -q
+  updated to hidden changeset 898ddd4443b3
+  (hidden revision '898ddd4443b3' was rewritten as: befae6138569)
+  working directory parent is obsolete! (898ddd4443b3)
+
+The other side of the divergence gets amended so it matches upstream.
+Relocation (onto upstream) will therefore result in no changes to commit.
+  $ hg revert -r 'desc("upstream")' --all
+  removing b
+  reverting a
+  $ hg amend --config experimental.evolution.allowdivergence=True
+  2 new content-divergent changesets
+
+Add a commit on top. This one should become an orphan. Evolving it later
+should put it on top of the other divergent side (the one that's on top of
+upstream)
+  $ echo 0 > c
+  $ hg ci -Aqm child
+  $ hg co -q null
+  $ hg glog
+  o  5:88473f9137d1 child
+  |   () [default] draft
+  *  4:4cc21313ecee divergent
+  |   () [default] draft
+  | *  3:befae6138569 divergent
+  | |   () [default] draft
+  | o  1:33c576d20069 upstream
+  |/    () [default] draft
+  o  0:98a3f8f02ba7 initial
+      () [default] draft
+  $ hg evolve --content-divergent
+  merge:[3] divergent
+  with: [4] divergent
+  base: [2] divergent
+  rebasing "other" content-divergent changeset 4cc21313ecee on 33c576d20069
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  1 new orphan changesets
+  $ hg glog
+  o  7:cc3d0c6117c7 divergent
+  |   () [default] draft
+  | *  5:88473f9137d1 child
+  | |   () [default] draft
+  | x  4:4cc21313ecee divergent
+  | |   () [default] draft
+  o |  1:33c576d20069 upstream
+  |/    () [default] draft
+  o  0:98a3f8f02ba7 initial
+      () [default] draft
+
+  $ hg evolve --any
+  move:[5] child
+  atop:[7] divergent
+  $ hg glog
+  o  8:916b4ec3b91f child
+  |   () [default] draft
+  o  7:cc3d0c6117c7 divergent
+  |   () [default] draft
+  o  1:33c576d20069 upstream
+  |   () [default] draft
+  o  0:98a3f8f02ba7 initial
+      () [default] draft
+  $ hg debugobsolete
+  898ddd4443b3d5520bf48f22f9411d5a0751cf2e befae61385695f1ae4b78b030ad91075b2b523ef 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  898ddd4443b3d5520bf48f22f9411d5a0751cf2e 4cc21313ecee97ce33265514a0596a192bfa6b3f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  4cc21313ecee97ce33265514a0596a192bfa6b3f bf4fe3a3afeb14c338094f41a35863921856592f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'evolve', 'user': 'test'}
+  befae61385695f1ae4b78b030ad91075b2b523ef cc3d0c6117c7400995107497370fa4c2138399cd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  bf4fe3a3afeb14c338094f41a35863921856592f cc3d0c6117c7400995107497370fa4c2138399cd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  88473f9137d12e90055d30bbb9b78dd786520870 916b4ec3b91fd03826bd4b179051ae3cee633b56 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog -r 'desc("divergent")' --all
+  o    cc3d0c6117c7 (7) divergent
+  |\     amended(content) from befae6138569 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten from bf4fe3a3afeb using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  befae6138569 (3) divergent
+  | |    rebased(parent) from 898ddd4443b3 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  bf4fe3a3afeb (6) divergent
+  | |    rewritten(parent, content) from 4cc21313ecee using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  4cc21313ecee (4) divergent
+  |/     amended(content) from 898ddd4443b3 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  898ddd4443b3 (2) divergent
+  
+  $ cd ..
--- a/tests/test-evolve-content-divergent-stack.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-content-divergent-stack.t	Fri May 08 20:36:29 2020 +0800
@@ -148,28 +148,28 @@
   merge:[6] added b
   with: [10] added b
   base: [2] added b
-  rebasing "divergent" content-divergent changeset d5f148423c16 on f66f262fff6c
+  rebasing "divergent" content-divergent changeset d5f148423c16 on df93a529fa42
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merge:[7] added c
   with: [11] added c
   base: [3] added c
-  rebasing "divergent" content-divergent changeset 3ce4be6d8e5e on eadfd9d70680
+  rebasing "divergent" content-divergent changeset 3ce4be6d8e5e on 365f419742a3
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merge:[8] added d
   with: [12] added d
   base: [4] added d
-  rebasing "divergent" content-divergent changeset c72d2885eb51 on b2cac10f3836
+  rebasing "divergent" content-divergent changeset c72d2885eb51 on a18171c7d9e7
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at f66f262fff6c
+  working directory is now at df93a529fa42
 
   $ hg glog
-  o  19:038fe7db3d88 added d
+  o  19:59d49942cf47 added d
   |   () [default] draft
-  o  17:b2cac10f3836 added c
+  o  17:a18171c7d9e7 added c
   |   () [default] draft
-  o  15:eadfd9d70680 added b
+  o  15:365f419742a3 added b
   |   () [default] draft
-  @  13:f66f262fff6c watbar to a
+  @  13:df93a529fa42 watbar to a
   |   () [default] draft
   o  0:8fa14d15e168 added hgignore
       () [default] draft
@@ -319,31 +319,31 @@
   merge:[11] added b
   with: [6] added b
   base: [2] added b
-  rebasing "divergent" content-divergent changeset 6eb54b5af3fb on 74fbf3e6a0b6
-  rebasing "other" content-divergent changeset d5f148423c16 on 74fbf3e6a0b6
+  rebasing "divergent" content-divergent changeset 6eb54b5af3fb on ebb749d2ace8
+  rebasing "other" content-divergent changeset d5f148423c16 on ebb749d2ace8
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merge:[12] added c
   with: [7] added c
   base: [3] added c
-  rebasing "divergent" content-divergent changeset 8ed612937375 on 4e29776e83a5
-  rebasing "other" content-divergent changeset 3ce4be6d8e5e on 4e29776e83a5
+  rebasing "divergent" content-divergent changeset 8ed612937375 on 9437917ebe8d
+  rebasing "other" content-divergent changeset 3ce4be6d8e5e on 9437917ebe8d
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merge:[13] added d
   with: [8] added d
   base: [4] added d
-  rebasing "divergent" content-divergent changeset d45f050514c2 on 77126af93a25
-  rebasing "other" content-divergent changeset c72d2885eb51 on 77126af93a25
+  rebasing "divergent" content-divergent changeset d45f050514c2 on 8e574c12775a
+  rebasing "other" content-divergent changeset c72d2885eb51 on 8e574c12775a
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 74fbf3e6a0b6
+  working directory is now at ebb749d2ace8
 
   $ hg glog
-  o  24:c8f73c376a6e added d
+  o  24:5ab9b88fbead added d
   |   () [default] draft
-  o  21:77126af93a25 added c
+  o  21:8e574c12775a added c
   |   () [default] draft
-  o  18:4e29776e83a5 added b
+  o  18:9437917ebe8d added b
   |   () [default] draft
-  @  15:74fbf3e6a0b6 watbar to a
+  @  15:ebb749d2ace8 watbar to a
   |   () [default] draft
   o  9:2228e3b74514 add newfile
   |   () [default] draft
@@ -355,7 +355,7 @@
 
   $ hg strip 14: --hidden
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  saved backup bundle to $TESTTMP/stackrepo1/.hg/strip-backup/74fbf3e6a0b6-f3612603-backup.hg
+  saved backup bundle to $TESTTMP/stackrepo1/.hg/strip-backup/ebb749d2ace8-0585ef5a-backup.hg
   8 new content-divergent changesets
 
 Prepare repo to have merge conflicts
@@ -368,7 +368,7 @@
   rebasing "other" content-divergent changeset 8e222f257bbf on 2228e3b74514
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   6 new orphan changesets
-  working directory is now at 74fbf3e6a0b6
+  working directory is now at ebb749d2ace8
   $ echo b_conflict > b
   $ hg amend -A
   adding b
@@ -378,7 +378,7 @@
   merge:[11] added b
   with: [6] added b
   base: [2] added b
-  rebasing "divergent" content-divergent changeset 6eb54b5af3fb on 119989a4317e
+  rebasing "divergent" content-divergent changeset 6eb54b5af3fb on 73a960350ce9
   merging b
   warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
   unresolved merge conflicts
@@ -391,7 +391,7 @@
   continue: hg evolve --continue
   $ hg evolve --continue
   evolving 11:6eb54b5af3fb "added b"
-  rebasing "other" content-divergent changeset d5f148423c16 on 119989a4317e
+  rebasing "other" content-divergent changeset d5f148423c16 on 73a960350ce9
   merging b
   warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
   unresolved merge conflicts
@@ -408,24 +408,24 @@
   merge:[12] added c
   with: [7] added c
   base: [3] added c
-  rebasing "divergent" content-divergent changeset 8ed612937375 on 646bd3372ee7
-  rebasing "other" content-divergent changeset 3ce4be6d8e5e on 646bd3372ee7
+  rebasing "divergent" content-divergent changeset 8ed612937375 on 1b637ec00f24
+  rebasing "other" content-divergent changeset 3ce4be6d8e5e on 1b637ec00f24
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merge:[13] added d
   with: [8] added d
   base: [4] added d
-  rebasing "divergent" content-divergent changeset d45f050514c2 on 67abc597e636
-  rebasing "other" content-divergent changeset c72d2885eb51 on 67abc597e636
+  rebasing "divergent" content-divergent changeset d45f050514c2 on fbfadbe143d8
+  rebasing "other" content-divergent changeset c72d2885eb51 on fbfadbe143d8
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 119989a4317e
+  working directory is now at 73a960350ce9
   $ hg glog
-  o  25:5e2572194f59 added d
+  o  25:bf2836f524a3 added d
   |   () [default] draft
-  o  22:67abc597e636 added c
+  o  22:fbfadbe143d8 added c
   |   () [default] draft
-  o  19:646bd3372ee7 added b
+  o  19:1b637ec00f24 added b
   |   () [default] draft
-  @  16:119989a4317e watbar to a
+  @  16:73a960350ce9 watbar to a
   |   () [default] draft
   o  9:2228e3b74514 add newfile
   |   () [default] draft
@@ -436,7 +436,7 @@
 --------------------------------------------------------------
   $ hg strip 14: --hidden
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-  saved backup bundle to $TESTTMP/stackrepo1/.hg/strip-backup/74fbf3e6a0b6-15474722-backup.hg
+  saved backup bundle to $TESTTMP/stackrepo1/.hg/strip-backup/ebb749d2ace8-c2c1e937-backup.hg
   8 new content-divergent changesets
 
 Insert conflicting changes in between the stack of content-div csets
@@ -477,8 +477,8 @@
   merge:[14] added b
   with: [17] added b
   base: [2] added b
-  rebasing "divergent" content-divergent changeset 2a955e808c53 on 74fbf3e6a0b6
-  rebasing "other" content-divergent changeset 509103439e5e on 74fbf3e6a0b6
+  rebasing "divergent" content-divergent changeset 2a955e808c53 on ebb749d2ace8
+  rebasing "other" content-divergent changeset 509103439e5e on ebb749d2ace8
   merging b
   warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
@@ -578,8 +578,8 @@
   merge:[14] added b
   with: [17] added b
   base: [2] added b
-  rebasing "divergent" content-divergent changeset 2a955e808c53 on 74fbf3e6a0b6
-  rebasing "other" content-divergent changeset 509103439e5e on 74fbf3e6a0b6
+  rebasing "divergent" content-divergent changeset 2a955e808c53 on ebb749d2ace8
+  rebasing "other" content-divergent changeset 509103439e5e on ebb749d2ace8
   merging b
   warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
@@ -593,7 +593,7 @@
   stopped the interrupted evolve
   working directory is now at 2a955e808c53
   $ hg log -G
-  o  changeset:   21:74fbf3e6a0b6
+  o  changeset:   21:ebb749d2ace8
   |  tag:         tip
   |  parent:      9:2228e3b74514
   |  user:        test
@@ -641,7 +641,7 @@
   +---x  changeset:   10:c04ff147ef79
   | |    user:        test
   | |    date:        Thu Jan 01 00:00:00 1970 +0000
-  | |    obsolete:    rewritten using evolve as 21:74fbf3e6a0b6
+  | |    obsolete:    rewritten using evolve as 21:ebb749d2ace8
   | |    summary:     added a
   | |
   o |  changeset:   9:2228e3b74514
@@ -654,7 +654,7 @@
   |/   parent:      0:8fa14d15e168
   |    user:        test
   |    date:        Thu Jan 01 00:00:00 1970 +0000
-  |    obsolete:    rebased using evolve as 21:74fbf3e6a0b6
+  |    obsolete:    rebased using evolve as 21:ebb749d2ace8
   |    summary:     watbar to a
   |
   o  changeset:   0:8fa14d15e168
@@ -663,35 +663,35 @@
      summary:     added hgignore
   
   $ hg obslog -r 'desc("watbar to a")' --all
-  o    74fbf3e6a0b6 (21) watbar to a
-  |\
+  o    ebb749d2ace8 (21) watbar to a
+  |\     rewritten from 186bdc2cdfa2 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten(description, content) from c04ff147ef79 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
   x |  186bdc2cdfa2 (20) watbar to a
-  | |    rewritten as 74fbf3e6a0b6 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rebased(parent) from 8e222f257bbf using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   | x  c04ff147ef79 (10) added a
-  | |    rewritten(description, content) as 74fbf3e6a0b6 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rebased(parent) from c7586e2a9264 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   x |  8e222f257bbf (5) watbar to a
-  |/     rebased(parent) as 186bdc2cdfa2 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  |/     rewritten(description, content) from c7586e2a9264 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  c7586e2a9264 (1) added a
-       rewritten(description, content) as 8e222f257bbf using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-       rebased(parent) as c04ff147ef79 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg obslog -r 'desc("added b")' --all
   @  2a955e808c53 (14) added b
+  |    amended(content) from 6eb54b5af3fb using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   | *  509103439e5e (17) added b
+  | |    amended(content) from d5f148423c16 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   x |  6eb54b5af3fb (11) added b
-  | |    amended(content) as 2a955e808c53 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rebased(parent) from b1661037fa25 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   | x  d5f148423c16 (6) added b
-  |/     amended(content) as 509103439e5e using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |/     rebased(parent) from b1661037fa25 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  b1661037fa25 (2) added b
-       rebased(parent) as 6eb54b5af3fb using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
-       rebased(parent) as d5f148423c16 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   
 
 Again, let's evolve the stack
@@ -699,8 +699,8 @@
   merge:[14] added b
   with: [17] added b
   base: [2] added b
-  rebasing "divergent" content-divergent changeset 2a955e808c53 on 74fbf3e6a0b6
-  rebasing "other" content-divergent changeset 509103439e5e on 74fbf3e6a0b6
+  rebasing "divergent" content-divergent changeset 2a955e808c53 on ebb749d2ace8
+  rebasing "other" content-divergent changeset 509103439e5e on ebb749d2ace8
   merging b
   warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
@@ -716,16 +716,16 @@
   merge:[15] added c
   with: [18] added c
   base: [3] added c
-  rebasing "divergent" content-divergent changeset 48b0f803817a on 4e29776e83a5
-  rebasing "other" content-divergent changeset eaf34afe4df3 on 4e29776e83a5
+  rebasing "divergent" content-divergent changeset 48b0f803817a on 32bceb5bc91e
+  rebasing "other" content-divergent changeset eaf34afe4df3 on 32bceb5bc91e
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merge:[16] added d
   with: [19] added d
   base: [4] added d
-  rebasing "divergent" content-divergent changeset 91c8ccb9c241 on 77126af93a25
-  rebasing "other" content-divergent changeset c351be27f199 on 77126af93a25
+  rebasing "divergent" content-divergent changeset 91c8ccb9c241 on a87eb9f90df6
+  rebasing "other" content-divergent changeset c351be27f199 on a87eb9f90df6
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 4e29776e83a5
+  working directory is now at 32bceb5bc91e
 
   $ hg evolve -l
 
@@ -860,8 +860,8 @@
   merge:[7] c
   with: [4] c
   base: [2] c
-  rebasing "divergent" content-divergent changeset ef4885dea3da on 0999c349998d
-  rebasing "other" content-divergent changeset fef59171875e on 0999c349998d
+  rebasing "divergent" content-divergent changeset ef4885dea3da on 6813d99f0a9d
+  rebasing "other" content-divergent changeset fef59171875e on 6813d99f0a9d
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Expected result:
@@ -869,15 +869,15 @@
 Changeset with description "c" only adds file "c" with content "c".
 
   $ hg glog -l2 -p
-  o  12:4ca627f76da9 c
-  |   () [default] draftdiff -r 0999c349998d -r 4ca627f76da9 c
+  o  12:d5a8159e883f c
+  |   () [default] draftdiff -r 6813d99f0a9d -r d5a8159e883f c
   |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   |  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
   |  @@ -0,0 +1,1 @@
   |  +c
   |
-  o  9:0999c349998d b
-  |   () [default] draftdiff -r 980f7dc84c29 -r 0999c349998d b
+  o  9:6813d99f0a9d b
+  |   () [default] draftdiff -r 980f7dc84c29 -r 6813d99f0a9d b
   ~  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
      +++ b/b	Thu Jan 01 00:00:00 1970 +0000
      @@ -0,0 +1,1 @@
@@ -963,16 +963,16 @@
   merge:[9] added bar and car
   with: [5] added bar and car
   base: [2] added bar and car
-  rebasing "divergent" content-divergent changeset 7dd5b9d42ef3 on 8ef6ad88580d
-  rebasing "other" content-divergent changeset f4ed107810a7 on 8ef6ad88580d
+  rebasing "divergent" content-divergent changeset 7dd5b9d42ef3 on 586526ab82c5
+  rebasing "other" content-divergent changeset f4ed107810a7 on 586526ab82c5
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   2 new orphan changesets
-  working directory is now at 8ef6ad88580d
+  working directory is now at 586526ab82c5
 
   $ hg glog
-  o  15:09ba686a465e added bar and car
+  o  15:e905bb19fd7e added bar and car
   |   () [default] draft
-  @  12:8ef6ad88580d added foo
+  @  12:586526ab82c5 added foo
   |   () [default] draft
   | *  10:9a1f460df8b5 added dar
   | |   () [default] draft
--- a/tests/test-evolve-cycles.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-cycles.t	Fri May 08 20:36:29 2020 +0800
@@ -85,10 +85,43 @@
 Actual test
 -----------
 
-Check that debugobshistory never crash on a cycle
+Check that obslog never crashes on a cycle
 
   $ hg obslog "desc(A)" --hidden
   @  2a34000d3544 (1) A
+  |    rewritten(description, parent, content) from a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  a8df460dbbfe (3) C
+  |    rewritten(description, parent, content) from c473644ee0e9 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  c473644ee0e9 (2) B
+  |    rewritten(description, parent, content) from 2a34000d3544 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+
+  $ hg obslog "desc(B)" --hidden
+  @  2a34000d3544 (1) A
+  |    rewritten(description, parent, content) from a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  a8df460dbbfe (3) C
+  |    rewritten(description, parent, content) from c473644ee0e9 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  c473644ee0e9 (2) B
+  |    rewritten(description, parent, content) from 2a34000d3544 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+
+  $ hg obslog "desc(C)" --hidden
+  @  2a34000d3544 (1) A
+  |    rewritten(description, parent, content) from a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  a8df460dbbfe (3) C
+  |    rewritten(description, parent, content) from c473644ee0e9 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  c473644ee0e9 (2) B
+  |    rewritten(description, parent, content) from 2a34000d3544 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+
+  $ hg obslog "desc(C)" --hidden --no-origin
+  @  2a34000d3544 (1) A
   |    rewritten(description, parent, content) as c473644ee0e9 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  a8df460dbbfe (3) C
@@ -98,31 +131,20 @@
   |    rewritten(description, parent, content) as a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   |
 
-  $ hg obslog "desc(B)" --hidden
+Check that all option doesn't crash on a cycle either
+
+  $ hg obslog "desc(C)" --hidden --all
   @  2a34000d3544 (1) A
-  |    rewritten(description, parent, content) as c473644ee0e9 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    rewritten(description, parent, content) from a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  a8df460dbbfe (3) C
-  |    rewritten(description, parent, content) as 2a34000d3544 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    rewritten(description, parent, content) from c473644ee0e9 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  c473644ee0e9 (2) B
-  |    rewritten(description, parent, content) as a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    rewritten(description, parent, content) from 2a34000d3544 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   |
 
-  $ hg obslog "desc(C)" --hidden
-  @  2a34000d3544 (1) A
-  |    rewritten(description, parent, content) as c473644ee0e9 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
-  |
-  x  a8df460dbbfe (3) C
-  |    rewritten(description, parent, content) as 2a34000d3544 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
-  |
-  x  c473644ee0e9 (2) B
-  |    rewritten(description, parent, content) as a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
-  |
-
-Check that all option don't crash on a cycle either
-
-  $ hg obslog "desc(C)" --hidden --all
+  $ hg obslog "desc(C)" --hidden --all --no-origin
   @  2a34000d3544 (1) A
   |    rewritten(description, parent, content) as c473644ee0e9 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   |
@@ -248,10 +270,31 @@
 Actual test
 -----------
 
-Check that debugobshistory never crash on a cycle
+Check that obslog never crashes on a cycle
 
   $ hg obslog "desc(D)" --hidden
   x  0da815c333f6 (5) E
+  |    rewritten(description, parent, content) from 868d2e0eb19c using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  @    868d2e0eb19c (4) D
+  |\     split(description, parent, content) from a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten(description, parent, content) from d9f908fde1a1 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  d9f908fde1a1 (6) F
+  | |    rewritten(description, parent, content) from 0da815c333f6 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  +---x  2a34000d3544 (1) A
+  | |      split(description, parent, content) from a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  a8df460dbbfe (3) C
+  | |    rewritten(description, parent, content) from c473644ee0e9 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  c473644ee0e9 (2) B
+  | |    rewritten(description, parent, content) from 2a34000d3544 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+
+  $ hg obslog "desc(D)" --hidden --no-origin
+  x  0da815c333f6 (5) E
   |    rewritten(description, parent, content) as d9f908fde1a1 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   @    868d2e0eb19c (4) D
@@ -269,9 +312,32 @@
   x |  c473644ee0e9 (2) B
   | |    rewritten(description, parent, content) as a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
-Check that all option don't crash either on a cycle
+
+Check that all option doesn't crash on a cycle either
+
   $ hg obslog --all --hidden "desc(F)"
   x  0da815c333f6 (5) E
+  |    rewritten(description, parent, content) from 868d2e0eb19c using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  @    868d2e0eb19c (4) D
+  |\     split(description, parent, content) from a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten(description, parent, content) from d9f908fde1a1 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  d9f908fde1a1 (6) F
+  | |    rewritten(description, parent, content) from 0da815c333f6 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  +---x  2a34000d3544 (1) A
+  | |      split(description, parent, content) from a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  a8df460dbbfe (3) C
+  | |    rewritten(description, parent, content) from c473644ee0e9 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  c473644ee0e9 (2) B
+  | |    rewritten(description, parent, content) from 2a34000d3544 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+
+  $ hg obslog --all --hidden --no-origin "desc(F)"
+  x  0da815c333f6 (5) E
   |    rewritten(description, parent, content) as d9f908fde1a1 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   @    868d2e0eb19c (4) D
@@ -289,6 +355,7 @@
   x |  c473644ee0e9 (2) B
   | |    rewritten(description, parent, content) as a8df460dbbfe using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
+
 Check the json output is valid in this case
 
   $ hg obslog "desc(D)" --hidden --no-graph -Tjson | python -m json.tool
@@ -296,20 +363,49 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description",
                       "parent",
                       "content"
                   ],
-                  "operation": "prune",
-                  "succnodes": [
-                      "0da815c333f6364b46c86b0a897c00eb617397b6"
+                  "operations": [
+                      "prune"
+                  ],
+                  "prednodes": [
+                      "a8df460dbbfe9ef0c1e5ab4fff02e9514672e379"
+                  ],
+                  "users": [
+                      "test"
                   ],
-                  "user": "test",
+                  "verb": "split"
+              },
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description",
+                      "parent",
+                      "content"
+                  ],
+                  "operations": [
+                      "prune"
+                  ],
+                  "prednodes": [
+                      "d9f908fde1a10ad198a462a3ec8b440bb397fc9c"
+                  ],
+                  "users": [
+                      "test"
+                  ],
                   "verb": "rewritten"
               }
           ],
@@ -319,20 +415,26 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description",
                       "parent",
                       "content"
                   ],
-                  "operation": "prune",
-                  "succnodes": [
-                      "868d2e0eb19c2b55a2894d37e1c435c221384d48"
+                  "operations": [
+                      "prune"
                   ],
-                  "user": "test",
+                  "prednodes": [
+                      "0da815c333f6364b46c86b0a897c00eb617397b6"
+                  ],
+                  "users": [
+                      "test"
+                  ],
                   "verb": "rewritten"
               }
           ],
@@ -342,20 +444,26 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description",
                       "parent",
                       "content"
                   ],
-                  "operation": "prune",
-                  "succnodes": [
-                      "d9f908fde1a10ad198a462a3ec8b440bb397fc9c"
+                  "operations": [
+                      "prune"
                   ],
-                  "user": "test",
+                  "prednodes": [
+                      "868d2e0eb19c2b55a2894d37e1c435c221384d48"
+                  ],
+                  "users": [
+                      "test"
+                  ],
                   "verb": "rewritten"
               }
           ],
@@ -365,21 +473,205 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description",
+                      "parent",
+                      "content"
+                  ],
+                  "operations": [
+                      "prune"
+                  ],
+                  "prednodes": [
+                      "c473644ee0e988d7f537e31423831bbc409f12f7"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "rewritten"
+              }
+          ],
+          "node": "a8df460dbbfe9ef0c1e5ab4fff02e9514672e379",
+          "shortdescription": "C"
+      },
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description",
+                      "parent",
+                      "content"
+                  ],
+                  "operations": [
+                      "prune"
+                  ],
+                  "prednodes": [
+                      "2a34000d35446022104f7a091c06fe21ff2b5912"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "rewritten"
+              }
+          ],
+          "node": "c473644ee0e988d7f537e31423831bbc409f12f7",
+          "shortdescription": "B"
+      },
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description",
                       "parent",
                       "content"
                   ],
-                  "operation": "prune",
+                  "operations": [
+                      "prune"
+                  ],
+                  "prednodes": [
+                      "a8df460dbbfe9ef0c1e5ab4fff02e9514672e379"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "split"
+              }
+          ],
+          "node": "2a34000d35446022104f7a091c06fe21ff2b5912",
+          "shortdescription": "A"
+      }
+  ]
+
+  $ hg obslog "desc(D)" --hidden --no-graph --no-origin -Tjson | python -m json.tool
+  [
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description",
+                      "parent",
+                      "content"
+                  ],
+                  "operations": [
+                      "prune"
+                  ],
+                  "succnodes": [
+                      "0da815c333f6364b46c86b0a897c00eb617397b6"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "rewritten"
+              }
+          ],
+          "node": "868d2e0eb19c2b55a2894d37e1c435c221384d48",
+          "shortdescription": "D"
+      },
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description",
+                      "parent",
+                      "content"
+                  ],
+                  "operations": [
+                      "prune"
+                  ],
+                  "succnodes": [
+                      "868d2e0eb19c2b55a2894d37e1c435c221384d48"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "rewritten"
+              }
+          ],
+          "node": "d9f908fde1a10ad198a462a3ec8b440bb397fc9c",
+          "shortdescription": "F"
+      },
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description",
+                      "parent",
+                      "content"
+                  ],
+                  "operations": [
+                      "prune"
+                  ],
+                  "succnodes": [
+                      "d9f908fde1a10ad198a462a3ec8b440bb397fc9c"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "rewritten"
+              }
+          ],
+          "node": "0da815c333f6364b46c86b0a897c00eb617397b6",
+          "shortdescription": "E"
+      },
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description",
+                      "parent",
+                      "content"
+                  ],
+                  "operations": [
+                      "prune"
+                  ],
                   "succnodes": [
                       "2a34000d35446022104f7a091c06fe21ff2b5912",
                       "868d2e0eb19c2b55a2894d37e1c435c221384d48"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "split"
               }
           ],
@@ -389,20 +681,26 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description",
                       "parent",
                       "content"
                   ],
-                  "operation": "prune",
+                  "operations": [
+                      "prune"
+                  ],
                   "succnodes": [
                       "a8df460dbbfe9ef0c1e5ab4fff02e9514672e379"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "rewritten"
               }
           ],
@@ -412,20 +710,26 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description",
                       "parent",
                       "content"
                   ],
-                  "operation": "prune",
+                  "operations": [
+                      "prune"
+                  ],
                   "succnodes": [
                       "c473644ee0e988d7f537e31423831bbc409f12f7"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "rewritten"
               }
           ],
@@ -433,4 +737,3 @@
           "shortdescription": "A"
       }
   ]
-
--- a/tests/test-evolve-effectflags.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-effectflags.t	Fri May 08 20:36:29 2020 +0800
@@ -32,9 +32,9 @@
   471f378eab4c5e25f6c77f785b27c936efb22874 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
   $ hg obslog .
   @  fdf9bde5129a (2) A1
+  |    reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  471f378eab4c (1) A0
-       reworded(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg log --hidden -r "desc(A0)"
   changeset:   1:471f378eab4c
@@ -56,9 +56,9 @@
   ef4a313b1e0ade55718395d80e6b88c5ccd875eb 5485c92d34330dac9d7a63dc07e1e3373835b964 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'amend', 'user': 'test'}
   $ hg obslog .
   @  5485c92d3433 (4) B0
+  |    reauthored(user) from ef4a313b1e0a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  ef4a313b1e0a (3) B0
-       reauthored(user) as 5485c92d3433 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg log --hidden -r "ef4a313b1e0a"
   changeset:   3:ef4a313b1e0a
@@ -80,9 +80,9 @@
   2ef0680ff45038ac28c9f1ff3644341f54487280 4dd84345082e9e5291c2e6b3f335bbf8bf389378 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '32', 'operation': 'amend', 'user': 'test'}
   $ hg obslog .
   @  4dd84345082e (6) B1
+  |    date-changed(date) from 2ef0680ff450 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  2ef0680ff450 (5) B1
-       date-changed(date) as 4dd84345082e using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg log --hidden -r "2ef0680ff450"
   changeset:   5:2ef0680ff450
@@ -107,9 +107,9 @@
   bd3db8264ceebf1966319f5df3be7aac6acd1a8e 14a01456e0574f0e0a0b15b2345486a6364a8d79 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '64', 'operation': 'amend', 'user': 'test'}
   $ hg obslog .
   @  14a01456e057 (8) B2
+  |    branch-changed(branch) from bd3db8264cee using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  bd3db8264cee (7) B2
-       branch-changed(branch) as 14a01456e057 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg log --hidden -r "bd3db8264cee"
   changeset:   7:bd3db8264cee
@@ -136,9 +136,9 @@
   c85eff83a0340efd9da52b806a94c350222f3371 da86aa2f19a30d6686b15cae15c7b6c908ec9699 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
   $ hg obslog .
   @  da86aa2f19a3 (11) D0
+  |    rebased(parent) from c85eff83a034 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  c85eff83a034 (10) D0
-       rebased(parent) as da86aa2f19a3 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg log --hidden -r "c85eff83a034"
   changeset:   10:c85eff83a034
@@ -161,9 +161,9 @@
   ebfe0333e0d96f68a917afd97c0a0af87f1c3b5f 75781fdbdbf58a987516b00c980bccda1e9ae588 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
   $ hg obslog .
   @  75781fdbdbf5 (13) E0
+  |    amended(content) from ebfe0333e0d9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  ebfe0333e0d9 (12) E0
-       amended(content) as 75781fdbdbf5 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg log --hidden -r "ebfe0333e0d9"
   changeset:   12:ebfe0333e0d9
@@ -187,9 +187,9 @@
   fad47e5bd78e6aa4db1b5a0a1751bc12563655ff a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '113', 'operation': 'amend', 'user': 'test'}
   $ hg obslog .
   @  a94e0fd5f1c8 (15) F1
+  |    rewritten(description, user, date, branch) from fad47e5bd78e using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  fad47e5bd78e (14) F0
-       rewritten(description, user, date, branch) as a94e0fd5f1c8 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg log --hidden -r "fad47e5bd78e"
   changeset:   14:fad47e5bd78e
@@ -240,11 +240,20 @@
   $ hg rebase -s "desc(H1)" -d "desc(H2)" -t :merge3
   rebasing 17:b57fed8d8322 "H1"
   merging H0
+  $ hg debugobsolete
+  471f378eab4c5e25f6c77f785b27c936efb22874 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
+  ef4a313b1e0ade55718395d80e6b88c5ccd875eb 5485c92d34330dac9d7a63dc07e1e3373835b964 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'amend', 'user': 'test'}
+  2ef0680ff45038ac28c9f1ff3644341f54487280 4dd84345082e9e5291c2e6b3f335bbf8bf389378 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '32', 'operation': 'amend', 'user': 'test'}
+  bd3db8264ceebf1966319f5df3be7aac6acd1a8e 14a01456e0574f0e0a0b15b2345486a6364a8d79 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '64', 'operation': 'amend', 'user': 'test'}
+  c85eff83a0340efd9da52b806a94c350222f3371 da86aa2f19a30d6686b15cae15c7b6c908ec9699 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  ebfe0333e0d96f68a917afd97c0a0af87f1c3b5f 75781fdbdbf58a987516b00c980bccda1e9ae588 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  fad47e5bd78e6aa4db1b5a0a1751bc12563655ff a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '113', 'operation': 'amend', 'user': 'test'}
+  b57fed8d83228a8ae3748d8c3760a77638dd4f8c e509e2eb3df5d131ff7c02350bf2a9edd0c09478 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
   $ hg obslog tip
   o  e509e2eb3df5 (19) H1
+  |    rebased(parent) from b57fed8d8322 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  b57fed8d8322 (17) H1
-       rebased(parent) as e509e2eb3df5 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg log --hidden -r "b57fed8d8322"
   changeset:   17:b57fed8d8322
@@ -267,9 +276,9 @@
 
   $ hg obslog .
   @  12c6238b5e37 (22) I0
+  |    meta-changed(meta) from 2f599e54c1c6 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  2f599e54c1c6 (21) I0
-       meta-changed(meta) as 12c6238b5e37 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg log --hidden -r "2f599e54c1c6"
   changeset:   21:2f599e54c1c6
--- a/tests/test-evolve-interrupted.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-interrupted.t	Fri May 08 20:36:29 2020 +0800
@@ -89,9 +89,8 @@
   $ hg evolve --abort
   evolve aborted
   working directory is now at e1989e4b1526
-  $ ls .hg/evolvestate
-  ls: cannot access '?.hg/evolvestate'?: No such file or directory (re)
-  [2]
+  $ test -f .hg/evolvestate
+  [1]
   $ cat b
   blueberry
   $ hg l
--- a/tests/test-evolve-issue5958.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-issue5958.t	Fri May 08 20:36:29 2020 +0800
@@ -61,23 +61,29 @@
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     add r0
   
+  $ hg debugobsolete
+  cc71ffbc7c002d7b45fb694f9c060bf2e6920672 0065551bd38fe59ea4a069a4db378550c60122d3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '32', 'operation': 'metaedit', 'user': 'test'}
+  0065551bd38fe59ea4a069a4db378550c60122d3 a25dd7af6cf6731ff93708abb2b1b889eae848a0 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  cc71ffbc7c002d7b45fb694f9c060bf2e6920672 c17bf400a2782394b1ca5fbbe59e30494f16dfdc 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '32', 'operation': 'metaedit', 'user': 'test'}
+  a25dd7af6cf6731ff93708abb2b1b889eae848a0 1d1fc409af989f5c0843507e202d69a1ad16c5ef 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  1d1fc409af989f5c0843507e202d69a1ad16c5ef 08bc7ba82799f1e419190b0dac1b0e1c4b1355f9 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'rebase', 'user': 'test'}
   $ hg obslog -a -r .
   @  08bc7ba82799 (6) add foo.txt
+  |    rewritten(parent, content) from 1d1fc409af98 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   | *  c17bf400a278 (4) add foo.txt
+  | |    date-changed(date) from cc71ffbc7c00 using metaedit by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   x |  1d1fc409af98 (5) add foo.txt
-  | |    rewritten(parent, content) as 08bc7ba82799 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    amended(content) from a25dd7af6cf6 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   x |  a25dd7af6cf6 (3) add foo.txt
-  | |    amended(content) as 1d1fc409af98 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    amended(content) from 0065551bd38f using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   x |  0065551bd38f (2) add foo.txt
-  |/     amended(content) as a25dd7af6cf6 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |/     date-changed(date) from cc71ffbc7c00 using metaedit by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  cc71ffbc7c00 (1) add foo.txt
-       date-changed(date) as 0065551bd38f using metaedit by test (Thu Jan 01 00:00:00 1970 +0000)
-       date-changed(date) as c17bf400a278 using metaedit by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg evolve --content-divergent
   merge:[6] add foo.txt
@@ -85,4 +91,4 @@
   base: [1] add foo.txt
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   1 new orphan changesets
-  working directory is now at 459c64f7eaad
+  working directory is now at 5899f25049de
--- a/tests/test-evolve-issue5967.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-issue5967.t	Fri May 08 20:36:29 2020 +0800
@@ -62,11 +62,14 @@
 
 This is important: 1 should not have a successor (especially not revision 2)
 
+  $ hg debugobsolete
+  3ba7db0ce860a189d1fd1fd7675f0e871652ed16 4d6fec23dcc4c3e4ccce8b1d3b79f62ee927c2be 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  dd9b5dd30cd6b703d126d55b34165fd6ec5717c9 0 {3ba7db0ce860a189d1fd1fd7675f0e871652ed16} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
   $ hg olog --all
   @  4d6fec23dcc4 (2) apricot
+  |    rewritten(description, content) from 3ba7db0ce860 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  3ba7db0ce860 (0) apple
-       rewritten(description, content) as 4d6fec23dcc4 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg olog --hidden --all 1
   x  dd9b5dd30cd6 (1) banana
--- a/tests/test-evolve-issue6097.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-issue6097.t	Fri May 08 20:36:29 2020 +0800
@@ -61,14 +61,18 @@
      summary:     apricot
   
 
+  $ hg debugobsolete
+  692cc7b6212c102a9eafcf04ed2e4bfca5023754 32acf8fb1b2325c727135dcd65153745a031a125 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  32acf8fb1b2325c727135dcd65153745a031a125 2868fe6df617a3045cf668e4ab1c486a8692abd1 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'rebase', 'user': 'test'}
+  e0486f65907dac7107e72a247386845e6a9fd83b 0 {692cc7b6212c102a9eafcf04ed2e4bfca5023754} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'}
   $ hg obslog
   @  2868fe6df617 (3) apricot and coconut
+  |    rewritten(parent, content) from 32acf8fb1b23 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  32acf8fb1b23 (2) apricot and coconut
-  |    rewritten(parent, content) as 2868fe6df617 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    rewritten(description, content) from 692cc7b6212c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  692cc7b6212c (0) apricot
-       rewritten(description, content) as 32acf8fb1b23 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
 
   $ hg evolve -r .
@@ -85,15 +89,20 @@
      summary:     apricot and coconut
   
 
+  $ hg debugobsolete
+  692cc7b6212c102a9eafcf04ed2e4bfca5023754 32acf8fb1b2325c727135dcd65153745a031a125 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  32acf8fb1b2325c727135dcd65153745a031a125 2868fe6df617a3045cf668e4ab1c486a8692abd1 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'rebase', 'user': 'test'}
+  e0486f65907dac7107e72a247386845e6a9fd83b 0 {692cc7b6212c102a9eafcf04ed2e4bfca5023754} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'}
+  2868fe6df617a3045cf668e4ab1c486a8692abd1 bb847d1d3a5f3de90f4fd5e845b69d848568401a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
   $ hg obslog
   @  bb847d1d3a5f (4) apricot and coconut
+  |    rebased(parent) from 2868fe6df617 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  2868fe6df617 (3) apricot and coconut
-  |    rebased(parent) as bb847d1d3a5f using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    rewritten(parent, content) from 32acf8fb1b23 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  32acf8fb1b23 (2) apricot and coconut
-  |    rewritten(parent, content) as 2868fe6df617 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    rewritten(description, content) from 692cc7b6212c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  692cc7b6212c (0) apricot
-       rewritten(description, content) as 32acf8fb1b23 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
--- a/tests/test-evolve-obshistory-amend-then-fold.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-obshistory-amend-then-fold.t	Fri May 08 20:36:29 2020 +0800
@@ -1,5 +1,4 @@
-This test file test the various messages when accessing obsolete
-revisions.
+Testing obslog and other commands accessing obsolete revisions.
 
 Global setup
 ============
@@ -80,8 +79,8 @@
 Actual test
 -----------
 
-Check that debugobshistory on head show a coherent graph
-  $ hg obslog eb5a0daa2192 --patch
+Check that obslog on head shows a coherent graph
+  $ hg obslog eb5a0daa2192 --patch --no-origin
   @    eb5a0daa2192 (4) C0
   |\
   x |  471f378eab4c (1) A0
@@ -114,8 +113,27 @@
          +B1
   
   
-Check that obslog on ROOT with all option show everything
-  $ hg obslog 1 --hidden --all --patch
+  $ hg obslog eb5a0daa2192 --patch
+  @    eb5a0daa2192 (4) C0
+  |\     folded(description, parent, content) from 471f378eab4c, b7ea6d14e664 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |      (No patch available, too many predecessors (2))
+  | |
+  x |  471f378eab4c (1) A0
+   /
+  x  b7ea6d14e664 (3) B1
+  |    reworded(description) from 0dec01379d3b using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 0dec01379d3b -r b7ea6d14e664 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -B0
+  |      +B1
+  |
+  |
+  x  0dec01379d3b (2) B0
+  
+Check that obslog on A0 with all option shows everything
+  $ hg obslog 1 --hidden --all --patch --no-origin
   @    eb5a0daa2192 (4) C0
   |\
   x |  471f378eab4c (1) A0
@@ -148,7 +166,26 @@
          +B1
   
   
-  $ hg obslog eb5a0daa2192 --no-graph -Tjson | python -m json.tool
+  $ hg obslog 1 --hidden --all --patch
+  @    eb5a0daa2192 (4) C0
+  |\     folded(description, parent, content) from 471f378eab4c, b7ea6d14e664 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |      (No patch available, too many predecessors (2))
+  | |
+  x |  471f378eab4c (1) A0
+   /
+  x  b7ea6d14e664 (3) B1
+  |    reworded(description) from 0dec01379d3b using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 0dec01379d3b -r b7ea6d14e664 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -B0
+  |      +B1
+  |
+  |
+  x  0dec01379d3b (2) B0
+  
+  $ hg obslog eb5a0daa2192 --no-graph --no-origin -Tjson | python -m json.tool
   [
       {
           "markers": [],
@@ -158,20 +195,26 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       *, (glob)
                       *, (glob)
                       "content"
                   ],
-                  "operation": "fold",
+                  "operations": [
+                      "fold"
+                  ],
                   "succnodes": [
                       "eb5a0daa21923bbf8caeb2c42085b9e463861fd0"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "folded"
               }
           ],
@@ -181,18 +224,24 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description"
                   ],
-                  "operation": "amend",
+                  "operations": [
+                      "amend"
+                  ],
                   "succnodes": [
                       "b7ea6d14e664bdc8922221f7992631b50da3fb07"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "reworded"
               }
           ],
@@ -202,19 +251,25 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description",
                       "content"
                   ],
-                  "operation": "fold",
+                  "operations": [
+                      "fold"
+                  ],
                   "succnodes": [
                       "eb5a0daa21923bbf8caeb2c42085b9e463861fd0"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "folded"
               }
           ],
@@ -222,6 +277,80 @@
           "shortdescription": "A0"
       }
   ]
+  $ hg obslog eb5a0daa2192 --no-graph -Tjson | python -m json.tool
+  [
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ],
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      *, (glob)
+                      *, (glob)
+                      "content"
+                  ],
+                  "operations": [
+                      "fold"
+                  ],
+                  "prednodes": [
+                      "471f378eab4c5e25f6c77f785b27c936efb22874",
+                      "b7ea6d14e664bdc8922221f7992631b50da3fb07"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "folded"
+              }
+          ],
+          "node": "eb5a0daa21923bbf8caeb2c42085b9e463861fd0",
+          "shortdescription": "C0"
+      },
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description"
+                  ],
+                  "operations": [
+                      "amend"
+                  ],
+                  "prednodes": [
+                      "0dec01379d3be6318c470ead31b1fe7ae7cb53d5"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "reworded"
+              }
+          ],
+          "node": "b7ea6d14e664bdc8922221f7992631b50da3fb07",
+          "shortdescription": "B1"
+      },
+      {
+          "markers": [],
+          "node": "0dec01379d3be6318c470ead31b1fe7ae7cb53d5",
+          "shortdescription": "B0"
+      },
+      {
+          "markers": [],
+          "node": "471f378eab4c5e25f6c77f785b27c936efb22874",
+          "shortdescription": "A0"
+      }
+  ]
   $ hg update 471f378eab4c
   abort: hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192!
   (use --hidden to access hidden revisions)
--- a/tests/test-evolve-obshistory-amend.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-obshistory-amend.t	Fri May 08 20:36:29 2020 +0800
@@ -1,12 +1,10 @@
-This test file test the various messages when accessing obsolete
-revisions.
+Testing obslog and other commands accessing obsolete revisions.
 
 Global setup
 ============
 
   $ . $TESTDIR/testlib/obshistory_setup.sh
 
-
 Test output on amended commit
 =============================
 
@@ -47,54 +45,52 @@
 -------------------------------
   $ hg obslog --patch 4ae3a4151de9
   @  4ae3a4151de9 (2) A1
+  |    rewritten(description, content) from 471f378eab4c using amend by test (*) (glob)
+  |      diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,3 @@
+  |      -A0
+  |      +A1
+  |      +
+  |      +Better commit message
+  |
+  |      diff -r 471f378eab4c -r 4ae3a4151de9 A0
+  |      --- a/A0	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ b/A0	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,1 +1,2 @@
+  |       A0
+  |      +42
+  |
   |
   x  471f378eab4c (1) A0
-       rewritten(description, content) as 4ae3a4151de9 using amend by test (*) (glob)
-         diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,3 @@
-         -A0
-         +A1
-         +
-         +Better commit message
-  
-         diff -r 471f378eab4c -r 4ae3a4151de9 A0
-         --- a/A0	Thu Jan 01 00:00:00 1970 +0000
-         +++ b/A0	Thu Jan 01 00:00:00 1970 +0000
-         @@ -1,1 +1,2 @@
-          A0
-         +42
-  
   
   $ hg obslog --patch --color debug
   @  [evolve.node|4ae3a4151de9] [evolve.rev|(2)] [evolve.short_description|A1]
+  |    [evolve.verb|rewritten](description, content) from [evolve.node|471f378eab4c] using [evolve.operation|amend] by [evolve.user|test] [evolve.date|(Thu Jan 01 00:00:00 1970 +0000)]
+  |      [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description]
+  |      [diff.file_a|--- a/changeset-description]
+  |      [diff.file_b|+++ b/changeset-description]
+  |      [diff.hunk|@@ -1,1 +1,3 @@]
+  |      [diff.deleted|-A0]
+  |      [diff.inserted|+A1]
+  |      [diff.inserted|+]
+  |      [diff.inserted|+Better commit message]
+  |
+  |      [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 A0]
+  |      [diff.file_a|--- a/A0	Thu Jan 01 00:00:00 1970 +0000]
+  |      [diff.file_b|+++ b/A0	Thu Jan 01 00:00:00 1970 +0000]
+  |      [diff.hunk|@@ -1,1 +1,2 @@]
+  |       A0
+  |      [diff.inserted|+42]
+  |
   |
   x  [evolve.node|471f378eab4c] [evolve.rev|(1)] [evolve.short_description|A0]
-       [evolve.verb|rewritten](description, content) as [evolve.node|4ae3a4151de9] using [evolve.operation|amend] by [evolve.user|test] [evolve.date|(Thu Jan 01 00:00:00 1970 +0000)]
-         [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description]
-         [diff.file_a|--- a/changeset-description]
-         [diff.file_b|+++ b/changeset-description]
-         [diff.hunk|@@ -1,1 +1,3 @@]
-         [diff.deleted|-A0]
-         [diff.inserted|+A1]
-         [diff.inserted|+]
-         [diff.inserted|+Better commit message]
-  
-         [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 A0]
-         [diff.file_a|--- a/A0	Thu Jan 01 00:00:00 1970 +0000]
-         [diff.file_b|+++ b/A0	Thu Jan 01 00:00:00 1970 +0000]
-         [diff.hunk|@@ -1,1 +1,2 @@]
-          A0
-         [diff.inserted|+42]
-  
   
 
   $ hg obslog --no-graph --patch 4ae3a4151de9
   4ae3a4151de9 (2) A1
-  
-  471f378eab4c (1) A0
-    rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)    
+    rewritten(description, content) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)    
       diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description
       --- a/changeset-description
       +++ b/changeset-description
@@ -112,106 +108,90 @@
       +42
   
   
+  471f378eab4c (1) A0
+  
 
 Test that content diff works with templating
   $ hg obslog --color=debug --patch 4ae3a4151de9 \
   > -T '{node|short} {desc|firstline}\n{markers % "patch:\n```{patch}```\n"}'
   @  4ae3a4151de9 A1
-  |
+  |  patch:
+  |  ```
+  |  [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 A0]
+  |  [diff.file_a|--- a/A0	Thu Jan 01 00:00:00 1970 +0000]
+  |  [diff.file_b|+++ b/A0	Thu Jan 01 00:00:00 1970 +0000]
+  |  [diff.hunk|@@ -1,1 +1,2 @@]
+  |   A0
+  |  [diff.inserted|+42]
+  |  ```
   x  471f378eab4c A0
-     patch:
-     ```
-     [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 A0]
-     [diff.file_a|--- a/A0	Thu Jan 01 00:00:00 1970 +0000]
-     [diff.file_b|+++ b/A0	Thu Jan 01 00:00:00 1970 +0000]
-     [diff.hunk|@@ -1,1 +1,2 @@]
-      A0
-     [diff.inserted|+42]
-     ```
+  
 
-  $ hg obslog 4ae3a4151de9 --graph -T'{label("log.summary", desc|firstline)} {if(markers, join(markers % "at {date|hgdate} by {user|person} ", " also "))}'
+  $ hg obslog 4ae3a4151de9 --graph --no-origin -T'{label("log.summary", desc|firstline)} {if(markers, join(markers % "at {date|hgdate} by {user|person} ", " also "))}'
   @  A1
   |
   x  A0 at 0 0 by test
   
+  $ hg obslog 4ae3a4151de9 --graph -T'{label("log.summary", desc|firstline)} {if(markers, join(markers % "at {date|hgdate} by {user|person} ", " also "))}'
+  @  A1 at 0 0 by test
+  |
+  x  A0
+  
 
 Check that the same thing works with the old {shortdescription} form
-  $ hg obslog 4ae3a4151de9 --graph -T'{label("log.summary", shortdescription)} {if(markers, join(markers % "at {date|hgdate} by {user|person} ", " also "))}'
+  $ hg obslog 4ae3a4151de9 --graph --no-origin -T'{label("log.summary", shortdescription)} {if(markers, join(markers % "at {date|hgdate} by {user|person} ", " also "))}'
   @  A1
   |
   x  A0 at 0 0 by test
   
+  $ hg obslog 4ae3a4151de9 --graph -T'{label("log.summary", shortdescription)} {if(markers, join(markers % "at {date|hgdate} by {user|person} ", " also "))}'
+  @  A1 at 0 0 by test
+  |
+  x  A0
+  
   $ hg obslog 4ae3a4151de9 --no-graph -Tjson | python -m json.tool
   [
       {
-          "markers": [],
-          "node": "4ae3a4151de9aa872113f0b196e28323308981e8",
-          "shortdescription": "A1"
-      },
-      {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description",
                       "content"
                   ],
-                  "operation": "amend",
-                  "succnodes": [
-                      "4ae3a4151de9aa872113f0b196e28323308981e8"
+                  "operations": [
+                      "amend"
                   ],
-                  "user": "test",
+                  "prednodes": [
+                      "471f378eab4c5e25f6c77f785b27c936efb22874"
+                  ],
+                  "users": [
+                      "test"
+                  ],
                   "verb": "rewritten"
               }
           ],
+          "node": "4ae3a4151de9aa872113f0b196e28323308981e8",
+          "shortdescription": "A1"
+      },
+      {
+          "markers": [],
           "node": "471f378eab4c5e25f6c77f785b27c936efb22874",
           "shortdescription": "A0"
       }
   ]
   $ hg obslog --hidden --patch 471f378eab4c
   x  471f378eab4c (1) A0
-       rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,3 @@
-         -A0
-         +A1
-         +
-         +Better commit message
-  
-         diff -r 471f378eab4c -r 4ae3a4151de9 A0
-         --- a/A0	Thu Jan 01 00:00:00 1970 +0000
-         +++ b/A0	Thu Jan 01 00:00:00 1970 +0000
-         @@ -1,1 +1,2 @@
-          A0
-         +42
-  
   
   $ hg obslog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
   [
       {
-          "markers": [
-              {
-                  "date": [
-                      *, (glob)
-                      0
-                  ],
-                  "effects": [
-                      *, (glob)
-                      "content"
-                  ],
-                  "operation": "amend",
-                  "succnodes": [
-                      "4ae3a4151de9aa872113f0b196e28323308981e8"
-                  ],
-                  "user": "test",
-                  "verb": "rewritten"
-              }
-          ],
+          "markers": [],
           "node": "471f378eab4c5e25f6c77f785b27c936efb22874",
           "shortdescription": "A0"
       }
@@ -230,30 +210,46 @@
 Check output on the server side
 -------------------------------
 
-  $ hg obslog -R $TESTTMP/server --patch 4ae3a4151de9
+  $ hg obslog -R $TESTTMP/server --patch 4ae3a4151de9 --no-origin
   o  4ae3a4151de9 (1) A1
   |
   x  471f378eab4c
        rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
          (No patch available, context is not local)
   
-  $ hg obslog -R $TESTTMP/server -f --patch 4ae3a4151de9
+  $ hg obslog -R $TESTTMP/server --patch 4ae3a4151de9
   o  4ae3a4151de9 (1) A1
+  |    rewritten(description, content) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      (No patch available, predecessor is unknown locally)
+  |
+  x  471f378eab4c
   
-  $ hg obslog -R $TESTTMP/server --no-graph --patch 4ae3a4151de9
+  $ hg obslog -R $TESTTMP/server --no-graph --patch 4ae3a4151de9 --no-origin
   4ae3a4151de9 (1) A1
   
   471f378eab4c
     rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)        
       (No patch available, context is not local)
   
+  $ hg obslog -R $TESTTMP/server --no-graph --patch 4ae3a4151de9
+  4ae3a4151de9 (1) A1
+    rewritten(description, content) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)        
+      (No patch available, predecessor is unknown locally)
+  
+  471f378eab4c
+  
 
-  $ hg obslog -R $TESTTMP/server --no-graph -f --patch 4ae3a4151de9
+  $ hg obslog -R $TESTTMP/server -f --patch 4ae3a4151de9 --no-origin
+  o  4ae3a4151de9 (1) A1
+  
+  $ hg obslog -R $TESTTMP/server -f --patch 4ae3a4151de9
+  o  4ae3a4151de9 (1) A1
+  
+  $ hg obslog -R $TESTTMP/server --no-graph -f --patch 4ae3a4151de9 --no-origin
   4ae3a4151de9 (1) A1
   
-  471f378eab4c
-    rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)        
-      (No patch available, context is not local)
+  $ hg obslog -R $TESTTMP/server --no-graph -f --patch 4ae3a4151de9
+  4ae3a4151de9 (1) A1
   
 
 Amend two more times
@@ -285,7 +281,7 @@
   $ hg amend -m "A2
   > 
   > Better better commit message"
-  $ hg amend -m "A3
+  $ hg amend --config devel.default-date='1 0' -m "A3
   > 
   > Better better better commit message"
   $ sync
@@ -327,9 +323,7 @@
 
   $ hg obslog --patch 92210308515b
   @  92210308515b (4) A3
-  |
-  x  4f1685185907 (3) A2
-  |    reworded(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    reworded(description) from 4f1685185907 using amend by test (Thu Jan 01 00:00:01 1970 +0000)
   |      diff -r 4f1685185907 -r 92210308515b changeset-description
   |      --- a/changeset-description
   |      +++ b/changeset-description
@@ -341,8 +335,8 @@
   |      +Better better better commit message
   |
   |
-  x  4ae3a4151de9 (2) A1
-  |    reworded(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  x  4f1685185907 (3) A2
+  |    reworded(description) from 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |      diff -r 4ae3a4151de9 -r 4f1685185907 changeset-description
   |      --- a/changeset-description
   |      +++ b/changeset-description
@@ -354,31 +348,31 @@
   |      +Better better commit message
   |
   |
+  x  4ae3a4151de9 (2) A1
+  |    rewritten(description, content) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,3 @@
+  |      -A0
+  |      +A1
+  |      +
+  |      +Better commit message
+  |
+  |      diff -r 471f378eab4c -r 4ae3a4151de9 A0
+  |      --- a/A0	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ b/A0	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,1 +1,2 @@
+  |       A0
+  |      +42
+  |
+  |
   x  471f378eab4c (1) A0
-       rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,3 @@
-         -A0
-         +A1
-         +
-         +Better commit message
-  
-         diff -r 471f378eab4c -r 4ae3a4151de9 A0
-         --- a/A0	Thu Jan 01 00:00:00 1970 +0000
-         +++ b/A0	Thu Jan 01 00:00:00 1970 +0000
-         @@ -1,1 +1,2 @@
-          A0
-         +42
-  
   
 Test that description diff works with templating
   $ hg obslog --color=debug --patch 92210308515b \
   > -T '{node|short} {desc|firstline}\n{markers % "description diff:\n```{descdiff}```\n"}'
   @  92210308515b A3
-  |
-  x  4f1685185907 A2
   |  description diff:
   |  ```
   |  [diff.diffline|diff -r 4f1685185907 -r 92210308515b changeset-description]
@@ -391,7 +385,7 @@
   |  [diff.deleted|-Better better commit message]
   |  [diff.inserted|+Better better better commit message]
   |  ```
-  x  4ae3a4151de9 A1
+  x  4f1685185907 A2
   |  description diff:
   |  ```
   |  [diff.diffline|diff -r 4ae3a4151de9 -r 4f1685185907 changeset-description]
@@ -404,81 +398,83 @@
   |  [diff.deleted|-Better commit message]
   |  [diff.inserted|+Better better commit message]
   |  ```
+  x  4ae3a4151de9 A1
+  |  description diff:
+  |  ```
+  |  [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description]
+  |  [diff.file_a|--- a/changeset-description]
+  |  [diff.file_b|+++ b/changeset-description]
+  |  [diff.hunk|@@ -1,1 +1,3 @@]
+  |  [diff.deleted|-A0]
+  |  [diff.inserted|+A1]
+  |  [diff.inserted|+]
+  |  [diff.inserted|+Better commit message]
+  |  ```
   x  471f378eab4c A0
-     description diff:
-     ```
-     [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description]
-     [diff.file_a|--- a/changeset-description]
-     [diff.file_b|+++ b/changeset-description]
-     [diff.hunk|@@ -1,1 +1,3 @@]
-     [diff.deleted|-A0]
-     [diff.inserted|+A1]
-     [diff.inserted|+]
-     [diff.inserted|+Better commit message]
-     ```
+  
 
 Check the output on the server
 ------------------------------
 
   $ hg obslog -R $TESTTMP/server --patch 92210308515b
   o  92210308515b (2) A3
+  |    reworded(description) from 4f1685185907 using amend by test (Thu Jan 01 00:00:01 1970 +0000)
+  |      (No patch available, predecessor is unknown locally)
   |
   x  4f1685185907
-  |    reworded(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    reworded(description) from 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |      (No patch available, context is not local)
   |
   x  4ae3a4151de9 (1) A1
-  |    reworded(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-  |      (No patch available, successor is unknown locally)
+  |    rewritten(description, content) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      (No patch available, predecessor is unknown locally)
   |
   x  471f378eab4c
-       rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         (No patch available, context is not local)
   
   $ hg obslog -R $TESTTMP/server -f --patch 92210308515b
   o  92210308515b (2) A3
+  |    reworded(description) from 4ae3a4151de9 using amend by test (between Thu Jan 01 00:00:00 1970 +0000 and Thu Jan 01 00:00:01 1970 +0000)
+  |      diff -r 4ae3a4151de9 -r 92210308515b changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,3 +1,3 @@
+  |      -A1
+  |      +A3
+  |
+  |      -Better commit message
+  |      +Better better better commit message
+  |
   |
   x  4ae3a4151de9 (1) A1
-       reworded(description) as 92210308515b using amend by test (at Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 4ae3a4151de9 -r 92210308515b changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,3 +1,3 @@
-         -A1
-         +A3
-  
-         -Better commit message
-         +Better better better commit message
-  
   
   $ hg obslog -R $TESTTMP/server --no-graph --patch 92210308515b
   92210308515b (2) A3
+    reworded(description) from 4f1685185907 using amend by test (Thu Jan 01 00:00:01 1970 +0000)        
+      (No patch available, predecessor is unknown locally)
   
   4f1685185907
-    reworded(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000)        
+    reworded(description) from 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)        
       (No patch available, context is not local)
   
   4ae3a4151de9 (1) A1
-    reworded(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000)        
-      (No patch available, successor is unknown locally)
+    rewritten(description, content) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)        
+      (No patch available, predecessor is unknown locally)
   
   471f378eab4c
-    rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)        
-      (No patch available, context is not local)
   
-
   $ hg obslog -R $TESTTMP/server --no-graph -f --patch 92210308515b
   92210308515b (2) A3
-  
-  4f1685185907
-    reworded(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000)        
-      (No patch available, context is not local)
+    reworded(description) from 4ae3a4151de9 using amend by test (between Thu Jan 01 00:00:00 1970 +0000 and Thu Jan 01 00:00:01 1970 +0000)    
+      diff -r 4ae3a4151de9 -r 92210308515b changeset-description
+      --- a/changeset-description
+      +++ b/changeset-description
+      @@ -1,3 +1,3 @@
+      -A1
+      +A3
+   
+      -Better commit message
+      +Better better better commit message
+      
   
   4ae3a4151de9 (1) A1
-    reworded(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000)        
-      (No patch available, successor is unknown locally)
   
-  471f378eab4c
-    rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)        
-      (No patch available, context is not local)
-  
--- a/tests/test-evolve-obshistory-complex.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-obshistory-complex.t	Fri May 08 20:36:29 2020 +0800
@@ -1,15 +1,9 @@
+Testing obslog and other commands accessing obsolete revisions.
+
 Global setup
 ============
 
-  $ . $TESTDIR/testlib/common.sh
-  $ cat >> $HGRCPATH <<EOF
-  > [ui]
-  > interactive = true
-  > [phases]
-  > publish=False
-  > [extensions]
-  > evolve =
-  > EOF
+  $ . $TESTDIR/testlib/obshistory_setup.sh
 
 Test obslog with split + fold + split
 =====================================
@@ -76,14 +70,12 @@
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg obslog -r .
   @    100cc25b765f (9) fold2
-  |\
+  |\     folded(description, parent, content) from 0da815c333f6, d9f908fde1a1 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |      note: folding changesets to test
+  | |
   x |  0da815c333f6 (5) E
-   /     folded(description, content) as 100cc25b765f using fold by test (Thu Jan 01 00:00:00 1970 +0000)
-  |        note: folding changesets to test
-  |
+   /
   x  d9f908fde1a1 (6) F
-       folded(description, parent, content) as 100cc25b765f using fold by test (Thu Jan 01 00:00:00 1970 +0000)
-         note: folding changesets to test
   
   $ hg log -G 
   @  changeset:   9:100cc25b765f
@@ -380,11 +372,34 @@
 Actual Test
 ===========
 
-Obslog should show a subset of the obs history, this test check that the
+Obslog should show a subset of the obs history, this test checks that the
 walking algorithm works no matter the level of successors + precursors
 
   $ hg obslog 12
   *    7b3290f6e0a0 (12) fold1
+  |\     split(parent, content) from d15d0ffc75f6 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten(description, parent, content) from e036916b63ea using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |    d15d0ffc75f6 (8) fold1
+  |\ \     folded(description, parent, content) from 868d2e0eb19c, a8df460dbbfe using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+  | | |
+  | | x  e036916b63ea (11) fold0
+  | | |    split(parent, content) from b868bc49b0a4 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  | | |
+  x | |  868d2e0eb19c (4) D
+   / /
+  x /  a8df460dbbfe (3) C
+   /
+  x    b868bc49b0a4 (7) fold0
+  |\     folded(description, parent, content) from 2a34000d3544, c473644ee0e9 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  2a34000d3544 (1) A
+   /
+  x  c473644ee0e9 (2) B
+  
+
+  $ hg obslog 12 --no-origin
+  *    7b3290f6e0a0 (12) fold1
   |\
   x |    d15d0ffc75f6 (8) fold1
   |\ \     split(parent, content) as 7b3290f6e0a0, d0f33db50670 using split by test (Thu Jan 01 00:00:00 1970 +0000)
@@ -411,46 +426,45 @@
 
   $ hg obslog --all 15
   o  19e14c8397fc (10) fold0
+  |    split(parent, content) from b868bc49b0a4 using split by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   | *    7b3290f6e0a0 (12) fold1
-  | |\
+  | |\     split(parent, content) from d15d0ffc75f6 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  | | |    rewritten(description, parent, content) from e036916b63ea using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | | |
   | | | @  d4a000f63ee9 (15) fold2
+  | | | |    split(parent, content) from 100cc25b765f using split by test (Thu Jan 01 00:00:00 1970 +0000)
   | | | |
   | | | | *  ec31316faa9d (14) fold2
-  | | | |/|
+  | | | |/|    split(parent, content) from 100cc25b765f using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  | | | | |    rewritten(description, parent, content) from d0f33db50670 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | | | | |      note: this is a note stored in obsmarker in prune
+  | | | | |
   | | | x |    100cc25b765f (9) fold2
-  | | | |\ \     split(parent, content) as d4a000f63ee9, ec31316faa9d using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  | | | |\ \     folded(description, parent, content) from 0da815c333f6, d9f908fde1a1 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+  | | | | | |      note: folding changesets to test
   | | | | | |
   | +-------x  d0f33db50670 (13) fold1
-  | | | | |      rewritten(description, parent, content) as ec31316faa9d using prune by test (Thu Jan 01 00:00:00 1970 +0000)
-  | | | | |        note: this is a note stored in obsmarker in prune
+  | | | | |      split(parent, content) from d15d0ffc75f6 using split by test (Thu Jan 01 00:00:00 1970 +0000)
   | | | | |
   +---x | |  e036916b63ea (11) fold0
-  | |  / /     rewritten(description, parent, content) as 7b3290f6e0a0 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |  / /     split(parent, content) from b868bc49b0a4 using split by test (Thu Jan 01 00:00:00 1970 +0000)
   | | | |
-  | | x |  0da815c333f6 (5) E
-  | |  /     folded(description, content) as 100cc25b765f using fold by test (Thu Jan 01 00:00:00 1970 +0000)
-  | | |        note: folding changesets to test
-  | | |
+  | | x /  0da815c333f6 (5) E
+  | |  /
   x | |    b868bc49b0a4 (7) fold0
-  |\ \ \     split(parent, content) as 19e14c8397fc, e036916b63ea using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |\ \ \     folded(description, parent, content) from 2a34000d3544, c473644ee0e9 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
   | | | |
   | | x |    d15d0ffc75f6 (8) fold1
-  | | |\ \     split(parent, content) as 7b3290f6e0a0, d0f33db50670 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  | | |\ \     folded(description, parent, content) from 868d2e0eb19c, a8df460dbbfe using fold by test (Thu Jan 01 00:00:00 1970 +0000)
   | | | | |
   | | | | x  d9f908fde1a1 (6) F
-  | | | |      folded(description, parent, content) as 100cc25b765f using fold by test (Thu Jan 01 00:00:00 1970 +0000)
-  | | | |        note: folding changesets to test
   | | | |
   x | | |  2a34000d3544 (1) A
-   / / /     folded(description, content) as b868bc49b0a4 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
-  | | |
-  | x |  868d2e0eb19c (4) D
-  |  /     folded(description, parent, content) as d15d0ffc75f6 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
-  | |
+   / / /
+  | x /  868d2e0eb19c (4) D
+  |  /
   | x  a8df460dbbfe (3) C
-  |      folded(description, content) as d15d0ffc75f6 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  c473644ee0e9 (2) B
-       folded(description, parent, content) as b868bc49b0a4 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
   
--- a/tests/test-evolve-obshistory-content-divergent.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-obshistory-content-divergent.t	Fri May 08 20:36:29 2020 +0800
@@ -1,5 +1,4 @@
-This test file test the various messages when accessing obsolete
-revisions.
+Testing obslog and other commands accessing obsolete revisions.
 
 Global setup
 ============
@@ -79,8 +78,8 @@
 Actual test
 -----------
 
-Check that debugobshistory on the divergent revision show both destinations
-  $ hg obslog --hidden 471f378eab4c --patch
+Check that obslog on the divergent revision shows both destinations
+  $ hg obslog --hidden 471f378eab4c --patch --no-origin
   x  471f378eab4c (1) A0
        reworded(description) as 65b757b745b9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
          diff -r 471f378eab4c -r 65b757b745b9 changeset-description
@@ -103,59 +102,71 @@
 Check that with all option, every changeset is shown
   $ hg obslog --hidden --all 471f378eab4c --patch
   @  65b757b745b9 (3) A2
+  |    reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 471f378eab4c -r 65b757b745b9 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -A0
+  |      +A2
+  |
   |
   | *  fdf9bde5129a (2) A1
-  |/
+  |/     reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        diff -r 471f378eab4c -r fdf9bde5129a changeset-description
+  |        --- a/changeset-description
+  |        +++ b/changeset-description
+  |        @@ -1,1 +1,1 @@
+  |        -A0
+  |        +A1
+  |
+  |
   x  471f378eab4c (1) A0
-       reworded(description) as 65b757b745b9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r 65b757b745b9 changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A2
   
-       reworded(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r fdf9bde5129a changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A1
-  
-  
-  $ hg obslog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
+  $ hg obslog --hidden 471f378eab4c --no-graph --no-origin -Tjson | python -m json.tool
   [
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description"
                   ],
-                  "operation": "amend",
+                  "operations": [
+                      "amend"
+                  ],
                   "succnodes": [
                       "65b757b745b935093c87a2bccd877521cccffcbd"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "reworded"
               },
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description"
                   ],
-                  "operation": "amend",
+                  "operations": [
+                      "amend"
+                  ],
                   "succnodes": [
                       "fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "reworded"
               }
           ],
@@ -163,9 +174,17 @@
           "shortdescription": "A0"
       }
   ]
-Check that debugobshistory on the first diverged revision show the revision
-and the diverent one
-  $ hg obslog fdf9bde5129a --patch
+  $ hg obslog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
+  [
+      {
+          "markers": [],
+          "node": "471f378eab4c5e25f6c77f785b27c936efb22874",
+          "shortdescription": "A0"
+      }
+  ]
+Check that obslog on the first diverged revision shows the revision and the
+divergent one
+  $ hg obslog fdf9bde5129a --patch --no-origin
   *  fdf9bde5129a (2) A1
   |
   x  471f378eab4c (1) A0
@@ -187,33 +206,33 @@
   
   
 
-Check that all option show all of them
+Check that all option shows all of them
   $ hg obslog fdf9bde5129a -a --patch
   @  65b757b745b9 (3) A2
+  |    reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 471f378eab4c -r 65b757b745b9 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -A0
+  |      +A2
+  |
   |
   | *  fdf9bde5129a (2) A1
-  |/
+  |/     reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        diff -r 471f378eab4c -r fdf9bde5129a changeset-description
+  |        --- a/changeset-description
+  |        +++ b/changeset-description
+  |        @@ -1,1 +1,1 @@
+  |        -A0
+  |        +A1
+  |
+  |
   x  471f378eab4c (1) A0
-       reworded(description) as 65b757b745b9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r 65b757b745b9 changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A2
   
-       reworded(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r fdf9bde5129a changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A1
-  
-  
-Check that debugobshistory on the second diverged revision show the revision
-and the diverent one
-  $ hg obslog 65b757b745b9 --patch
+Check that obslog on the second diverged revision shows the revision and the
+divergent one
+  $ hg obslog 65b757b745b9 --patch --no-origin
   @  65b757b745b9 (3) A2
   |
   x  471f378eab4c (1) A0
@@ -234,56 +253,55 @@
          +A1
   
   
-Check that all option show all of them
+Check that all option shows all of them
   $ hg obslog 65b757b745b9 -a --patch
   @  65b757b745b9 (3) A2
+  |    reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 471f378eab4c -r 65b757b745b9 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -A0
+  |      +A2
+  |
   |
   | *  fdf9bde5129a (2) A1
-  |/
+  |/     reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        diff -r 471f378eab4c -r fdf9bde5129a changeset-description
+  |        --- a/changeset-description
+  |        +++ b/changeset-description
+  |        @@ -1,1 +1,1 @@
+  |        -A0
+  |        +A1
+  |
+  |
   x  471f378eab4c (1) A0
-       reworded(description) as 65b757b745b9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r 65b757b745b9 changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A2
   
-       reworded(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r fdf9bde5129a changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A1
-  
-  
-Check that debugobshistory on the both diverged revision show a coherent
-graph
+Check that obslog on the both diverged revision shows a coherent graph
   $ hg obslog '65b757b745b9+fdf9bde5129a' --patch
   @  65b757b745b9 (3) A2
+  |    reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 471f378eab4c -r 65b757b745b9 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -A0
+  |      +A2
+  |
   |
   | *  fdf9bde5129a (2) A1
-  |/
+  |/     reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        diff -r 471f378eab4c -r fdf9bde5129a changeset-description
+  |        --- a/changeset-description
+  |        +++ b/changeset-description
+  |        @@ -1,1 +1,1 @@
+  |        -A0
+  |        +A1
+  |
+  |
   x  471f378eab4c (1) A0
-       reworded(description) as 65b757b745b9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r 65b757b745b9 changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A2
   
-       reworded(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r fdf9bde5129a changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A1
-  
-  
-  $ hg obslog '65b757b745b9+fdf9bde5129a' --no-graph -Tjson | python -m json.tool
+  $ hg obslog '65b757b745b9+fdf9bde5129a' --no-graph --no-origin -Tjson | python -m json.tool
   [
       {
           "markers": [],
@@ -293,33 +311,45 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description"
                   ],
-                  "operation": "amend",
+                  "operations": [
+                      "amend"
+                  ],
                   "succnodes": [
                       "65b757b745b935093c87a2bccd877521cccffcbd"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "reworded"
               },
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description"
                   ],
-                  "operation": "amend",
+                  "operations": [
+                      "amend"
+                  ],
                   "succnodes": [
                       "fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "reworded"
               }
           ],
@@ -332,6 +362,68 @@
           "shortdescription": "A1"
       }
   ]
+  $ hg obslog '65b757b745b9+fdf9bde5129a' --no-graph -Tjson | python -m json.tool
+  [
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          0.0,
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description"
+                  ],
+                  "operations": [
+                      "amend"
+                  ],
+                  "prednodes": [
+                      "471f378eab4c5e25f6c77f785b27c936efb22874"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "reworded"
+              }
+          ],
+          "node": "65b757b745b935093c87a2bccd877521cccffcbd",
+          "shortdescription": "A2"
+      },
+      {
+          "markers": [],
+          "node": "471f378eab4c5e25f6c77f785b27c936efb22874",
+          "shortdescription": "A0"
+      },
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description"
+                  ],
+                  "operations": [
+                      "amend"
+                  ],
+                  "prednodes": [
+                      "471f378eab4c5e25f6c77f785b27c936efb22874"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "reworded"
+              }
+          ],
+          "node": "fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e",
+          "shortdescription": "A1"
+      }
+  ]
   $ hg update 471f378eab4c
   abort: hidden revision '471f378eab4c' has diverged!
   (use --hidden to access hidden revisions)
--- a/tests/test-evolve-obshistory-fold.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-obshistory-fold.t	Fri May 08 20:36:29 2020 +0800
@@ -1,5 +1,4 @@
-This test file test the various messages when accessing obsolete
-revisions.
+Testing obslog and other commands accessing obsolete revisions.
 
 Global setup
 ============
@@ -69,9 +68,9 @@
 Check output of the client
 --------------------------
 
-Check that debugobshistory on the first folded revision show only
-the revision with the target
-  $ hg obslog --hidden 471f378eab4c --patch
+Check that obslog on the first folded revision shows only the revision with the
+target
+  $ hg obslog --hidden 471f378eab4c --patch --no-origin
   x  471f378eab4c (1) A0
        folded(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
          diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
@@ -89,7 +88,7 @@
   
   
 Check that with all option, all changesets are shown
-  $ hg obslog --hidden --all 471f378eab4c --patch
+  $ hg obslog --hidden --all 471f378eab4c --patch --no-origin
   @    eb5a0daa2192 (3) C0
   |\
   x |  0dec01379d3b (2) B0
@@ -112,15 +111,39 @@
          +B0
   
   
-Check that debugobshistory on the second folded revision show only
-the revision with the target
-  $ hg obslog --hidden 0dec01379d3b --patch
+Check that obslog on the second folded revision shows only the revision with
+the target
+  $ hg obslog --hidden 0dec01379d3b --patch --no-origin
   x  0dec01379d3b (2) B0
        folded(description, parent, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
          (No patch available, changesets rebased)
   
 Check that with all option, all changesets are shown
-  $ hg obslog --hidden --all 0dec01379d3b --patch
+  $ hg obslog --hidden --all 0dec01379d3b --patch --no-origin
+  @    eb5a0daa2192 (3) C0
+  |\
+  x |  0dec01379d3b (2) B0
+   /     folded(description, parent, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        (No patch available, changesets rebased)
+  |
+  x  471f378eab4c (1) A0
+       folded(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+         diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
+         --- a/changeset-description
+         +++ b/changeset-description
+         @@ -1,1 +1,1 @@
+         -A0
+         +C0
+  
+         diff -r 471f378eab4c -r eb5a0daa2192 B0
+         --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+         +++ b/B0	Thu Jan 01 00:00:00 1970 +0000
+         @@ -0,0 +1,1 @@
+         +B0
+  
+  
+Check that obslog on the successor revision shows a coherent graph
+  $ hg obslog eb5a0daa2192 --patch --no-origin
   @    eb5a0daa2192 (3) C0
   |\
   x |  0dec01379d3b (2) B0
@@ -143,32 +166,7 @@
          +B0
   
   
-Check that debugobshistory on the successor revision show a coherent
-graph
-  $ hg obslog eb5a0daa2192 --patch
-  @    eb5a0daa2192 (3) C0
-  |\
-  x |  0dec01379d3b (2) B0
-   /     folded(description, parent, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
-  |        (No patch available, changesets rebased)
-  |
-  x  471f378eab4c (1) A0
-       folded(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +C0
-  
-         diff -r 471f378eab4c -r eb5a0daa2192 B0
-         --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-         +++ b/B0	Thu Jan 01 00:00:00 1970 +0000
-         @@ -0,0 +1,1 @@
-         +B0
-  
-  
-  $ hg obslog eb5a0daa2192 --no-graph -Tjson | python -m json.tool
+  $ hg obslog eb5a0daa2192 --no-graph --no-origin -Tjson | python -m json.tool
   [
       {
           "markers": [],
@@ -178,19 +176,25 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description",
                       "content"
                   ],
-                  "operation": "fold",
+                  "operations": [
+                      "fold"
+                  ],
                   "succnodes": [
                       "eb5a0daa21923bbf8caeb2c42085b9e463861fd0"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "folded"
               }
           ],
@@ -200,20 +204,26 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "description",
                       "parent",
                       "content"
                   ],
-                  "operation": "fold",
+                  "operations": [
+                      "fold"
+                  ],
                   "succnodes": [
                       "eb5a0daa21923bbf8caeb2c42085b9e463861fd0"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "folded"
               }
           ],
@@ -221,6 +231,63 @@
           "shortdescription": "B0"
       }
   ]
+
+  $ hg obslog eb5a0daa2192 --patch
+  @    eb5a0daa2192 (3) C0
+  |\     folded(description, parent, content) from 0dec01379d3b, 471f378eab4c using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |      (No patch available, too many predecessors (2))
+  | |
+  x |  0dec01379d3b (2) B0
+   /
+  x  471f378eab4c (1) A0
+  
+  $ hg obslog eb5a0daa2192 --no-graph -Tjson | python -m json.tool
+  [
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ],
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description",
+                      "parent",
+                      "content"
+                  ],
+                  "operations": [
+                      "fold"
+                  ],
+                  "prednodes": [
+                      "0dec01379d3be6318c470ead31b1fe7ae7cb53d5",
+                      "471f378eab4c5e25f6c77f785b27c936efb22874"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "folded"
+              }
+          ],
+          "node": "eb5a0daa21923bbf8caeb2c42085b9e463861fd0",
+          "shortdescription": "C0"
+      },
+      {
+          "markers": [],
+          "node": "471f378eab4c5e25f6c77f785b27c936efb22874",
+          "shortdescription": "A0"
+      },
+      {
+          "markers": [],
+          "node": "0dec01379d3be6318c470ead31b1fe7ae7cb53d5",
+          "shortdescription": "B0"
+      }
+  ]
   $ hg update 471f378eab4c
   abort: hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192!
   (use --hidden to access hidden revisions)
@@ -245,7 +312,7 @@
 Check output of the server
 --------------------------
 
-  $ hg obslog -R $TESTTMP/server --patch tip --all
+  $ hg obslog -R $TESTTMP/server --all --patch tip --no-origin
   o    eb5a0daa2192 (2) C0
   |\
   x |  0dec01379d3b
@@ -268,11 +335,11 @@
          +B0
   
   
-  $ hg obslog -R $TESTTMP/server -f --all --patch tip
+  $ hg obslog -R $TESTTMP/server -f --all --patch tip --no-origin
   o  eb5a0daa2192 (2) C0
   |
   x  471f378eab4c (1) A0
-       folded(description, content) as eb5a0daa2192 using fold by test (at Thu Jan 01 00:00:00 1970 +0000)
+       folded(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
          diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
          --- a/changeset-description
          +++ b/changeset-description
@@ -288,7 +355,7 @@
   
   
 
-  $ hg obslog -R $TESTTMP/server --all --patch 471f378eab4c --hidden
+  $ hg obslog -R $TESTTMP/server --all --patch 471f378eab4c --no-origin --hidden
   o    eb5a0daa2192 (2) C0
   |\
   x |  0dec01379d3b
@@ -311,11 +378,11 @@
          +B0
   
   
-  $ hg obslog -R $TESTTMP/server -f --all --patch 471f378eab4c --hidden
+  $ hg obslog -R $TESTTMP/server -f --all --patch 471f378eab4c --no-origin --hidden
   o  eb5a0daa2192 (2) C0
   |
   x  471f378eab4c (1) A0
-       folded(description, content) as eb5a0daa2192 using fold by test (at Thu Jan 01 00:00:00 1970 +0000)
+       folded(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
          diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
          --- a/changeset-description
          +++ b/changeset-description
--- a/tests/test-evolve-obshistory-lots-of-splits.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-obshistory-lots-of-splits.t	Fri May 08 20:36:29 2020 +0800
@@ -1,5 +1,4 @@
-This test file test the various messages when accessing obsolete
-revisions.
+Testing obslog and other commands accessing obsolete revisions.
 
 Global setup
 ============
@@ -160,12 +159,12 @@
 Actual test
 -----------
 
-  $ hg obslog de7290d8b885 --hidden --patch
+  $ hg obslog de7290d8b885 --hidden --patch --no-origin
   x  de7290d8b885 (1) A0
        split(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
          (No patch available, too many successors (4))
   
-  $ hg obslog de7290d8b885 --hidden --all --patch
+  $ hg obslog de7290d8b885 --hidden --all --patch --no-origin
   o  1ae8bc733a14 (4) A0
   |
   | o  337fec4d2edc (2) A0
@@ -178,27 +177,67 @@
        split(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
          (No patch available, too many successors (4))
   
-  $ hg obslog de7290d8b885 --hidden --no-graph -Tjson | python -m json.tool
+  $ hg obslog de7290d8b885 --hidden --all --patch
+  o  1ae8bc733a14 (4) A0
+  |    split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      (No patch available, changesets rebased)
+  |
+  | o  337fec4d2edc (2) A0
+  |/     split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        diff -r de7290d8b885 -r 337fec4d2edc b
+  |        --- a/b	Thu Jan 01 00:00:00 1970 +0000
+  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |        @@ -1,1 +0,0 @@
+  |        -43
+  |        diff -r de7290d8b885 -r 337fec4d2edc c
+  |        --- a/c	Thu Jan 01 00:00:00 1970 +0000
+  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |        @@ -1,1 +0,0 @@
+  |        -44
+  |        diff -r de7290d8b885 -r 337fec4d2edc d
+  |        --- a/d	Thu Jan 01 00:00:00 1970 +0000
+  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |        @@ -1,1 +0,0 @@
+  |        -45
+  |
+  |
+  | @  c7f044602e9b (5) A0
+  |/     split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        (No patch available, changesets rebased)
+  |
+  | o  f257fde29c7a (3) A0
+  |/     split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        (No patch available, changesets rebased)
+  |
+  x  de7290d8b885 (1) A0
+  
+  $ hg obslog de7290d8b885 --hidden --no-graph --no-origin -Tjson | python -m json.tool
   [
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "parent",
                       "content"
                   ],
-                  "operation": "split",
+                  "operations": [
+                      "split"
+                  ],
                   "succnodes": [
                       "1ae8bc733a14e374f11767d2ad128d4c891dc43f",
                       "337fec4d2edcf0e7a467e35f818234bc620068b5",
                       "c7f044602e9bd5dec6528b33114df3d0221e6359",
                       "f257fde29c7a847c9b607f6e958656d0df0fb15c"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "split"
               }
           ],
@@ -206,14 +245,21 @@
           "shortdescription": "A0"
       }
   ]
-  $ hg obslog c7f044602e9b --patch
+  $ hg obslog c7f044602e9b --patch --no-origin
   @  c7f044602e9b (5) A0
   |
   x  de7290d8b885 (1) A0
        split(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
          (No patch available, too many successors (4))
   
-  $ hg obslog c7f044602e9b --no-graph -Tjson | python -m json.tool
+  $ hg obslog c7f044602e9b --patch
+  @  c7f044602e9b (5) A0
+  |    split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      (No patch available, changesets rebased)
+  |
+  x  de7290d8b885 (1) A0
+  
+  $ hg obslog c7f044602e9b --no-graph --no-origin -Tjson | python -m json.tool
   [
       {
           "markers": [],
@@ -223,22 +269,28 @@
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "parent",
                       "content"
                   ],
-                  "operation": "split",
+                  "operations": [
+                      "split"
+                  ],
                   "succnodes": [
                       "1ae8bc733a14e374f11767d2ad128d4c891dc43f",
                       "337fec4d2edcf0e7a467e35f818234bc620068b5",
                       "c7f044602e9bd5dec6528b33114df3d0221e6359",
                       "f257fde29c7a847c9b607f6e958656d0df0fb15c"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "split"
               }
           ],
@@ -246,9 +298,92 @@
           "shortdescription": "A0"
       }
   ]
-Check that debugobshistory on all heads show a coherent graph
+  $ hg obslog c7f044602e9b --no-graph -Tjson | python -m json.tool
+  [
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "parent",
+                      "content"
+                  ],
+                  "operations": [
+                      "split"
+                  ],
+                  "prednodes": [
+                      "de7290d8b885925115bb9e88887252dfc20ef2a8"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "split"
+              }
+          ],
+          "node": "c7f044602e9bd5dec6528b33114df3d0221e6359",
+          "shortdescription": "A0"
+      },
+      {
+          "markers": [],
+          "node": "de7290d8b885925115bb9e88887252dfc20ef2a8",
+          "shortdescription": "A0"
+      }
+  ]
+Check that obslog on all heads shows a coherent graph
+  $ hg obslog 2::5 --patch --no-origin
+  o  1ae8bc733a14 (4) A0
+  |
+  | o  337fec4d2edc (2) A0
+  |/
+  | @  c7f044602e9b (5) A0
+  |/
+  | o  f257fde29c7a (3) A0
+  |/
+  x  de7290d8b885 (1) A0
+       split(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
+         (No patch available, too many successors (4))
+  
   $ hg obslog 2::5 --patch
   o  1ae8bc733a14 (4) A0
+  |    split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      (No patch available, changesets rebased)
+  |
+  | o  337fec4d2edc (2) A0
+  |/     split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        diff -r de7290d8b885 -r 337fec4d2edc b
+  |        --- a/b	Thu Jan 01 00:00:00 1970 +0000
+  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |        @@ -1,1 +0,0 @@
+  |        -43
+  |        diff -r de7290d8b885 -r 337fec4d2edc c
+  |        --- a/c	Thu Jan 01 00:00:00 1970 +0000
+  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |        @@ -1,1 +0,0 @@
+  |        -44
+  |        diff -r de7290d8b885 -r 337fec4d2edc d
+  |        --- a/d	Thu Jan 01 00:00:00 1970 +0000
+  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |        @@ -1,1 +0,0 @@
+  |        -45
+  |
+  |
+  | @  c7f044602e9b (5) A0
+  |/     split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        (No patch available, changesets rebased)
+  |
+  | o  f257fde29c7a (3) A0
+  |/     split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        (No patch available, changesets rebased)
+  |
+  x  de7290d8b885 (1) A0
+  
+  $ hg obslog 5 --all --patch --no-origin
+  o  1ae8bc733a14 (4) A0
   |
   | o  337fec4d2edc (2) A0
   |/
@@ -262,16 +397,37 @@
   
   $ hg obslog 5 --all --patch
   o  1ae8bc733a14 (4) A0
+  |    split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      (No patch available, changesets rebased)
   |
   | o  337fec4d2edc (2) A0
-  |/
+  |/     split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        diff -r de7290d8b885 -r 337fec4d2edc b
+  |        --- a/b	Thu Jan 01 00:00:00 1970 +0000
+  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |        @@ -1,1 +0,0 @@
+  |        -43
+  |        diff -r de7290d8b885 -r 337fec4d2edc c
+  |        --- a/c	Thu Jan 01 00:00:00 1970 +0000
+  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |        @@ -1,1 +0,0 @@
+  |        -44
+  |        diff -r de7290d8b885 -r 337fec4d2edc d
+  |        --- a/d	Thu Jan 01 00:00:00 1970 +0000
+  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |        @@ -1,1 +0,0 @@
+  |        -45
+  |
+  |
   | @  c7f044602e9b (5) A0
-  |/
+  |/     split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        (No patch available, changesets rebased)
+  |
   | o  f257fde29c7a (3) A0
-  |/
+  |/     split(parent, content) from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        (No patch available, changesets rebased)
+  |
   x  de7290d8b885 (1) A0
-       split(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
-         (No patch available, too many successors (4))
   
   $ hg update de7290d8b885
   abort: hidden revision 'de7290d8b885' was split as: 337fec4d2edc, f257fde29c7a and 2 more!
--- a/tests/test-evolve-obshistory-phase-divergent.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-obshistory-phase-divergent.t	Fri May 08 20:36:29 2020 +0800
@@ -1,5 +1,4 @@
-This test file test the various messages when accessing obsolete
-revisions.
+Testing obslog and other commands accessing obsolete revisions.
 
 Global setup
 ============
@@ -7,7 +6,7 @@
   $ . $TESTDIR/testlib/obshistory_setup.sh
 
 Test output with phase-divergence
-===================================
+=================================
 
 Test setup
 ----------
@@ -66,8 +65,8 @@
 Actual test
 -----------
 
-Check that debugobshistory on the divergent revision show both destinations
-  $ hg obslog --hidden 471f378eab4c --patch
+Check that obslog on the public revision shows both public (diverged) and draft (divergent) revisions
+  $ hg obslog --hidden 471f378eab4c --patch --no-origin
   @  471f378eab4c (1) A0
        reworded(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
          diff -r 471f378eab4c -r fdf9bde5129a changeset-description
@@ -80,46 +79,7 @@
   
 
 Check that with all option, every changeset is shown
-  $ hg obslog --hidden --all 471f378eab4c --patch
-  *  fdf9bde5129a (2) A1
-  |
-  @  471f378eab4c (1) A0
-       reworded(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r fdf9bde5129a changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A1
-  
-  
-  $ hg obslog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
-  [
-      {
-          "markers": [
-              {
-                  "date": [
-                      *, (glob)
-                      0
-                  ],
-                  "effects": [
-                      "description"
-                  ],
-                  "operation": "amend",
-                  "succnodes": [
-                      "fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"
-                  ],
-                  "user": "test",
-                  "verb": "reworded"
-              }
-          ],
-          "node": "471f378eab4c5e25f6c77f785b27c936efb22874",
-          "shortdescription": "A0"
-      }
-  ]
-Check that debugobshistory on the first diverged revision show the revision
-and the diverent one
-  $ hg obslog fdf9bde5129a --patch
+  $ hg obslog --hidden --all 471f378eab4c --patch --no-origin
   *  fdf9bde5129a (2) A1
   |
   @  471f378eab4c (1) A0
@@ -132,66 +92,101 @@
          +A1
   
   
-
-Check that all option show all of them
-  $ hg obslog fdf9bde5129a -a --patch
+  $ hg obslog --hidden --all 471f378eab4c --patch
   *  fdf9bde5129a (2) A1
+  |    reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 471f378eab4c -r fdf9bde5129a changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -A0
+  |      +A1
   |
-  @  471f378eab4c (1) A0
-       reworded(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r fdf9bde5129a changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A1
-  
-  
-Check that debugobshistory on the second diverged revision show the revision
-and the diverent one
-  $ hg obslog fdf9bde5129a --patch
-  *  fdf9bde5129a (2) A1
   |
   @  471f378eab4c (1) A0
-       reworded(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r fdf9bde5129a changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A1
   
-  
-Check that all option show all of them
-  $ hg obslog fdf9bde5129a -a --patch
+  $ hg obslog --hidden 471f378eab4c --no-graph --no-origin -Tjson | python -m json.tool
+  [
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description"
+                  ],
+                  "operations": [
+                      "amend"
+                  ],
+                  "succnodes": [
+                      "fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "reworded"
+              }
+          ],
+          "node": "471f378eab4c5e25f6c77f785b27c936efb22874",
+          "shortdescription": "A0"
+      }
+  ]
+  $ hg obslog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
+  [
+      {
+          "markers": [],
+          "node": "471f378eab4c5e25f6c77f785b27c936efb22874",
+          "shortdescription": "A0"
+      }
+  ]
+Check that obslog on the draft (divergent) revision also shows public (diverged) revision
+  $ hg obslog fdf9bde5129a --patch
   *  fdf9bde5129a (2) A1
+  |    reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 471f378eab4c -r fdf9bde5129a changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -A0
+  |      +A1
+  |
   |
   @  471f378eab4c (1) A0
-       reworded(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r fdf9bde5129a changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A1
   
-  
-Check that debugobshistory on the both diverged revision show a coherent
-graph
-  $ hg obslog 'fdf9bde5129a+fdf9bde5129a' --patch
+
+Check that all option shows all of them
+  $ hg obslog fdf9bde5129a -a --patch
   *  fdf9bde5129a (2) A1
+  |    reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 471f378eab4c -r fdf9bde5129a changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -A0
+  |      +A1
+  |
   |
   @  471f378eab4c (1) A0
-       reworded(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 471f378eab4c -r fdf9bde5129a changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -A0
-         +A1
   
+Check that obslog on the both draft (divergent) and public (diverged) revisions shows a coherent graph
+  $ hg obslog 'fdf9bde5129a+471f378eab4c' --patch
+  *  fdf9bde5129a (2) A1
+  |    reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 471f378eab4c -r fdf9bde5129a changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -A0
+  |      +A1
+  |
+  |
+  @  471f378eab4c (1) A0
   
-  $ hg obslog 'fdf9bde5129a+fdf9bde5129a' --no-graph -Tjson | python -m json.tool
+  $ hg obslog 'fdf9bde5129a+471f378eab4c' --no-graph --no-origin -Tjson | python -m json.tool
   [
       {
           "markers": [],
@@ -201,18 +196,24 @@
       {
           "markers": [
               {
-                  "date": [
-                      0.0,
-                      0
+                  "dates": [
+                      [
+                          0.0,
+                          0
+                      ]
                   ],
                   "effects": [
                       "description"
                   ],
-                  "operation": "amend",
+                  "operations": [
+                      "amend"
+                  ],
                   "succnodes": [
                       "fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "reworded"
               }
           ],
@@ -220,6 +221,41 @@
           "shortdescription": "A0"
       }
   ]
+  $ hg obslog 'fdf9bde5129a+471f378eab4c' --no-graph -Tjson | python -m json.tool
+  [
+      {
+          "markers": [
+              {
+                  "dates": [
+                      [
+                          0.0,
+                          0
+                      ]
+                  ],
+                  "effects": [
+                      "description"
+                  ],
+                  "operations": [
+                      "amend"
+                  ],
+                  "prednodes": [
+                      "471f378eab4c5e25f6c77f785b27c936efb22874"
+                  ],
+                  "users": [
+                      "test"
+                  ],
+                  "verb": "reworded"
+              }
+          ],
+          "node": "fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e",
+          "shortdescription": "A1"
+      },
+      {
+          "markers": [],
+          "node": "471f378eab4c5e25f6c77f785b27c936efb22874",
+          "shortdescription": "A0"
+      }
+  ]
   $ hg update 471f378eab4c
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg update --hidden 'desc(A0)'
--- a/tests/test-evolve-obshistory-prune.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-obshistory-prune.t	Fri May 08 20:36:29 2020 +0800
@@ -1,5 +1,4 @@
-This test file test the various messages when accessing obsolete
-revisions.
+Testing obslog and other commands accessing obsolete revisions.
 
 Global setup
 ============
@@ -66,19 +65,25 @@
   $ hg obslog 'desc(B0)' --hidden --patch
   x  0dec01379d3b (2) B0
        pruned using prune by test (Thu Jan 01 00:00:00 1970 +0000)
-         (No patch available, no successors)
+         (No patch available, no predecessors)
   
   $ hg obslog 'desc(B0)' --hidden --no-graph -Tjson | python -m json.tool
   [
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
-                  "operation": "prune",
-                  "user": "test",
+                  "operations": [
+                      "prune"
+                  ],
+                  "users": [
+                      "test"
+                  ],
                   "verb": "pruned"
               }
           ],
@@ -115,7 +120,7 @@
 
   $ hg obslog -f -R $TESTTMP/server --patch 0dec01379d3b --hidden
   x  0dec01379d3b (2) B0
-       pruned using prune by test (at Thu Jan 01 00:00:00 1970 +0000)
-         (No patch available, no successors)
+       pruned using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+         (No patch available, no predecessors)
   
 # TODO ADD amend + prune
--- a/tests/test-evolve-obshistory-split.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-obshistory-split.t	Fri May 08 20:36:29 2020 +0800
@@ -1,5 +1,4 @@
-This test file test the various messages when accessing obsolete
-revisions.
+Testing obslog and other commands accessing obsolete revisions.
 
 Global setup
 ============
@@ -98,33 +97,41 @@
 Check output on the client side
 -------------------------------
 
-Check that debugobshistory on split commit show both targets
-  $ hg obslog 471597cad322 --hidden --patch
+Check that obslog on split commit shows both targets
+  $ hg obslog 471597cad322 --hidden --patch --no-origin
   x  471597cad322 (1) A0
        split(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
          note: testing split
          (No patch available, too many successors (2))
   
-  $ hg obslog 471597cad322 --hidden --no-graph -Tjson | python -m json.tool
+  $ hg obslog 471597cad322 --hidden --no-graph --no-origin -Tjson | python -m json.tool
   [
       {
           "markers": [
               {
-                  "date": [
-                      *, (glob)
-                      0
+                  "dates": [
+                      [
+                          *, (glob)
+                          0
+                      ]
                   ],
                   "effects": [
                       "parent",
                       "content"
                   ],
-                  "note": "testing split",
-                  "operation": "split",
+                  "notes": [
+                      "testing split"
+                  ],
+                  "operations": [
+                      "split"
+                  ],
                   "succnodes": [
                       "337fec4d2edcf0e7a467e35f818234bc620068b5",
                       "f257fde29c7a847c9b607f6e958656d0df0fb15c"
                   ],
-                  "user": "test",
+                  "users": [
+                      "test"
+                  ],
                   "verb": "split"
               }
           ],
@@ -132,18 +139,79 @@
           "shortdescription": "A0"
       }
   ]
-Check that debugobshistory on the first successor after split show
-the revision plus the split one
+  $ hg obslog 471597cad322 --hidden --no-graph -Tjson | python -m json.tool
+  [
+      {
+          "markers": [],
+          "node": "471597cad322d1f659bb169751be9133dad92ef3",
+          "shortdescription": "A0"
+      }
+  ]
+Check that obslog on the first successor after split shows the revision plus
+the split one
   $ hg obslog 337fec4d2edc --patch
   o  337fec4d2edc (2) A0
+  |    split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      note: testing split
+  |      diff -r 471597cad322 -r 337fec4d2edc b
+  |      --- a/b	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,1 +0,0 @@
+  |      -43
+  |
   |
   x  471597cad322 (1) A0
-       split(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
-         note: testing split
-         (No patch available, too many successors (2))
+  
+With the all option, it should show all three changesets
+  $ hg obslog --all 337fec4d2edc --patch
+  o  337fec4d2edc (2) A0
+  |    split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      note: testing split
+  |      diff -r 471597cad322 -r 337fec4d2edc b
+  |      --- a/b	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,1 +0,0 @@
+  |      -43
+  |
+  |
+  | @  f257fde29c7a (3) A0
+  |/     split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        note: testing split
+  |        (No patch available, changesets rebased)
+  |
+  x  471597cad322 (1) A0
   
-With the all option, it should show the three changesets
-  $ hg obslog --all 337fec4d2edc --patch
+Check that obslog on the second successor after split shows the revision plus
+the split one
+  $ hg obslog f257fde29c7a --patch
+  @  f257fde29c7a (3) A0
+  |    split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      note: testing split
+  |      (No patch available, changesets rebased)
+  |
+  x  471597cad322 (1) A0
+  
+With the all option, it should show all three changesets
+  $ hg obslog f257fde29c7a --all --patch
+  o  337fec4d2edc (2) A0
+  |    split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      note: testing split
+  |      diff -r 471597cad322 -r 337fec4d2edc b
+  |      --- a/b	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,1 +0,0 @@
+  |      -43
+  |
+  |
+  | @  f257fde29c7a (3) A0
+  |/     split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        note: testing split
+  |        (No patch available, changesets rebased)
+  |
+  x  471597cad322 (1) A0
+  
+Obslog with all option should also works on the split commit
+  $ hg obslog -a 471597cad322 --hidden --patch --no-origin
   o  337fec4d2edc (2) A0
   |
   | @  f257fde29c7a (3) A0
@@ -153,18 +221,8 @@
          note: testing split
          (No patch available, too many successors (2))
   
-Check that debugobshistory on the second successor after split show
-the revision plus the split one
-  $ hg obslog f257fde29c7a --patch
-  @  f257fde29c7a (3) A0
-  |
-  x  471597cad322 (1) A0
-       split(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
-         note: testing split
-         (No patch available, too many successors (2))
-  
-With the all option, it should show the three changesets
-  $ hg obslog f257fde29c7a --all --patch
+Check that obslog on both successors after split shows a coherent graph
+  $ hg obslog 'f257fde29c7a+337fec4d2edc' --patch --no-origin
   o  337fec4d2edc (2) A0
   |
   | @  f257fde29c7a (3) A0
@@ -174,28 +232,23 @@
          note: testing split
          (No patch available, too many successors (2))
   
-Obslog with all option all should also works on the split commit
-  $ hg obslog -a 471597cad322 --hidden --patch
+  $ hg obslog 'f257fde29c7a+337fec4d2edc' --patch
   o  337fec4d2edc (2) A0
+  |    split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      note: testing split
+  |      diff -r 471597cad322 -r 337fec4d2edc b
+  |      --- a/b	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,1 +0,0 @@
+  |      -43
+  |
   |
   | @  f257fde29c7a (3) A0
-  |/
+  |/     split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        note: testing split
+  |        (No patch available, changesets rebased)
+  |
   x  471597cad322 (1) A0
-       split(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
-         note: testing split
-         (No patch available, too many successors (2))
-  
-Check that debugobshistory on both successors after split show
-a coherent graph
-  $ hg obslog 'f257fde29c7a+337fec4d2edc' --patch
-  o  337fec4d2edc (2) A0
-  |
-  | @  f257fde29c7a (3) A0
-  |/
-  x  471597cad322 (1) A0
-       split(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
-         note: testing split
-         (No patch available, too many successors (2))
   
   $ hg update 471597cad322
   abort: hidden revision '471597cad322' was split as: 337fec4d2edc, f257fde29c7a!
@@ -211,7 +264,7 @@
 Check output on the server side
 -------------------------------
 
-  $ hg obslog -R $TESTTMP/server --patch tip
+  $ hg obslog -R $TESTTMP/server --patch tip --no-origin
   o  f257fde29c7a (2) A0
   |
   x  471597cad322
@@ -219,10 +272,10 @@
          note: testing split
          (No patch available, context is not local)
   
-  $ hg obslog -R $TESTTMP/server -f --patch tip
+  $ hg obslog -R $TESTTMP/server -f --patch tip --no-origin
   o  f257fde29c7a (2) A0
   
-  $ hg obslog -R $TESTTMP/server --all --patch tip
+  $ hg obslog -R $TESTTMP/server --all --patch tip --no-origin
   o  337fec4d2edc (1) A0
   |
   | o  f257fde29c7a (2) A0
@@ -232,12 +285,12 @@
          note: testing split
          (No patch available, context is not local)
   
-  $ hg obslog -R $TESTTMP/server --all -f --patch tip
+  $ hg obslog -R $TESTTMP/server --all -f --patch tip --no-origin
   o  337fec4d2edc (1) A0
   
   o  f257fde29c7a (2) A0
   
-  $ hg obslog -R $TESTTMP/server --no-graph -f --all --patch tip
+  $ hg obslog -R $TESTTMP/server --no-graph --all --patch tip --no-origin
   f257fde29c7a (2) A0
   
   471597cad322
@@ -245,12 +298,58 @@
       note: testing split        
       (No patch available, context is not local)
   
+  337fec4d2edc (1) A0
+  
+  $ hg obslog -R $TESTTMP/server --no-graph -f --all --patch tip --no-origin
+  f257fde29c7a (2) A0
+  
+  337fec4d2edc (1) A0
+  
 
+  $ hg obslog -R $TESTTMP/server --patch tip
+  o  f257fde29c7a (2) A0
+  |    split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      note: testing split
+  |      (No patch available, predecessor is unknown locally)
+  |
+  x  471597cad322
+  
+  $ hg obslog -R $TESTTMP/server -f --patch tip
+  o  f257fde29c7a (2) A0
+  
+  $ hg obslog -R $TESTTMP/server --all --patch tip
+  o  337fec4d2edc (1) A0
+  |    split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      note: testing split
+  |      (No patch available, predecessor is unknown locally)
+  |
+  | o  f257fde29c7a (2) A0
+  |/     split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        note: testing split
+  |        (No patch available, predecessor is unknown locally)
+  |
+  x  471597cad322
+  
+  $ hg obslog -R $TESTTMP/server --all -f --patch tip
+  o  337fec4d2edc (1) A0
+  
+  o  f257fde29c7a (2) A0
+  
+  $ hg obslog -R $TESTTMP/server --no-graph --all --patch tip
+  f257fde29c7a (2) A0
+    split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+      note: testing split        
+      (No patch available, predecessor is unknown locally)
+  
+  471597cad322
+  
+  337fec4d2edc (1) A0
+    split(parent, content) from 471597cad322 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+      note: testing split        
+      (No patch available, predecessor is unknown locally)
+  
   $ hg obslog -R $TESTTMP/server --no-graph -f --all --patch tip
   f257fde29c7a (2) A0
   
-  471597cad322
-    split(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
-      note: testing split        
-      (No patch available, context is not local)
+  337fec4d2edc (1) A0
   
--- a/tests/test-evolve-obshistory.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-obshistory.t	Fri May 08 20:36:29 2020 +0800
@@ -93,7 +93,7 @@
 Actual test
 -----------
 
-  $ hg obslog 7a230b46bf61 --patch
+  $ hg obslog 7a230b46bf61 --patch --no-origin
   @  7a230b46bf61 (3) A2
   |
   x  fdf9bde5129a (2) A1
@@ -116,6 +116,31 @@
          +A1
   
   
+
+  $ hg obslog 7a230b46bf61 --patch
+  @  7a230b46bf61 (3) A2
+  |    reworded(description) from fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r fdf9bde5129a -r 7a230b46bf61 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -A1
+  |      +A2
+  |
+  |
+  x  fdf9bde5129a (2) A1
+  |    reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 471f378eab4c -r fdf9bde5129a changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -A0
+  |      +A1
+  |
+  |
+  x  471f378eab4c (1) A0
+  
+
   $ cd $TESTTMP/local-remote-markers-2
   $ hg pull
   pulling from $TESTTMP/local-remote-markers-1
@@ -130,9 +155,8 @@
   (run 'hg heads' to see heads, 'hg merge' to merge)
   working directory parent is obsolete! (471f378eab4c)
   (use 'hg evolve' to update to its successor: 7a230b46bf61)
-Check that debugobshistory works with markers pointing to missing local
-changectx
-  $ hg obslog 7a230b46bf61 --patch
+Check that obslog works with markers pointing to missing local changectx
+  $ hg obslog 7a230b46bf61 --patch --no-origin
   o  7a230b46bf61 (2) A2
   |
   x  fdf9bde5129a
@@ -144,11 +168,23 @@
          (No patch available, successor is unknown locally)
   
 
-  $ hg obslog 7a230b46bf61 --patch -f
+  $ hg obslog 7a230b46bf61 --patch
+  o  7a230b46bf61 (2) A2
+  |    reworded(description) from fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      (No patch available, predecessor is unknown locally)
+  |
+  x  fdf9bde5129a
+  |    reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      (No patch available, context is not local)
+  |
+  @  471f378eab4c (1) A0
+  
+
+  $ hg obslog 7a230b46bf61 --patch -f --no-origin
   o  7a230b46bf61 (2) A2
   |
   @  471f378eab4c (1) A0
-       reworded(description) as 7a230b46bf61 using amend by test (at Thu Jan 01 00:00:00 1970 +0000)
+       reworded(description) as 7a230b46bf61 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
          diff -r 471f378eab4c -r 7a230b46bf61 changeset-description
          --- a/changeset-description
          +++ b/changeset-description
@@ -157,23 +193,111 @@
          +A2
   
   
+  $ hg obslog 7a230b46bf61 --patch -f
+  o  7a230b46bf61 (2) A2
+  |    reworded(description) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 471f378eab4c -r 7a230b46bf61 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -A0
+  |      +A2
+  |
+  |
+  @  471f378eab4c (1) A0
+  
+
   $ hg obslog 7a230b46bf61 --color=debug --patch
   o  [evolve.node|7a230b46bf61] [evolve.rev|(2)] [evolve.short_description|A2]
+  |    [evolve.verb|reworded](description) from [evolve.node|fdf9bde5129a] using [evolve.operation|amend] by [evolve.user|test] [evolve.date|(Thu Jan 01 00:00:00 1970 +0000)]
+  |      (No patch available, predecessor is unknown locally)
   |
   x  [evolve.node evolve.missing_change_ctx|fdf9bde5129a]
-  |    [evolve.verb|reworded](description) as [evolve.node|7a230b46bf61] using [evolve.operation|amend] by [evolve.user|test] [evolve.date|(Thu Jan 01 00:00:00 1970 +0000)]
+  |    [evolve.verb|reworded](description) from [evolve.node|471f378eab4c] using [evolve.operation|amend] by [evolve.user|test] [evolve.date|(Thu Jan 01 00:00:00 1970 +0000)]
   |      (No patch available, context is not local)
   |
   @  [evolve.node|471f378eab4c] [evolve.rev|(1)] [evolve.short_description|A0]
-       [evolve.verb|reworded](description) as [evolve.node|fdf9bde5129a] using [evolve.operation|amend] by [evolve.user|test] [evolve.date|(Thu Jan 01 00:00:00 1970 +0000)]
-         (No patch available, successor is unknown locally)
   
 
-  $ hg obslog 7a230b46bf61 --graph \
-  > -T '{node|short} {rev} {desc|firstline}\n{markers % "rewritten using {operation}"}\n'
+  $ hg obslog 7a230b46bf61 --graph --no-origin \
+  > -T '{node|short} {rev} {desc|firstline}\n{markers % "rewritten using {operations}"}\n'
   o  7a230b46bf61 2 A2
   |
   x  fdf9bde5129a
   |  rewritten using amend
   @  471f378eab4c 1 A0
      rewritten using amend
+
+  $ hg obslog 7a230b46bf61 --graph \
+  > -T '{node|short} {rev} {desc|firstline}\n{markers % "rewritten using {operations}"}\n'
+  o  7a230b46bf61 2 A2
+  |  rewritten using amend
+  x  fdf9bde5129a
+  |  rewritten using amend
+  @  471f378eab4c 1 A0
+  
+
+Test output with non-local changesets and various templates
+===========================================================
+
+  $ hg init $TESTTMP/obslog-non-local-templates
+  $ cd $TESTTMP/obslog-non-local-templates
+  $ cat << EOF >> .hg/hgrc
+  > [templates]
+  > fancy = '{desc|firstline}\n{markers % "{verb} using {operations} by {users} ({join(notes, "; ")})"}'
+  > fancier = '{desc|firstline}\n{markers % "{join(users, ", ")} had {verb} this commit using {join(operations, "/")} and said: {join(notes % "\"{note}\"", ", ")})"}'
+  > EOF
+
+  $ mkcommit A0
+  $ hg metaedit -m 'A1' -n 'note1' -d '42 0' --config devel.default-date='1 0' -q
+  $ HGUSER=alice hg amend -m 'A2' -n 'note2'
+  $ HGUSER=bob hg amend -m 'A3' -n 'note3'
+
+  $ hg debugobsolete
+  6ffd04c870fe2b73e7c885e508c4f1213a75c4d4 e481355d236800802337be3e637bd820870b04d2 0 (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '33', 'note': 'note1', 'operation': 'metaedit', 'user': 'test'}
+  e481355d236800802337be3e637bd820870b04d2 65835bf83412a950e6a47f023690d5e6ae09718d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'note': 'note2', 'operation': 'amend', 'user': 'alice'}
+  65835bf83412a950e6a47f023690d5e6ae09718d 41985e02b792daac8907f6b30b513bbf6e8e034d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'note': 'note3', 'operation': 'amend', 'user': 'bob'}
+
+  $ hg strip 'desc(A1) + desc(A2)' --hidden --quiet --config extensions.strip=
+
+  $ hg obslog -f --no-origin
+  @  41985e02b792 (1) A3
+  |
+  x  6ffd04c870fe (0) A0
+       rewritten(description, date) as 41985e02b792 using amend, metaedit by alice, bob, test (between Thu Jan 01 00:00:00 1970 +0000 and Thu Jan 01 00:00:01 1970 +0000)
+         note: note1
+         note: note2
+         note: note3
+  
+  $ hg obslog -f
+  @  41985e02b792 (1) A3
+  |    rewritten(description, date) from 6ffd04c870fe using amend, metaedit by alice, bob, test (between Thu Jan 01 00:00:00 1970 +0000 and Thu Jan 01 00:00:01 1970 +0000)
+  |      note: note1
+  |      note: note2
+  |      note: note3
+  |
+  x  6ffd04c870fe (0) A0
+  
+  $ hg obslog -f -T fancy --no-origin
+  @  A3
+  |
+  x  A0
+     rewritten using amend, metaedit by alice, bob, test (note1; note2; note3)
+
+  $ hg obslog -f -T fancy
+  @  A3
+  |  rewritten using amend, metaedit by alice, bob, test (note1; note2; note3)
+  x  A0
+  
+
+  $ hg obslog -f -T fancier --no-origin
+  @  A3
+  |
+  x  A0
+     alice, bob, test had rewritten this commit using amend/metaedit and said: "note1", "note2", "note3")
+
+  $ hg obslog -f -T fancier
+  @  A3
+  |  alice, bob, test had rewritten this commit using amend/metaedit and said: "note1", "note2", "note3")
+  x  A0
+  
--- a/tests/test-evolve-phase-divergence.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-phase-divergence.t	Fri May 08 20:36:29 2020 +0800
@@ -160,9 +160,9 @@
 XXX: There must be mention of phase-divergence here
   $ hg obslog -r . --all
   @  98bb3a6cfe1a (2) tweak a
+  |    reworded(description) from 4d1169d82e47 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   o  4d1169d82e47 (1) modify a
-       reworded(description) as 98bb3a6cfe1a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
 Solving the phase divergence using evolve command
 --------------------------------------------------
@@ -352,14 +352,19 @@
   o  0:d3873e73d99e init
       () public
 
+  $ hg debugobsolete
+  4d1169d82e47b11570c7f380790da5f89f7cabc2 98bb3a6cfe1a3d98d0959e9d42322f38313a08f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
+  98bb3a6cfe1a3d98d0959e9d42322f38313a08f3 0 {d3873e73d99ef67873dac33fbcc66268d5d2b6f4} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  aa071e5554e36080a36cfd24accd5a71e3320f1e d47f2b37ed8216234c503b3a2657989958754a59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  d47f2b37ed8216234c503b3a2657989958754a59 3d62500c673dd1c88bb09a73e86d0210aed6fcb6 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
   $ hg obslog -r . --all
   @  3d62500c673d (5) phase-divergent update to aa071e5554e3:
+  |    rewritten(description, parent, content) from d47f2b37ed82 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  d47f2b37ed82 (4) added bar to foo
-  |    rewritten(description, parent, content) as 3d62500c673d using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    rewritten(description, content) from aa071e5554e3 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   o  aa071e5554e3 (3) added foo to foo
-       rewritten(description, content) as d47f2b37ed82 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
 
 Syncing all other repositories
@@ -582,11 +587,19 @@
   1 new phase-divergent changesets
   1 local changesets published
 
+  $ hg debugobsolete
+  4d1169d82e47b11570c7f380790da5f89f7cabc2 98bb3a6cfe1a3d98d0959e9d42322f38313a08f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
+  98bb3a6cfe1a3d98d0959e9d42322f38313a08f3 0 {d3873e73d99ef67873dac33fbcc66268d5d2b6f4} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  aa071e5554e36080a36cfd24accd5a71e3320f1e d47f2b37ed8216234c503b3a2657989958754a59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  d47f2b37ed8216234c503b3a2657989958754a59 3d62500c673dd1c88bb09a73e86d0210aed6fcb6 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
+  b756eb10ea73ee4ba69c998e64a5c6e1005d74b5 2c3560aedeadb452d517b6c5a93fd3af91b3b8cd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  2c3560aedeadb452d517b6c5a93fd3af91b3b8cd 502e737366322886cf628276aa0a2796904453b4 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
+  2352021b37851be226ebed109b0eb6eada918566 334e300d6db500489d842240cbdc40c203d385c7 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
   $ hg obslog -r .
   @  334e300d6db5 (10) added x to x
+  |    rebased(parent) from 2352021b3785 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   o  2352021b3785 (9) added x to x
-       rebased(parent) as 334e300d6db5 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg glog -r .^::
   @  10:334e300d6db5 added x to x
@@ -629,15 +642,25 @@
   o  0:d3873e73d99e init
       () public
 
+  $ hg debugobsolete
+  4d1169d82e47b11570c7f380790da5f89f7cabc2 98bb3a6cfe1a3d98d0959e9d42322f38313a08f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
+  98bb3a6cfe1a3d98d0959e9d42322f38313a08f3 0 {d3873e73d99ef67873dac33fbcc66268d5d2b6f4} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  aa071e5554e36080a36cfd24accd5a71e3320f1e d47f2b37ed8216234c503b3a2657989958754a59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  d47f2b37ed8216234c503b3a2657989958754a59 3d62500c673dd1c88bb09a73e86d0210aed6fcb6 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
+  b756eb10ea73ee4ba69c998e64a5c6e1005d74b5 2c3560aedeadb452d517b6c5a93fd3af91b3b8cd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  2c3560aedeadb452d517b6c5a93fd3af91b3b8cd 502e737366322886cf628276aa0a2796904453b4 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
+  2352021b37851be226ebed109b0eb6eada918566 334e300d6db500489d842240cbdc40c203d385c7 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  334e300d6db500489d842240cbdc40c203d385c7 b1a0e143e32be800ff6a5c2cd6c77823652c901b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  b1a0e143e32be800ff6a5c2cd6c77823652c901b 0 {502e737366322886cf628276aa0a2796904453b4} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
   $ hg obslog -r . b1a0e143e32b --all --hidden
   x  b1a0e143e32b (11) added x to x
+  |    rebased(parent) from 334e300d6db5 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   |    pruned using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  334e300d6db5 (10) added x to x
-  |    rebased(parent) as b1a0e143e32b using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    rebased(parent) from 2352021b3785 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   @  2352021b3785 (9) added x to x
-       rebased(parent) as 334e300d6db5 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   
 
   $ hg exp
@@ -713,14 +736,26 @@
   o  0:d3873e73d99e init
       () public
 
+  $ hg debugobsolete
+  4d1169d82e47b11570c7f380790da5f89f7cabc2 98bb3a6cfe1a3d98d0959e9d42322f38313a08f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
+  98bb3a6cfe1a3d98d0959e9d42322f38313a08f3 0 {d3873e73d99ef67873dac33fbcc66268d5d2b6f4} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  aa071e5554e36080a36cfd24accd5a71e3320f1e d47f2b37ed8216234c503b3a2657989958754a59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  d47f2b37ed8216234c503b3a2657989958754a59 3d62500c673dd1c88bb09a73e86d0210aed6fcb6 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
+  b756eb10ea73ee4ba69c998e64a5c6e1005d74b5 2c3560aedeadb452d517b6c5a93fd3af91b3b8cd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  2c3560aedeadb452d517b6c5a93fd3af91b3b8cd 502e737366322886cf628276aa0a2796904453b4 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
+  2352021b37851be226ebed109b0eb6eada918566 334e300d6db500489d842240cbdc40c203d385c7 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  334e300d6db500489d842240cbdc40c203d385c7 b1a0e143e32be800ff6a5c2cd6c77823652c901b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  b1a0e143e32be800ff6a5c2cd6c77823652c901b 0 {502e737366322886cf628276aa0a2796904453b4} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  dc88f5aa9bc90a6418899d267d9524205dfb429b 211ab84d1689507465ecf708fea540e9867d5fda 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  211ab84d1689507465ecf708fea540e9867d5fda 13015a180eee523ba9950f18683762a77f560f3d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
   $ hg obslog -r .
   @  13015a180eee (14) y to y and foobar to foo
+  |    amended(content) from 211ab84d1689 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  211ab84d1689 (13) y to y and foobar to foo
-  |    amended(content) as 13015a180eee using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    rebased(parent) from dc88f5aa9bc9 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   o  dc88f5aa9bc9 (12) y to y and foobar to foo
-       rebased(parent) as 211ab84d1689 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   
 Resolving divergence using `hg evolve`
 -------------------------------------
@@ -785,14 +820,30 @@
   $ hg add x
   $ hg amend
 
+  $ hg debugobsolete
+  4d1169d82e47b11570c7f380790da5f89f7cabc2 98bb3a6cfe1a3d98d0959e9d42322f38313a08f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
+  98bb3a6cfe1a3d98d0959e9d42322f38313a08f3 0 {d3873e73d99ef67873dac33fbcc66268d5d2b6f4} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  aa071e5554e36080a36cfd24accd5a71e3320f1e d47f2b37ed8216234c503b3a2657989958754a59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  d47f2b37ed8216234c503b3a2657989958754a59 3d62500c673dd1c88bb09a73e86d0210aed6fcb6 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
+  b756eb10ea73ee4ba69c998e64a5c6e1005d74b5 2c3560aedeadb452d517b6c5a93fd3af91b3b8cd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  2c3560aedeadb452d517b6c5a93fd3af91b3b8cd 502e737366322886cf628276aa0a2796904453b4 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
+  2352021b37851be226ebed109b0eb6eada918566 334e300d6db500489d842240cbdc40c203d385c7 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  334e300d6db500489d842240cbdc40c203d385c7 b1a0e143e32be800ff6a5c2cd6c77823652c901b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  b1a0e143e32be800ff6a5c2cd6c77823652c901b 0 {502e737366322886cf628276aa0a2796904453b4} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  dc88f5aa9bc90a6418899d267d9524205dfb429b 211ab84d1689507465ecf708fea540e9867d5fda 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  211ab84d1689507465ecf708fea540e9867d5fda 13015a180eee523ba9950f18683762a77f560f3d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  13015a180eee523ba9950f18683762a77f560f3d 7687d2968b3e2697f955beac2da24ee879950cb9 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  7687d2968b3e2697f955beac2da24ee879950cb9 8c2bb6fb44e9443c64b3a2a3d061272c8e25e6ce 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
+  f3794e5a91dc1d4d36fee5c423386b19433a1f48 2bfd56949cf0a3abfbf9881254a88fe07b336ddb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  2bfd56949cf0a3abfbf9881254a88fe07b336ddb 5fd38c0de46ec31f0bb1904b5909802bc4bcb47e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
   $ hg obslog -r .
   @  5fd38c0de46e (19) added l to l
+  |    amended(content) from 2bfd56949cf0 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  2bfd56949cf0 (18) added l to l
-  |    amended(content) as 5fd38c0de46e using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    rebased(parent) from f3794e5a91dc using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  f3794e5a91dc (17) added l to l
-       rebased(parent) as 2bfd56949cf0 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   
 
   $ hg phase -r f3794e5a91dc --public --hidden
@@ -1021,22 +1072,28 @@
   o  0:d3873e73d99e init
       () public
 
+  $ hg debugobsolete
+  a51bce62c219f024bc0ae0cc0e3957ee77d7cb46 4f25cd9cd2bf15bc83316e91fbcb93489ea15a75 e1154ec0206ac05c3765f7bd1337e3b96db2974f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'prune', 'user': 'test'}
+  4f25cd9cd2bf15bc83316e91fbcb93489ea15a75 86419909e01787959aa6471aee605c6d604a3e0d 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
+  e1154ec0206ac05c3765f7bd1337e3b96db2974f ee4af146c5cfe0b1bf7665243dd89f9bfe604f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  ee4af146c5cfe0b1bf7665243dd89f9bfe604f59 89ba615ea1ec3ba5b25db9f7897eb29712d7e5d6 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
   $ hg obslog -r a51bce62c219 --all
   o  86419909e017 (4) phase-divergent update to a51bce62c219:
+  |    rewritten(description, parent, content) from 4f25cd9cd2bf using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   | @  89ba615ea1ec (6) phase-divergent update to a51bce62c219:
+  | |    rewritten(description, parent, content) from ee4af146c5cf using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   x |  4f25cd9cd2bf (2) added m
-  | |    rewritten(description, parent, content) as 86419909e017 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    split(description, parent, content) from a51bce62c219 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   | x  ee4af146c5cf (5) added n
-  | |    rewritten(description, parent, content) as 89ba615ea1ec using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rebased(parent) from e1154ec0206a using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   | x  e1154ec0206a (3) added n
-  |/     rebased(parent) as ee4af146c5cf using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  |/     split(description, parent, content) from a51bce62c219 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   o  a51bce62c219 (1) added m and n
-       split(description, parent, content) as 4f25cd9cd2bf, e1154ec0206a using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   
 
 XXX: not sure this is the correct
@@ -1151,19 +1208,24 @@
   o  0:d3873e73d99e init
       () public
 
+  $ hg debugobsolete
+  90859808ece64c9ca64dd29992db42353c70f164 a472632947451d2e52659aec3088c98ddf920f2b bb87595f9a77d7d1e4a8726beef266a1636f63d5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'prune', 'user': 'test'}
+  a472632947451d2e52659aec3088c98ddf920f2b 25875a9cb6400973b846c94f6a80410067c2cb1f 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
+  bb87595f9a77d7d1e4a8726beef266a1636f63d5 26f564f94bcc34e049eb112fd14ab1e5286f2325 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
   $ hg obslog -r 90859808ece6 --all
   o  25875a9cb640 (4) phase-divergent update to 90859808ece6:
+  |    rewritten(description, parent, content) from a47263294745 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   | @  26f564f94bcc (5) phase-divergent update to 90859808ece6:
+  | |    rewritten(description, parent, content) from bb87595f9a77 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   x |  a47263294745 (2) added p
-  | |    rewritten(description, parent, content) as 25875a9cb640 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    split(description, content) from 90859808ece6 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   | x  bb87595f9a77 (3) added q
-  |/     rewritten(description, parent, content) as 26f564f94bcc using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  |/     split(description, content) from 90859808ece6 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   o  90859808ece6 (1) added p and q
-       split(description, content) as a47263294745, bb87595f9a77 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   
 
 XXX: not sure this is correct
@@ -1282,25 +1344,32 @@
   o  0:d3873e73d99e init
       () public
 
+  $ hg debugobsolete
+  a51bce62c219f024bc0ae0cc0e3957ee77d7cb46 4f25cd9cd2bf15bc83316e91fbcb93489ea15a75 e1154ec0206ac05c3765f7bd1337e3b96db2974f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'prune', 'user': 'test'}
+  e1154ec0206ac05c3765f7bd1337e3b96db2974f 52ca78bb98c71222f8afae28d48ae6cfd44a60c9 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  4f25cd9cd2bf15bc83316e91fbcb93489ea15a75 86419909e01787959aa6471aee605c6d604a3e0d 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
+  52ca78bb98c71222f8afae28d48ae6cfd44a60c9 98dad881251146cd171f53b2a5b7fc3a371f820e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  98dad881251146cd171f53b2a5b7fc3a371f820e 88b0dae5369aaa3bceb6c0b647542594e2c72fb7 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
   $ hg obslog -r a51bce62c219 --all
   o  86419909e017 (5) phase-divergent update to a51bce62c219:
+  |    rewritten(description, parent, content) from 4f25cd9cd2bf using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   | @  88b0dae5369a (7) phase-divergent update to a51bce62c219:
+  | |    rewritten(description, parent, content) from 98dad8812511 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   x |  4f25cd9cd2bf (2) added m
-  | |    rewritten(description, parent, content) as 86419909e017 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    split(description, parent, content) from a51bce62c219 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   | x  98dad8812511 (6) added n
-  | |    rewritten(description, parent, content) as 88b0dae5369a using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rebased(parent) from 52ca78bb98c7 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   | x  52ca78bb98c7 (4) added n
-  | |    rebased(parent) as 98dad8812511 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    amended(content) from e1154ec0206a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   | x  e1154ec0206a (3) added n
-  |/     amended(content) as 52ca78bb98c7 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |/     split(description, parent, content) from a51bce62c219 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   o  a51bce62c219 (1) added m and n
-       split(description, parent, content) as 4f25cd9cd2bf, e1154ec0206a using prune by test (Thu Jan 01 00:00:00 1970 +0000)
   
 
 XXX: not sure this is correct
@@ -1579,56 +1648,58 @@
   599454370881: E2
     phase-divergent: 3074c7249d20 (immutable precursor)
   
+  $ hg debugobsolete
+  3074c7249d2023b1fff891591d7e609695cd09c2 59945437088136c5fa2f9bb8573d5d02623fe7cb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
   $ hg obslog --all --patch
   @  599454370881 (2) E2
+  |    rewritten(description, content) from 3074c7249d20 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 3074c7249d20 -r 599454370881 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -E1
+  |      +E2
+  |
+  |      diff -r 3074c7249d20 -r 599454370881 letters
+  |      --- a/letters	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ b/letters	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,7 +1,7 @@
+  |       a
+  |       b
+  |       c
+  |      -D
+  |      +d
+  |       e
+  |       f
+  |       g
+  |      diff -r 3074c7249d20 -r 599454370881 numbers
+  |      --- a/numbers	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ b/numbers	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,9 +1,9 @@
+  |       1
+  |       2
+  |       3
+  |      -four
+  |      +4
+  |       5
+  |       6
+  |      -7
+  |      +seven
+  |       8
+  |       nine
+  |      diff -r 3074c7249d20 -r 599454370881 romans
+  |      --- a/romans	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ b/romans	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,5 +1,5 @@
+  |       I
+  |      -II
+  |      +ii
+  |       III
+  |       IV
+  |       V
+  |
   |
   o  3074c7249d20 (1) E1
-       rewritten(description, content) as 599454370881 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 3074c7249d20 -r 599454370881 changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -E1
-         +E2
-  
-         diff -r 3074c7249d20 -r 599454370881 letters
-         --- a/letters	Thu Jan 01 00:00:00 1970 +0000
-         +++ b/letters	Thu Jan 01 00:00:00 1970 +0000
-         @@ -1,7 +1,7 @@
-          a
-          b
-          c
-         -D
-         +d
-          e
-          f
-          g
-         diff -r 3074c7249d20 -r 599454370881 numbers
-         --- a/numbers	Thu Jan 01 00:00:00 1970 +0000
-         +++ b/numbers	Thu Jan 01 00:00:00 1970 +0000
-         @@ -1,9 +1,9 @@
-          1
-          2
-          3
-         -four
-         +4
-          5
-          6
-         -7
-         +seven
-          8
-          nine
-         diff -r 3074c7249d20 -r 599454370881 romans
-         --- a/romans	Thu Jan 01 00:00:00 1970 +0000
-         +++ b/romans	Thu Jan 01 00:00:00 1970 +0000
-         @@ -1,5 +1,5 @@
-          I
-         -II
-         +ii
-          III
-          IV
-          V
-  
   
 
   $ hg evolve --phase-divergent --rev 'desc("E2")'
@@ -1763,60 +1834,63 @@
      -9
      +nine
   
+  $ hg debugobsolete
+  3074c7249d2023b1fff891591d7e609695cd09c2 59945437088136c5fa2f9bb8573d5d02623fe7cb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  59945437088136c5fa2f9bb8573d5d02623fe7cb 9eebcb77a7e2b240cb7dce095bbe608b5de91cc8 1 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'evolve', 'user': 'test'}
   $ hg obslog --patch
   @  9eebcb77a7e2 (3) phase-divergent update to 3074c7249d20:
+  |    rewritten(description, parent, content) from 599454370881 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      (No patch available, changesets rebased)
   |
   x  599454370881 (2) E2
-  |    rewritten(description, parent, content) as 9eebcb77a7e2 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
-  |      (No patch available, changesets rebased)
+  |    rewritten(description, content) from 3074c7249d20 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 3074c7249d20 -r 599454370881 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,1 +1,1 @@
+  |      -E1
+  |      +E2
+  |
+  |      diff -r 3074c7249d20 -r 599454370881 letters
+  |      --- a/letters	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ b/letters	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,7 +1,7 @@
+  |       a
+  |       b
+  |       c
+  |      -D
+  |      +d
+  |       e
+  |       f
+  |       g
+  |      diff -r 3074c7249d20 -r 599454370881 numbers
+  |      --- a/numbers	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ b/numbers	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,9 +1,9 @@
+  |       1
+  |       2
+  |       3
+  |      -four
+  |      +4
+  |       5
+  |       6
+  |      -7
+  |      +seven
+  |       8
+  |       nine
+  |      diff -r 3074c7249d20 -r 599454370881 romans
+  |      --- a/romans	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ b/romans	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,5 +1,5 @@
+  |       I
+  |      -II
+  |      +ii
+  |       III
+  |       IV
+  |       V
+  |
   |
   o  3074c7249d20 (1) E1
-       rewritten(description, content) as 599454370881 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 3074c7249d20 -r 599454370881 changeset-description
-         --- a/changeset-description
-         +++ b/changeset-description
-         @@ -1,1 +1,1 @@
-         -E1
-         +E2
-  
-         diff -r 3074c7249d20 -r 599454370881 letters
-         --- a/letters	Thu Jan 01 00:00:00 1970 +0000
-         +++ b/letters	Thu Jan 01 00:00:00 1970 +0000
-         @@ -1,7 +1,7 @@
-          a
-          b
-          c
-         -D
-         +d
-          e
-          f
-          g
-         diff -r 3074c7249d20 -r 599454370881 numbers
-         --- a/numbers	Thu Jan 01 00:00:00 1970 +0000
-         +++ b/numbers	Thu Jan 01 00:00:00 1970 +0000
-         @@ -1,9 +1,9 @@
-          1
-          2
-          3
-         -four
-         +4
-          5
-          6
-         -7
-         +seven
-          8
-          nine
-         diff -r 3074c7249d20 -r 599454370881 romans
-         --- a/romans	Thu Jan 01 00:00:00 1970 +0000
-         +++ b/romans	Thu Jan 01 00:00:00 1970 +0000
-         @@ -1,5 +1,5 @@
-          I
-         -II
-         +ii
-          III
-          IV
-          V
-  
   
   $ cd ..
 
--- a/tests/test-evolve-public-content-divergent-corner-cases.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-public-content-divergent-corner-cases.t	Fri May 08 20:36:29 2020 +0800
@@ -137,14 +137,14 @@
   base: [2] added c
   rebasing "other" content-divergent changeset f5f9b4fc8b77 on c9241b0f2d5b
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  committed as 3b336cbee992
-  working directory is now at 3b336cbee992
+  committed as 0941937e8302
+  working directory is now at 0941937e8302
 
   $ hg glog -p
-  @  8:3b336cbee992 phase-divergent update to c0d7ee6604ea:
+  @  8:0941937e8302 phase-divergent update to c0d7ee6604ea:
   |   draft
   |
-  |  diff -r c0d7ee6604ea -r 3b336cbee992 c
+  |  diff -r c0d7ee6604ea -r 0941937e8302 c
   |  --- a/c	Thu Jan 01 00:00:00 1970 +0000
   |  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
   |  @@ -1,1 +1,2 @@
@@ -366,22 +366,25 @@
      +a
   
 
+  $ hg debugobsolete
+  9150fe93bec603cd88d05cda9f6ff13420cb53e9 93cd84bbdacaeb8f881c29a609dbdd30c38cbc57 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'prune', 'user': 'test'}
+  9150fe93bec603cd88d05cda9f6ff13420cb53e9 e568fd1029bbe9d506275bbb9a034a0509d80324 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'prune', 'user': 'test'}
   $ hg obslog --all --rev tip --patch
   @  93cd84bbdaca (5) added d
+  |    amended(content) from 9150fe93bec6 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 9150fe93bec6 -r 93cd84bbdaca d
+  |      --- a/d	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ b/d	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,1 +1,1 @@
+  |      -d
+  |      +dd
+  |
   |
   | *  e568fd1029bb (4) added c e
-  |/
+  |/     rewritten(description, parent, content) from 9150fe93bec6 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  |        (No patch available, changesets rebased)
+  |
   x  9150fe93bec6 (3) added d
-       amended(content) as 93cd84bbdaca using prune by test (Thu Jan 01 00:00:00 1970 +0000)
-         diff -r 9150fe93bec6 -r 93cd84bbdaca d
-         --- a/d	Thu Jan 01 00:00:00 1970 +0000
-         +++ b/d	Thu Jan 01 00:00:00 1970 +0000
-         @@ -1,1 +1,1 @@
-         -d
-         +dd
-  
-       rewritten(description, parent, content) as e568fd1029bb using prune by test (Thu Jan 01 00:00:00 1970 +0000)
-         (No patch available, changesets rebased)
   
 
   $ hg evolve --content-divergent --any --update
@@ -444,27 +447,27 @@
   continue: hg evolve --continue
 
   $ hg evolve --continue
-  committed as bc1f4610744c
-  working directory is now at bc1f4610744c
+  committed as bb4d94ae1a5a
+  working directory is now at bb4d94ae1a5a
 
   $ hg export
   # HG changeset patch
   # User test
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
-  # Node ID bc1f4610744c6aa0e851d3876a61bfff6243b31c
+  # Node ID bb4d94ae1a5ac031ba524ef30850f32b9b50a560
   # Parent  93cd84bbdacaeb8f881c29a609dbdd30c38cbc57
   phase-divergent update to 93cd84bbdaca:
   
   added c e
   
-  diff -r 93cd84bbdaca -r bc1f4610744c d
+  diff -r 93cd84bbdaca -r bb4d94ae1a5a d
   --- a/d	Thu Jan 01 00:00:00 1970 +0000
   +++ b/d	Thu Jan 01 00:00:00 1970 +0000
   @@ -1,1 +1,1 @@
   -dd
   +resolved
-  diff -r 93cd84bbdaca -r bc1f4610744c e
+  diff -r 93cd84bbdaca -r bb4d94ae1a5a e
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/e	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
@@ -752,16 +755,25 @@
   @@ -0,0 +1,1 @@
   +c_F
 
+  $ hg debugobsolete
+  4ab2719bbab9c0f4addf11ab7fa3cf3e1a832c2d c7d2d47c7240562be5cbd1a24080dd0396178709 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  77ccbf8d837e0eb67e09569335146263e7d61551 a52ac76b45f523a039fc4a938d79874f4bdb1a85 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  4ab2719bbab9c0f4addf11ab7fa3cf3e1a832c2d b4a584aea4bd8d771184530d445a582251275f37 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  77ccbf8d837e0eb67e09569335146263e7d61551 8ae8db670b4ad2385b9e008122af42ef6048a675 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  b4a584aea4bd8d771184530d445a582251275f37 0773642cfa95002f7937f44bec95dd208564c64e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  0773642cfa95002f7937f44bec95dd208564c64e c7d2d47c7240562be5cbd1a24080dd0396178709 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  8ae8db670b4ad2385b9e008122af42ef6048a675 6a87ed4aa31771f9041ca1260a91f7185f38f15c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  6a87ed4aa31771f9041ca1260a91f7185f38f15c a52ac76b45f523a039fc4a938d79874f4bdb1a85 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
   $ hg obslog --rev a52ac76b45f5
   @    a52ac76b45f5 (8) c_F
-  |\
+  |\     rewritten from 6a87ed4aa317 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rebased(parent) from 77ccbf8d837e using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
   x |  6a87ed4aa317 (12) c_F
-  | |    rewritten as a52ac76b45f5 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rebased(parent) from 8ae8db670b4a using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
   x |  8ae8db670b4a (10) c_F
-  |/     rebased(parent) as 6a87ed4aa317 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  |/     rebased(parent) from 77ccbf8d837e using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  77ccbf8d837e (6) c_F
-       rebased(parent) as 8ae8db670b4a using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
-       rebased(parent) as a52ac76b45f5 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   
--- a/tests/test-evolve-public-content-divergent-main.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-public-content-divergent-main.t	Fri May 08 20:36:29 2020 +0800
@@ -43,7 +43,7 @@
 
 Make an amend and change phase to public:
 
-  $ sed -i "1 i I am first" b
+  $ printf "I am first\nb\n" > b
   $ hg amend
   $ hg phase --public
 
@@ -77,16 +77,16 @@
   base: [1] added b
   merging b
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-  committed as c1aa9cfb6cf8
-  working directory is now at c1aa9cfb6cf8
+  committed as b11d193ede1d
+  working directory is now at b11d193ede1d
 
 Following graph log shows that it correctly merged the two divergent csets:
 
   $ hg glog -p
-  @  5:c1aa9cfb6cf8 phase-divergent update to 44f360db368f:
+  @  5:b11d193ede1d phase-divergent update to 44f360db368f:
   |   draft
   |
-  |  diff -r 44f360db368f -r c1aa9cfb6cf8 b
+  |  diff -r 44f360db368f -r b11d193ede1d b
   |  --- a/b	Thu Jan 01 00:00:00 1970 +0000
   |  +++ b/b	Thu Jan 01 00:00:00 1970 +0000
   |  @@ -1,2 +1,3 @@
@@ -181,11 +181,11 @@
   (no more unresolved files)
   continue: hg evolve --continue
   $ hg evolve --continue
-  committed as 1a739394e9d4
-  working directory is now at 1a739394e9d4
+  committed as 4ae447c511d3
+  working directory is now at 4ae447c511d3
 
   $ hg glog
-  @  5:1a739394e9d4 phase-divergent update to 580f2d01e52c:
+  @  5:4ae447c511d3 phase-divergent update to 580f2d01e52c:
   |   draft
   |
   o  2:580f2d01e52c added b
@@ -271,11 +271,11 @@
   base: [3] added d
   rebasing "other" content-divergent changeset 4291d72ee19a on 155349b645be
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  committed as 4cbe48a0c3d9
-  working directory is now at 4cbe48a0c3d9
+  committed as 07aa587dcd2b
+  working directory is now at 07aa587dcd2b
 
   $ hg glog -l 1
-  @  8:4cbe48a0c3d9 phase-divergent update to 93cd84bbdaca:
+  @  8:07aa587dcd2b phase-divergent update to 93cd84bbdaca:
   |   draft
   ~
 
@@ -392,20 +392,20 @@
   $ hg evolve --continue
   evolving 4:f31bcc378766 "added d c e"
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  committed as 412dde898967
-  working directory is now at 412dde898967
+  committed as 4bce4ff71bf9
+  working directory is now at 4bce4ff71bf9
   $ hg export
   # HG changeset patch
   # User test
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
-  # Node ID 412dde898967b50e7d334aefff778a9af46d29d1
+  # Node ID 4bce4ff71bf901840aebb0aa87716e878938b55e
   # Parent  93cd84bbdacaeb8f881c29a609dbdd30c38cbc57
   phase-divergent update to 93cd84bbdaca:
   
   added d c e
   
-  diff -r 93cd84bbdaca -r 412dde898967 e
+  diff -r 93cd84bbdaca -r 4bce4ff71bf9 e
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/e	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
@@ -500,7 +500,7 @@
   continue: hg evolve --continue
 
   $ hg evolve --continue
-  committed as 2a0f44767904
+  committed as d87a8f56f14a
   working directory is now at 93cd84bbdaca
 
   $ hg evolve -l
@@ -628,7 +628,7 @@
   continue: hg evolve --continue
 
   $ hg evolve --continue
-  committed as b9082a9e66ce
+  committed as ba823b8ff683
   working directory is now at 93cd84bbdaca
 
   $ hg evolve -l
--- a/tests/test-evolve-templates.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve-templates.t	Fri May 08 20:36:29 2020 +0800
@@ -19,8 +19,11 @@
   >     {if(predecessors, "\n  semi-colon: {join(predecessors, "; ")}")}\
   >     {if(successors, "\n  Successors: {successors}")}\
   >     {if(successors, "\n  semi-colon: {join(successors, "; ")}")}\
-  >     {if(obsfate, "\n  Fate: {join(obsfate, "\n  Fate: ")}\n")}\n'
-  > fatelog = log -G -T '{node|short}\n{if(obsfate, "  Obsfate: {join(obsfate, "; ")}\n\n")}'
+  >     {if(obsfate, "{obsfate % "\n  Fate: {fate}"}")}\
+  >     {if(obsorigin, "{obsorigin % "\n  Origin: {origin}"}")}\n\n'
+  > fateoriginlog = log -G -T '{node|short}\
+  >     {if(obsfate, "\n  Obsfate: {join(obsfate, "; ")}")}\
+  >     {if(obsorigin, "\n  Obsorigin: {join(obsorigin, "; ")}")}\n\n'
   > EOF
 
 Test templates on amended commit
@@ -74,17 +77,19 @@
 Predecessors template should show current revision as it is the working copy
   $ hg olog tip
   o  d004c8f274b9 (3) A2
+  |    reworded(description) from a468dc9b3633 using amend by test2 (Thu Apr 19 04:25:21 2001 +0000)
   |
   x  a468dc9b3633 (2) A1
-  |    reworded(description) as d004c8f274b9 using amend by test2 (Thu Apr 19 04:25:21 2001 +0000)
+  |    rewritten(description, content) from 471f378eab4c using amend by test (Fri Feb 13 23:31:30 2009 +0000)
   |
   @  471f378eab4c (1) A0
-       rewritten(description, content) as a468dc9b3633 using amend by test (Fri Feb 13 23:31:30 2009 +0000)
   
   $ hg tlog
   o  d004c8f274b9
   |    Predecessors: 1:471f378eab4c
   |    semi-colon: 1:471f378eab4c
+  |    Origin: rewritten using amend from 1:471f378eab4c by test, test2
+  |
   | @  471f378eab4c
   |/     Successors: 3:d004c8f274b9
   |      semi-colon: 3:d004c8f274b9
@@ -113,8 +118,9 @@
      summary:     ROOT
   
 
-  $ hg fatelog -q
+  $ hg fateoriginlog -q
   o  d004c8f274b9
+  |    Obsorigin: rewritten using amend from 1:471f378eab4c
   |
   | @  471f378eab4c
   |/     Obsfate: rewritten using amend as 3:d004c8f274b9
@@ -122,16 +128,18 @@
   o  ea207398892e
   
 
-  $ hg fatelog
+  $ hg fateoriginlog
   o  d004c8f274b9
+  |    Obsorigin: rewritten using amend from 1:471f378eab4c by test, test2
   |
   | @  471f378eab4c
   |/     Obsfate: rewritten using amend as 3:d004c8f274b9 by test, test2
   |
   o  ea207398892e
   
-  $ hg fatelog -v
+  $ hg fateoriginlog -v
   o  d004c8f274b9
+  |    Obsorigin: rewritten using amend from 1:471f378eab4c by test, test2 (between 2001-04-19 04:25 +0000 and 2009-02-13 23:31 +0000)
   |
   | @  471f378eab4c
   |/     Obsfate: rewritten using amend as 3:d004c8f274b9 by test, test2 (between 2001-04-19 04:25 +0000 and 2009-02-13 23:31 +0000)
@@ -169,6 +177,8 @@
   o  d004c8f274b9
   |    Predecessors: 2:a468dc9b3633
   |    semi-colon: 2:a468dc9b3633
+  |    Origin: reworded using amend from 2:a468dc9b3633 by test2
+  |
   | @  a468dc9b3633
   |/     Successors: 3:d004c8f274b9
   |      semi-colon: 3:d004c8f274b9
@@ -182,12 +192,15 @@
   o  d004c8f274b9
   |    Predecessors: 2:a468dc9b3633
   |    semi-colon: 2:a468dc9b3633
+  |    Origin: reworded using amend from 2:a468dc9b3633 by test2
+  |
   | @  a468dc9b3633
   |/     Predecessors: 1:471f378eab4c
   |      semi-colon: 1:471f378eab4c
   |      Successors: 3:d004c8f274b9
   |      semi-colon: 3:d004c8f274b9
   |      Fate: reworded using amend as 3:d004c8f274b9 by test2
+  |      Origin: rewritten using amend from 1:471f378eab4c
   |
   | x  471f378eab4c
   |/     Successors: 2:a468dc9b3633
@@ -196,8 +209,9 @@
   |
   o  ea207398892e
   
-  $ hg fatelog -v
+  $ hg fateoriginlog -v
   o  d004c8f274b9
+  |    Obsorigin: reworded using amend from 2:a468dc9b3633 by test2 (at 2001-04-19 04:25 +0000)
   |
   | @  a468dc9b3633
   |/     Obsfate: reworded using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000)
@@ -215,12 +229,15 @@
   @  d004c8f274b9
   |    Predecessors: 2:a468dc9b3633
   |    semi-colon: 2:a468dc9b3633
+  |    Origin: reworded using amend from 2:a468dc9b3633 by test2
+  |
   | x  a468dc9b3633
   |/     Predecessors: 1:471f378eab4c
   |      semi-colon: 1:471f378eab4c
   |      Successors: 3:d004c8f274b9
   |      semi-colon: 3:d004c8f274b9
   |      Fate: reworded using amend as 3:d004c8f274b9 by test2
+  |      Origin: rewritten using amend from 1:471f378eab4c
   |
   | x  471f378eab4c
   |/     Successors: 2:a468dc9b3633
@@ -229,17 +246,19 @@
   |
   o  ea207398892e
   
-  $ hg fatelog -v
+  $ hg fateoriginlog -v
   @  d004c8f274b9
   |
   o  ea207398892e
   
 
-  $ hg fatelog -v --hidden
+  $ hg fateoriginlog -v --hidden
   @  d004c8f274b9
+  |    Obsorigin: reworded using amend from 2:a468dc9b3633 by test2 (at 2001-04-19 04:25 +0000)
   |
   | x  a468dc9b3633
   |/     Obsfate: reworded using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000)
+  |      Obsorigin: rewritten using amend from 1:471f378eab4c by test (at 2009-02-13 23:31 +0000)
   |
   | x  471f378eab4c
   |/     Obsfate: rewritten using amend as 2:a468dc9b3633 by test (at 2009-02-13 23:31 +0000)
@@ -345,9 +364,13 @@
   o  f257fde29c7a
   |    Predecessors: 1:471597cad322
   |    semi-colon: 1:471597cad322
+  |    Origin: split using split from 1:471597cad322
+  |
   o  337fec4d2edc
   |    Predecessors: 1:471597cad322
   |    semi-colon: 1:471597cad322
+  |    Origin: split using split from 1:471597cad322
+  |
   | @  471597cad322
   |/     Successors: 2:337fec4d2edc 3:f257fde29c7a
   |      semi-colon: 2:337fec4d2edc 3:f257fde29c7a
@@ -355,10 +378,12 @@
   |
   o  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   o  f257fde29c7a
+  |    Obsorigin: split using split from 1:471597cad322
   |
   o  337fec4d2edc
+  |    Obsorigin: split using split from 1:471597cad322
   |
   | @  471597cad322
   |/     Obsfate: split using split as 2:337fec4d2edc, 3:f257fde29c7a
@@ -384,9 +409,13 @@
   @  f257fde29c7a
   |    Predecessors: 1:471597cad322
   |    semi-colon: 1:471597cad322
+  |    Origin: split using split from 1:471597cad322
+  |
   o  337fec4d2edc
   |    Predecessors: 1:471597cad322
   |    semi-colon: 1:471597cad322
+  |    Origin: split using split from 1:471597cad322
+  |
   | x  471597cad322
   |/     Successors: 2:337fec4d2edc 3:f257fde29c7a
   |      semi-colon: 2:337fec4d2edc 3:f257fde29c7a
@@ -394,10 +423,12 @@
   |
   o  ea207398892e
   
-  $ hg fatelog --hidden
+  $ hg fateoriginlog --hidden
   @  f257fde29c7a
+  |    Obsorigin: split using split from 1:471597cad322
   |
   o  337fec4d2edc
+  |    Obsorigin: split using split from 1:471597cad322
   |
   | x  471597cad322
   |/     Obsfate: split using split as 2:337fec4d2edc, 3:f257fde29c7a
@@ -476,6 +507,8 @@
   o  eb5a0daa2192
   |    Predecessors: 1:471f378eab4c
   |    semi-colon: 1:471f378eab4c
+  |    Origin: folded using fold from 1:471f378eab4c
+  |
   | @  471f378eab4c
   |/     Successors: 3:eb5a0daa2192
   |      semi-colon: 3:eb5a0daa2192
@@ -483,8 +516,9 @@
   |
   o  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   o  eb5a0daa2192
+  |    Obsorigin: folded using fold from 1:471f378eab4c
   |
   | @  471f378eab4c
   |/     Obsfate: folded using fold as 3:eb5a0daa2192
@@ -504,6 +538,8 @@
   o  eb5a0daa2192
   |    Predecessors: 2:0dec01379d3b 1:471f378eab4c
   |    semi-colon: 2:0dec01379d3b; 1:471f378eab4c
+  |    Origin: folded using fold from 1:471f378eab4c, 2:0dec01379d3b
+  |
   | @  0dec01379d3b
   | |    Successors: 3:eb5a0daa2192
   | |    semi-colon: 3:eb5a0daa2192
@@ -516,8 +552,9 @@
   |
   o  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   o  eb5a0daa2192
+  |    Obsorigin: folded using fold from 1:471f378eab4c, 2:0dec01379d3b
   |
   | @  0dec01379d3b
   | |    Obsfate: folded using fold as 3:eb5a0daa2192
@@ -544,6 +581,8 @@
   @  eb5a0daa2192
   |    Predecessors: 2:0dec01379d3b 1:471f378eab4c
   |    semi-colon: 2:0dec01379d3b; 1:471f378eab4c
+  |    Origin: folded using fold from 1:471f378eab4c, 2:0dec01379d3b
+  |
   | x  0dec01379d3b
   | |    Successors: 3:eb5a0daa2192
   | |    semi-colon: 3:eb5a0daa2192
@@ -556,8 +595,9 @@
   |
   o  ea207398892e
   
-  $ hg fatelog --hidden
+  $ hg fateoriginlog --hidden
   @  eb5a0daa2192
+  |    Obsorigin: folded using fold from 1:471f378eab4c, 2:0dec01379d3b
   |
   | x  0dec01379d3b
   | |    Obsfate: folded using fold as 3:eb5a0daa2192
@@ -651,9 +691,13 @@
   *  019fadeab383
   |    Predecessors: 1:471f378eab4c
   |    semi-colon: 1:471f378eab4c
+  |    Origin: reworded using amend from 1:471f378eab4c
+  |
   | *  fdf9bde5129a
   |/     Predecessors: 1:471f378eab4c
   |      semi-colon: 1:471f378eab4c
+  |      Origin: reworded using amend from 1:471f378eab4c
+  |
   | @  471f378eab4c
   |/     Successors: 2:fdf9bde5129a; 4:019fadeab383
   |      semi-colon: 2:fdf9bde5129a; 4:019fadeab383
@@ -662,11 +706,13 @@
   |
   o  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   *  019fadeab383
+  |    Obsorigin: reworded using amend from 1:471f378eab4c
   |
   | *  fdf9bde5129a
-  |/
+  |/     Obsorigin: reworded using amend from 1:471f378eab4c
+  |
   | @  471f378eab4c
   |/     Obsfate: reworded using amend as 2:fdf9bde5129a; reworded using amend as 4:019fadeab383
   |
@@ -685,7 +731,7 @@
   o  ea207398892e
   
 
-  $ hg fatelog
+  $ hg fateoriginlog
   *  019fadeab383
   |
   | @  fdf9bde5129a
@@ -697,16 +743,21 @@
   *  019fadeab383
   |    Predecessors: 3:65b757b745b9
   |    semi-colon: 3:65b757b745b9
+  |    Origin: reworded using amend from 3:65b757b745b9
+  |
   | x  65b757b745b9
   |/     Predecessors: 1:471f378eab4c
   |      semi-colon: 1:471f378eab4c
   |      Successors: 4:019fadeab383
   |      semi-colon: 4:019fadeab383
   |      Fate: reworded using amend as 4:019fadeab383
+  |      Origin: reworded using amend from 1:471f378eab4c
   |
   | @  fdf9bde5129a
   |/     Predecessors: 1:471f378eab4c
   |      semi-colon: 1:471f378eab4c
+  |      Origin: reworded using amend from 1:471f378eab4c
+  |
   | x  471f378eab4c
   |/     Successors: 2:fdf9bde5129a; 3:65b757b745b9
   |      semi-colon: 2:fdf9bde5129a; 3:65b757b745b9
@@ -715,14 +766,17 @@
   |
   o  ea207398892e
   
-  $ hg fatelog --hidden
+  $ hg fateoriginlog --hidden
   *  019fadeab383
+  |    Obsorigin: reworded using amend from 3:65b757b745b9
   |
   | x  65b757b745b9
   |/     Obsfate: reworded using amend as 4:019fadeab383
+  |      Obsorigin: reworded using amend from 1:471f378eab4c
   |
   | @  fdf9bde5129a
-  |/
+  |/     Obsorigin: reworded using amend from 1:471f378eab4c
+  |
   | x  471f378eab4c
   |/     Obsfate: reworded using amend as 2:fdf9bde5129a; reworded using amend as 3:65b757b745b9
   |
@@ -813,6 +867,8 @@
   o  eb5a0daa2192
   |    Predecessors: 1:471f378eab4c
   |    semi-colon: 1:471f378eab4c
+  |    Origin: folded using fold from 1:471f378eab4c
+  |
   | @  471f378eab4c
   |/     Successors: 4:eb5a0daa2192
   |      semi-colon: 4:eb5a0daa2192
@@ -820,8 +876,9 @@
   |
   o  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   o  eb5a0daa2192
+  |    Obsorigin: folded using fold from 1:471f378eab4c
   |
   | @  471f378eab4c
   |/     Obsfate: folded using fold as 4:eb5a0daa2192
@@ -838,6 +895,8 @@
   o  eb5a0daa2192
   |    Predecessors: 2:0dec01379d3b 1:471f378eab4c
   |    semi-colon: 2:0dec01379d3b; 1:471f378eab4c
+  |    Origin: folded using amend, fold from 1:471f378eab4c, 2:0dec01379d3b
+  |
   | @  0dec01379d3b
   | |    Successors: 4:eb5a0daa2192
   | |    semi-colon: 4:eb5a0daa2192
@@ -850,8 +909,9 @@
   |
   o  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   o  eb5a0daa2192
+  |    Obsorigin: folded using amend, fold from 1:471f378eab4c, 2:0dec01379d3b
   |
   | @  0dec01379d3b
   | |    Obsfate: rewritten using amend, fold as 4:eb5a0daa2192
@@ -872,6 +932,8 @@
   o  eb5a0daa2192
   |    Predecessors: 1:471f378eab4c 3:b7ea6d14e664
   |    semi-colon: 1:471f378eab4c; 3:b7ea6d14e664
+  |    Origin: folded using fold from 1:471f378eab4c, 3:b7ea6d14e664
+  |
   | @  b7ea6d14e664
   | |    Successors: 4:eb5a0daa2192
   | |    semi-colon: 4:eb5a0daa2192
@@ -884,8 +946,9 @@
   |
   o  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   o  eb5a0daa2192
+  |    Obsorigin: folded using fold from 1:471f378eab4c, 3:b7ea6d14e664
   |
   | @  b7ea6d14e664
   | |    Obsfate: folded using fold as 4:eb5a0daa2192
@@ -907,12 +970,15 @@
   @  eb5a0daa2192
   |    Predecessors: 1:471f378eab4c 3:b7ea6d14e664
   |    semi-colon: 1:471f378eab4c; 3:b7ea6d14e664
+  |    Origin: folded using fold from 1:471f378eab4c, 3:b7ea6d14e664
+  |
   | x  b7ea6d14e664
   | |    Predecessors: 2:0dec01379d3b
   | |    semi-colon: 2:0dec01379d3b
   | |    Successors: 4:eb5a0daa2192
   | |    semi-colon: 4:eb5a0daa2192
   | |    Fate: folded using fold as 4:eb5a0daa2192
+  | |    Origin: reworded using amend from 2:0dec01379d3b
   | |
   | | x  0dec01379d3b
   | |/     Successors: 3:b7ea6d14e664
@@ -926,11 +992,13 @@
   |
   o  ea207398892e
   
-  $ hg fatelog --hidden
+  $ hg fateoriginlog --hidden
   @  eb5a0daa2192
+  |    Obsorigin: folded using fold from 1:471f378eab4c, 3:b7ea6d14e664
   |
   | x  b7ea6d14e664
   | |    Obsfate: folded using fold as 4:eb5a0daa2192
+  | |    Obsorigin: reworded using amend from 2:0dec01379d3b
   | |
   | | x  0dec01379d3b
   | |/     Obsfate: reworded using amend as 3:b7ea6d14e664
@@ -1036,6 +1104,8 @@
   o  7a230b46bf61
   |    Predecessors: 1:471f378eab4c
   |    semi-colon: 1:471f378eab4c
+  |    Origin: reworded using amend from 1:471f378eab4c
+  |
   | @  471f378eab4c
   |/     Successors: 2:7a230b46bf61
   |      semi-colon: 2:7a230b46bf61
@@ -1043,8 +1113,9 @@
   |
   o  ea207398892e
   
-  $ hg fatelog --hidden -v
+  $ hg fateoriginlog --hidden -v
   o  7a230b46bf61
+  |    Obsorigin: reworded using amend from 1:471f378eab4c by test (at 1970-01-01 00:00 +0000)
   |
   | @  471f378eab4c
   |/     Obsfate: reworded using amend as 2:7a230b46bf61 by test (at 1970-01-01 00:00 +0000)
@@ -1058,7 +1129,7 @@
   |
   o  ea207398892e
   
-  $ hg fatelog -v
+  $ hg fateoriginlog -v
   @  7a230b46bf61
   |
   o  ea207398892e
@@ -1067,6 +1138,8 @@
   @  7a230b46bf61
   |    Predecessors: 1:471f378eab4c
   |    semi-colon: 1:471f378eab4c
+  |    Origin: reworded using amend from 1:471f378eab4c
+  |
   | x  471f378eab4c
   |/     Successors: 2:7a230b46bf61
   |      semi-colon: 2:7a230b46bf61
@@ -1074,8 +1147,9 @@
   |
   o  ea207398892e
   
-  $ hg fatelog --hidden -v
+  $ hg fateoriginlog --hidden -v
   @  7a230b46bf61
+  |    Obsorigin: reworded using amend from 1:471f378eab4c by test (at 1970-01-01 00:00 +0000)
   |
   | x  471f378eab4c
   |/     Obsfate: reworded using amend as 2:7a230b46bf61 by test (at 1970-01-01 00:00 +0000)
@@ -1116,7 +1190,7 @@
   |
   o  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   @  f897c6137566
   |
   o  ea207398892e
@@ -1131,6 +1205,8 @@
   o  f897c6137566
   |    Predecessors: 2:0dec01379d3b
   |    semi-colon: 2:0dec01379d3b
+  |    Origin: rewritten from 2:0dec01379d3b
+  |
   | @  0dec01379d3b
   | |    Predecessors: 1:471f378eab4c
   | |    semi-colon: 1:471f378eab4c
@@ -1138,6 +1214,7 @@
   | |    semi-colon: 3:f897c6137566; 1:471f378eab4c
   | |    Fate: rewritten as 3:f897c6137566
   | |    Fate: rewritten as 1:471f378eab4c
+  | |    Origin: rewritten from 1:471f378eab4c
   | |
   | x  471f378eab4c
   |/     Predecessors: 2:0dec01379d3b
@@ -1145,17 +1222,21 @@
   |      Successors: 2:0dec01379d3b
   |      semi-colon: 2:0dec01379d3b
   |      Fate: rewritten as 2:0dec01379d3b
+  |      Origin: rewritten from 2:0dec01379d3b
   |
   o  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   o  f897c6137566
+  |    Obsorigin: rewritten from 2:0dec01379d3b
   |
   | @  0dec01379d3b
   | |    Obsfate: rewritten as 3:f897c6137566; rewritten as 1:471f378eab4c
+  | |    Obsorigin: rewritten from 1:471f378eab4c
   | |
   | x  471f378eab4c
   |/     Obsfate: rewritten as 2:0dec01379d3b
+  |      Obsorigin: rewritten from 2:0dec01379d3b
   |
   o  ea207398892e
   
@@ -1167,13 +1248,16 @@
   o  f897c6137566
   |    Predecessors: 1:471f378eab4c
   |    semi-colon: 1:471f378eab4c
+  |    Origin: rewritten from 1:471f378eab4c
+  |
   | @  471f378eab4c
   |/     Fate: pruned
   |
   o  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   o  f897c6137566
+  |    Obsorigin: rewritten from 1:471f378eab4c
   |
   | @  471f378eab4c
   |/     Obsfate: pruned
@@ -1188,7 +1272,7 @@
   |
   @  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   o  f897c6137566
   |
   @  ea207398892e
@@ -1197,6 +1281,8 @@
   o  f897c6137566
   |    Predecessors: 2:0dec01379d3b
   |    semi-colon: 2:0dec01379d3b
+  |    Origin: rewritten from 2:0dec01379d3b
+  |
   | x  0dec01379d3b
   | |    Predecessors: 1:471f378eab4c
   | |    semi-colon: 1:471f378eab4c
@@ -1204,6 +1290,7 @@
   | |    semi-colon: 3:f897c6137566; 1:471f378eab4c
   | |    Fate: rewritten as 3:f897c6137566
   | |    Fate: rewritten as 1:471f378eab4c
+  | |    Origin: rewritten from 1:471f378eab4c
   | |
   | x  471f378eab4c
   |/     Predecessors: 2:0dec01379d3b
@@ -1211,6 +1298,7 @@
   |      Successors: 2:0dec01379d3b
   |      semi-colon: 2:0dec01379d3b
   |      Fate: rewritten as 2:0dec01379d3b
+  |      Origin: rewritten from 2:0dec01379d3b
   |
   @  ea207398892e
   
@@ -1383,9 +1471,13 @@
   @  0b997eb7ceee
   |    Predecessors: 6:4a004186e638
   |    semi-colon: 6:4a004186e638
+  |    Origin: reworded using amend from 6:4a004186e638
+  |
   | *  b18bc8331526
   |/     Predecessors: 6:4a004186e638
   |      semi-colon: 6:4a004186e638
+  |      Origin: reworded using amend from 6:4a004186e638
+  |
   | *  ba2ed02b0c9a
   | |
   | x  4a004186e638
@@ -1400,11 +1492,13 @@
   |
   o  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   @  0b997eb7ceee
+  |    Obsorigin: reworded using amend from 6:4a004186e638
   |
   | *  b18bc8331526
-  |/
+  |/     Obsorigin: reworded using amend from 6:4a004186e638
+  |
   | *  ba2ed02b0c9a
   | |
   | x  4a004186e638
@@ -1420,12 +1514,18 @@
   @  0b997eb7ceee
   |    Predecessors: 6:4a004186e638
   |    semi-colon: 6:4a004186e638
+  |    Origin: reworded using amend from 6:4a004186e638
+  |
   | *  b18bc8331526
   |/     Predecessors: 6:4a004186e638
   |      semi-colon: 6:4a004186e638
+  |      Origin: reworded using amend from 6:4a004186e638
+  |
   | *  ba2ed02b0c9a
   | |    Predecessors: 4:9bd10a0775e4
   | |    semi-colon: 4:9bd10a0775e4
+  | |    Origin: split from 4:9bd10a0775e4
+  | |
   | x  4a004186e638
   |/     Predecessors: 4:9bd10a0775e4
   |      semi-colon: 4:9bd10a0775e4
@@ -1433,10 +1533,13 @@
   |      semi-colon: 8:b18bc8331526; 9:0b997eb7ceee
   |      Fate: reworded using amend as 8:b18bc8331526
   |      Fate: reworded using amend as 9:0b997eb7ceee
+  |      Origin: split from 4:9bd10a0775e4
   |
   *  dd800401bd8c
   |    Predecessors: 4:9bd10a0775e4
   |    semi-colon: 4:9bd10a0775e4
+  |    Origin: split from 4:9bd10a0775e4
+  |
   | x  9bd10a0775e4
   |/     Successors: 5:dd800401bd8c 6:4a004186e638 7:ba2ed02b0c9a
   |      semi-colon: 5:dd800401bd8c 6:4a004186e638 7:ba2ed02b0c9a
@@ -1445,6 +1548,8 @@
   o  f897c6137566
   |    Predecessors: 2:0dec01379d3b
   |    semi-colon: 2:0dec01379d3b
+  |    Origin: rewritten from 2:0dec01379d3b
+  |
   | x  0dec01379d3b
   | |    Predecessors: 1:471f378eab4c
   | |    semi-colon: 1:471f378eab4c
@@ -1452,6 +1557,7 @@
   | |    semi-colon: 3:f897c6137566; 1:471f378eab4c
   | |    Fate: rewritten as 3:f897c6137566
   | |    Fate: rewritten as 1:471f378eab4c
+  | |    Origin: rewritten from 1:471f378eab4c
   | |
   | x  471f378eab4c
   |/     Predecessors: 2:0dec01379d3b
@@ -1459,31 +1565,40 @@
   |      Successors: 2:0dec01379d3b
   |      semi-colon: 2:0dec01379d3b
   |      Fate: rewritten as 2:0dec01379d3b
+  |      Origin: rewritten from 2:0dec01379d3b
   |
   o  ea207398892e
   
-  $ hg fatelog --hidden
+  $ hg fateoriginlog --hidden
   @  0b997eb7ceee
+  |    Obsorigin: reworded using amend from 6:4a004186e638
   |
   | *  b18bc8331526
-  |/
+  |/     Obsorigin: reworded using amend from 6:4a004186e638
+  |
   | *  ba2ed02b0c9a
+  | |    Obsorigin: split from 4:9bd10a0775e4
   | |
   | x  4a004186e638
   |/     Obsfate: reworded using amend as 8:b18bc8331526; reworded using amend as 9:0b997eb7ceee
+  |      Obsorigin: split from 4:9bd10a0775e4
   |
   *  dd800401bd8c
+  |    Obsorigin: split from 4:9bd10a0775e4
   |
   | x  9bd10a0775e4
   |/     Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a
   |
   o  f897c6137566
+  |    Obsorigin: rewritten from 2:0dec01379d3b
   |
   | x  0dec01379d3b
   | |    Obsfate: rewritten as 3:f897c6137566; rewritten as 1:471f378eab4c
+  | |    Obsorigin: rewritten from 1:471f378eab4c
   | |
   | x  471f378eab4c
   |/     Obsfate: rewritten as 2:0dec01379d3b
+  |      Obsorigin: rewritten from 2:0dec01379d3b
   |
   o  ea207398892e
   
@@ -1499,15 +1614,23 @@
   *  eceed8f98ffc
   |    Predecessors: 4:9bd10a0775e4
   |    semi-colon: 4:9bd10a0775e4
+  |    Origin: rewritten using rebase from 4:9bd10a0775e4
+  |
   | *  0b997eb7ceee
   | |    Predecessors: 4:9bd10a0775e4
   | |    semi-colon: 4:9bd10a0775e4
+  | |    Origin: rewritten using amend from 4:9bd10a0775e4
+  | |
   * |  b18bc8331526
   |/     Predecessors: 4:9bd10a0775e4
   |      semi-colon: 4:9bd10a0775e4
+  |      Origin: rewritten using amend from 4:9bd10a0775e4
+  |
   *  dd800401bd8c
   |    Predecessors: 4:9bd10a0775e4
   |    semi-colon: 4:9bd10a0775e4
+  |    Origin: split from 4:9bd10a0775e4
+  |
   | @  9bd10a0775e4
   |/     Successors: 5:dd800401bd8c 9:0b997eb7ceee 10:eceed8f98ffc; 5:dd800401bd8c 8:b18bc8331526 10:eceed8f98ffc
   |      semi-colon: 5:dd800401bd8c 9:0b997eb7ceee 10:eceed8f98ffc; 5:dd800401bd8c 8:b18bc8331526 10:eceed8f98ffc
@@ -1518,14 +1641,18 @@
   |
   o  ea207398892e
   
-  $ hg fatelog
+  $ hg fateoriginlog
   *  eceed8f98ffc
+  |    Obsorigin: rewritten using rebase from 4:9bd10a0775e4
   |
   | *  0b997eb7ceee
+  | |    Obsorigin: rewritten using amend from 4:9bd10a0775e4
   | |
   * |  b18bc8331526
-  |/
+  |/     Obsorigin: rewritten using amend from 4:9bd10a0775e4
+  |
   *  dd800401bd8c
+  |    Obsorigin: split from 4:9bd10a0775e4
   |
   | @  9bd10a0775e4
   |/     Obsfate: split using amend, rebase as 5:dd800401bd8c, 9:0b997eb7ceee, 10:eceed8f98ffc; split using amend, rebase as 5:dd800401bd8c, 8:b18bc8331526, 10:eceed8f98ffc
@@ -1564,9 +1691,65 @@
   |
   o  ea207398892e
   
-  $ hg fatelog -v
+  $ hg fateoriginlog -v
   @  471f378eab4c
   |    Obsfate: pruned using prune by test (at 1970-01-01 00:00 +0000)
   |
   o  ea207398892e
   
+
+Test templates when having multiple unrelated predecessors
+==========================================================
+
+  $ hg init $TESTTMP/templates-local-multipreds
+  $ cd $TESTTMP/templates-local-multipreds
+  $ mkcommit R
+  $ mkcommit A
+  $ mkcommit B
+  $ hg up 'desc(R)'
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ mkcommit C
+  created new head
+  $ hg up 'desc(R)'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ mkcommit Z
+  created new head
+  $ hg up 'desc(R)'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg prune -r 'desc(A) + desc(B)' -s 'desc(Z)' --fold
+  2 changesets pruned
+  $ hg prune -r 'desc(C)' -s 'desc(Z)'
+  1 changesets pruned
+  $ hg debugobsolete
+  944ade52b6a1afe01817e7cae4c3006f1f128279 4568aafd15c0ac96a9828ce8418556bb1e76d6d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'fold-id': 'c59cbeaa', 'fold-idx': '1', 'fold-size': '2', 'operation': 'prune', 'user': 'test'}
+  36ca49338d3a303e90126c28b1713092aaf3e9ed 4568aafd15c0ac96a9828ce8418556bb1e76d6d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'fold-id': 'c59cbeaa', 'fold-idx': '2', 'fold-size': '2', 'operation': 'prune', 'user': 'test'}
+  5b3370228fe5fa9824b8df21cd54876ef23ac745 4568aafd15c0ac96a9828ce8418556bb1e76d6d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'prune', 'user': 'test'}
+  $ hg tlog
+  o  4568aafd15c0
+  |
+  @  7ca5bfdbe243
+  
+  $ hg tlog --hidden
+  o  4568aafd15c0
+  |    Predecessors: 2:36ca49338d3a 3:5b3370228fe5 1:944ade52b6a1
+  |    semi-colon: 2:36ca49338d3a; 3:5b3370228fe5; 1:944ade52b6a1
+  |    Origin: folded using prune from 1:944ade52b6a1, 2:36ca49338d3a
+  |    Origin: rewritten using prune from 3:5b3370228fe5
+  |
+  | x  5b3370228fe5
+  |/     Successors: 4:4568aafd15c0
+  |      semi-colon: 4:4568aafd15c0
+  |      Fate: rewritten using prune as 4:4568aafd15c0
+  |
+  | x  36ca49338d3a
+  | |    Successors: 4:4568aafd15c0
+  | |    semi-colon: 4:4568aafd15c0
+  | |    Fate: folded using prune as 4:4568aafd15c0
+  | |
+  | x  944ade52b6a1
+  |/     Successors: 4:4568aafd15c0
+  |      semi-colon: 4:4568aafd15c0
+  |      Fate: folded using prune as 4:4568aafd15c0
+  |
+  @  7ca5bfdbe243
+  
--- a/tests/test-evolve.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-evolve.t	Fri May 08 20:36:29 2020 +0800
@@ -757,7 +757,7 @@
 
 Test olog
 
-  $ hg olog | head -n 10 # hg touch makes the output unstable (fix it with devel option for more stable touch)
+  $ hg olog --no-origin | head -n 10 # hg touch makes the output unstable (fix it with devel option for more stable touch)
   @    d26d339c513f (12) add 4
   |\
   x |  ce341209337f (4) add 4
--- a/tests/test-fold.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-fold.t	Fri May 08 20:36:29 2020 +0800
@@ -100,6 +100,33 @@
   c8d03c1b5e94af74b772900c58259d2e08917735 198b5c405d01a50c41a81a00fc61677b81981a5f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '33', 'fold-id': '25cb328e', 'fold-idx': '1', 'fold-size': '3', 'operation': 'fold', 'user': 'test'}
   f69452c5b1af6cbaaa56ef50cf94fff5bcc6ca23 198b5c405d01a50c41a81a00fc61677b81981a5f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '37', 'fold-id': '25cb328e', 'fold-idx': '2', 'fold-size': '3', 'operation': 'fold', 'user': 'test'}
 
+  $ hg obslog --no-origin
+  @    198b5c405d01 (11) r5
+  |\
+  | \
+  | |\
+  x | |  4de32a90b66c (7) r7
+   / /     folded(description, date, parent) as 198b5c405d01 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  c8d03c1b5e94 (5) r5
+   /     folded(description, date) as 198b5c405d01 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  f69452c5b1af (6) r6
+       folded(description, date, parent) as 198b5c405d01 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+  
+  $ hg obslog
+  @    198b5c405d01 (11) r5
+  |\     folded(description, date, parent) from 4de32a90b66c, c8d03c1b5e94, f69452c5b1af using fold by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | \
+  | |\
+  x | |  4de32a90b66c (7) r7
+   / /
+  x /  c8d03c1b5e94 (5) r5
+   /
+  x  f69452c5b1af (6) r6
+  
+
 Checking whether the bookmarks are moved or not
 
   $ hg log -G
--- a/tests/test-metaedit.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-metaedit.t	Fri May 08 20:36:29 2020 +0800
@@ -132,7 +132,12 @@
   |
   ~
 
-  $ hg obslog -r .
+  $ hg debugobsolete
+  e2abbe8ca2ec6ffca6fd7a19d4158c58ff461723 f3d001339afd30d27fcd91e713274a78233528c8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  587528abfffe33d49f94f9d6223dbbd58d6197c6 212b2a2b87cdbae992f001e9baba64db389fbce7 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'metaedit', 'user': 'test'}
+  c2bd843aa2468b30bb56d69d4f5fef95b85986f2 a08d35fd7d9d0f8cb33d5bd2074e9bafb5cbc70f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'fold-id': 'c5832a81', 'fold-idx': '1', 'fold-size': '2', 'note': 'folding changesets using metaedit', 'operation': 'metaedit', 'user': 'test'}
+  212b2a2b87cdbae992f001e9baba64db389fbce7 a08d35fd7d9d0f8cb33d5bd2074e9bafb5cbc70f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '29', 'fold-id': 'c5832a81', 'fold-idx': '2', 'fold-size': '2', 'note': 'folding changesets using metaedit', 'operation': 'metaedit', 'user': 'test'}
+  $ hg obslog -r . --no-origin
   @    a08d35fd7d9d (9) E
   |\
   x |  212b2a2b87cd (8) F
@@ -146,6 +151,18 @@
   x  587528abfffe (7) F
        reauthored(user) as 212b2a2b87cd using metaedit by test (Thu Jan 01 00:00:00 1970 +0000)
   
+  $ hg obslog -r .
+  @    a08d35fd7d9d (9) E
+  |\     folded(description, user, parent, content) from 212b2a2b87cd, c2bd843aa246 using metaedit by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |      note: folding changesets using metaedit
+  | |
+  x |  212b2a2b87cd (8) F
+  | |    reauthored(user) from 587528abfffe using metaedit by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  c2bd843aa246 (6) E
+  |
+  x  587528abfffe (7) F
+  
   $ hg debugobsolete --rev . --exclusive
   212b2a2b87cdbae992f001e9baba64db389fbce7 a08d35fd7d9d0f8cb33d5bd2074e9bafb5cbc70f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '29', 'fold-id': 'c5832a81', 'fold-idx': '2', 'fold-size': '2', 'note': 'folding changesets using metaedit', 'operation': 'metaedit', 'user': 'test'}
   c2bd843aa2468b30bb56d69d4f5fef95b85986f2 a08d35fd7d9d0f8cb33d5bd2074e9bafb5cbc70f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'fold-id': 'c5832a81', 'fold-idx': '1', 'fold-size': '2', 'note': 'folding changesets using metaedit', 'operation': 'metaedit', 'user': 'test'}
--- a/tests/test-obsolete.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-obsolete.t	Fri May 08 20:36:29 2020 +0800
@@ -715,13 +715,17 @@
   [4] add obsol_c'
   [10] add obsol_c
   [2]
-  $ hg olog
+  $ hg olog -a
+  o  2033b4e49474 (10) add obsol_c
+  |    rebased(parent) from 0d3f46688ccc using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  | o  725c380fe99b (4) add obsol_c'
+  |/     rewritten from 0d3f46688ccc by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
   @  0d3f46688ccc (3) add obsol_c
-  |    rebased(parent) as 2033b4e49474 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
-  |    rewritten as 725c380fe99b by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    rewritten from 4538525df7e2 by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  4538525df7e2 (2) add c
-       rewritten as 0d3f46688ccc by test (Thu Jan 01 00:00:00 1970 +0000)
   
 
 Check import reports new unstable changeset:
--- a/tests/test-pick.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-pick.t	Fri May 08 20:36:29 2020 +0800
@@ -171,6 +171,9 @@
 there were no changes to commit, so there shouldn't be any predecessors of 6,
 and 2 should say it was pruned (issue6093)
 
+  $ hg debugobsolete
+  7c3bad9141dcb46ff89abf5f61856facd56e476c 7c15c05db6fa1458a8a745f977f4d2426abde6a0 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'pick', 'user': 'test'}
+  4538525df7e2b9f09423636c61ef63a4cb872a2d 0 {7c3bad9141dcb46ff89abf5f61856facd56e476c} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'pick', 'user': 'test'}
   $ hg olog --all --hidden -r 2+6
   x  4538525df7e2 (2) add c
        pruned using pick by test (Thu Jan 01 00:00:00 1970 +0000)
--- a/tests/test-rewind.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-rewind.t	Fri May 08 20:36:29 2020 +0800
@@ -90,13 +90,20 @@
   $ hg debugobsolete
   7e594302a05d3769b27be88fc3cdfd39d7498498 0 {579f120ba91885449adc92eedf48ef3569742cee} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'}
   7e594302a05d3769b27be88fc3cdfd39d7498498 073989a581cf430a844192364fa37606357cbbc2 4 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '2', 'operation': 'rewind', 'user': 'test'}
-  $ hg obslog -r 'desc("c_B0")'
+  $ hg obslog -r 'desc("c_B0")' --no-origin
   o  073989a581cf (3) c_B0
   |
   x  7e594302a05d (2) c_B0
        pruned using prune by test (Thu Jan 01 00:00:00 1970 +0000)
        meta-changed(meta) as 073989a581cf using rewind by test (Thu Jan 01 00:00:00 1970 +0000)
   
+  $ hg obslog -r 'desc("c_B0")'
+  o  073989a581cf (3) c_B0
+  |    meta-changed(meta) from 7e594302a05d using rewind by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  7e594302a05d (2) c_B0
+       pruned using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  
   $ hg log -G
   o  changeset:   3:073989a581cf
   |  tag:         tip
@@ -165,7 +172,7 @@
   7e594302a05d3769b27be88fc3cdfd39d7498498 073989a581cf430a844192364fa37606357cbbc2 4 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '2', 'operation': 'rewind', 'user': 'test'}
   073989a581cf430a844192364fa37606357cbbc2 0 {579f120ba91885449adc92eedf48ef3569742cee} (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'}
   7e594302a05d3769b27be88fc3cdfd39d7498498 b13b032065ef57a68d9a4cead38ba0f34f95529b 4 (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '2', 'operation': 'rewind', 'user': 'test'}
-  $ hg obslog -r 'desc("c_B0")' --all
+  $ hg obslog -r 'desc("c_B0")' --all --no-origin
   x  073989a581cf (3) c_B0
   |    pruned using prune by test (Thu Jan 01 00:00:01 1970 +0000)
   |
@@ -176,6 +183,17 @@
        meta-changed(meta) as 073989a581cf using rewind by test (Thu Jan 01 00:00:00 1970 +0000)
        meta-changed(meta) as b13b032065ef using rewind by test (Thu Jan 01 00:00:01 1970 +0000)
   
+  $ hg obslog -r 'desc("c_B0")' --all
+  x  073989a581cf (3) c_B0
+  |    meta-changed(meta) from 7e594302a05d using rewind by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    pruned using prune by test (Thu Jan 01 00:00:01 1970 +0000)
+  |
+  | o  b13b032065ef (4) c_B0
+  |/     meta-changed(meta) from 7e594302a05d using rewind by test (Thu Jan 01 00:00:01 1970 +0000)
+  |
+  x  7e594302a05d (2) c_B0
+       pruned using prune by test (Thu Jan 01 00:00:00 1970 +0000)
+  
   $ hg log -G
   o  changeset:   4:b13b032065ef
   |  tag:         tip
@@ -268,13 +286,19 @@
   $ hg debugobsolete
   7e594302a05d3769b27be88fc3cdfd39d7498498 25c8f5ab0c3bb569ec672570f1a901be4c6f032b 0 (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
   7e594302a05d3769b27be88fc3cdfd39d7498498 b13b032065ef57a68d9a4cead38ba0f34f95529b 4 (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '2', 'operation': 'rewind', 'user': 'test'}
-  $ hg obslog --rev 'desc("c_B0")'
+  $ hg obslog --rev 'desc("c_B0")' --no-origin
   *  b13b032065ef (4) c_B0
   |
   x  7e594302a05d (2) c_B0
        rewritten(description, content) as 25c8f5ab0c3b using amend by test (Thu Jan 01 00:00:01 1970 +0000)
        meta-changed(meta) as b13b032065ef using rewind by test (Thu Jan 01 00:00:01 1970 +0000)
   
+  $ hg obslog --rev 'desc("c_B0")'
+  *  b13b032065ef (4) c_B0
+  |    meta-changed(meta) from 7e594302a05d using rewind by test (Thu Jan 01 00:00:01 1970 +0000)
+  |
+  x  7e594302a05d (2) c_B0
+  
   $ hg log -G
   *  changeset:   4:b13b032065ef
   |  tag:         tip
@@ -372,7 +396,7 @@
   b13b032065ef57a68d9a4cead38ba0f34f95529b 0 {579f120ba91885449adc92eedf48ef3569742cee} (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'}
   7e594302a05d3769b27be88fc3cdfd39d7498498 837cd997bb05a27f8ed7d1ba3ff1e8422b9b464e 4 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '2', 'operation': 'rewind', 'user': 'test'}
   25c8f5ab0c3bb569ec672570f1a901be4c6f032b 837cd997bb05a27f8ed7d1ba3ff1e8422b9b464e 0 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '11', 'operation': 'rewind', 'user': 'test'}
-  $ hg obslog --rev 'desc("c_B0")'
+  $ hg obslog --rev 'desc("c_B0")' --no-origin
   @    837cd997bb05 (5) c_B0
   |\
   x |  25c8f5ab0c3b (3) c_B1
@@ -383,6 +407,16 @@
        meta-changed(meta) as 837cd997bb05 using rewind by test (Thu Jan 01 00:00:02 1970 +0000)
        meta-changed(meta) as b13b032065ef using rewind by test (Thu Jan 01 00:00:01 1970 +0000)
   
+  $ hg obslog --rev 'desc("c_B0")'
+  @    837cd997bb05 (5) c_B0
+  |\     rewritten(description, meta, content) from 25c8f5ab0c3b using rewind by test (Thu Jan 01 00:00:02 1970 +0000)
+  | |    meta-changed(meta) from 7e594302a05d using rewind by test (Thu Jan 01 00:00:02 1970 +0000)
+  | |
+  x |  25c8f5ab0c3b (3) c_B1
+  |/     rewritten(description, content) from 7e594302a05d using amend by test (Thu Jan 01 00:00:01 1970 +0000)
+  |
+  x  7e594302a05d (2) c_B0
+  
   $ hg log -G
   @  changeset:   5:837cd997bb05
   |  tag:         tip
@@ -511,7 +545,7 @@
   
   $ hg debugobsolete
   49fb7d900906b0a3d329e90da4dcb0a7582d3b6e a0316c4c54179357e71d068fb8884678ebc7c351 9576e80d6851ce79cd535e2dc5fa01b444d89a39 0 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '12', 'operation': 'split', 'user': 'test'}
-  $ hg obslog --all
+  $ hg obslog --all --no-origin
   @  9576e80d6851 (5) c_CD0
   |
   | o  a0316c4c5417 (4) c_CD0
@@ -519,6 +553,15 @@
   x  49fb7d900906 (3) c_CD0
        split(parent, content) as 9576e80d6851, a0316c4c5417 using split by test (Thu Jan 01 00:00:02 1970 +0000)
   
+  $ hg obslog --all
+  @  9576e80d6851 (5) c_CD0
+  |    split(parent, content) from 49fb7d900906 using split by test (Thu Jan 01 00:00:02 1970 +0000)
+  |
+  | o  a0316c4c5417 (4) c_CD0
+  |/     split(parent, content) from 49fb7d900906 using split by test (Thu Jan 01 00:00:02 1970 +0000)
+  |
+  x  49fb7d900906 (3) c_CD0
+  
 
 Actual rewind
 `````````````
@@ -532,7 +575,7 @@
   49fb7d900906b0a3d329e90da4dcb0a7582d3b6e 4535d0af405c1bf35f37b35f26ec6f9acfa6fe0b 4 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '2', 'operation': 'rewind', 'user': 'test'}
   9576e80d6851ce79cd535e2dc5fa01b444d89a39 4535d0af405c1bf35f37b35f26ec6f9acfa6fe0b 0 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '14', 'operation': 'rewind', 'user': 'test'}
   a0316c4c54179357e71d068fb8884678ebc7c351 4535d0af405c1bf35f37b35f26ec6f9acfa6fe0b 0 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '10', 'operation': 'rewind', 'user': 'test'}
-  $ hg obslog
+  $ hg obslog --no-origin
   @    4535d0af405c (6) c_CD0
   |\
   | \
@@ -547,6 +590,22 @@
        meta-changed(meta) as 4535d0af405c using rewind by test (Thu Jan 01 00:00:02 1970 +0000)
        split(parent, content) as 9576e80d6851, a0316c4c5417 using split by test (Thu Jan 01 00:00:02 1970 +0000)
   
+  $ hg obslog
+  @    4535d0af405c (6) c_CD0
+  |\     meta-changed(meta) from 49fb7d900906 using rewind by test (Thu Jan 01 00:00:02 1970 +0000)
+  | |    rewritten(meta, parent, content) from 9576e80d6851 using rewind by test (Thu Jan 01 00:00:02 1970 +0000)
+  | |    rewritten(meta, content) from a0316c4c5417 using rewind by test (Thu Jan 01 00:00:02 1970 +0000)
+  | |
+  | \
+  | |\
+  | x |  9576e80d6851 (5) c_CD0
+  |/ /     split(parent, content) from 49fb7d900906 using split by test (Thu Jan 01 00:00:02 1970 +0000)
+  | |
+  | x  a0316c4c5417 (4) c_CD0
+  |/     split(parent, content) from 49fb7d900906 using split by test (Thu Jan 01 00:00:02 1970 +0000)
+  |
+  x  49fb7d900906 (3) c_CD0
+  
   $ hg log -G
   @  changeset:   6:4535d0af405c
   |  tag:         tip
@@ -594,7 +653,7 @@
   a0316c4c54179357e71d068fb8884678ebc7c351 e76375de0bfc9c59bdd91067c901f3eed7d6c8fe 4 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '2', 'operation': 'rewind', 'user': 'test'}
   9576e80d6851ce79cd535e2dc5fa01b444d89a39 95d72d892df7fec59107e10914c5729bdf03665f 4 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '6', 'operation': 'rewind', 'user': 'test'}
   4535d0af405c1bf35f37b35f26ec6f9acfa6fe0b e76375de0bfc9c59bdd91067c901f3eed7d6c8fe 95d72d892df7fec59107e10914c5729bdf03665f 0 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '14', 'operation': 'rewind', 'user': 'test'}
-  $ hg obslog -r -2:
+  $ hg obslog -r -2: --no-origin
   @    95d72d892df7 (8) c_CD0
   |\
   +---o  e76375de0bfc (7) c_CD0
@@ -670,7 +729,7 @@
   $ hg debugobsolete
   579f120ba91885449adc92eedf48ef3569742cee d952d1794ff657f5c2a82225d2e6307ed930b32f 0 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
   7e594302a05d3769b27be88fc3cdfd39d7498498 a65fceb2324ae1eb1231610193d24a5fa02c7c0e 0 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
-  $ hg obslog -r 'desc("c_A1")::'
+  $ hg obslog -r 'desc("c_A1")::' --no-origin
   @  a65fceb2324a (4) c_B0
   |
   | o  d952d1794ff6 (3) c_A1
@@ -681,6 +740,17 @@
   x  7e594302a05d (2) c_B0
        rebased(parent) as a65fceb2324a using evolve by test (Thu Jan 01 00:00:03 1970 +0000)
   
+  $ hg obslog -r 'desc("c_A1")::'
+  @  a65fceb2324a (4) c_B0
+  |    rebased(parent) from 7e594302a05d using evolve by test (Thu Jan 01 00:00:03 1970 +0000)
+  |
+  | o  d952d1794ff6 (3) c_A1
+  | |    rewritten(description, content) from 579f120ba918 using amend by test (Thu Jan 01 00:00:03 1970 +0000)
+  | |
+  | x  579f120ba918 (1) c_A0
+  |
+  x  7e594302a05d (2) c_B0
+  
   $ hg log -G
   @  changeset:   4:a65fceb2324a
   |  tag:         tip
@@ -713,7 +783,7 @@
   7e594302a05d3769b27be88fc3cdfd39d7498498 a65fceb2324ae1eb1231610193d24a5fa02c7c0e 0 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
   7e594302a05d3769b27be88fc3cdfd39d7498498 ac979e0aac4e63ccbbf88ac33942192942302766 4 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '2', 'operation': 'rewind', 'user': 'test'}
   a65fceb2324ae1eb1231610193d24a5fa02c7c0e ac979e0aac4e63ccbbf88ac33942192942302766 0 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '6', 'operation': 'rewind', 'user': 'test'}
-  $ hg obslog
+  $ hg obslog --no-origin
   @    ac979e0aac4e (5) c_B0
   |\
   | x  a65fceb2324a (4) c_B0
@@ -723,6 +793,16 @@
        rebased(parent) as a65fceb2324a using evolve by test (Thu Jan 01 00:00:03 1970 +0000)
        meta-changed(meta) as ac979e0aac4e using rewind by test (Thu Jan 01 00:00:03 1970 +0000)
   
+  $ hg obslog
+  @    ac979e0aac4e (5) c_B0
+  |\     meta-changed(meta) from 7e594302a05d using rewind by test (Thu Jan 01 00:00:03 1970 +0000)
+  | |    rewritten(meta, parent) from a65fceb2324a using rewind by test (Thu Jan 01 00:00:03 1970 +0000)
+  | |
+  | x  a65fceb2324a (4) c_B0
+  |/     rebased(parent) from 7e594302a05d using evolve by test (Thu Jan 01 00:00:03 1970 +0000)
+  |
+  x  7e594302a05d (2) c_B0
+  
   $ hg log -G
   @  changeset:   5:ac979e0aac4e
   |  tag:         tip
@@ -787,7 +867,7 @@
   a65fceb2324ae1eb1231610193d24a5fa02c7c0e ac979e0aac4e63ccbbf88ac33942192942302766 0 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '6', 'operation': 'rewind', 'user': 'test'}
   a65fceb2324ae1eb1231610193d24a5fa02c7c0e a5dd64adbb2af2e646859b35d0d7128daa73cb2b 4 (Thu Jan 01 00:00:04 1970 +0000) {'ef1': '2', 'operation': 'rewind', 'user': 'test'}
   ac979e0aac4e63ccbbf88ac33942192942302766 a5dd64adbb2af2e646859b35d0d7128daa73cb2b 0 (Thu Jan 01 00:00:04 1970 +0000) {'ef1': '6', 'operation': 'rewind', 'user': 'test'}
-  $ hg obslog
+  $ hg obslog --no-origin
   @    a5dd64adbb2a (6) c_B0
   |\
   | x  ac979e0aac4e (5) c_B0
@@ -819,7 +899,7 @@
   ac979e0aac4e63ccbbf88ac33942192942302766 3f2d8862657d20af331f0c0531f5228eef4d36c5 4 (Thu Jan 01 00:00:05 1970 +0000) {'ef1': '6', 'operation': 'rewind', 'user': 'test'}
   a5dd64adbb2af2e646859b35d0d7128daa73cb2b 3f2d8862657d20af331f0c0531f5228eef4d36c5 0 (Thu Jan 01 00:00:05 1970 +0000) {'ef1': '6', 'operation': 'rewind', 'user': 'test'}
   d952d1794ff657f5c2a82225d2e6307ed930b32f 9c28b7ed3951fd15b20ab75449c1e0fdec445958 0 (Thu Jan 01 00:00:05 1970 +0000) {'ef1': '11', 'operation': 'rewind', 'user': 'test'}
-  $ hg obslog
+  $ hg obslog --no-origin
   @    3f2d8862657d (8) c_B0
   |\
   x |  a5dd64adbb2a (6) c_B0
@@ -879,7 +959,7 @@
   a5dd64adbb2af2e646859b35d0d7128daa73cb2b d36d6d267714108384f31762b6193c32f9f97514 4 (Thu Jan 01 00:00:06 1970 +0000) {'ef1': '6', 'operation': 'rewind', 'user': 'test'}
   3f2d8862657d20af331f0c0531f5228eef4d36c5 d36d6d267714108384f31762b6193c32f9f97514 0 (Thu Jan 01 00:00:06 1970 +0000) {'ef1': '6', 'operation': 'rewind', 'user': 'test'}
   9c28b7ed3951fd15b20ab75449c1e0fdec445958 fef4355b4cc9e2d3ddc154f60e4f4f1a286e9ce7 0 (Thu Jan 01 00:00:06 1970 +0000) {'ef1': '11', 'operation': 'rewind', 'user': 'test'}
-  $ hg obslog
+  $ hg obslog --no-origin
   @    d36d6d267714 (10) c_B0
   |\
   x |  3f2d8862657d (8) c_B0
@@ -1002,7 +1082,11 @@
   $ hg rewind --keep --to 'desc("initial")' --hidden
   rewinded to 1 changesets
   (1 changesets obsoleted)
-  $ hg obslog
+  $ hg debugobsolete
+  30704102d912d9d35a3d51400c4c93ad1e8bc7f3 2ea5be2f87510c7d26d5866dec83b57a7d939c4a 0 (Thu Jan 01 00:00:06 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  30704102d912d9d35a3d51400c4c93ad1e8bc7f3 b4c97fddc16aa57693fa0a730d4b44ceb75bb35c 4 (Thu Jan 01 00:00:06 1970 +0000) {'ef1': '2', 'operation': 'rewind', 'user': 'test'}
+  2ea5be2f87510c7d26d5866dec83b57a7d939c4a b4c97fddc16aa57693fa0a730d4b44ceb75bb35c 0 (Thu Jan 01 00:00:06 1970 +0000) {'ef1': '11', 'operation': 'rewind', 'user': 'test'}
+  $ hg obslog --no-origin
   @    b4c97fddc16a (3) initial
   |\
   x |  2ea5be2f8751 (2) amended
@@ -1012,6 +1096,16 @@
        rewritten(description, content) as 2ea5be2f8751 using amend by test (Thu Jan 01 00:00:06 1970 +0000)
        meta-changed(meta) as b4c97fddc16a using rewind by test (Thu Jan 01 00:00:06 1970 +0000)
   
+  $ hg obslog
+  @    b4c97fddc16a (3) initial
+  |\     rewritten(description, meta, content) from 2ea5be2f8751 using rewind by test (Thu Jan 01 00:00:06 1970 +0000)
+  | |    meta-changed(meta) from 30704102d912 using rewind by test (Thu Jan 01 00:00:06 1970 +0000)
+  | |
+  x |  2ea5be2f8751 (2) amended
+  |/     rewritten(description, content) from 30704102d912 using amend by test (Thu Jan 01 00:00:06 1970 +0000)
+  |
+  x  30704102d912 (1) initial
+  
   $ hg glf --hidden
   @  3: initial (a b)
   |
--- a/tests/test-sharing.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-sharing.t	Fri May 08 20:36:29 2020 +0800
@@ -520,12 +520,12 @@
   with: [6] fix bug 24 (v2 by alice)
   base: [4] fix bug 24 (v1)
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-  working directory is now at aa824ceedb8b
+  working directory is now at f92394e17e33
   $ hg log -q -r 'contentdivergent()'
 
 Figure SG10: Bob's repository after fixing divergence.
   $ hg --hidden shortlog -G -r 3::
-  @  7:aa82  draft  fix bug 24 (v2 by bob)
+  @  7:f923  draft  fix bug 24 (v2 by bob)
   |
   | x  6:e3a5  draft  fix bug 24 (v2 by alice)
   |/
@@ -536,7 +536,7 @@
   o  3:dd15  public  fix bug 15 (v2)
   |
   ~
-  $ hg --hidden shortlog -r 'predecessors(aa82)'
+  $ hg --hidden shortlog -r 'predecessors(.)'
   5:541f  draft  fix bug 24 (v2 by bob)
   6:e3a5  draft  fix bug 24 (v2 by alice)
   $ cat file1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-sqlite3-permissions.t	Fri May 08 20:36:29 2020 +0800
@@ -0,0 +1,30 @@
+#require unix-permissions
+
+Test that sqlite3 cache files inherit the permissions of the .hg
+directory like other cache files.
+
+  $ . $TESTDIR/testlib/common.sh
+
+  $ cat << EOF >> $HGRCPATH
+  > [extensions]
+  > evolve =
+  > EOF
+  $ hg init test
+  $ cd test
+  $ chmod 700 .hg
+  $ hg debugupdatecache
+  $ ls -l .hg/cache/evoext_*.sqlite
+  -rw------- * .hg/cache/evoext_obshashrange_v2.sqlite (glob)
+  -rw------- * .hg/cache/evoext_stablerange_v2.sqlite (glob)
+  $ rm -r .hg/cache
+  $ chmod 770 .hg
+  $ hg debugupdatecache
+  $ ls -l .hg/cache/evoext_*.sqlite
+  -rw-rw---- * .hg/cache/evoext_obshashrange_v2.sqlite (glob)
+  -rw-rw---- * .hg/cache/evoext_stablerange_v2.sqlite (glob)
+  $ rm -r .hg/cache
+  $ chmod 774 .hg
+  $ hg debugupdatecache
+  $ ls -l .hg/cache/evoext_*.sqlite
+  -rw-rw-r-- * .hg/cache/evoext_obshashrange_v2.sqlite (glob)
+  -rw-rw-r-- * .hg/cache/evoext_stablerange_v2.sqlite (glob)
--- a/tests/test-topic-stack-complex.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-topic-stack-complex.t	Fri May 08 20:36:29 2020 +0800
@@ -174,7 +174,7 @@
   with: [s4] Added e and f
   base: [3] Added e and f
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 80b2ddbf01d3
+  working directory is now at 692bc8b2aa4d
 
-  $ hg log -r 80b2ddbf01d3 -T '{date|hgdate}\n'
+  $ hg log -r . -T '{date|hgdate}\n'
   0 1
--- a/tests/test-topic-stack.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-topic-stack.t	Fri May 08 20:36:29 2020 +0800
@@ -952,22 +952,37 @@
   
   continue splitting? [Ycdq?] c
 
+  $ hg debugobsolete
+  34679cfcccdd07565970b959c79428af9a5744e4 6a11ae6b0cde4d4952ed68e8077b9e3596d99548 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'amend', 'user': 'test'}
+  20f7945d89a5e372b7548f766ebc800677856443 3c7bec987cd37ba12b83c01683e8609dd549c07b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'amend', 'user': 'test'}
+  952e24687ebc5f11743268f6f1c3f24fa83c7ddd 74979543bf1d6c0f75229991400f352a6fb3fddb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'amend', 'user': 'test'}
+  c9961f97c7b40b54b3c1922986675d6f38793014 d7bfa3d6ce36dfb917547246752f0c2a564fe33b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'amend', 'user': 'test'}
+  c7d60a180d05255e8c6ea50bce09d014015b7cdc 3ab2eedae500f52b6aa220bb8ce6e20732a8a6d1 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'amend', 'user': 'test'}
+  6a11ae6b0cde4d4952ed68e8077b9e3596d99548 61700bf67137c724a72aa5f034e9187d2c5e7e47 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'amend', 'user': 'test'}
+  3c7bec987cd37ba12b83c01683e8609dd549c07b 4bcfa5dd0945476ba938e8115e81ba367af3b573 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'amend', 'user': 'test'}
+  74979543bf1d6c0f75229991400f352a6fb3fddb 1d84ec948370a2ac1a51f3ab27835e31d50c3407 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'amend', 'user': 'test'}
+  1d84ec948370a2ac1a51f3ab27835e31d50c3407 f3328cd199dc389b850ca952f65a15a8e6dbc79b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  3ab2eedae500f52b6aa220bb8ce6e20732a8a6d1 907f7d3c2333082d62942ac3a47e466ce03d82b9 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  3bfe800e04863d23f909f8d98848656b7b5a971a 662ff4ad29901b325a64c39f7850e3efaaeeccc5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  907f7d3c2333082d62942ac3a47e466ce03d82b9 b24bab30ac12f6124a52e74aaf46b7468e42526c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  b24bab30ac12f6124a52e74aaf46b7468e42526c dde94df880e97f4a1ee8c5408254b429b3d90204 e7ea874afbd5c17aeee366d39a828dbcb01682ce 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'split', 'user': 'test'}
   $ hg --config extensions.evolve= obslog --all
   o  dde94df880e9 (21) c_G
+  |    split(parent, content) from b24bab30ac12 using split by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   | @  e7ea874afbd5 (22) c_G
-  |/
+  |/     split(parent, content) from b24bab30ac12 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
   x  b24bab30ac12 (20) c_G
-  |    split(parent, content) as dde94df880e9, e7ea874afbd5 using split by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    amended(content) from 907f7d3c2333 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  907f7d3c2333 (18) c_G
-  |    amended(content) as b24bab30ac12 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    rebased(parent) from 3ab2eedae500 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  3ab2eedae500 (13) c_G
-  |    rebased(parent) as 907f7d3c2333 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  |    reauthored(user) from c7d60a180d05 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
   x  c7d60a180d05 (6) c_G
-       reauthored(user) as 3ab2eedae500 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   
   $ hg export .
   # HG changeset patch
--- a/tests/test-touch.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-touch.t	Fri May 08 20:36:29 2020 +0800
@@ -157,7 +157,18 @@
   1 changesets pruned
   $ hg touch 13 --hidden --note "testing with no successor"
   1 new orphan changesets
-  $ hg obslog -r 13 --hidden
+  $ hg debugobsolete
+  * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'touch', 'user': 'test'} (glob)
+  * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'} (glob)
+  * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'touch', 'user': 'test'} (glob)
+  * 0 {0000000000000000000000000000000000000000} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'} (glob)
+  * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'touch', 'user': 'test'} (glob)
+  * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'touch', 'user': 'test'} (glob)
+  * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'touch', 'user': 'test'} (glob)
+  * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} (glob)
+  * 0 {*} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'} (glob)
+  * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'note': 'testing with no successor', 'operation': 'touch', 'user': 'test'} (glob)
+  $ hg obslog -r 13 --no-origin --hidden
   x  [0-9a-f]{12} (.*) move (re)
        pruned using prune by test (Thu Jan 01 00:00:00 1970 +0000)
        rewritten(.*) as [0-9a-f]{12} using touch by test (.*) (re)
--- a/tests/test-uncommit-interactive.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-uncommit-interactive.t	Fri May 08 20:36:29 2020 +0800
@@ -164,12 +164,15 @@
   discard change 3/3 to 'a'? [Ynesfdaq?] n
   
 
+  $ hg debugobsolete
+  e9635f4beaf11f64a07ccc74684092b144c53d89 0 {7733902a8d94c789ca81d866bea1893d79442db6} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'uncommit', 'user': 'test'}
+  f70fb463d5bf9f0ffd38f105521d96e9f2591bc1 678a59e5ff90754d5e94719bd82ad169be773c21 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'note on amend --extract', 'operation': 'uncommit', 'user': 'test'}
   $ hg obslog
   @  678a59e5ff90 (3) another one
+  |    amended(content) from f70fb463d5bf using uncommit by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      note: note on amend --extract
   |
   x  f70fb463d5bf (1) another one
-       amended(content) as 678a59e5ff90 using uncommit by test (Thu Jan 01 00:00:00 1970 +0000)
-         note: note on amend --extract
   
 The unselected part should be in the diff
 -----------------------------------------
@@ -296,16 +299,21 @@
 
 Checking the obsolescence history
 
+  $ hg debugobsolete
+  e9635f4beaf11f64a07ccc74684092b144c53d89 0 {7733902a8d94c789ca81d866bea1893d79442db6} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'uncommit', 'user': 'test'}
+  f70fb463d5bf9f0ffd38f105521d96e9f2591bc1 678a59e5ff90754d5e94719bd82ad169be773c21 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'note on amend --extract', 'operation': 'uncommit', 'user': 'test'}
+  7ca9935a62f11b39b60c7fb8861377c7d45b3e99 0 {7733902a8d94c789ca81d866bea1893d79442db6} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'uncommit', 'user': 'test'}
+  678a59e5ff90754d5e94719bd82ad169be773c21 46e35360be473bf761bedf3d05de4a68ffd9d9f8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'testing uncommit on dirty wdir', 'operation': 'uncommit', 'user': 'test'}
   $ hg obslog
   @  46e35360be47 (5) another one
+  |    amended(content) from 678a59e5ff90 using uncommit by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      note: testing uncommit on dirty wdir
   |
   x  678a59e5ff90 (3) another one
-  |    amended(content) as 46e35360be47 using uncommit by test (Thu Jan 01 00:00:00 1970 +0000)
-  |      note: testing uncommit on dirty wdir
+  |    amended(content) from f70fb463d5bf using uncommit by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      note: note on amend --extract
   |
   x  f70fb463d5bf (1) another one
-       amended(content) as 678a59e5ff90 using uncommit by test (Thu Jan 01 00:00:00 1970 +0000)
-         note: note on amend --extract
   
 
 Push the changes back to the commit and more commits for more testing
--- a/tests/test-unstability-resolution-result.t	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/test-unstability-resolution-result.t	Fri May 08 20:36:29 2020 +0800
@@ -66,7 +66,8 @@
 
 Test evolve of orphan that run into conflict
 
-  $ ls
+  $ ls -A
+  .hg
   a
   b
   $ hg pdiff a
--- a/tests/testlib/push-checkheads-util.sh	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/testlib/push-checkheads-util.sh	Fri May 08 20:36:29 2020 +0800
@@ -34,6 +34,6 @@
 
         echo >> "client/.hg/hgrc" "[ui]"
         echo >> "client/.hg/hgrc" "# simpler log output"
-        echo >> "client/.hg/hgrc" 'logtemplate = "{node|short} [{branch}{if(topic, ":{topic}")}] ({phase}): {desc}\\n"'
+        printf >> "client/.hg/hgrc" "%s" 'logtemplate = "{node|short} [{branch}{if(topic, ":{topic}")}] ({phase}): {desc}\n"'
     fi
 }
--- a/tests/testlib/pythonpath.sh	Wed Apr 08 01:16:54 2020 +0800
+++ b/tests/testlib/pythonpath.sh	Fri May 08 20:36:29 2020 +0800
@@ -3,7 +3,7 @@
 export SRCDIR="`dirname $TESTDIR`"
 if [ -n "$PYTHONPATH" ]; then
     export HGTEST_ORIG_PYTHONPATH=$PYTHONPATH
-    if uname -o | grep -q Msys; then
+    if uname -o 2> /dev/null | grep -q Msys; then
         export PYTHONPATH="$SRCDIR;$PYTHONPATH"
     else
         export PYTHONPATH=$SRCDIR:$PYTHONPATH