Patchwork D10209: typing: fix directives mangled by black

login
register
mail settings
Submitter phabricator
Date March 13, 2021, 7:34 p.m.
Message ID <differential-rev-PHID-DREV-7rtt6vd5g2nvkjertl5w-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48522/
State Superseded
Headers show

Comments

phabricator - March 13, 2021, 7:34 p.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  mercurial/changegroup.py
  mercurial/dagparser.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/dagparser.py b/mercurial/dagparser.py
--- a/mercurial/dagparser.py
+++ b/mercurial/dagparser.py
@@ -168,9 +168,9 @@ 
     if not desc:
         return
 
-    wordchars = pycompat.bytestr(
-        string.ascii_letters + string.digits
-    )  # pytype: disable=wrong-arg-types
+    # pytype: disable=wrong-arg-types
+    wordchars = pycompat.bytestr(string.ascii_letters + string.digits)
+    # pytype: enable=wrong-arg-types
 
     labels = {}
     p1 = -1
@@ -179,9 +179,9 @@ 
     def resolve(ref):
         if not ref:
             return p1
-        elif ref[0] in pycompat.bytestr(
-            string.digits
-        ):  # pytype: disable=wrong-arg-types
+        # pytype: disable=wrong-arg-types
+        elif ref[0] in pycompat.bytestr(string.digits):
+            # pytype: enable=wrong-arg-types
             return r - int(ref)
         else:
             return labels[ref]
@@ -215,9 +215,9 @@ 
 
     c = nextch()
     while c != b'\0':
-        while c in pycompat.bytestr(
-            string.whitespace
-        ):  # pytype: disable=wrong-arg-types
+        # pytype: disable=wrong-arg-types
+        while c in pycompat.bytestr(string.whitespace):
+            # pytype: enable=wrong-arg-types
             c = nextch()
         if c == b'.':
             yield b'n', (r, [p1])
@@ -225,9 +225,9 @@ 
             r += 1
             c = nextch()
         elif c == b'+':
-            c, digs = nextrun(
-                nextch(), pycompat.bytestr(string.digits)
-            )  # pytype: disable=wrong-arg-types
+            # pytype: disable=wrong-arg-types
+            c, digs = nextrun(nextch(), pycompat.bytestr(string.digits))
+            # pytype: enable=wrong-arg-types
             n = int(digs)
             for i in pycompat.xrange(0, n):
                 yield b'n', (r, [p1])
diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -1162,9 +1162,10 @@ 
         def makelookupmflinknode(tree, nodes):
             if fastpathlinkrev:
                 assert not tree
-                return (
-                    manifests.__getitem__
-                )  # pytype: disable=unsupported-operands
+
+                # pytype: disable=unsupported-operands
+                return manifests.__getitem__
+                # pytype: enable=unsupported-operands
 
             def lookupmflinknode(x):
                 """Callback for looking up the linknode for manifests.