mercurial/sshserver.py
changeset 6678 1eba8e8f2cce
parent 6211 f89fd07fc51d
child 6782 b9d6ab187523
equal deleted inserted replaced
6669:782dbbdfb1d7 6678:1eba8e8f2cce
   165             return
   165             return
   166 
   166 
   167         self.respond('')
   167         self.respond('')
   168 
   168 
   169         # write bundle data to temporary file because it can be big
   169         # write bundle data to temporary file because it can be big
   170 
   170         tempname = fp = None
   171         try:
   171         try:
   172             fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-')
   172             fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-')
   173             fp = os.fdopen(fd, 'wb+')
   173             fp = os.fdopen(fd, 'wb+')
   174 
   174 
   175             count = int(self.fin.readline())
   175             count = int(self.fin.readline())
   196             finally:
   196             finally:
   197                 if not was_locked:
   197                 if not was_locked:
   198                     self.lock.release()
   198                     self.lock.release()
   199                     self.lock = None
   199                     self.lock = None
   200         finally:
   200         finally:
   201             fp.close()
   201             if fp is not None:
   202             os.unlink(tempname)
   202                 fp.close()
       
   203             if tempname is not None:
       
   204                 os.unlink(tempname)
   203 
   205 
   204     def do_stream_out(self):
   206     def do_stream_out(self):
   205         streamclone.stream_out(self.repo, self.fout)
   207         streamclone.stream_out(self.repo, self.fout)