[PATCH 01 of 11] largefiles: specify unit for ui.progress when operating on files

Anton Shestakov av6 at dwimlabs.net
Fri Mar 11 09:57:33 EST 2016


# HG changeset patch
# User Anton Shestakov <av6 at dwimlabs.net>
# Date 1457706103 -28800
#      Fri Mar 11 22:21:43 2016 +0800
# Node ID 5dae424b724e159488eebb1f3bd6b358bb1abb52
# Parent  1c658391b22fb4d98ccfb60c0e57315b55634117
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.

diff --git a/hgext/largefiles/basestore.py b/hgext/largefiles/basestore.py
--- a/hgext/largefiles/basestore.py
+++ b/hgext/largefiles/basestore.py
@@ -63,7 +63,7 @@ class basestore(object):
         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))
diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py
+++ b/hgext/largefiles/lfcommands.py
@@ -346,7 +346,7 @@ def uploadlfiles(ui, rsrc, rdst, files):
     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:
diff --git a/tests/test-largefiles-wireproto.t b/tests/test-largefiles-wireproto.t
--- a/tests/test-largefiles-wireproto.t
+++ b/tests/test-largefiles-wireproto.t
@@ -291,7 +291,7 @@ largefiles pulled on update - no server 
   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


More information about the Mercurial-devel mailing list