durin42 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches.
REVISION SUMMARY This will make this code easier to understand in the future. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D11007 AFFECTED FILES hgext/remotefilelog/shallowutil.py CHANGE DETAILS diff --git a/hgext/remotefilelog/shallowutil.py b/hgext/remotefilelog/shallowutil.py --- a/hgext/remotefilelog/shallowutil.py +++ b/hgext/remotefilelog/shallowutil.py @@ -247,6 +247,11 @@ size = None try: index = raw.index(b'\0') + except ValueError: + raise BadRemotefilelogHeader( + "unexpected remotefilelog header: illegal format" + ) + if True: header = raw[:index] if header.startswith(b'v'): # v1 and above, header starts with 'v' @@ -263,10 +268,6 @@ else: # v0, str(int(size)) is the header size = int(header) - except ValueError: - raise BadRemotefilelogHeader( - "unexpected remotefilelog header: illegal format" - ) if size is None: raise BadRemotefilelogHeader( "unexpected remotefilelog header: no size found" To: durin42, #hg-reviewers Cc: mercurial-patches, mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel