convert/svn: report path discovery progress
authorPatrick Mezard <pmezard@gmail.com>
Sun, 09 May 2010 22:51:25 +0200
changeset 11137 94afe7bc87a9
parent 11136 ecc8b18736da
child 11138 99eee847beaa
convert/svn: report path discovery progress When converting non-local repositories, scanning changed paths before retrieving data can be almost as slow as retrieving the data itself, thanks to HTTP calls overhead.
hgext/convert/subversion.py
tests/test-convert-svn-move.out
--- a/hgext/convert/subversion.py	Sun May 09 22:50:42 2010 +0200
+++ b/hgext/convert/subversion.py	Sun May 09 22:51:25 2010 +0200
@@ -610,7 +610,9 @@
             self.module = new_module
             self.reparent(self.module)
 
-        for path, ent in paths:
+        for i, (path, ent) in enumerate(paths):
+            self.ui.progress(_('scanning paths'), i, item=path,
+                             total=len(paths))
             entrypath = self.getrelpath(path)
 
             kind = self._checkpath(entrypath, revnum)
@@ -689,6 +691,7 @@
                     copytopath = self.getrelpath(copytopath)
                     copies[self.recode(copytopath)] = self.recode(childpath)
 
+        self.ui.progress(_('scanning paths'), None)
         changed.update(removed)
         return (list(changed), removed, copies)
 
--- a/tests/test-convert-svn-move.out	Sun May 09 22:50:42 2010 +0200
+++ b/tests/test-convert-svn-move.out	Sun May 09 22:51:25 2010 +0200
@@ -95,15 +95,22 @@
 retrieving file [========================================================>] 5/5
                                                                                 
 converting [==============>                                               ] 1/4
+scanning paths [                                                          ] 0/1
+                                                                                
 retrieving file [========================================================>] 1/1
                                                                                 
 converting [==============================>                               ] 2/4
+scanning paths [                                                          ] 0/2
+scanning paths [============================>                             ] 1/2
+                                                                                
 retrieving file [=============>                                           ] 1/4
 retrieving file [===========================>                             ] 2/4
 retrieving file [=========================================>               ] 3/4
 retrieving file [========================================================>] 4/4
                                                                                 
 converting [=============================================>                ] 3/4
+scanning paths [                                                          ] 0/1
+                                                                                
 retrieving file [========================================================>] 1/1
                                                                                 
 initializing destination hg-progress repository