##// END OF EJS Templates
rebase: use dirstateguard instead of dirstate.invalidate...
FUJIWARA Katsunori -
r24998:c8a97fa7 default
parent child Browse files
Show More
@@ -530,10 +530,9 def concludenode(repo, rev, p1, p2, comm
530 '''Commit the wd changes with parents p1 and p2. Reuse commit info from rev
530 '''Commit the wd changes with parents p1 and p2. Reuse commit info from rev
531 but also store useful information in extra.
531 but also store useful information in extra.
532 Return node of committed revision.'''
532 Return node of committed revision.'''
533 dsguard = cmdutil.dirstateguard(repo, 'rebase')
533 try:
534 try:
534 repo.dirstate.beginparentchange()
535 repo.setparents(repo[p1].node(), repo[p2].node())
535 repo.setparents(repo[p1].node(), repo[p2].node())
536 repo.dirstate.endparentchange()
537 ctx = repo[rev]
536 ctx = repo[rev]
538 if commitmsg is None:
537 if commitmsg is None:
539 commitmsg = ctx.description()
538 commitmsg = ctx.description()
@@ -552,11 +551,10 def concludenode(repo, rev, p1, p2, comm
552 repo.ui.restoreconfig(backup)
551 repo.ui.restoreconfig(backup)
553
552
554 repo.dirstate.setbranch(repo[newnode].branch())
553 repo.dirstate.setbranch(repo[newnode].branch())
554 dsguard.close()
555 return newnode
555 return newnode
556 except util.Abort:
556 finally:
557 # Invalidate the previous setparents
557 release(dsguard)
558 repo.dirstate.invalidate()
559 raise
560
558
561 def rebasenode(repo, rev, p1, base, state, collapse, target):
559 def rebasenode(repo, rev, p1, base, state, collapse, target):
562 'Rebase a single revision rev on top of p1 using base as merge ancestor'
560 'Rebase a single revision rev on top of p1 using base as merge ancestor'
@@ -1017,7 +1017,7 that time)
1017
1017
1018 $ hg -R no-largefiles -q pull --rebase
1018 $ hg -R no-largefiles -q pull --rebase
1019 Invoking status precommit hook
1019 Invoking status precommit hook
1020 ? normal3
1020 M normal3
1021
1021
1022 (test reverting)
1022 (test reverting)
1023
1023
General Comments 0
You need to be logged in to leave comments. Login now