changeset 22413:3cb0318bb2dd

convert: enable deterministic conversion progress bar for git
author Augie Fackler <raf@durin42.com>
date Wed, 10 Sep 2014 10:51:46 -0400
parents dde99b827288
children 299eaa09b41b
files hgext/convert/git.py tests/test-convert-git.t
diffstat 2 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/git.py	Wed Sep 10 11:04:29 2014 -0400
+++ b/hgext/convert/git.py	Wed Sep 10 10:51:46 2014 -0400
@@ -263,6 +263,9 @@
                    rev=version)
         return c
 
+    def numcommits(self):
+        return len([None for _ in self.gitopen('git rev-list --all')])
+
     def gettags(self):
         tags = {}
         alltags = {}
@@ -342,4 +345,3 @@
     def checkrevformat(self, revstr, mapname='splicemap'):
         """ git revision string is a 40 byte hex """
         self.checkhexformat(revstr, mapname)
-
--- a/tests/test-convert-git.t	Wed Sep 10 11:04:29 2014 -0400
+++ b/tests/test-convert-git.t	Wed Sep 10 10:51:46 2014 -0400
@@ -56,12 +56,12 @@
   >   --config progress.refresh=0 --config progress.width=60 \
   > --datesort git-repo
   \r (no-eol) (esc)
-  scanning [ <=>                                          ] 1\r (no-eol) (esc)
-  scanning [  <=>                                         ] 2\r (no-eol) (esc)
-  scanning [   <=>                                        ] 3\r (no-eol) (esc)
-  scanning [    <=>                                       ] 4\r (no-eol) (esc)
-  scanning [     <=>                                      ] 5\r (no-eol) (esc)
-  scanning [      <=>                                     ] 6\r (no-eol) (esc)
+  scanning [======>                                     ] 1/6\r (no-eol) (esc)
+  scanning [=============>                              ] 2/6\r (no-eol) (esc)
+  scanning [=====================>                      ] 3/6\r (no-eol) (esc)
+  scanning [============================>               ] 4/6\r (no-eol) (esc)
+  scanning [===================================>        ] 5/6\r (no-eol) (esc)
+  scanning [===========================================>] 6/6\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
   converting [                                          ] 0/6\r (no-eol) (esc)