largefiles: use revisions as a ui.progress unit
authorAnton Shestakov <av6@dwimlabs.net>
Fri, 11 Mar 2016 22:26:06 +0800
changeset 28464 6e34690230c0
parent 28463 19b4a2087dfc
child 28465 43eb31ea2dcb
largefiles: use revisions as a ui.progress unit Using plural form is consistent with other progress units, and "1 out of 5 revisions" sounds more correct. Also, tests don't show this, but if you have 'speed' item in progress.format config, it shows e.g. '100 revisions/sec', which also seems better.
hgext/largefiles/lfcommands.py
hgext/largefiles/lfutil.py
tests/test-largefiles-misc.t
--- a/hgext/largefiles/lfcommands.py	Fri Mar 11 22:21:43 2016 +0800
+++ b/hgext/largefiles/lfcommands.py	Fri Mar 11 22:26:06 2016 +0800
@@ -99,7 +99,7 @@
             lfiletohash = {}
             for ctx in ctxs:
                 ui.progress(_('converting revisions'), ctx.rev(),
-                    unit=_('revision'), total=rsrc['tip'].rev())
+                    unit=_('revisions'), total=rsrc['tip'].rev())
                 _lfconvert_addchangeset(rsrc, rdst, ctx, revmap,
                     lfiles, normalfiles, matcher, size, lfiletohash)
             ui.progress(_('converting revisions'), None)
--- a/hgext/largefiles/lfutil.py	Fri Mar 11 22:21:43 2016 +0800
+++ b/hgext/largefiles/lfutil.py	Fri Mar 11 22:26:06 2016 +0800
@@ -468,7 +468,7 @@
 def getlfilestoupload(repo, missing, addfunc):
     for i, n in enumerate(missing):
         repo.ui.progress(_('finding outgoing largefiles'), i,
-            unit=_('revision'), total=len(missing))
+            unit=_('revisions'), total=len(missing))
         parents = [p for p in repo.changelog.parents(n) if p != node.nullid]
 
         oldlfstatus = repo.lfstatus
--- a/tests/test-largefiles-misc.t	Fri Mar 11 22:21:43 2016 +0800
+++ b/tests/test-largefiles-misc.t	Fri Mar 11 22:26:06 2016 +0800
@@ -682,8 +682,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%)
+  finding outgoing largefiles: 0/2 revisions (0.00%)
+  finding outgoing largefiles: 1/2 revisions (50.00%)
   largefiles to upload (1 entities):
   b
       89e6c98d92887913cadf06b2adb97f26cde4849b
@@ -740,11 +740,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%)
+  finding outgoing largefiles: 0/5 revisions (0.00%)
+  finding outgoing largefiles: 1/5 revisions (20.00%)
+  finding outgoing largefiles: 2/5 revisions (40.00%)
+  finding outgoing largefiles: 3/5 revisions (60.00%)
+  finding outgoing largefiles: 4/5 revisions (80.00%)
   largefiles to upload (3 entities):
   b
       13f9ed0898e315bf59dc2973fec52037b6f441a2
@@ -791,10 +791,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%)
+  finding outgoing largefiles: 0/4 revisions (0.00%)
+  finding outgoing largefiles: 1/4 revisions (25.00%)
+  finding outgoing largefiles: 2/4 revisions (50.00%)
+  finding outgoing largefiles: 3/4 revisions (75.00%)
   largefiles to upload (2 entities):
   b
       13f9ed0898e315bf59dc2973fec52037b6f441a2