Patchwork D682: merge: allow a custom working context to be passed to update

login
register
mail settings
Submitter phabricator
Date Sept. 11, 2017, 8:25 p.m.
Message ID <815641d22d0fd65e29bacec37ac538c2@localhost.localdomain>
Download mbox | patch
Permalink /patch/23790/
State Not Applicable
Headers show

Comments

phabricator - Sept. 11, 2017, 8:25 p.m.
phillco updated this revision to Diff 1726.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D682?vs=1725&id=1726

REVISION DETAIL
  https://phab.mercurial-scm.org/D682

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS




To: phillco, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1467,7 +1467,7 @@ 
 
 def update(repo, node, branchmerge, force, ancestor=None,
            mergeancestor=False, labels=None, matcher=None, mergeforce=False,
-           updatecheck=None):
+           updatecheck=None, wc=None):
     """
     Perform a merge between the working directory and the given node
 
@@ -1515,6 +1515,9 @@ 
     2 = abort: uncommitted changes (commit or update --clean to discard changes)
     3 = abort: uncommitted changes (checked in commands.py)
 
+    The merge is performed inside ``wc``, a workingctx-like objects. It defaults
+    to repo[None] if None is passed.
+
     Return the same tuple as applyupdates().
     """
     # Avoid cycle.
@@ -1538,7 +1541,8 @@ 
     else:
         partial = True
     with repo.wlock():
-        wc = repo[None]
+        if wc is None:
+            wc = repo[None]
         pl = wc.parents()
         p1 = pl[0]
         pas = [None]