# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1304323878 -7200 # Node ID 9bed13113742c7d792884cbd0757c8cfe4b93fcf # Parent e1bf64aaef4f7a8546c87bd72a16dda1fe264498 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(...) [ original upstream description ] diff -r e1bf64aaef4f -r 9bed13113742 hgkw/keyword.py --- a/hgkw/keyword.py Mon May 02 19:20:29 2011 +0200 +++ b/hgkw/keyword.py Mon May 02 10:11:18 2011 +0200 @@ -413,7 +413,7 @@ demoitems('keywordset', ui.configitems('keywordset')) demoitems('keywordmaps', kwmaps.iteritems()) keywords = '$' + '$\n$'.join(sorted(kwmaps.keys())) + '$\n' - repo.wopener(fn, 'w').write(keywords) + repo.wopener.write(fn, keywords) repo[None].add([fn]) ui.note(_('\nkeywords written to %s:\n') % fn) ui.note(keywords)