# HG changeset patch # User Markus F.X.J. Oberhumer # Date 2011-03-16 22:54:55 # Node ID 9a41af6b9f29cad0cf12073eb2be495488ae740b # Parent 8cbb59124e67cd464a3ef1b14d49702face91085 archive: use hardcoded constants when creating .zip archives Do not rely on local stat constants, which may differ. diff --git a/mercurial/archival.py b/mercurial/archival.py --- a/mercurial/archival.py +++ b/mercurial/archival.py @@ -9,7 +9,7 @@ from i18n import _ 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 @@ class zipit(object): # 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)