Patchwork [06,of,13] largefiles: don't close the fd passed to store._getfile

login
register
mail settings
Submitter Mads Kiilerich
Date April 16, 2013, 2:43 a.m.
Message ID <1de0e7b65b58a91e7b78.1366080203@mk-desktop>
Download mbox | patch
Permalink /patch/1335/
State Accepted
Commit ad993cb7bbb111d3aaeb213a4e2d9d845c72fd8c
Headers show

Comments

Mads Kiilerich - April 16, 2013, 2:43 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1366062424 -7200
#      Mon Apr 15 23:47:04 2013 +0200
# Node ID 1de0e7b65b58a91e7b78474f5aacb8bfef0e66df
# Parent  ac3a22732f6b00c7301836016110b73c0383709e
largefiles: don't close the fd passed to store._getfile

Patch

diff --git a/hgext/largefiles/basestore.py b/hgext/largefiles/basestore.py
--- a/hgext/largefiles/basestore.py
+++ b/hgext/largefiles/basestore.py
@@ -77,7 +77,7 @@ 
             except StoreError, err:
                 ui.warn(err.longmessage())
                 hhash = ""
-            tmpfile.close() # has probably already been closed!
+            tmpfile.close()
 
             if hhash != hash:
                 if hhash != "":
diff --git a/hgext/largefiles/localstore.py b/hgext/largefiles/localstore.py
--- a/hgext/largefiles/localstore.py
+++ b/hgext/largefiles/localstore.py
@@ -45,7 +45,6 @@ 
             return lfutil.copyandhash(fd, tmpfile)
         finally:
             fd.close()
-            tmpfile.close()
 
     def _verifyfile(self, cctx, cset, contents, standin, verified):
         filename = lfutil.splitstandin(standin)
diff --git a/hgext/largefiles/remotestore.py b/hgext/largefiles/remotestore.py
--- a/hgext/largefiles/remotestore.py
+++ b/hgext/largefiles/remotestore.py
@@ -79,7 +79,6 @@ 
                                       tmpfile)
         finally:
             infile.close()
-            tmpfile.close()
 
     def _verifyfile(self, cctx, cset, contents, standin, verified):
         filename = lfutil.splitstandin(standin)