context: unstable was deprecated
authorBoris Feld <boris.feld@octobus.net>
Thu, 10 Aug 2017 20:40:57 +0200
changeset 2838 1c9150e30b28
parent 2837 cec8609bb396
child 2839 f9c8c754a528
context: unstable was deprecated Use orphan instead. Match f163edb45c47 mercurial changeset.
hgext3rd/evolve/__init__.py
hgext3rd/topic/stack.py
--- a/hgext3rd/evolve/__init__.py	Thu Aug 10 20:31:39 2017 +0200
+++ b/hgext3rd/evolve/__init__.py	Thu Aug 10 20:40:57 2017 +0200
@@ -1311,7 +1311,7 @@
     fm = ui.formatter('evolvelist', opts)
     for rev in revs:
         ctx = repo[rev]
-        unpars = _preparelistctxs(ctx.parents(), lambda p: p.unstable())
+        unpars = _preparelistctxs(ctx.parents(), lambda p: p.orphan())
         obspars = _preparelistctxs(ctx.parents(), lambda p: p.obsolete())
         imprecs = _preparelistctxs(repo.set("allprecursors(%n)", ctx.node()),
                                    lambda p: not p.mutable())
--- a/hgext3rd/topic/stack.py	Thu Aug 10 20:31:39 2017 +0200
+++ b/hgext3rd/topic/stack.py	Thu Aug 10 20:40:57 2017 +0200
@@ -5,13 +5,20 @@
 from mercurial.i18n import _
 from mercurial import (
     destutil,
+    context,
     error,
     node,
+    util,
 )
 from .evolvebits import builddependencies, _orderrevs, _singlesuccessor
 
 short = node.short
 
+# TODO: compat
+
+if not util.safehasattr(context.basectx, 'orphan'):
+    context.basectx.orphan = context.basectx.unstable
+
 def getstack(repo, branch=None, topic=None):
     # XXX need sorting
     if topic is not None and branch is not None:
@@ -122,7 +129,7 @@
             # "base" is kind of a "ghost" entry
             # skip other label for them (no current, no unstable)
             states = ['base']
-        elif ctx.unstable():
+        elif ctx.orphan():
             # current revision can be unstable also, so in that case show both
             # the states and the symbol '@' (issue5553)
             if iscurrentrevision: