mercurial/archival.py
branchstable
changeset 12319 381f131220ad
parent 10282 08a0f04b56bd
child 12321 11db6fa2961e
--- a/mercurial/archival.py	Fri Sep 17 12:44:35 2010 -0500
+++ b/mercurial/archival.py	Mon Sep 20 15:33:39 2010 +0200
@@ -139,6 +139,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):