largefiles: show progress when checking standin hashes in outgoing changesets
authorMads Kiilerich <madski@unity3d.com>
Fri, 16 Jan 2015 19:51:25 +0100
changeset 23892 f2b6f37d537b
parent 23891 5827ad0b849e
child 23893 f21a0d6d6efd
largefiles: show progress when checking standin hashes in outgoing changesets This checking can take a huge amount of time and we should give user a hint that something is going on.
hgext/largefiles/lfutil.py
tests/test-largefiles-misc.t
--- a/hgext/largefiles/lfutil.py	Wed Jan 14 17:09:55 2015 -0800
+++ b/hgext/largefiles/lfutil.py	Fri Jan 16 19:51:25 2015 +0100
@@ -420,7 +420,9 @@
     return filelist
 
 def getlfilestoupload(repo, missing, addfunc):
-    for n in missing:
+    for i, n in enumerate(missing):
+        repo.ui.progress(_('finding outgoing largefiles'), i,
+            unit=_('revision'), total=len(missing))
         parents = [p for p in repo.changelog.parents(n) if p != node.nullid]
 
         oldlfstatus = repo.lfstatus
@@ -447,6 +449,7 @@
         for fn in files:
             if isstandin(fn) and fn in ctx:
                 addfunc(fn, ctx[fn].data().strip())
+    repo.ui.progress(_('finding outgoing largefiles'), None)
 
 def updatestandinsbymatch(repo, match):
     '''Update standins in the working directory according to specified match
--- a/tests/test-largefiles-misc.t	Wed Jan 14 17:09:55 2015 -0800
+++ b/tests/test-largefiles-misc.t	Fri Jan 16 19:51:25 2015 +0100
@@ -590,6 +590,8 @@
   all remote heads known locally
   1:1acbe71ce432
   2:6095d0695d70
+  finding outgoing largefiles: 0/2 revision (0.00%)
+  finding outgoing largefiles: 1/2 revision (50.00%)
   largefiles to upload (1 entities):
   b
       89e6c98d92887913cadf06b2adb97f26cde4849b
@@ -645,6 +647,11 @@
   3:7983dce246cc
   4:233f12ada4ae
   5:036794ea641c
+  finding outgoing largefiles: 0/5 revision (0.00%)
+  finding outgoing largefiles: 1/5 revision (20.00%)
+  finding outgoing largefiles: 2/5 revision (40.00%)
+  finding outgoing largefiles: 3/5 revision (60.00%)
+  finding outgoing largefiles: 4/5 revision (80.00%)
   largefiles to upload (3 entities):
   b
       13f9ed0898e315bf59dc2973fec52037b6f441a2
@@ -690,6 +697,10 @@
   3:7983dce246cc
   4:233f12ada4ae
   5:036794ea641c
+  finding outgoing largefiles: 0/4 revision (0.00%)
+  finding outgoing largefiles: 1/4 revision (25.00%)
+  finding outgoing largefiles: 2/4 revision (50.00%)
+  finding outgoing largefiles: 3/4 revision (75.00%)
   largefiles to upload (2 entities):
   b
       13f9ed0898e315bf59dc2973fec52037b6f441a2