evolve: use in code filtered error for 4.6
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 19 Apr 2018 14:26:03 +0200
changeset 3691 96cb98989d57
parent 3690 44580b7e288b
child 3692 f9988919d69e
evolve: use in code filtered error for 4.6 Things have been upstream into core for a while, let us use them instead of the evolve version.
hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py	Thu Apr 19 15:51:44 2018 +0200
+++ b/hgext3rd/evolve/__init__.py	Thu Apr 19 14:26:03 2018 +0200
@@ -32,7 +32,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.2).
+Mercurial version 4.3).
 
 New Config::
 
@@ -82,6 +82,7 @@
 
 It is recommended to enable the blackbox extension. It gathers useful data about
 the experiment. It is shipped with Mercurial so no extra install is needed::
+    $ hg debugupdatecache
 
 It is recommended to enable the blackbox extension. It gathers useful data about
 the experiment. It is shipped with Mercurial so no extra install is needed::
@@ -719,9 +720,8 @@
 
     ui.warn("(%s)\n" % solvemsg)
 
-if util.safehasattr(context, '_filterederror'):
-    # if < hg-4.2 we do not update the message
-    @eh.wrapfunction(context, '_filterederror')
+if util.safehasattr(context, '_filterederror'): # <= hg-4.5
+    @eh.wrapfunction(scmutil, '_filterederror')
     def evolve_filtererror(original, repo, changeid):
         """build an exception to be raised about a filtered changeid
 
@@ -730,10 +730,10 @@
         if repo.filtername.startswith('visible'):
 
             unfilteredrepo = repo.unfiltered()
-            rev = unfilteredrepo[changeid]
+            rev = repo[scmutil.revsingle(unfilteredrepo, changeid)]
             reason, successors = obshistory._getobsfateandsuccs(unfilteredrepo, rev.node())
 
-            # Be more precise in cqse the revision is superseed
+            # Be more precise in case the revision is superseed
             if reason == 'superseed':
                 reason = _("successor: %s") % successors[0]
             elif reason == 'superseed_split':