remotefilelog: avoid temporarily using "count" variable as synonym for "total"
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 04 Dec 2018 21:58:46 -0800
changeset 53612 b34b1b865ef953933ac92e651e7c72789411b188
parent 53611 e58cd7ede1c3d21d2cb8216cf948abb3be6f660c
child 53613 70de33b9d32865e9d813ee4f5d4ca84dbed8d215
push id1079
push usergszorc@mozilla.com
push dateMon, 10 Dec 2018 19:44:59 +0000
remotefilelog: avoid temporarily using "count" variable as synonym for "total" The "count" variable is generally used for updating progress, but early in fileserverclient.request(), its used to mean the total count. We already have another "total" variable for that, so it seems much clearer to use that. Differential Revision: https://phab.mercurial-scm.org/D5382
hgext/remotefilelog/fileserverclient.py
--- a/hgext/remotefilelog/fileserverclient.py
+++ b/hgext/remotefilelog/fileserverclient.py
@@ -312,31 +312,30 @@ class fileserverclient(object):
         If the connection fails, an exception is raised.
         """
         if not self.remotecache.connected:
             self.connect()
         cache = self.remotecache
         writedata = self.writedata
 
         repo = self.repo
-        count = len(fileids)
-        request = "get\n%d\n" % count
+        total = len(fileids)
+        request = "get\n%d\n" % total
         idmap = {}
         reponame = repo.name
         for file, id in fileids:
             fullid = getcachekey(reponame, file, id)
             if self.cacheprocesspasspath:
                 request += file + '\0'
             request += fullid + "\n"
             idmap[fullid] = file
 
         cache.request(request)
 
-        total = count
-        progress = self.ui.makeprogress(_('downloading'), total=count)
+        progress = self.ui.makeprogress(_('downloading'), total=total)
         progress.update(0)
 
         missed = []
         count = 0
         while True:
             missingid = cache.receiveline()
             if not missingid:
                 missedset = set(missed)