comparison mercurial/revlog.py @ 5659:3da652f2039c

util: get rid of is_win_9x wart
author Matt Mackall <mpm@selenic.com>
date Tue, 18 Dec 2007 14:01:42 -0600
parents 7c1a9a21dcd7
children f45f7390c1c5
comparison
equal deleted inserted replaced
5658:ae3089cefaab 5659:3da652f2039c
110 """ 110 """
111 111
112 # lazyparser is not safe to use on windows if win32 extensions not 112 # lazyparser is not safe to use on windows if win32 extensions not
113 # available. it keeps file handle open, which make it not possible 113 # available. it keeps file handle open, which make it not possible
114 # to break hardlinks on local cloned repos. 114 # to break hardlinks on local cloned repos.
115 safe_to_use = os.name != 'nt' or (not util.is_win_9x() and
116 hasattr(util, 'win32api'))
117 115
118 def __init__(self, dataf, size): 116 def __init__(self, dataf, size):
119 self.dataf = dataf 117 self.dataf = dataf
120 self.s = struct.calcsize(indexformatng) 118 self.s = struct.calcsize(indexformatng)
121 self.datasize = size 119 self.datasize = size
360 try: 358 try:
361 size = util.fstat(fp).st_size 359 size = util.fstat(fp).st_size
362 except AttributeError: 360 except AttributeError:
363 size = 0 361 size = 0
364 362
365 if lazyparser.safe_to_use and not inline and size > 1000000: 363 if util.openhardlinks() and not inline and size > 1000000:
366 # big index, let's parse it on demand 364 # big index, let's parse it on demand
367 parser = lazyparser(fp, size) 365 parser = lazyparser(fp, size)
368 index = lazyindex(parser) 366 index = lazyindex(parser)
369 nodemap = lazymap(parser) 367 nodemap = lazymap(parser)
370 e = list(index[0]) 368 e = list(index[0])