mercurial/archival.py
changeset 12321 11db6fa2961e
parent 12058 1ef70bdd1e62
parent 12319 381f131220ad
child 12323 f00953d9533c
--- a/mercurial/archival.py	Fri Sep 17 12:45:13 2010 -0500
+++ b/mercurial/archival.py	Mon Sep 20 15:42:58 2010 +0200
@@ -150,6 +150,13 @@
         self.z = zipfile.ZipFile(dest, 'w',
                                  compress and zipfile.ZIP_DEFLATED or
                                  zipfile.ZIP_STORED)
+
+        # Python's zipfile module emits deprecation warnings if we try
+        # to store files with a date before 1980.
+        epoch = 315532800 # calendar.timegm((1980, 1, 1, 0, 0, 0, 1, 1, 0))
+        if mtime < epoch:
+            mtime = epoch
+
         self.date_time = time.gmtime(mtime)[:6]
 
     def addfile(self, name, mode, islink, data):