973 repo.ui.warn(_("warning: new changesets detected on target branch, " |
973 repo.ui.warn(_("warning: new changesets detected on target branch, " |
974 "can't strip\n")) |
974 "can't strip\n")) |
975 cleanup = False |
975 cleanup = False |
976 |
976 |
977 if cleanup: |
977 if cleanup: |
978 # Update away from the rebase if necessary |
978 shouldupdate = False |
979 if needupdate(repo, state): |
|
980 merge.update(repo, originalwd, False, True) |
|
981 |
|
982 # Strip from the first rebased revision |
|
983 rebased = filter(lambda x: x >= 0 and x != target, state.values()) |
979 rebased = filter(lambda x: x >= 0 and x != target, state.values()) |
984 if rebased: |
980 if rebased: |
985 strippoints = [ |
981 strippoints = [ |
986 c.node() for c in repo.set('roots(%ld)', rebased)] |
982 c.node() for c in repo.set('roots(%ld)', rebased)] |
|
983 shouldupdate = len([ |
|
984 c.node() for c in repo.set('. & (%ld)', rebased)]) > 0 |
|
985 |
|
986 # Update away from the rebase if necessary |
|
987 if shouldupdate or needupdate(repo, state): |
|
988 merge.update(repo, originalwd, False, True) |
|
989 |
|
990 # Strip from the first rebased revision |
|
991 if rebased: |
987 # no backup of rebased cset versions needed |
992 # no backup of rebased cset versions needed |
988 repair.strip(repo.ui, repo, strippoints) |
993 repair.strip(repo.ui, repo, strippoints) |
989 |
994 |
990 if activebookmark and activebookmark in repo._bookmarks: |
995 if activebookmark and activebookmark in repo._bookmarks: |
991 bookmarks.activate(repo, activebookmark) |
996 bookmarks.activate(repo, activebookmark) |