Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 43025:3518da504303
vfs: give all vfs an options attribute by default
Multiple code path assume vfs have an options attribute, including the vfs module
itself. So for consistency we explicitly add one to all vfs.
This will prevent various crash in the next changesets.
Differential Revision: https://phab.mercurial-scm.org/D6935
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 27 Sep 2019 05:17:30 +0200 |
parents | 188476e48f51 |
children | 827cb4fe62a3 |
comparison
equal
deleted
inserted
replaced
43024:188476e48f51 | 43025:3518da504303 |
---|---|
353 | 353 |
354 self._loadindex() | 354 self._loadindex() |
355 | 355 |
356 def _loadindex(self): | 356 def _loadindex(self): |
357 mmapindexthreshold = None | 357 mmapindexthreshold = None |
358 opts = getattr(self.opener, 'options', {}) or {} | 358 opts = self.opener.options |
359 | 359 |
360 if 'revlogv2' in opts: | 360 if 'revlogv2' in opts: |
361 newversionflags = REVLOGV2 | FLAG_INLINE_DATA | 361 newversionflags = REVLOGV2 | FLAG_INLINE_DATA |
362 elif 'revlogv1' in opts: | 362 elif 'revlogv1' in opts: |
363 newversionflags = REVLOGV1 | FLAG_INLINE_DATA | 363 newversionflags = REVLOGV1 | FLAG_INLINE_DATA |
364 if 'generaldelta' in opts: | 364 if 'generaldelta' in opts: |
365 newversionflags |= FLAG_GENERALDELTA | 365 newversionflags |= FLAG_GENERALDELTA |
366 elif 'revlogv0' in getattr(self.opener, 'options', {}): | 366 elif 'revlogv0' in self.opener.options: |
367 newversionflags = REVLOGV0 | 367 newversionflags = REVLOGV0 |
368 else: | 368 else: |
369 newversionflags = REVLOG_DEFAULT_VERSION | 369 newversionflags = REVLOG_DEFAULT_VERSION |
370 | 370 |
371 if 'chunkcachesize' in opts: | 371 if 'chunkcachesize' in opts: |