diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py --- a/hgext/convert/convcmd.py +++ b/hgext/convert/convcmd.py @@ -111,11 +111,13 @@ class converter(object): if n in known or n in self.map: continue known.add(n) + self.ui.progress(_('scanning'), len(known), unit=_('revisions')) commit = self.cachecommit(n) parents[n] = [] for p in commit.parents: parents[n].append(p) visit.append(p) + self.ui.progress(_('scanning'), None) return parents @@ -321,7 +323,7 @@ class converter(object): c = None self.ui.status(_("converting...\n")) - for c in t: + for i, c in enumerate(t): num -= 1 desc = self.commitcache[c].desc if "\n" in desc: @@ -331,7 +333,10 @@ class converter(object): # 'utf-8' self.ui.status("%d %s\n" % (num, recode(desc))) self.ui.note(_("source: %s\n") % recode(c)) + self.ui.progress(_('converting'), i, unit=_('revisions'), + total=len(t)) self.copy(c) + self.ui.progress(_('converting'), None) tags = self.source.gettags() ctags = {} diff --git a/tests/test-convert-svn-move b/tests/test-convert-svn-move --- a/tests/test-convert-svn-move +++ b/tests/test-convert-svn-move @@ -51,3 +51,20 @@ hg -v manifest -r 3 echo '% try updating' hg up -qC default cd .. + +echo '% test convert progress bar' + +echo "progress=" >> $HGRCPATH +echo "[progress]" >> $HGRCPATH +echo "assume-tty=1" >> $HGRCPATH +echo "delay=0" >> $HGRCPATH +echo "refresh=0" >> $HGRCPATH + +cat > filtercr.py <&1 | python filtercr.py diff --git a/tests/test-convert-svn-move.out b/tests/test-convert-svn-move.out --- a/tests/test-convert-svn-move.out +++ b/tests/test-convert-svn-move.out @@ -80,3 +80,26 @@ 644 dlink/b 644 @ dlink2 644 @ dlink3 % try updating +% test convert progress bar + +scanning [ <=> ] 1 +scanning [ <=> ] 2 +scanning [ <=> ] 3 +scanning [ <=> ] 4 + +converting [ ] 0/4 + +converting [==============> ] 1/4 + +converting [==============================> ] 2/4 + +converting [=============================================> ] 3/4 + +initializing destination hg-progress repository +scanning source... +sorting... +converting... +3 initial +2 clobber symlink +1 clobber1 +0 clobber2