Show More
@@ -475,24 +475,12 b' class rebaseruntime(object):' | |||||
475 | editopt = True |
|
475 | editopt = True | |
476 | editor = cmdutil.getcommiteditor(edit=editopt, editform=editform) |
|
476 | editor = cmdutil.getcommiteditor(edit=editopt, editform=editform) | |
477 | revtoreuse = max(self.state) |
|
477 | revtoreuse = max(self.state) | |
478 | dsguard = dirstateguard.dirstateguard(repo, 'rebase') |
|
478 | newnode = concludenode(repo, revtoreuse, p1, self.external, | |
479 | try: |
|
479 | commitmsg=commitmsg, | |
480 | newnode = concludenode(repo, revtoreuse, p1, self.external, |
|
480 | extrafn=_makeextrafn(self.extrafns), | |
481 |
|
|
481 | editor=editor, | |
482 |
|
|
482 | keepbranches=self.keepbranchesf, | |
483 |
|
|
483 | date=self.date) | |
484 | keepbranches=self.keepbranchesf, |
|
|||
485 | date=self.date) |
|
|||
486 | dsguard.close() |
|
|||
487 | release(dsguard) |
|
|||
488 | except error.InterventionRequired: |
|
|||
489 | dsguard.close() |
|
|||
490 | release(dsguard) |
|
|||
491 | raise |
|
|||
492 | except Exception: |
|
|||
493 | release(dsguard) |
|
|||
494 | raise |
|
|||
495 |
|
||||
496 | if newnode is None: |
|
484 | if newnode is None: | |
497 | newrev = self.target |
|
485 | newrev = self.target | |
498 | else: |
|
486 | else: | |
@@ -734,19 +722,11 b' def rebase(ui, repo, **opts):' | |||||
734 | return retcode |
|
722 | return retcode | |
735 |
|
723 | |||
736 | with repo.transaction('rebase') as tr: |
|
724 | with repo.transaction('rebase') as tr: | |
737 | dsguard = dirstateguard.dirstateguard(repo, 'rebase') |
|
|||
738 | try: |
|
725 | try: | |
739 | rbsrt._performrebase(tr) |
|
726 | rbsrt._performrebase(tr) | |
740 | dsguard.close() |
|
|||
741 | release(dsguard) |
|
|||
742 | except error.InterventionRequired: |
|
727 | except error.InterventionRequired: | |
743 | dsguard.close() |
|
|||
744 | release(dsguard) |
|
|||
745 | tr.close() |
|
728 | tr.close() | |
746 | raise |
|
729 | raise | |
747 | except Exception: |
|
|||
748 | release(dsguard) |
|
|||
749 | raise |
|
|||
750 | rbsrt._finishrebase() |
|
730 | rbsrt._finishrebase() | |
751 | finally: |
|
731 | finally: | |
752 | release(lock, wlock) |
|
732 | release(lock, wlock) | |
@@ -874,28 +854,33 b' def concludenode(repo, rev, p1, p2, comm' | |||||
874 | '''Commit the wd changes with parents p1 and p2. Reuse commit info from rev |
|
854 | '''Commit the wd changes with parents p1 and p2. Reuse commit info from rev | |
875 | but also store useful information in extra. |
|
855 | but also store useful information in extra. | |
876 | Return node of committed revision.''' |
|
856 | Return node of committed revision.''' | |
877 | repo.setparents(repo[p1].node(), repo[p2].node()) |
|
857 | dsguard = dirstateguard.dirstateguard(repo, 'rebase') | |
878 | ctx = repo[rev] |
|
858 | try: | |
879 | if commitmsg is None: |
|
859 | repo.setparents(repo[p1].node(), repo[p2].node()) | |
880 | commitmsg = ctx.description() |
|
860 | ctx = repo[rev] | |
881 | keepbranch = keepbranches and repo[p1].branch() != ctx.branch() |
|
861 | if commitmsg is None: | |
882 | extra = {'rebase_source': ctx.hex()} |
|
862 | commitmsg = ctx.description() | |
883 | if extrafn: |
|
863 | keepbranch = keepbranches and repo[p1].branch() != ctx.branch() | |
884 | extrafn(ctx, extra) |
|
864 | extra = {'rebase_source': ctx.hex()} | |
|
865 | if extrafn: | |||
|
866 | extrafn(ctx, extra) | |||
885 |
|
867 | |||
886 | targetphase = max(ctx.phase(), phases.draft) |
|
868 | targetphase = max(ctx.phase(), phases.draft) | |
887 | overrides = {('phases', 'new-commit'): targetphase} |
|
869 | overrides = {('phases', 'new-commit'): targetphase} | |
888 | with repo.ui.configoverride(overrides, 'rebase'): |
|
870 | with repo.ui.configoverride(overrides, 'rebase'): | |
889 | if keepbranch: |
|
871 | if keepbranch: | |
890 | repo.ui.setconfig('ui', 'allowemptycommit', True) |
|
872 | repo.ui.setconfig('ui', 'allowemptycommit', True) | |
891 | # Commit might fail if unresolved files exist |
|
873 | # Commit might fail if unresolved files exist | |
892 | if date is None: |
|
874 | if date is None: | |
893 | date = ctx.date() |
|
875 | date = ctx.date() | |
894 | newnode = repo.commit(text=commitmsg, user=ctx.user(), |
|
876 | newnode = repo.commit(text=commitmsg, user=ctx.user(), | |
895 | date=date, extra=extra, editor=editor) |
|
877 | date=date, extra=extra, editor=editor) | |
896 |
|
878 | |||
897 | repo.dirstate.setbranch(repo[newnode].branch()) |
|
879 | repo.dirstate.setbranch(repo[newnode].branch()) | |
898 | return newnode |
|
880 | dsguard.close() | |
|
881 | return newnode | |||
|
882 | finally: | |||
|
883 | release(dsguard) | |||
899 |
|
884 | |||
900 | def rebasenode(repo, rev, p1, base, state, collapse, target): |
|
885 | def rebasenode(repo, rev, p1, base, state, collapse, target): | |
901 | 'Rebase a single revision rev on top of p1 using base as merge ancestor' |
|
886 | 'Rebase a single revision rev on top of p1 using base as merge ancestor' |
@@ -572,8 +572,6 b' Interactions between collapse and keepbr' | |||||
572 | o 0: 'A' |
|
572 | o 0: 'A' | |
573 |
|
573 | |||
574 | $ hg rebase --keepbranches --collapse -s 1 -d 3 |
|
574 | $ hg rebase --keepbranches --collapse -s 1 -d 3 | |
575 | transaction abort! |
|
|||
576 | rollback completed |
|
|||
577 | abort: cannot collapse multiple named branches |
|
575 | abort: cannot collapse multiple named branches | |
578 | [255] |
|
576 | [255] | |
579 |
|
577 |
@@ -270,8 +270,6 b' G onto B - merge revision with both pare' | |||||
270 |
|
270 | |||
271 | $ hg rebase -s 6 -d 1 |
|
271 | $ hg rebase -s 6 -d 1 | |
272 | rebasing 6:eea13746799a "G" |
|
272 | rebasing 6:eea13746799a "G" | |
273 | transaction abort! |
|
|||
274 | rollback completed |
|
|||
275 | abort: cannot use revision 6 as base, result would have 3 parents |
|
273 | abort: cannot use revision 6 as base, result would have 3 parents | |
276 | [255] |
|
274 | [255] | |
277 | $ hg rebase --abort |
|
275 | $ hg rebase --abort |
General Comments 0
You need to be logged in to leave comments.
Login now