hgext/largefiles/overrides.py
branchstable
changeset 15576 e387e760b207
parent 15383 155d0f8fb7e5
child 15598 a77ce45584ef
equal deleted inserted replaced
15575:4a4a95029b31 15576:e387e760b207
   617         if lfutil.isstandin(f):
   617         if lfutil.isstandin(f):
   618             path = lfutil.findfile(repo, getdata().strip())
   618             path = lfutil.findfile(repo, getdata().strip())
   619             f = lfutil.splitstandin(f)
   619             f = lfutil.splitstandin(f)
   620 
   620 
   621             def getdatafn():
   621             def getdatafn():
       
   622                 fd = None
   622                 try:
   623                 try:
   623                     fd = open(path, 'rb')
   624                     fd = open(path, 'rb')
   624                     return fd.read()
   625                     return fd.read()
   625                 finally:
   626                 finally:
   626                     fd.close()
   627                     if fd:
       
   628                         fd.close()
   627 
   629 
   628             getdata = getdatafn
   630             getdata = getdatafn
   629         write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
   631         write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
   630 
   632 
   631     if subrepos:
   633     if subrepos: