mercurial/revlog.py
changeset 47285 46b828b85eb7
parent 47284 21ed126bab53
child 47294 93a0abe098e7
equal deleted inserted replaced
47284:21ed126bab53 47285:46b828b85eb7
  2188                         header = self.index.pack_header(header)
  2188                         header = self.index.pack_header(header)
  2189                         e = header + e
  2189                         e = header + e
  2190                     fp.write(e)
  2190                     fp.write(e)
  2191                 if self._docket is not None:
  2191                 if self._docket is not None:
  2192                     self._docket.index_end = fp.tell()
  2192                     self._docket.index_end = fp.tell()
       
  2193 
       
  2194                 # There is a small transactional race here. If the rename of
       
  2195                 # the index fails, we should remove the datafile. It is more
       
  2196                 # important to ensure that the data file is not truncated
       
  2197                 # when the index is replaced as otherwise data is lost.
       
  2198                 tr.replace(self._datafile, self.start(trindex))
       
  2199 
  2193                 # the temp file replace the real index when we exit the context
  2200                 # the temp file replace the real index when we exit the context
  2194                 # manager
  2201                 # manager
  2195 
  2202 
  2196             tr.replace(self._indexfile, trindex * self.index.entry_size)
  2203             tr.replace(self._indexfile, trindex * self.index.entry_size)
  2197             nodemaputil.setup_persistent_nodemap(tr, self)
  2204             nodemaputil.setup_persistent_nodemap(tr, self)