hgext/rebase.py
changeset 28015 a036e1ae1fbe
parent 28002 e862b1fd33a8
parent 27988 61f4d59e9a0b
child 28117 41a0fb2b4bbc
--- a/hgext/rebase.py	Tue Jan 19 18:20:13 2016 +0000
+++ b/hgext/rebase.py	Sun Feb 07 00:49:31 2016 -0600
@@ -980,15 +980,20 @@
             cleanup = False
 
         if cleanup:
+            shouldupdate = False
+            rebased = filter(lambda x: x >= 0 and x != target, state.values())
+            if rebased:
+                strippoints = [
+                        c.node() for c in repo.set('roots(%ld)', rebased)]
+                shouldupdate = len([
+                        c.node() for c in repo.set('. & (%ld)', rebased)]) > 0
+
             # Update away from the rebase if necessary
-            if needupdate(repo, state):
+            if shouldupdate or needupdate(repo, state):
                 merge.update(repo, originalwd, False, True)
 
             # Strip from the first rebased revision
-            rebased = filter(lambda x: x >= 0 and x != target, state.values())
             if rebased:
-                strippoints = [
-                        c.node()  for c in repo.set('roots(%ld)', rebased)]
                 # no backup of rebased cset versions needed
                 repair.strip(repo.ui, repo, strippoints)