##// END OF EJS Templates
rebase: do not abort if all changesets have equivalents in the destination
Kostia Balytskyi -
r29372:0b5e9a62 default
parent child Browse files
Show More
@@ -531,6 +531,9 b' def rebase(ui, repo, **opts):'
531 for k, v in rbsrt.state.iteritems():
531 for k, v in rbsrt.state.iteritems():
532 if v > nullmerge:
532 if v > nullmerge:
533 nstate[repo[k].node()] = repo[v].node()
533 nstate[repo[k].node()] = repo[v].node()
534 elif v == revprecursor:
535 succ = obsoletenotrebased[k]
536 nstate[repo[k].node()] = repo[succ].node()
534 # XXX this is the same as dest.node() for the non-continue path --
537 # XXX this is the same as dest.node() for the non-continue path --
535 # this should probably be cleaned up
538 # this should probably be cleaned up
536 targetnode = repo[rbsrt.target].node()
539 targetnode = repo[rbsrt.target].node()
@@ -538,7 +541,9 b' def rebase(ui, repo, **opts):'
538 # restore original working directory
541 # restore original working directory
539 # (we do this before stripping)
542 # (we do this before stripping)
540 newwd = rbsrt.state.get(rbsrt.originalwd, rbsrt.originalwd)
543 newwd = rbsrt.state.get(rbsrt.originalwd, rbsrt.originalwd)
541 if newwd < 0:
544 if newwd == revprecursor:
545 newwd = obsoletenotrebased[rbsrt.originalwd]
546 elif newwd < 0:
542 # original directory is a parent of rebase set root or ignored
547 # original directory is a parent of rebase set root or ignored
543 newwd = rbsrt.originalwd
548 newwd = rbsrt.originalwd
544 if newwd not in [c.rev() for c in repo[None].parents()]:
549 if newwd not in [c.rev() for c in repo[None].parents()]:
@@ -777,17 +782,6 b' def _checkobsrebase(repo, ui,'
777 "experimental.allowdivergence=True")
782 "experimental.allowdivergence=True")
778 raise error.Abort(msg % (",".join(divhashes),), hint=h)
783 raise error.Abort(msg % (",".join(divhashes),), hint=h)
779
784
780 # - plain prune (no successor) changesets are rebased
781 # - split changesets are not rebased if at least one of the
782 # changeset resulting from the split is an ancestor of dest
783 rebaseset = rebasesetrevs - rebaseobsskipped
784 if rebasesetrevs and not rebaseset:
785 msg = _('all requested changesets have equivalents '
786 'or were marked as obsolete')
787 hint = _('to force the rebase, set the config '
788 'experimental.rebaseskipobsolete to False')
789 raise error.Abort(msg, hint=hint)
790
791 def defineparents(repo, rev, target, state, targetancestors,
785 def defineparents(repo, rev, target, state, targetancestors,
792 obsoletenotrebased):
786 obsoletenotrebased):
793 'Return the new parent relationship of the revision that will be rebased'
787 'Return the new parent relationship of the revision that will be rebased'
@@ -709,9 +709,7 b' should display a friendly error message'
709 created new head
709 created new head
710 $ hg debugobsolete `hg log -r 11 -T '{node}\n'` --config experimental.evolution=all
710 $ hg debugobsolete `hg log -r 11 -T '{node}\n'` --config experimental.evolution=all
711 $ hg rebase -r . -d 10
711 $ hg rebase -r . -d 10
712 abort: all requested changesets have equivalents or were marked as obsolete
712 note: not rebasing 11:f44da1f4954c "nonrelevant" (tip), it has no successor
713 (to force the rebase, set the config experimental.rebaseskipobsolete to False)
714 [255]
715
713
716 If a rebase is going to create divergence, it should abort
714 If a rebase is going to create divergence, it should abort
717
715
@@ -916,3 +914,38 b' rebase source is obsoleted (issue5198)'
916 o 0:cd010b8cd998 A
914 o 0:cd010b8cd998 A
917
915
918 $ cd ..
916 $ cd ..
917
918 Test that bookmark is moved and working dir is updated when all changesets have
919 equivalents in destination
920 $ hg init rbsrepo && cd rbsrepo
921 $ echo "[experimental]" > .hg/hgrc
922 $ echo "evolution=all" >> .hg/hgrc
923 $ echo "rebaseskipobsolete=on" >> .hg/hgrc
924 $ echo root > root && hg ci -Am root
925 adding root
926 $ echo a > a && hg ci -Am a
927 adding a
928 $ hg up 0
929 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
930 $ echo b > b && hg ci -Am b
931 adding b
932 created new head
933 $ hg rebase -r 2 -d 1
934 rebasing 2:1e9a3c00cbe9 "b" (tip)
935 $ hg log -r . # working dir is at rev 3 (successor of 2)
936 3:be1832deae9a b (no-eol)
937 $ hg book -r 2 mybook --hidden # rev 2 has a bookmark on it now
938 $ hg up 2 && hg log -r . # working dir is at rev 2 again
939 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
940 2:1e9a3c00cbe9 b (no-eol)
941 $ hg rebase -r 2 -d 3
942 note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b"
943 Check that working directory was updated to rev 3 although rev 2 was skipped
944 during the rebase operation
945 $ hg log -r .
946 3:be1832deae9a b (no-eol)
947
948 Check that bookmark was moved to rev 3 although rev 2 was skipped
949 during the rebase operation
950 $ hg bookmarks
951 mybook 3:be1832deae9a
General Comments 0
You need to be logged in to leave comments. Login now