Mercurial > hg
comparison hgext/rebase.py @ 44095:e733c59f3c09
rebase: fix bug where `--collapse` would apply diff on missing file
Even though the file was missing, the rebase would succeed.
Differential Revision: https://phab.mercurial-scm.org/D7897
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 13 Jan 2020 11:18:29 -0800 |
parents | 521b4e3a42d7 |
children | 4263aaab651d |
comparison
equal
deleted
inserted
replaced
44094:521b4e3a42d7 | 44095:e733c59f3c09 |
---|---|
1484 repo.dirstate.write(repo.currenttransaction()) | 1484 repo.dirstate.write(repo.currenttransaction()) |
1485 ctx = repo[rev] | 1485 ctx = repo[rev] |
1486 repo.ui.debug(b" merge against %d:%s\n" % (rev, ctx)) | 1486 repo.ui.debug(b" merge against %d:%s\n" % (rev, ctx)) |
1487 if base is not None: | 1487 if base is not None: |
1488 repo.ui.debug(b" detach base %d:%s\n" % (base, repo[base])) | 1488 repo.ui.debug(b" detach base %d:%s\n" % (base, repo[base])) |
1489 # When collapsing in-place, the parent is the common ancestor, we | 1489 |
1490 # have to allow merging with it. | 1490 # See explanation in merge.graft() |
1491 mergeancestor = repo.changelog.isancestor(p1ctx.node(), ctx.node()) | |
1491 stats = mergemod.update( | 1492 stats = mergemod.update( |
1492 repo, | 1493 repo, |
1493 rev, | 1494 rev, |
1494 branchmerge=True, | 1495 branchmerge=True, |
1495 force=True, | 1496 force=True, |
1496 ancestor=base, | 1497 ancestor=base, |
1497 mergeancestor=collapse, | 1498 mergeancestor=mergeancestor, |
1498 labels=[b'dest', b'source'], | 1499 labels=[b'dest', b'source'], |
1499 wc=wctx, | 1500 wc=wctx, |
1500 ) | 1501 ) |
1501 if collapse: | 1502 if collapse: |
1502 copies.graftcopies(wctx, ctx, repo[dest]) | 1503 copies.graftcopies(wctx, ctx, repo[dest]) |