diff hgext/rebase.py @ 23246:643c58303fb0 stable 3.2.1

rebase: fix rebase with no common ancestors (issue4446) The new rebase revset didn't check for the case when there are no common ancestors. Now it does. The new behavior should be the same as the pre-3.2 behavior. Added a test.
author Durham Goode <durham@fb.com>
date Mon, 10 Nov 2014 10:44:42 -0800
parents d583f1cfca96
children 3480c07fc934 57d35d3c1cf1
line wrap: on
line diff
--- a/hgext/rebase.py	Thu Nov 06 10:57:13 2014 -0500
+++ b/hgext/rebase.py	Mon Nov 10 10:44:42 2014 -0800
@@ -274,8 +274,12 @@
                                 "can't compute rebase set\n"))
                     return 1
                 commonanc = repo.revs('ancestor(%ld, %d)', base, dest).first()
-                rebaseset = repo.revs('(%d::(%ld) - %d)::',
-                                      commonanc, base, commonanc)
+                if commonanc is not None:
+                    rebaseset = repo.revs('(%d::(%ld) - %d)::',
+                                          commonanc, base, commonanc)
+                else:
+                    rebaseset = []
+
                 if not rebaseset:
                     # transform to list because smartsets are not comparable to
                     # lists. This should be improved to honor lazyness of