Patrick Mézard avatar Patrick Mézard committed c072e55

evolve: move _stabilizableunstable() with related functions

Comments (0)

Files changed (1)

         repo.dirstate.invalidate()
         raise
 
-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 ctx in pctx.descendants():
-            yield ctx
-
-    # Look for an unstable which can be stabilized as a child of
-    # node. The unstable must be a child of one of node predecessors.
-    for ctx in selfanddescendants(repo, pctx):
-        unstables = list(repo.set('unstable() and children(allprecursors(%d))',
-                                  ctx.rev()))
-        if unstables:
-            return unstables[0]
-    return None
-
 def _bookmarksupdater(repo, oldid):
     """Return a callable update(newid) updating the current bookmark
     and bookmarks bound to oldid to newid.
 
     return tr
 
+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 ctx in pctx.descendants():
+            yield ctx
+
+    # Look for an unstable which can be stabilized as a child of
+    # node. The unstable must be a child of one of node predecessors.
+    for ctx in selfanddescendants(repo, pctx):
+        unstables = list(repo.set('unstable() and children(allprecursors(%d))',
+                                  ctx.rev()))
+        if unstables:
+            return unstables[0]
+    return None
 
 def _solveunstable(ui, repo, orig, dryrun=False):
     """Stabilize a unstable changeset"""
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.