##// END OF EJS Templates
fastannotate: stop using the `pycompat.open()` shim
Matt Harbison -
r53271:472c30a4 default
parent child Browse files
Show More
@@ -12,9 +12,6 import contextlib
12 import os
12 import os
13
13
14 from mercurial.i18n import _
14 from mercurial.i18n import _
15 from mercurial.pycompat import (
16 open,
17 )
18 from mercurial.node import (
15 from mercurial.node import (
19 bin,
16 bin,
20 hex,
17 hex,
@@ -222,7 +219,7 class _annotatecontext:
222 def linelog(self):
219 def linelog(self):
223 if self._linelog is None:
220 if self._linelog is None:
224 if os.path.exists(self.linelogpath):
221 if os.path.exists(self.linelogpath):
225 with open(self.linelogpath, b'rb') as f:
222 with open(self.linelogpath, 'rb') as f:
226 try:
223 try:
227 self._linelog = linelogmod.linelog.fromdata(f.read())
224 self._linelog = linelogmod.linelog.fromdata(f.read())
228 except linelogmod.LineLogError:
225 except linelogmod.LineLogError:
@@ -242,7 +239,7 class _annotatecontext:
242 self._revmap.flush()
239 self._revmap.flush()
243 self._revmap = None
240 self._revmap = None
244 if self._linelog is not None:
241 if self._linelog is not None:
245 with open(self.linelogpath, b'wb') as f:
242 with open(self.linelogpath, 'wb') as f:
246 f.write(self._linelog.encode())
243 f.write(self._linelog.encode())
247 self._linelog = None
244 self._linelog = None
248
245
General Comments 0
You need to be logged in to leave comments. Login now