Patchwork D9532: transaction: windows workaround for missing line iteration support

login
register
mail settings
Submitter phabricator
Date Dec. 7, 2020, 10:24 a.m.
Message ID <differential-rev-PHID-DREV-ti4ky4pkdynbkyew3jhf-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47816/
State Superseded
Headers show

Comments

phabricator - Dec. 7, 2020, 10:24 a.m.
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The mixedfilemodewrapper doesn't support line iteration, so just read
  the whole file in one go.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/transaction.py

CHANGE DETAILS




To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -418,7 +418,7 @@ 
     def readjournal(self):
         self._file.seek(0)
         entries = []
-        for l in self._file:
+        for l in self._file.readlines():
             file, troffset = l.split(b'\0')
             entries.append((file, int(troffset)))
         return entries