remotefilelog: replace a "a=[expr]; b=a[0]" by "b=expr; a = [b]"
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 04 Dec 2018 22:12:47 -0800
changeset 53614 fe0b65ff00e75e5aa913be4aadec22b0019de7dc
parent 53613 70de33b9d32865e9d813ee4f5d4ca84dbed8d215
child 53615 fcee112fb7c4b8f009815ec580b135dffbf568d7
push id1079
push usergszorc@mozilla.com
push dateMon, 10 Dec 2018 19:44:59 +0000
remotefilelog: replace a "a=[expr]; b=a[0]" by "b=expr; a = [b]" Simpler is better. Differential Revision: https://phab.mercurial-scm.org/D5384
hgext/remotefilelog/fileserverclient.py
--- a/hgext/remotefilelog/fileserverclient.py
+++ b/hgext/remotefilelog/fileserverclient.py
@@ -354,18 +354,18 @@ class fileserverclient(object):
                 progress.update(count)
                 continue
 
             missed.append(missingid)
 
         global fetchmisses
         fetchmisses += len(missed)
 
-        count = [total - len(missed)]
-        fromcache = count[0]
+        fromcache = total - len(missed)
+        count = [fromcache]
         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)
 
         oldumask = os.umask(0o002)
         try:
             # receive cache misses from master
             if missed: