[Updated] D12191: filemerge: use leverage `util.readfile()` in `_maketempfiles()`

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Feb 16 10:31:16 UTC 2022


Closed by commit rHGf20feb496d3c: filemerge: use leverage `util.readfile()` in `_maketempfiles()` (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D12191?vs=32229&id=32248

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D12191/new/

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -944,8 +944,8 @@
     d = localpath
     if localpath is not None:
         f, d = maketempfrompath(b"local", d)
-        with open(localpath, b'rb') as src:
-            f.write(src.read())
+        data = util.readfile(localpath)
+        f.write(data)
         f.close()
 
     try:



To: martinvonz, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220216/bca5689b/attachment-0002.html>


More information about the Mercurial-patches mailing list