changeset 32899:3980b2e061f0

shelve: rewrite "x in y.children()" as "y in x.parents()" children() is slow
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 17 Jun 2017 23:09:39 -0700
parents c425b678df7c
children 07d5a503124c
files hgext/shelve.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/shelve.py	Sat Jun 17 17:16:28 2017 +0530
+++ b/hgext/shelve.py	Sat Jun 17 23:09:39 2017 -0700
@@ -681,7 +681,7 @@
             raise
 
         shelvectx = repo['tip']
-        if not shelvectx in state.pendingctx.children():
+        if state.pendingctx not in shelvectx.parents():
             # rebase was a no-op, so it produced no child commit
             shelvectx = state.pendingctx
         else:
@@ -758,7 +758,7 @@
     # refresh ctx after rebase completes
     shelvectx = repo['tip']
 
-    if not shelvectx in tmpwctx.children():
+    if tmpwctx not in shelvectx.parents():
         # rebase was a no-op, so it produced no child commit
         shelvectx = tmpwctx
     return shelvectx