changeset 28463:19b4a2087dfc

largefiles: specify unit for ui.progress when operating on files Also make it available for translation. It could already be translated, because it's used as a unit in archival.py and subrepo.py, for example.
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 11 Mar 2016 22:21:43 +0800
parents dbba18ba26d4
children 6e34690230c0
files hgext/largefiles/basestore.py hgext/largefiles/lfcommands.py tests/test-largefiles-wireproto.t
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/basestore.py	Wed Mar 09 23:59:26 2016 +0900
+++ b/hgext/largefiles/basestore.py	Fri Mar 11 22:21:43 2016 +0800
@@ -63,7 +63,7 @@
         at = 0
         available = self.exists(set(hash for (_filename, hash) in files))
         for filename, hash in files:
-            ui.progress(_('getting largefiles'), at, unit='lfile',
+            ui.progress(_('getting largefiles'), at, unit=_('files'),
                 total=len(files))
             at += 1
             ui.note(_('getting %s:%s\n') % (filename, hash))
--- a/hgext/largefiles/lfcommands.py	Wed Mar 09 23:59:26 2016 +0900
+++ b/hgext/largefiles/lfcommands.py	Fri Mar 11 22:21:43 2016 +0800
@@ -346,7 +346,7 @@
     ui.debug("%d largefiles need to be uploaded\n" % len(files))
 
     for hash in files:
-        ui.progress(_('uploading largefiles'), at, unit='largefile',
+        ui.progress(_('uploading largefiles'), at, unit=_('files'),
                     total=len(files))
         source = lfutil.findfile(rsrc, hash)
         if not source:
--- a/tests/test-largefiles-wireproto.t	Wed Mar 09 23:59:26 2016 +0900
+++ b/tests/test-largefiles-wireproto.t	Fri Mar 11 22:21:43 2016 +0800
@@ -291,7 +291,7 @@
   using http://localhost:$HGPORT2/
   sending capabilities command
   sending batch command
-  getting largefiles: 0/1 lfile (0.00%)
+  getting largefiles: 0/1 files (0.00%)
   getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
   sending getlfile command
   found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store