Patchwork [3,of,6] merge: convert repo.wwrite() calls to wctx[f].write()

login
register
mail settings
Submitter Phillip Cohen
Date June 26, 2017, 5:36 a.m.
Message ID <5de156099f329b1296e8.1498455363@phillco-mbp.dhcp.thefacebook.com>
Download mbox | patch
Permalink /patch/21721/
State Accepted
Headers show

Comments

Phillip Cohen - June 26, 2017, 5:36 a.m.
# HG changeset patch
# User Phil Cohen <phillco@fb.com>
# Date 1498435215 25200
#      Sun Jun 25 17:00:15 2017 -0700
# Node ID 5de156099f329b1296e8cbddd48278d2eab5159e
# Parent  27b3d6c945ab47745d89b21e5b4f1bc66f53c4a1
merge: convert repo.wwrite() calls to wctx[f].write()

As with the previous patch in this series, workingfilectx.write() is a direct
call to repo.wwrite(), so this change should be a no-op.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -492,7 +492,7 @@ 
             # restore local
             if hash != nullhex:
                 f = self._repo.vfs('merge/' + hash)
-                self._repo.wwrite(dfile, f.read(), flags)
+                wctx[dfile].write(f.read(), flags)
                 f.close()
             else:
                 wctx[dfile].remove(ignoremissing=True)
@@ -1270,7 +1270,7 @@ 
         f0, flags = args
         repo.ui.note(_("moving %s to %s\n") % (f0, f))
         audit(f)
-        repo.wwrite(f, wctx.filectx(f0).data(), flags)
+        wctx[f].write(wctx.filectx(f0).data(), flags)
         wctx[f0].remove()
         updated += 1
 
@@ -1281,7 +1281,7 @@ 
         progress(_updating, z, item=f, total=numupdates, unit=_files)
         f0, flags = args
         repo.ui.note(_("getting %s to %s\n") % (f0, f))
-        repo.wwrite(f, mctx.filectx(f0).data(), flags)
+        wctx[f].write(mctx.filectx(f0).data(), flags)
         updated += 1
 
     # exec