changeset 44473:6c36a521572e stable

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 10 Mar 2020 18:57:49 +0100
parents b7760c2d33de
children a23b859ad17d
files mercurial/archival.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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