[PATCH 2 of 2] rebase: use ancestorsofanotb to compute detach set

Siddharth Agarwal sid0 at fb.com
Tue Nov 20 21:15:27 CST 2012


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1353139552 28800
# Node ID 917aa9379d8180bebacf2f4c16ad16b1093c34c9
# Parent  25bdb24973e3b43d84b6d4c314f035f303ada192
rebase: use ancestorsofanotb to compute detach set

diff -r 25bdb24973e3 -r 917aa9379d81 hgext/rebase.py
--- a/hgext/rebase.py	Tue Nov 20 19:12:21 2012 -0800
+++ b/hgext/rebase.py	Sat Nov 17 00:05:52 2012 -0800
@@ -15,7 +15,7 @@
 '''
 
 from mercurial import hg, util, repair, merge, cmdutil, commands, bookmarks
-from mercurial import extensions, patch, scmutil, phases, obsolete
+from mercurial import extensions, patch, scmutil, phases, obsolete, ancestor
 from mercurial.commands import templateopts
 from mercurial.node import nullrev
 from mercurial.lock import release
@@ -656,9 +656,12 @@
     #
     # The actual abort is handled by `defineparents`
     if len(root.parents()) <= 1:
-        # (strict) ancestors of <root> not ancestors of <dest>
-        detachset = repo.revs('::%d - ::%d - %d', root, commonbase, root)
+        # ancestors of <root> not ancestors of <dest>
+        detachset = ancestor.ancestorsofanotb(root.rev(), commonbase.rev(),
+            repo.changelog.parentrevs)
         state.update(dict.fromkeys(detachset, nullmerge))
+        # detachset can have root, and we definitely want to rebase that
+        state[root.rev()] = nullrev
     return repo['.'].rev(), dest.rev(), state
 
 def clearrebased(ui, repo, state, collapsedas=None):


More information about the Mercurial-devel mailing list