Mercurial > hg
comparison mercurial/upgrade.py @ 37444:c8666a9e9e11
upgrade: sniff for filelog type
The upgrade code should never encounter a vanilla revlog
instance: only changelog, manifestrevlog, and filelog should
be seen.
The previous code assumed !changelog & !manifestrevlog meant
file data. So this change feels pretty safe. If nothing else, it
will help tease out typing issues.
Differential Revision: https://phab.mercurial-scm.org/D3152
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 05 Apr 2018 17:40:51 -0700 |
parents | 0147a4730420 |
children | 2ce60954b1b7 |
comparison
equal
deleted
inserted
replaced
37443:65250a66b55c | 37444:c8666a9e9e11 |
---|---|
478 elif isinstance(rl, manifest.manifestrevlog): | 478 elif isinstance(rl, manifest.manifestrevlog): |
479 mcount += 1 | 479 mcount += 1 |
480 mrevcount += len(rl) | 480 mrevcount += len(rl) |
481 msrcsize += datasize | 481 msrcsize += datasize |
482 mrawsize += rawsize | 482 mrawsize += rawsize |
483 elif isinstance(rl, revlog.revlog): | 483 elif isinstance(rl, filelog.filelog): |
484 fcount += 1 | 484 fcount += 1 |
485 frevcount += len(rl) | 485 frevcount += len(rl) |
486 fsrcsize += datasize | 486 fsrcsize += datasize |
487 frawsize += rawsize | 487 frawsize += rawsize |
488 else: | |
489 error.ProgrammingError('unknown revlog type') | |
488 | 490 |
489 if not revcount: | 491 if not revcount: |
490 return | 492 return |
491 | 493 |
492 ui.write(_('migrating %d total revisions (%d in filelogs, %d in manifests, ' | 494 ui.write(_('migrating %d total revisions (%d in filelogs, %d in manifests, ' |