comparison hgext/gpg.py @ 13400:14f3795a5ed7

explicitly close files Add missing calls to close() to many places where files are opened. Relying on reference counting to catch them soon-ish is not portable and fails in environments with a proper GC, such as PyPy.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Fri, 24 Dec 2010 15:23:01 +0100
parents 0d4fb319974b
children 135e244776f0
comparison
equal deleted inserted replaced
13399:eff102facb15 13400:14f3795a5ed7
242 if util.any(s) and not opts["force"]: 242 if util.any(s) and not opts["force"]:
243 raise util.Abort(_("working copy of .hgsigs is changed " 243 raise util.Abort(_("working copy of .hgsigs is changed "
244 "(please commit .hgsigs manually " 244 "(please commit .hgsigs manually "
245 "or use --force)")) 245 "or use --force)"))
246 246
247 repo.wfile(".hgsigs", "ab").write(sigmessage) 247 sigsfile = repo.wfile(".hgsigs", "ab")
248 sigsfile.write(sigmessage)
249 sigsfile.close()
248 250
249 if '.hgsigs' not in repo.dirstate: 251 if '.hgsigs' not in repo.dirstate:
250 repo[None].add([".hgsigs"]) 252 repo[None].add([".hgsigs"])
251 253
252 if opts["no_commit"]: 254 if opts["no_commit"]: