365 sortedstate = sorted(state) |
366 sortedstate = sorted(state) |
366 total = len(sortedstate) |
367 total = len(sortedstate) |
367 pos = 0 |
368 pos = 0 |
368 for rev in sortedstate: |
369 for rev in sortedstate: |
369 pos += 1 |
370 pos += 1 |
370 if state[rev] == -1: |
371 if state[rev] == revtodo: |
371 ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, repo[rev])), |
372 ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, repo[rev])), |
372 _('changesets'), total) |
373 _('changesets'), total) |
373 p1, p2, base = defineparents(repo, rev, target, state, |
374 p1, p2, base = defineparents(repo, rev, target, state, |
374 targetancestors) |
375 targetancestors) |
375 storestatus(repo, originalwd, target, state, collapsef, keepf, |
376 storestatus(repo, originalwd, target, state, collapsef, keepf, |
788 skipped = set() |
789 skipped = set() |
789 # recompute the set of skipped revs |
790 # recompute the set of skipped revs |
790 if not collapse: |
791 if not collapse: |
791 seen = set([target]) |
792 seen = set([target]) |
792 for old, new in sorted(state.items()): |
793 for old, new in sorted(state.items()): |
793 if new != nullrev and new in seen: |
794 if new != revtodo and new in seen: |
794 skipped.add(old) |
795 skipped.add(old) |
795 seen.add(new) |
796 seen.add(new) |
796 repo.ui.debug('computed skipped revs: %s\n' % |
797 repo.ui.debug('computed skipped revs: %s\n' % |
797 (' '.join(str(r) for r in sorted(skipped)) or None)) |
798 (' '.join(str(r) for r in sorted(skipped)) or None)) |
798 repo.ui.debug('rebase status resumed\n') |
799 repo.ui.debug('rebase status resumed\n') |
880 if not collapse and samebranch and root in dest.children(): |
881 if not collapse and samebranch and root in dest.children(): |
881 repo.ui.debug('source is a child of destination\n') |
882 repo.ui.debug('source is a child of destination\n') |
882 return None |
883 return None |
883 |
884 |
884 repo.ui.debug('rebase onto %d starting from %s\n' % (dest, root)) |
885 repo.ui.debug('rebase onto %d starting from %s\n' % (dest, root)) |
885 state.update(dict.fromkeys(rebaseset, nullrev)) |
886 state.update(dict.fromkeys(rebaseset, revtodo)) |
886 # Rebase tries to turn <dest> into a parent of <root> while |
887 # Rebase tries to turn <dest> into a parent of <root> while |
887 # preserving the number of parents of rebased changesets: |
888 # preserving the number of parents of rebased changesets: |
888 # |
889 # |
889 # - A changeset with a single parent will always be rebased as a |
890 # - A changeset with a single parent will always be rebased as a |
890 # changeset with a single parent. |
891 # changeset with a single parent. |