1467 |
1467 |
1468 def rebasenode(repo, rev, p1, base, collapse, dest, wctx): |
1468 def rebasenode(repo, rev, p1, base, collapse, dest, wctx): |
1469 """Rebase a single revision rev on top of p1 using base as merge ancestor""" |
1469 """Rebase a single revision rev on top of p1 using base as merge ancestor""" |
1470 # Merge phase |
1470 # Merge phase |
1471 # Update to destination and merge it with local |
1471 # Update to destination and merge it with local |
|
1472 p1ctx = repo[p1] |
1472 if wctx.isinmemory(): |
1473 if wctx.isinmemory(): |
1473 wctx.setbase(repo[p1]) |
1474 wctx.setbase(p1ctx) |
1474 else: |
1475 else: |
1475 if repo[b'.'].rev() != p1: |
1476 if repo[b'.'].rev() != p1: |
1476 repo.ui.debug(b" update to %d:%s\n" % (p1, repo[p1])) |
1477 repo.ui.debug(b" update to %d:%s\n" % (p1, p1ctx)) |
1477 mergemod.update(repo, p1, branchmerge=False, force=True) |
1478 mergemod.update(repo, p1, branchmerge=False, force=True) |
1478 else: |
1479 else: |
1479 repo.ui.debug(b" already in destination\n") |
1480 repo.ui.debug(b" already in destination\n") |
1480 # This is, alas, necessary to invalidate workingctx's manifest cache, |
1481 # This is, alas, necessary to invalidate workingctx's manifest cache, |
1481 # as well as other data we litter on it in other places. |
1482 # as well as other data we litter on it in other places. |