1479 repo.ui.debug(b" already in destination\n") |
1479 repo.ui.debug(b" already in destination\n") |
1480 # This is, alas, necessary to invalidate workingctx's manifest cache, |
1480 # This is, alas, necessary to invalidate workingctx's manifest cache, |
1481 # as well as other data we litter on it in other places. |
1481 # as well as other data we litter on it in other places. |
1482 wctx = repo[None] |
1482 wctx = repo[None] |
1483 repo.dirstate.write(repo.currenttransaction()) |
1483 repo.dirstate.write(repo.currenttransaction()) |
1484 repo.ui.debug(b" merge against %d:%s\n" % (rev, repo[rev])) |
1484 ctx = repo[rev] |
|
1485 repo.ui.debug(b" merge against %d:%s\n" % (rev, ctx)) |
1485 if base is not None: |
1486 if base is not None: |
1486 repo.ui.debug(b" detach base %d:%s\n" % (base, repo[base])) |
1487 repo.ui.debug(b" detach base %d:%s\n" % (base, repo[base])) |
1487 # When collapsing in-place, the parent is the common ancestor, we |
1488 # When collapsing in-place, the parent is the common ancestor, we |
1488 # have to allow merging with it. |
1489 # have to allow merging with it. |
1489 stats = mergemod.update( |
1490 stats = mergemod.update( |
1494 ancestor=base, |
1495 ancestor=base, |
1495 mergeancestor=collapse, |
1496 mergeancestor=collapse, |
1496 labels=[b'dest', b'source'], |
1497 labels=[b'dest', b'source'], |
1497 wc=wctx, |
1498 wc=wctx, |
1498 ) |
1499 ) |
|
1500 destctx = repo[dest] |
1499 if collapse: |
1501 if collapse: |
1500 copies.duplicatecopies(repo, wctx, rev, dest) |
1502 copies.graftcopies(repo, wctx, ctx, destctx) |
1501 else: |
1503 else: |
1502 # If we're not using --collapse, we need to |
1504 # If we're not using --collapse, we need to |
1503 # duplicate copies between the revision we're |
1505 # duplicate copies between the revision we're |
1504 # rebasing and its first parent, but *not* |
1506 # rebasing and its first parent, but *not* |
1505 # duplicate any copies that have already been |
1507 # duplicate any copies that have already been |
1506 # performed in the destination. |
1508 # performed in the destination. |
1507 p1rev = repo[rev].p1().rev() |
1509 copies.graftcopies(repo, wctx, ctx, ctx.p1(), skip=destctx) |
1508 copies.duplicatecopies(repo, wctx, rev, p1rev, skiprev=dest) |
|
1509 return stats |
1510 return stats |
1510 |
1511 |
1511 |
1512 |
1512 def adjustdest(repo, rev, destmap, state, skipped): |
1513 def adjustdest(repo, rev, destmap, state, skipped): |
1513 r"""adjust rebase destination given the current rebase state |
1514 r"""adjust rebase destination given the current rebase state |