D5381: remotefilelog: use progress helper in fileserverclient

2018-12-06 Thread martinvonz (Martin von Zweigbergk)
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=12742

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

AFFECTED FILES
  hgext/remotefilelog/fileserverclient.py

CHANGE DETAILS

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)



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5381: remotefilelog: use progress helper in fileserverclient

2018-12-05 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/remotefilelog/fileserverclient.py

CHANGE DETAILS

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)



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel