mercurial/bundlerepo.py
changeset 3419 b19360aa21e9
parent 2740 386f04d6ecb3
child 3579 0ed2732aa393
equal deleted inserted replaced
3418:7012c889e8f2 3419:b19360aa21e9
   231     def close(self):
   231     def close(self):
   232         """Close assigned bundle file immediately."""
   232         """Close assigned bundle file immediately."""
   233         self.bundlefile.close()
   233         self.bundlefile.close()
   234 
   234 
   235     def __del__(self):
   235     def __del__(self):
   236         if not self.bundlefile.closed:
   236         bundlefile = getattr(self, 'bundlefile', None)
   237             self.bundlefile.close()
   237         if bundlefile and not bundlefile.closed:
   238         if self.tempfile is not None:
   238             bundlefile.close()
   239             os.unlink(self.tempfile)
   239         tempfile = getattr(self, 'tempfile', None)
       
   240         if tempfile is not None:
       
   241             os.unlink(tempfile)
   240 
   242 
   241 def instance(ui, path, create):
   243 def instance(ui, path, create):
   242     if create:
   244     if create:
   243         raise util.Abort(_('cannot create new bundle repository'))
   245         raise util.Abort(_('cannot create new bundle repository'))
   244     path = util.drop_scheme('file', path)
   246     path = util.drop_scheme('file', path)