Commit 8664231b authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

py3: fix progress() functions to not use "%s" with int

Python3 doesn't support "%s" with int arguments (and not with None
arguments either, which this code was also using).
parent 75307f276a79
......@@ -112,5 +112,6 @@
cl = repo.unfiltered().changelog
total = len(data)
def progress(pos, rev):
def progress(pos, rev=None):
revstr = '' if rev is None else ('rev %d' % rev)
compat.progress(repo.ui, 'updating depth cache',
......@@ -116,8 +117,8 @@
compat.progress(repo.ui, 'updating depth cache',
pos, 'rev %s' % rev, unit='revision', total=total)
progress(0, '')
pos, revstr, unit='revision', total=total)
progress(0)
for idx, rev in enumerate(data, 1):
assert rev == len(self._data), (rev, len(self._data))
self._data.append(self._depth(cl, rev))
if not (idx % 10000): # progress as a too high performance impact
progress(idx, rev)
......@@ -119,9 +120,9 @@
for idx, rev in enumerate(data, 1):
assert rev == len(self._data), (rev, len(self._data))
self._data.append(self._depth(cl, rev))
if not (idx % 10000): # progress as a too high performance impact
progress(idx, rev)
progress(None, '')
progress(None)
def _depth(self, changelog, rev):
cl = changelog
......
......@@ -74,5 +74,6 @@
cl = repo.unfiltered().changelog
total = len(data)
def progress(pos, rev):
def progress(pos, rev=None):
revstr = '' if rev is None else ('rev %d' % rev)
compat.progress(repo.ui, 'updating firstmerge cache',
......@@ -78,8 +79,8 @@
compat.progress(repo.ui, 'updating firstmerge cache',
pos, 'rev %s' % rev, unit='revision', total=total)
progress(0, '')
pos, revstr, unit='revision', total=total)
progress(0)
for idx, rev in enumerate(data, 1):
assert rev == len(self._data), (rev, len(self._data))
self._data.append(self._firstmerge(cl, rev))
if not (idx % 10000): # progress as a too high performance impact
progress(idx, rev)
......@@ -81,9 +82,9 @@
for idx, rev in enumerate(data, 1):
assert rev == len(self._data), (rev, len(self._data))
self._data.append(self._firstmerge(cl, rev))
if not (idx % 10000): # progress as a too high performance impact
progress(idx, rev)
progress(None, '')
progress(None)
def _firstmerge(self, changelog, rev):
cl = changelog
......
......@@ -466,5 +466,6 @@
repo.depthcache.update(repo)
total = len(revs)
def progress(pos, rev):
def progress(pos, rev=None):
revstr = '' if rev is None else ('rev %d' % rev)
compat.progress(repo.ui, 'updating obshashrange cache',
......@@ -470,3 +471,3 @@
compat.progress(repo.ui, 'updating obshashrange cache',
pos, 'rev %s' % rev, unit='revision', total=total)
pos, revstr, unit='revision', total=total)
# warm the cache for the new revs
......@@ -472,5 +473,5 @@
# warm the cache for the new revs
progress(0, '')
progress(0)
for idx, r in enumerate(revs):
_obshashrange(repo, (r, 0))
progress(idx, r)
......@@ -474,7 +475,7 @@
for idx, r in enumerate(revs):
_obshashrange(repo, (r, 0))
progress(idx, r)
progress(None, '')
progress(None)
del self._updating
......
......@@ -578,5 +578,6 @@
total = len(data)
def progress(pos, rev):
def progress(pos, rev=None):
revstr = '' if rev is None else ('rev %d' % rev)
compat.progress(repo.ui, 'updating stablesort cache',
......@@ -582,3 +583,3 @@
compat.progress(repo.ui, 'updating stablesort cache',
pos, 'rev %s' % rev, unit='revision', total=total)
pos, revstr, unit='revision', total=total)
......@@ -584,5 +585,4 @@
progress(0, '')
for idx, rev in enumerate(data):
parents = filterparents(repo.changelog.parentrevs(rev))
if len(parents) <= 1:
......@@ -596,7 +596,7 @@
break
if not (idx % 1000): # progress as a too high performance impact
progress(idx, rev)
progress(None, '')
progress(None)
def clear(self, reset=False):
super(ondiskstablesortcache, self).clear()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment