D11008: shallowutil: dedent code after the previous change

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Jul 7 18:12:29 UTC 2021


durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -251,23 +251,22 @@
         raise BadRemotefilelogHeader(
             "unexpected remotefilelog header: illegal format"
         )
-    if True:
-        header = raw[:index]
-        if header.startswith(b'v'):
-            # v1 and above, header starts with 'v'
-            if header.startswith(b'v1\n'):
-                for s in header.split(b'\n'):
-                    if s.startswith(constants.METAKEYSIZE):
-                        size = int(s[len(constants.METAKEYSIZE) :])
-                    elif s.startswith(constants.METAKEYFLAG):
-                        flags = int(s[len(constants.METAKEYFLAG) :])
-            else:
-                raise BadRemotefilelogHeader(
-                    b'unsupported remotefilelog header: %s' % header
-                )
+    header = raw[:index]
+    if header.startswith(b'v'):
+        # v1 and above, header starts with 'v'
+        if header.startswith(b'v1\n'):
+            for s in header.split(b'\n'):
+                if s.startswith(constants.METAKEYSIZE):
+                    size = int(s[len(constants.METAKEYSIZE) :])
+                elif s.startswith(constants.METAKEYFLAG):
+                    flags = int(s[len(constants.METAKEYFLAG) :])
         else:
-            # v0, str(int(size)) is the header
-            size = int(header)
+            raise BadRemotefilelogHeader(
+                b'unsupported remotefilelog header: %s' % header
+            )
+    else:
+        # v0, str(int(size)) is the header
+        size = int(header)
     if size is None:
         raise BadRemotefilelogHeader(
             "unexpected remotefilelog header: no size found"



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


More information about the Mercurial-devel mailing list