Patchwork D5781: py3: fix test-remotefilelog-repack.t

login
register
mail settings
Submitter phabricator
Date Feb. 1, 2019, 6:30 p.m.
Message ID <aa68995fe1a76453eb3164d48097f2ba@localhost.localdomain>
Download mbox | patch
Permalink /patch/38298/
State Not Applicable
Headers show

Comments

phabricator - Feb. 1, 2019, 6:30 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGac14362ced4b: py3: fix test-remotefilelog-repack.t (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5781?vs=13642&id=13675

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

AFFECTED FILES
  contrib/python3-whitelist
  hgext/remotefilelog/basestore.py

CHANGE DETAILS




To: durin42, pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/remotefilelog/basestore.py b/hgext/remotefilelog/basestore.py
--- a/hgext/remotefilelog/basestore.py
+++ b/hgext/remotefilelog/basestore.py
@@ -410,16 +410,18 @@ 
         def wrapped(self, *args, **kwargs):
             retrylog = self.retrylog or noop
             funcname = fn.__name__
-            for i in pycompat.xrange(self.numattempts):
+            i = 0
+            while i < self.numattempts:
                 if i > 0:
                     retrylog('re-attempting (n=%d) %s\n' % (i, funcname))
                     self.markforrefresh()
+                i += 1
                 try:
                     return fn(self, *args, **kwargs)
                 except KeyError:
-                    pass
-            # retries exhausted
-            retrylog('retries exhausted in %s, raising KeyError\n' %
-                     pycompat.sysbytes(funcname))
-            raise
+                    if i == self.numattempts:
+                        # retries exhausted
+                        retrylog('retries exhausted in %s, raising KeyError\n' %
+                                 pycompat.sysbytes(funcname))
+                        raise
         return wrapped
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -603,6 +603,7 @@ 
 test-remotefilelog-permisssions.t
 test-remotefilelog-prefetch.t
 test-remotefilelog-pull-noshallow.t
+test-remotefilelog-repack.t
 test-remotefilelog-share.t
 test-remotefilelog-sparse.t
 test-remotefilelog-tags.t