Patchwork D11008: shallowutil: dedent code after the previous change

login
register
mail settings
Submitter phabricator
Date July 7, 2021, 6:12 p.m.
Message ID <differential-rev-PHID-DREV-a6x6gvmfcasff2bwjb62-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49321/
State Superseded
Headers show

Comments

phabricator - July 7, 2021, 6:12 p.m.
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




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

Patch

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"