Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 34309:440ece43024c
merge: allow a custom working context to be passed to update
This will allow anyone to enable the first in-menmory merge milestone
by wrapping merge.update in an extension and creating an overlayworkingctx.
Differential Revision: https://phab.mercurial-scm.org/D682
author | Phil Cohen <phillco@fb.com> |
---|---|
date | Thu, 14 Sep 2017 13:14:32 -0700 |
parents | 24bf823377fc |
children | 1a5abc45e2fa |
comparison
equal
deleted
inserted
replaced
34308:3704d3f21136 | 34309:440ece43024c |
---|---|
1477 else: | 1477 else: |
1478 repo.dirstate.normal(f) | 1478 repo.dirstate.normal(f) |
1479 | 1479 |
1480 def update(repo, node, branchmerge, force, ancestor=None, | 1480 def update(repo, node, branchmerge, force, ancestor=None, |
1481 mergeancestor=False, labels=None, matcher=None, mergeforce=False, | 1481 mergeancestor=False, labels=None, matcher=None, mergeforce=False, |
1482 updatecheck=None): | 1482 updatecheck=None, wc=None): |
1483 """ | 1483 """ |
1484 Perform a merge between the working directory and the given node | 1484 Perform a merge between the working directory and the given node |
1485 | 1485 |
1486 node = the node to update to | 1486 node = the node to update to |
1487 branchmerge = whether to merge between branches | 1487 branchmerge = whether to merge between branches |
1524 x = can't happen | 1524 x = can't happen |
1525 * = don't-care | 1525 * = don't-care |
1526 1 = incompatible options (checked in commands.py) | 1526 1 = incompatible options (checked in commands.py) |
1527 2 = abort: uncommitted changes (commit or update --clean to discard changes) | 1527 2 = abort: uncommitted changes (commit or update --clean to discard changes) |
1528 3 = abort: uncommitted changes (checked in commands.py) | 1528 3 = abort: uncommitted changes (checked in commands.py) |
1529 | |
1530 The merge is performed inside ``wc``, a workingctx-like objects. It defaults | |
1531 to repo[None] if None is passed. | |
1529 | 1532 |
1530 Return the same tuple as applyupdates(). | 1533 Return the same tuple as applyupdates(). |
1531 """ | 1534 """ |
1532 # Avoid cycle. | 1535 # Avoid cycle. |
1533 from . import sparse | 1536 from . import sparse |
1548 if matcher is None or matcher.always(): | 1551 if matcher is None or matcher.always(): |
1549 partial = False | 1552 partial = False |
1550 else: | 1553 else: |
1551 partial = True | 1554 partial = True |
1552 with repo.wlock(): | 1555 with repo.wlock(): |
1553 wc = repo[None] | 1556 if wc is None: |
1557 wc = repo[None] | |
1554 pl = wc.parents() | 1558 pl = wc.parents() |
1555 p1 = pl[0] | 1559 p1 = pl[0] |
1556 pas = [None] | 1560 pas = [None] |
1557 if ancestor is not None: | 1561 if ancestor is not None: |
1558 pas = [repo[ancestor]] | 1562 pas = [repo[ancestor]] |