diff mercurial/archival.py @ 45942:89a2afe31e82

formating: upgrade to black 20.8b1 This required a couple of small tweaks to un-confuse black, but now it works. Big formatting changes come from: * Dramatically improved collection-splitting logic upstream * Black having a strong (correct IMO) opinion that """ is better than ''' Differential Revision: https://phab.mercurial-scm.org/D9430
author Augie Fackler <raf@durin42.com>
date Fri, 27 Nov 2020 17:03:29 -0500
parents 3a6ec080b521
children 406a7e629946
line wrap: on
line diff
--- a/mercurial/archival.py	Fri Nov 27 17:00:00 2020 -0500
+++ b/mercurial/archival.py	Fri Nov 27 17:03:29 2020 -0500
@@ -37,8 +37,8 @@
 
 
 def tidyprefix(dest, kind, prefix):
-    '''choose prefix to use for names in archive.  make sure prefix is
-    safe for consumers.'''
+    """choose prefix to use for names in archive.  make sure prefix is
+    safe for consumers."""
 
     if prefix:
         prefix = util.normpath(prefix)
@@ -132,8 +132,8 @@
 
 
 class tarit(object):
-    '''write archive to tar file or stream.  can write uncompressed,
-    or compress with gzip or bzip2.'''
+    """write archive to tar file or stream.  can write uncompressed,
+    or compress with gzip or bzip2."""
 
     if pycompat.ispy3:
         GzipFileWithTime = gzip.GzipFile  # camelcase-required
@@ -185,8 +185,10 @@
                     mtime=mtime,
                 )
                 self.fileobj = gzfileobj
-                return tarfile.TarFile.taropen(  # pytype: disable=attribute-error
-                    name, pycompat.sysstr(mode), gzfileobj
+                return (
+                    tarfile.TarFile.taropen(  # pytype: disable=attribute-error
+                        name, pycompat.sysstr(mode), gzfileobj
+                    )
                 )
             else:
                 try:
@@ -224,8 +226,8 @@
 
 
 class zipit(object):
-    '''write archive to zip file or stream.  can write uncompressed,
-    or compressed with deflate.'''
+    """write archive to zip file or stream.  can write uncompressed,
+    or compressed with deflate."""
 
     def __init__(self, dest, mtime, compress=True):
         if isinstance(dest, bytes):
@@ -316,7 +318,7 @@
     mtime=None,
     subrepos=False,
 ):
-    '''create archive of repo as it was at node.
+    """create archive of repo as it was at node.
 
     dest can be name of directory, name of archive file, or file
     object to write archive to.
@@ -333,7 +335,7 @@
     mtime is the modified time, in seconds, or None to use the changeset time.
 
     subrepos tells whether to include subrepos.
-    '''
+    """
 
     if kind == b'txz' and not pycompat.ispy3:
         raise error.Abort(_(b'xz compression is only available in Python 3'))