[PATCH 4 of 4 evolve-ext] evolve: remove unused function _stabilizableunstable

Laurent Charignon lcharignon at fb.com
Mon Jun 22 17:42:03 CDT 2015


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1435010578 25200
#      Mon Jun 22 15:02:58 2015 -0700
# Node ID fc53dc3f81a7fbe9836c710f9733b91706bfb3aa
# Parent  c64696fe12b20a96db8fccf94b18d62bddca20b3
evolve: remove unused function _stabilizableunstable

With the rework of hg evolve with no argument, this function is no longer
needed.

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -1641,30 +1641,6 @@ def evolve(ui, repo, **opts):
     progresscb()
     _cleanup(ui, repo, startnode, showprogress)
 
-def _stabilizableunstable(repo, pctx):
-    """Return a changectx for an unstable changeset which can be
-    stabilized on top of pctx or one of its descendants. None if none
-    can be found.
-    """
-    def selfanddescendants(repo, pctx):
-        yield pctx
-        for prec in repo.set('allprecursors(%d)', pctx):
-            yield prec
-        for ctx in pctx.descendants():
-            yield ctx
-            for prec in repo.set('allprecursors(%d)', ctx):
-                yield prec
-
-    # Look for an unstable which can be stabilized as a child of
-    # node. The unstable must be a child of one of node predecessors.
-    directdesc = set([pctx.rev()])
-    for ctx in selfanddescendants(repo, pctx):
-        for child in ctx.children():
-            if ctx.rev() in directdesc and not child.obsolete():
-                directdesc.add(child.rev())
-            elif child.unstable():
-                return child
-    return None
 
 def _solveunstable(ui, repo, orig, dryrun=False, confirm=False,
                    progresscb=None):


More information about the Mercurial-devel mailing list