Patchwork D5381: remotefilelog: use progress helper in fileserverclient

login
register
mail settings
Submitter phabricator
Date Dec. 6, 2018, 11:41 a.m.
Message ID <1e3ae2d8c33ecb5a10adf52a1bfc47db@localhost.localdomain>
Download mbox | patch
Permalink /patch/37011/
State Not Applicable
Headers show

Comments

phabricator - Dec. 6, 2018, 11:41 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe58cd7ede1c3: remotefilelog: use progress helper in fileserverclient (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5381?vs=12720&id=12742

REVISION DETAIL
  https://phab.mercurial-scm.org/D5381

AFFECTED FILES
  hgext/remotefilelog/fileserverclient.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/remotefilelog/fileserverclient.py b/hgext/remotefilelog/fileserverclient.py
--- a/hgext/remotefilelog/fileserverclient.py
+++ b/hgext/remotefilelog/fileserverclient.py
@@ -42,7 +42,6 @@ 
 fetchmisses = 0
 
 _lfsmod = None
-_downloading = _('downloading')
 
 def getcachekey(reponame, file, id):
     pathhash = node.hex(hashlib.sha1(file).digest())
@@ -332,7 +331,8 @@ 
         cache.request(request)
 
         total = count
-        self.ui.progress(_downloading, 0, total=count)
+        progress = self.ui.makeprogress(_('downloading'), total=count)
+        progress.update(0)
 
         missed = []
         count = 0
@@ -352,7 +352,7 @@ 
                 # receive progress reports
                 parts = missingid.split("_")
                 count += int(parts[2])
-                self.ui.progress(_downloading, count, total=total)
+                progress.update(count)
                 continue
 
             missed.append(missingid)
@@ -362,7 +362,7 @@ 
 
         count = [total - len(missed)]
         fromcache = count[0]
-        self.ui.progress(_downloading, count[0], total=total)
+        progress.update(count[0], total=total)
         self.ui.log("remotefilelog", "remote cache hit rate is %r of %r\n",
                     count[0], total, hit=count[0], total=total)
 
@@ -372,7 +372,7 @@ 
             if missed:
                 def progresstick():
                     count[0] += 1
-                    self.ui.progress(_downloading, count[0], total=total)
+                    progress.update(count[0])
                 # When verbose is true, sshpeer prints 'running ssh...'
                 # to stdout, which can interfere with some command
                 # outputs
@@ -427,7 +427,7 @@ 
                 request = "set\n%d\n%s\n" % (count[0], "\n".join(missed))
                 cache.request(request)
 
-            self.ui.progress(_downloading, None)
+            progress.complete()
 
             # mark ourselves as a user of this cache
             writedata.markrepo(self.repo.path)