diff mercurial/merge.py @ 14168:135e244776f0

prevent transient leaks of file handle by using new helper functions These leaks may occur in environments that don't employ a reference counting GC, i.e. PyPy. This implies: - changing opener(...).read() calls to opener.read(...) - changing opener(...).write() calls to opener.write(...) - changing open(...).read(...) to util.readfile(...) - changing open(...).write(...) to util.writefile(...)
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Mon, 02 May 2011 10:11:18 +0200
parents e4bfb9c337f3
children 21b8ce4d3331
line wrap: on
line diff
--- a/mercurial/merge.py	Mon May 02 10:11:05 2011 +0200
+++ b/mercurial/merge.py	Mon May 02 10:11:18 2011 +0200
@@ -47,7 +47,7 @@
             self._dirty = False
     def add(self, fcl, fco, fca, fd, flags):
         hash = util.sha1(fcl.path()).hexdigest()
-        self._repo.opener("merge/" + hash, "w").write(fcl.data())
+        self._repo.opener.write("merge/" + hash, fcl.data())
         self._state[fd] = ['u', hash, fcl.path(), fca.path(),
                            hex(fca.filenode()), fco.path(), flags]
         self._dirty = True