convert: add missing numcommits() override to hg sources
Otherwise, the progressbar in converter.walktree() gets None as its total during
the initial scan. (Though that seems harmless, and there are other foreign vcs
sources without this.)
--- a/hgext/convert/filemap.py Thu Jan 10 14:32:36 2019 -0800
+++ b/hgext/convert/filemap.py Wed Jan 09 14:33:06 2019 -0500
@@ -270,6 +270,9 @@
self.children[p] = self.children.get(p, 0) + 1
return c
+ def numcommits(self):
+ return self.base.numcommits()
+
def _cachedcommit(self, rev):
if rev in self.commits:
return self.commits[rev]
--- a/hgext/convert/hg.py Thu Jan 10 14:32:36 2019 -0800
+++ b/hgext/convert/hg.py Wed Jan 09 14:33:06 2019 -0500
@@ -597,6 +597,9 @@
saverev=self.saverev,
phase=ctx.phase())
+ def numcommits(self):
+ return len(self.repo)
+
def gettags(self):
# This will get written to .hgtags, filter non global tags out.
tags = [t for t in self.repo.tagslist()
--- a/tests/test-convert-filemap.t Thu Jan 10 14:32:36 2019 -0800
+++ b/tests/test-convert-filemap.t Wed Jan 09 14:33:06 2019 -0500
@@ -451,7 +451,7 @@
run hg source pre-conversion action
run hg sink pre-conversion action
scanning source...
- scanning: 1 revisions
+ scanning: 1/7 revisions (14.29%)
sorting...
converting...
0 merging something