hgext/journal.py
changeset 33923 e6d421566906
parent 33499 0407a51b9d8c
child 35000 135edf120d76
equal deleted inserted replaced
33922:1a6707b43d05 33923:e6d421566906
   340 
   340 
   341     def _write(self, vfs, entry):
   341     def _write(self, vfs, entry):
   342         with self.jlock(vfs):
   342         with self.jlock(vfs):
   343             version = None
   343             version = None
   344             # open file in amend mode to ensure it is created if missing
   344             # open file in amend mode to ensure it is created if missing
   345             with vfs('namejournal', mode='a+b', atomictemp=True) as f:
   345             with vfs('namejournal', mode='a+b') as f:
   346                 f.seek(0, os.SEEK_SET)
   346                 f.seek(0, os.SEEK_SET)
   347                 # Read just enough bytes to get a version number (up to 2
   347                 # Read just enough bytes to get a version number (up to 2
   348                 # digits plus separator)
   348                 # digits plus separator)
   349                 version = f.read(3).partition('\0')[0]
   349                 version = f.read(3).partition('\0')[0]
   350                 if version and version != str(storageversion):
   350                 if version and version != str(storageversion):