changeset 44306:a0ec05d93c8e

cleanup: re-run black on the codebase Looks like a few patches have landed without having been blackened. I strongly suspect I should write a patch for baymax that blackens things on the way in... # skip-blame automatic formatting Differential Revision: https://phab.mercurial-scm.org/D8104
author Augie Fackler <augie@google.com>
date Mon, 10 Feb 2020 17:31:05 -0500
parents d8d4fa9a7f18
children c577bb4a04d4
files mercurial/branchmap.py mercurial/changegroup.py mercurial/cmdutil.py mercurial/commands.py mercurial/debugcommands.py mercurial/discovery.py mercurial/dispatch.py mercurial/help.py mercurial/posix.py mercurial/tags.py
diffstat 10 files changed, 37 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/branchmap.py	Thu Jan 16 13:34:04 2020 +0100
+++ b/mercurial/branchmap.py	Mon Feb 10 17:31:05 2020 -0500
@@ -291,8 +291,8 @@
                     % (
                         _branchcachedesc(repo),
                         pycompat.bytestr(
-                            inst  # pytype: disable=wrong-arg-types
-                        ),
+                            inst
+                        ),  # pytype: disable=wrong-arg-types
                     )
                 )
             bcache = None
--- a/mercurial/changegroup.py	Thu Jan 16 13:34:04 2020 +0100
+++ b/mercurial/changegroup.py	Mon Feb 10 17:31:05 2020 -0500
@@ -1149,8 +1149,8 @@
             if fastpathlinkrev:
                 assert not tree
                 return (
-                    manifests.__getitem__  # pytype: disable=unsupported-operands
-                )
+                    manifests.__getitem__
+                )  # pytype: disable=unsupported-operands
 
             def lookupmflinknode(x):
                 """Callback for looking up the linknode for manifests.
--- a/mercurial/cmdutil.py	Thu Jan 16 13:34:04 2020 +0100
+++ b/mercurial/cmdutil.py	Mon Feb 10 17:31:05 2020 -0500
@@ -170,7 +170,12 @@
 
 diffopts = [
     (b'a', b'text', None, _(b'treat all files as text')),
-    (b'g', b'git', None, _(b'use git extended diff format (DEFAULT: diff.git)')),
+    (
+        b'g',
+        b'git',
+        None,
+        _(b'use git extended diff format (DEFAULT: diff.git)'),
+    ),
     (b'', b'binary', None, _(b'generate binary diffs in git mode (default)')),
     (b'', b'nodates', None, _(b'omit dates from diff headers')),
 ]
@@ -209,7 +214,9 @@
             b'p',
             b'show-function',
             None,
-            _(b'show which function each change is in (DEFAULT: diff.showfunc)'),
+            _(
+                b'show which function each change is in (DEFAULT: diff.showfunc)'
+            ),
         ),
         (b'', b'reverse', None, _(b'produce a diff that undoes the changes')),
     ]
--- a/mercurial/commands.py	Thu Jan 16 13:34:04 2020 +0100
+++ b/mercurial/commands.py	Mon Feb 10 17:31:05 2020 -0500
@@ -6646,7 +6646,12 @@
         (b'i', b'ignored', None, _(b'show only ignored files')),
         (b'n', b'no-status', None, _(b'hide status prefix')),
         (b't', b'terse', _NOTTERSE, _(b'show the terse output (EXPERIMENTAL)')),
-        (b'C', b'copies', None, _(b'show source of copied files (DEFAULT: ui.statuscopies)')),
+        (
+            b'C',
+            b'copies',
+            None,
+            _(b'show source of copied files (DEFAULT: ui.statuscopies)'),
+        ),
         (
             b'0',
             b'print0',
--- a/mercurial/debugcommands.py	Thu Jan 16 13:34:04 2020 +0100
+++ b/mercurial/debugcommands.py	Mon Feb 10 17:31:05 2020 -0500
@@ -3429,6 +3429,7 @@
                     ui.write(node2str(node))
             ui.write(b'\n')
 
+
 @command(b'debugtagscache', [])
 def debugtagscache(ui, repo):
     """display the contents of .hg/cache/hgtagsfnodes1"""
@@ -3439,6 +3440,7 @@
         tagsnodedisplay = hex(tagsnode) if tagsnode else 'missing/invalid'
         ui.write(b'%s %s %s\n' % (r, hex(node), tagsnodedisplay))
 
+
 @command(
     b'debugtemplate',
     [
--- a/mercurial/discovery.py	Thu Jan 16 13:34:04 2020 +0100
+++ b/mercurial/discovery.py	Mon Feb 10 17:31:05 2020 -0500
@@ -448,7 +448,7 @@
                 if branch not in (b'default', None):
                     errormsg = _(
                         b"push creates new remote head %s on branch '%s'!"
-                    ) % (short(dhs[0]), branch)
+                    ) % (short(dhs[0]), branch,)
                 elif repo[dhs[0]].bookmarks():
                     errormsg = _(
                         b"push creates new remote head %s "
--- a/mercurial/dispatch.py	Thu Jan 16 13:34:04 2020 +0100
+++ b/mercurial/dispatch.py	Mon Feb 10 17:31:05 2020 -0500
@@ -624,7 +624,7 @@
         except error.AmbiguousCommand:
             self.badalias = _(
                 b"alias '%s' resolves to ambiguous command '%s'"
-            ) % (self.name, cmd)
+            ) % (self.name, cmd,)
 
     def _populatehelp(self, ui, name, cmd, fn, defaulthelp=None):
         # confine strings to be passed to i18n.gettext()
--- a/mercurial/help.py	Thu Jan 16 13:34:04 2020 +0100
+++ b/mercurial/help.py	Mon Feb 10 17:31:05 2020 -0500
@@ -152,6 +152,7 @@
     doc = b''.join(rst)
     return doc
 
+
 def parsedefaultmarker(text):
     """given a text 'abc (DEFAULT: def.ghi)',
     returns (b'abc', (b'def', b'ghi')). Otherwise return None"""
@@ -159,9 +160,10 @@
         marker = b' (DEFAULT: '
         pos = text.find(marker)
         if pos >= 0:
-            item = text[pos + len(marker):-1]
+            item = text[pos + len(marker) : -1]
             return text[:pos], item.split(b'.', 2)
 
+
 def optrst(header, options, verbose, ui):
     data = []
     multioccur = False
@@ -734,7 +736,9 @@
 
         if ui.verbose:
             rst.append(
-                optrst(_(b"global options"), commands.globalopts, ui.verbose, ui)
+                optrst(
+                    _(b"global options"), commands.globalopts, ui.verbose, ui
+                )
             )
 
         if not ui.verbose:
@@ -874,7 +878,9 @@
         elif ui.verbose:
             rst.append(
                 b'\n%s\n'
-                % optrst(_(b"global options"), commands.globalopts, ui.verbose, ui)
+                % optrst(
+                    _(b"global options"), commands.globalopts, ui.verbose, ui
+                )
             )
             if name == b'shortlist':
                 rst.append(
--- a/mercurial/posix.py	Thu Jan 16 13:34:04 2020 +0100
+++ b/mercurial/posix.py	Mon Feb 10 17:31:05 2020 -0500
@@ -324,9 +324,8 @@
                     open(fullpath, b'w').close()
                 except IOError as inst:
                     if (
-                        inst[0]  # pytype: disable=unsupported-operands
-                        == errno.EACCES
-                    ):
+                        inst[0] == errno.EACCES
+                    ):  # pytype: disable=unsupported-operands
                         # If we can't write to cachedir, just pretend
                         # that the fs is readonly and by association
                         # that the fs won't support symlinks. This
--- a/mercurial/tags.py	Thu Jan 16 13:34:04 2020 +0100
+++ b/mercurial/tags.py	Mon Feb 10 17:31:05 2020 -0500
@@ -720,7 +720,9 @@
 
         self._dirtyoffset = None
 
-        rawlentokeep = min(wantedlen, (rawlen / _fnodesrecsize) * _fnodesrecsize)
+        rawlentokeep = min(
+            wantedlen, (rawlen / _fnodesrecsize) * _fnodesrecsize
+        )
         if rawlen > rawlentokeep:
             # There's no easy way to truncate array instances. This seems
             # slightly less evil than copying a potentially large array slice.