comparison mercurial/bundlerepo.py @ 2176:9b42304d9896

fix file handling bugs on windows. add util.posixfile class that has posix semantics on windows. fix util.rename so it works with stupid windows delete semantics.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Tue, 02 May 2006 14:30:00 -0700
parents e5f5c21f4169
children 4b71f37cbdb7
comparison
equal deleted inserted replaced
2129:e5f5c21f4169 2176:9b42304d9896
158 158
159 class bundlerepository(localrepo.localrepository): 159 class bundlerepository(localrepo.localrepository):
160 def __init__(self, ui, path, bundlename): 160 def __init__(self, ui, path, bundlename):
161 localrepo.localrepository.__init__(self, ui, path) 161 localrepo.localrepository.__init__(self, ui, path)
162 f = open(bundlename, "rb") 162 f = open(bundlename, "rb")
163 s = os.fstat(f.fileno()) 163 s = util.fstat(f)
164 self.bundlefile = f 164 self.bundlefile = f
165 header = self.bundlefile.read(6) 165 header = self.bundlefile.read(6)
166 if not header.startswith("HG"): 166 if not header.startswith("HG"):
167 raise util.Abort(_("%s: not a Mercurial bundle file") % bundlename) 167 raise util.Abort(_("%s: not a Mercurial bundle file") % bundlename)
168 elif not header.startswith("HG10"): 168 elif not header.startswith("HG10"):