Show More
@@ -388,13 +388,13 b' class revlog(object):' | |||||
388 |
|
388 | |||
389 | if 'revlogv2' in opts: |
|
389 | if 'revlogv2' in opts: | |
390 | # version 2 revlogs always use generaldelta. |
|
390 | # version 2 revlogs always use generaldelta. | |
391 | v = REVLOGV2 | FLAG_GENERALDELTA | FLAG_INLINE_DATA |
|
391 | versionflags = REVLOGV2 | FLAG_GENERALDELTA | FLAG_INLINE_DATA | |
392 | elif 'revlogv1' in opts: |
|
392 | elif 'revlogv1' in opts: | |
393 | v = REVLOGV1 | FLAG_INLINE_DATA |
|
393 | versionflags = REVLOGV1 | FLAG_INLINE_DATA | |
394 | if 'generaldelta' in opts: |
|
394 | if 'generaldelta' in opts: | |
395 | v |= FLAG_GENERALDELTA |
|
395 | versionflags |= FLAG_GENERALDELTA | |
396 | else: |
|
396 | else: | |
397 | v = REVLOG_DEFAULT_VERSION |
|
397 | versionflags = REVLOG_DEFAULT_VERSION | |
398 |
|
398 | |||
399 | if 'chunkcachesize' in opts: |
|
399 | if 'chunkcachesize' in opts: | |
400 | self._chunkcachesize = opts['chunkcachesize'] |
|
400 | self._chunkcachesize = opts['chunkcachesize'] | |
@@ -431,9 +431,9 b' class revlog(object):' | |||||
431 | raise error.RevlogError(_('revlog chunk cache size %r is not a ' |
|
431 | raise error.RevlogError(_('revlog chunk cache size %r is not a ' | |
432 | 'power of 2') % self._chunkcachesize) |
|
432 | 'power of 2') % self._chunkcachesize) | |
433 |
|
433 | |||
434 | self._loadindex(v, mmapindexthreshold) |
|
434 | self._loadindex(versionflags, mmapindexthreshold) | |
435 |
|
435 | |||
436 | def _loadindex(self, v, mmapindexthreshold): |
|
436 | def _loadindex(self, versionflags, mmapindexthreshold): | |
437 | indexdata = '' |
|
437 | indexdata = '' | |
438 | self._initempty = True |
|
438 | self._initempty = True | |
439 | try: |
|
439 | try: | |
@@ -444,17 +444,17 b' class revlog(object):' | |||||
444 | else: |
|
444 | else: | |
445 | indexdata = f.read() |
|
445 | indexdata = f.read() | |
446 | if len(indexdata) > 0: |
|
446 | if len(indexdata) > 0: | |
447 | v = versionformat_unpack(indexdata[:4])[0] |
|
447 | versionflags = versionformat_unpack(indexdata[:4])[0] | |
448 | self._initempty = False |
|
448 | self._initempty = False | |
449 | except IOError as inst: |
|
449 | except IOError as inst: | |
450 | if inst.errno != errno.ENOENT: |
|
450 | if inst.errno != errno.ENOENT: | |
451 | raise |
|
451 | raise | |
452 |
|
452 | |||
453 | self.version = v |
|
453 | self.version = versionflags | |
454 | self._inline = v & FLAG_INLINE_DATA |
|
454 | self._inline = versionflags & FLAG_INLINE_DATA | |
455 | self._generaldelta = v & FLAG_GENERALDELTA |
|
455 | self._generaldelta = versionflags & FLAG_GENERALDELTA | |
456 | flags = v & ~0xFFFF |
|
456 | flags = versionflags & ~0xFFFF | |
457 | fmt = v & 0xFFFF |
|
457 | fmt = versionflags & 0xFFFF | |
458 | if fmt == REVLOGV0: |
|
458 | if fmt == REVLOGV0: | |
459 | if flags: |
|
459 | if flags: | |
460 | raise error.RevlogError(_('unknown flags (%#04x) in version %d ' |
|
460 | raise error.RevlogError(_('unknown flags (%#04x) in version %d ' |
General Comments 0
You need to be logged in to leave comments.
Login now