mercurial/revlog.py
changeset 14334 85c82ebc96a3
parent 14333 31a5973fcf96
child 14365 a8e3931e3fb5
equal deleted inserted replaced
14333:31a5973fcf96 14334:85c82ebc96a3
   232                     v |= REVLOGGENERALDELTA
   232                     v |= REVLOGGENERALDELTA
   233             else:
   233             else:
   234                 v = 0
   234                 v = 0
   235 
   235 
   236         i = ''
   236         i = ''
       
   237         self._initempty = True
   237         try:
   238         try:
   238             f = self.opener(self.indexfile)
   239             f = self.opener(self.indexfile)
   239             i = f.read()
   240             i = f.read()
   240             f.close()
   241             f.close()
   241             if len(i) > 0:
   242             if len(i) > 0:
   242                 v = struct.unpack(versionformat, i[:4])[0]
   243                 v = struct.unpack(versionformat, i[:4])[0]
       
   244                 self._initempty = False
   243         except IOError, inst:
   245         except IOError, inst:
   244             if inst.errno != errno.ENOENT:
   246             if inst.errno != errno.ENOENT:
   245                 raise
   247                 raise
   246 
   248 
   247         self.version = v
   249         self.version = v