--- a/hgext/largefiles/basestore.py Sat Oct 08 00:59:40 2016 +0200
+++ b/hgext/largefiles/basestore.py Sat Oct 08 00:59:41 2016 +0200
@@ -91,15 +91,13 @@
storefilename = lfutil.storepath(self.repo, hash)
tmpname = storefilename + '.tmp'
- tmpfile = util.atomictempfile(tmpname,
- createmode=self.repo.store.createmode)
-
- try:
- gothash = self._getfile(tmpfile, filename, hash)
- except StoreError as err:
- self.ui.warn(err.longmessage())
- gothash = ""
- tmpfile.close()
+ with util.atomictempfile(tmpname,
+ createmode=self.repo.store.createmode) as tmpfile:
+ try:
+ gothash = self._getfile(tmpfile, filename, hash)
+ except StoreError as err:
+ self.ui.warn(err.longmessage())
+ gothash = ""
if gothash != hash:
if gothash != "":