diff --git a/mercurial/filelog.py b/mercurial/filelog.py --- a/mercurial/filelog.py +++ b/mercurial/filelog.py @@ -73,7 +73,7 @@ def iscensored(self, rev): return self._revlog.iscensored(rev) - # Used by repo upgrade. + # Unused. def rawsize(self, rev): return self._revlog.rawsize(rev) @@ -203,7 +203,7 @@ def indexfile(self, value): self._revlog.indexfile = value - # Used by repo upgrade. + # Unused. @property def opener(self): return self._revlog.opener diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py --- a/mercurial/upgrade.py +++ b/mercurial/upgrade.py @@ -483,15 +483,13 @@ continue rl = _revlogfrompath(srcrepo, unencoded) - revcount += len(rl) - datasize = 0 - rawsize = 0 + info = rl.storageinfo(exclusivefiles=True, revisionscount=True, + trackedsize=True, storedsize=True) - for path in rl.files(): - datasize += rl.opener.stat(path).st_size - - rawsize += sum(map(rl.rawsize, iter(rl))) + revcount += info['revisionscount'] or 0 + datasize = info['storedsize'] or 0 + rawsize = info['trackedsize'] or 0 srcsize += datasize srcrawsize += rawsize @@ -581,9 +579,8 @@ deltareuse=deltareuse, deltabothparents=deltabothparents) - datasize = 0 - for path in newrl.files(): - datasize += newrl.opener.stat(path).st_size + info = newrl.storageinfo(storedsize=True) + datasize = info['storedsize'] or 0 dstsize += datasize