Patchwork D12191: filemerge: use leverage `util.readfile()` in `_maketempfiles()`

login
register
mail settings
Submitter phabricator
Date Feb. 16, 2022, 4:09 a.m.
Message ID <differential-rev-PHID-DREV-6v32oojb322gcmmp3tfc-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50528/
State New
Headers show

Comments

phabricator - Feb. 16, 2022, 4:09 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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: