##// END OF EJS Templates
rebase: do not update if IMM; instead, set the overlaywctx's parents...
Phil Cohen -
r35318:5c25fe7f default
parent child Browse files
Show More
@@ -507,7 +507,10 b' class rebaseruntime(object):'
507 mergemod.mergestate.clean(repo)
507 mergemod.mergestate.clean(repo)
508 else:
508 else:
509 # Skip commit if we are collapsing
509 # Skip commit if we are collapsing
510 repo.setparents(repo[p1].node())
510 if self.wctx.isinmemory():
511 self.wctx.setbase(repo[p1])
512 else:
513 repo.setparents(repo[p1].node())
511 newnode = None
514 newnode = None
512 # Update the state
515 # Update the state
513 if newnode is not None:
516 if newnode is not None:
@@ -570,7 +573,8 b' class rebaseruntime(object):'
570 if newwd < 0:
573 if newwd < 0:
571 # original directory is a parent of rebase set root or ignored
574 # original directory is a parent of rebase set root or ignored
572 newwd = self.originalwd
575 newwd = self.originalwd
573 if newwd not in [c.rev() for c in repo[None].parents()]:
576 if (newwd not in [c.rev() for c in repo[None].parents()] and
577 not self.inmemory):
574 ui.note(_("update back to initial working directory parent\n"))
578 ui.note(_("update back to initial working directory parent\n"))
575 hg.updaterepo(repo, newwd, False)
579 hg.updaterepo(repo, newwd, False)
576
580
@@ -996,18 +1000,22 b' def rebasenode(repo, rev, p1, base, stat'
996 'Rebase a single revision rev on top of p1 using base as merge ancestor'
1000 'Rebase a single revision rev on top of p1 using base as merge ancestor'
997 # Merge phase
1001 # Merge phase
998 # Update to destination and merge it with local
1002 # Update to destination and merge it with local
999 if repo['.'].rev() != p1:
1003 if wctx.isinmemory():
1000 repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1]))
1004 wctx.setbase(repo[p1])
1001 mergemod.update(repo, p1, False, True)
1002 else:
1005 else:
1003 repo.ui.debug(" already in destination\n")
1006 # This is necessary to invalidate workingctx's caches.
1004 repo.dirstate.write(repo.currenttransaction())
1007 wctx = repo[None]
1008 if repo['.'].rev() != p1:
1009 repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1]))
1010 mergemod.update(repo, p1, False, True)
1011 else:
1012 repo.ui.debug(" already in destination\n")
1013 repo.dirstate.write(repo.currenttransaction())
1005 repo.ui.debug(" merge against %d:%s\n" % (rev, repo[rev]))
1014 repo.ui.debug(" merge against %d:%s\n" % (rev, repo[rev]))
1006 if base is not None:
1015 if base is not None:
1007 repo.ui.debug(" detach base %d:%s\n" % (base, repo[base]))
1016 repo.ui.debug(" detach base %d:%s\n" % (base, repo[base]))
1008 # When collapsing in-place, the parent is the common ancestor, we
1017 # When collapsing in-place, the parent is the common ancestor, we
1009 # have to allow merging with it.
1018 # have to allow merging with it.
1010 wctx = repo[None]
1011 stats = mergemod.update(repo, rev, True, True, base, collapse,
1019 stats = mergemod.update(repo, rev, True, True, base, collapse,
1012 labels=['dest', 'source'])
1020 labels=['dest', 'source'])
1013 if collapse:
1021 if collapse:
General Comments 0
You need to be logged in to leave comments. Login now