gzip: rename the argument to `mtime` to match upstream python stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Mar 2020 18:57:49 +0100
branchstable
changeset 44473 6c36a521572e
parent 44472 b7760c2d33de
child 44474 a23b859ad17d
gzip: rename the argument to `mtime` to match upstream python Python gained the feature we missed in 3.1. The argument name is `mtime`. We align our version for consistency.
mercurial/archival.py
--- a/mercurial/archival.py	Tue Mar 10 16:49:38 2020 +0100
+++ b/mercurial/archival.py	Tue Mar 10 18:57:49 2020 +0100
@@ -138,8 +138,8 @@
     class GzipFileWithTime(gzip.GzipFile):
         def __init__(self, *args, **kw):
             timestamp = None
-            if 'timestamp' in kw:
-                timestamp = kw.pop('timestamp')
+            if 'mtime' in kw:
+                timestamp = kw.pop('mtime')
             if timestamp is None:
                 self.timestamp = time.time()
             else:
@@ -178,7 +178,7 @@
                     pycompat.sysstr(mode + b'b'),
                     zlib.Z_BEST_COMPRESSION,
                     fileobj,
-                    timestamp=mtime,
+                    mtime=mtime,
                 )
                 self.fileobj = gzfileobj
                 return tarfile.TarFile.taropen(  # pytype: disable=attribute-error