Patchwork D499: merge: pass wctx to premerge, filemerge

login
register
mail settings
Submitter phabricator
Date Aug. 23, 2017, 9:28 p.m.
Message ID <bfd1bb05b39d5cdf62cf67f8a7c3e711@localhost.localdomain>
Download mbox | patch
Permalink /patch/23283/
State Not Applicable
Headers show

Comments

phabricator - Aug. 23, 2017, 9:28 p.m.
phillco updated this revision to Diff 1233.
phillco retitled this revision from "filemerge: add wctx to all internal tools" to "merge: pass wctx to premerge, filemerge".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D499?vs=1232&id=1233

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

AFFECTED FILES
  hgext/largefiles/overrides.py
  mercurial/filemerge.py
  mercurial/merge.py
  tests/failfilemerge.py

CHANGE DETAILS




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

Patch

diff --git a/tests/failfilemerge.py b/tests/failfilemerge.py
--- a/tests/failfilemerge.py
+++ b/tests/failfilemerge.py
@@ -9,7 +9,8 @@ 
 )
 
 def failfilemerge(filemergefn,
-                  premerge, repo, mynode, orig, fcd, fco, fca, labels=None):
+                  premerge, repo, wctx, mynode, orig, fcd, fco, fca,
+                  labels=None):
     raise error.Abort("^C")
     return filemergefn(premerge, repo, mynode, orig, fcd, fco, fca, labels)
 
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -495,12 +495,14 @@ 
                 f.close()
             else:
                 wctx[dfile].remove(ignoremissing=True)
-            complete, r, deleted = filemerge.premerge(self._repo, self._local,
-                                                      lfile, fcd, fco, fca,
+            complete, r, deleted = filemerge.premerge(self._repo, wctx,
+                                                      self._local, lfile, fcd,
+                                                      fco, fca,
                                                       labels=self._labels)
         else:
-            complete, r, deleted = filemerge.filemerge(self._repo, self._local,
-                                                       lfile, fcd, fco, fca,
+            complete, r, deleted = filemerge.filemerge(self._repo, wctx,
+                                                       self._local, lfile, fcd,
+                                                       fco, fca,
                                                        labels=self._labels)
         if r is None:
             # no real conflict
diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -586,7 +586,7 @@ 
         "o": " [%s]" % labels[1],
     }
 
-def _filemerge(premerge, repo, mynode, orig, fcd, fco, fca, labels=None):
+def _filemerge(premerge, repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
     """perform a 3-way merge in the working directory
 
     premerge = whether this is a premerge
@@ -728,11 +728,12 @@ 
 
     return r
 
-def premerge(repo, mynode, orig, fcd, fco, fca, labels=None):
+def premerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
     return _filemerge(True, repo, mynode, orig, fcd, fco, fca, labels=labels)
 
-def filemerge(repo, mynode, orig, fcd, fco, fca, labels=None):
-    return _filemerge(False, repo, mynode, orig, fcd, fco, fca, labels=labels)
+def filemerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
+    return _filemerge(False, repo, wctx, mynode, orig, fcd, fco, fca,
+                      labels=labels)
 
 def loadinternalmerge(ui, extname, registrarobj):
     """Load internal merge tool from specified registrarobj
diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -545,10 +545,10 @@ 
 
 # Override filemerge to prompt the user about how they wish to merge
 # largefiles. This will handle identical edits without prompting the user.
-def overridefilemerge(origfn, premerge, repo, mynode, orig, fcd, fco, fca,
+def overridefilemerge(origfn, premerge, repo, wctx, mynode, orig, fcd, fco, fca,
                       labels=None):
     if not lfutil.isstandin(orig) or fcd.isabsent() or fco.isabsent():
-        return origfn(premerge, repo, mynode, orig, fcd, fco, fca,
+        return origfn(premerge, repo, wctx, mynode, orig, fcd, fco, fca,
                       labels=labels)
 
     ahash = lfutil.readasstandin(fca).lower()