Patchwork [2,of,2] rebase: rewrite "x in y.children()" as "y in x.parents()"

login
register
mail settings
Submitter via Mercurial-devel
Date June 18, 2017, 6:13 a.m.
Message ID <ae7a9461a249b94cf2eb.1497766435@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/21473/
State Accepted
Headers show

Comments

via Mercurial-devel - June 18, 2017, 6:13 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1497766187 25200
#      Sat Jun 17 23:09:47 2017 -0700
# Node ID ae7a9461a249b94cf2eb48b1ab93d3ecc15ef17e
# Parent  d8c3f47d162dafa180996d3dfd8b59f1e901735b
rebase: rewrite "x in y.children()" as "y in x.parents()"

children() is slow

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1265,7 +1265,7 @@ 
                 samebranch = root.branch() == wctx.branch()
             else:
                 samebranch = root.branch() == dest.branch()
-            if not collapse and samebranch and root in dest.children():
+            if not collapse and samebranch and dest in root.parents():
                 # mark the revision as done by setting its new revision
                 # equal to its old (current) revisions
                 state[root.rev()] = root.rev()