D5781: py3: fix test-remotefilelog-repack.t
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=13675 REVISION DETAIL https://phab.mercurial-scm.org/D5781 AFFECTED FILES contrib/python3-whitelist hgext/remotefilelog/basestore.py CHANGE DETAILS 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 To: durin42, pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5781: py3: fix test-remotefilelog-repack.t
durin42 created this revision. Herald added a reviewer: pulkit. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is uglier, but more obviously correct in my opinion. I guess Python 3 doesn't hang on to the exception as long, which seems reasonable. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5781 AFFECTED FILES contrib/python3-whitelist hgext/remotefilelog/basestore.py CHANGE DETAILS 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 @@ -602,6 +602,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 To: durin42, pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel