rebase: use revlog.findmissingrevs to compute detach set
authorSiddharth Agarwal <sid0@fb.com>
Tue, 27 Nov 2012 16:24:21 -0800
changeset 17973 fa6be7b81f77
parent 17972 7ef00d09ef35
child 17974 337d728e644f
rebase: use revlog.findmissingrevs to compute detach set
hgext/rebase.py
--- a/hgext/rebase.py	Mon Nov 26 10:48:24 2012 -0800
+++ b/hgext/rebase.py	Tue Nov 27 16:24:21 2012 -0800
@@ -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 = repo.changelog.findmissingrevs([commonbase.rev()],
+                                                   [root.rev()])
         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):