changeset 13668:9a41af6b9f29

archive: use hardcoded constants when creating .zip archives Do not rely on local stat constants, which may differ.
author Markus F.X.J. Oberhumer <markus@oberhumer.com>
date Wed, 16 Mar 2011 23:54:55 +0100
parents 8cbb59124e67
children 12f60626d817
files mercurial/archival.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/archival.py	Wed Mar 16 03:06:57 2011 +0100
+++ b/mercurial/archival.py	Wed Mar 16 23:54:55 2011 +0100
@@ -9,7 +9,7 @@
 from node import hex
 import cmdutil
 import util, encoding
-import cStringIO, os, stat, tarfile, time, zipfile
+import cStringIO, os, tarfile, time, zipfile
 import zlib, gzip
 
 def tidyprefix(dest, kind, prefix):
@@ -172,10 +172,10 @@
         # unzip will not honor unix file modes unless file creator is
         # set to unix (id 3).
         i.create_system = 3
-        ftype = stat.S_IFREG
+        ftype = 0x8000 # UNX_IFREG in unzip source code
         if islink:
             mode = 0777
-            ftype = stat.S_IFLNK
+            ftype = 0xa000 # UNX_IFLNK in unzip source code
         i.external_attr = (mode | ftype) << 16L
         self.z.writestr(i, data)