bookmark: simplify mutability check in `validdest`
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 24 Oct 2012 17:26:40 +0200
changeset 17916 ed225834b372
parent 17915 fb14a5dcdc62
child 17917 12178f07de97
bookmark: simplify mutability check in `validdest` There is no need to check phase by hand. We already have a ctx method for that.
mercurial/bookmarks.py
--- a/mercurial/bookmarks.py	Wed Nov 07 09:59:46 2012 -0800
+++ b/mercurial/bookmarks.py	Wed Oct 24 17:26:40 2012 +0200
@@ -7,7 +7,7 @@
 
 from mercurial.i18n import _
 from mercurial.node import hex
-from mercurial import encoding, error, util, obsolete, phases
+from mercurial import encoding, error, util, obsolete
 import errno, os
 
 def read(repo):
@@ -264,7 +264,7 @@
             plen = len(validdests)
             succs = set(c.node() for c in validdests)
             for c in validdests:
-                if c.phase() > phases.public:
+                if c.mutable():
                     # obsolescence marker does not apply to public changeset
                     succs.update(obsolete.allsuccessors(repo.obsstore,
                                                         [c.node()]))