181 '''return default os-specific hgrc search path''' |
181 '''return default os-specific hgrc search path''' |
182 proc = win32api.GetCurrentProcess() |
182 proc = win32api.GetCurrentProcess() |
183 filename = win32process.GetModuleFileNameEx(proc, 0) |
183 filename = win32process.GetModuleFileNameEx(proc, 0) |
184 return [os.path.join(os.path.dirname(filename), 'mercurial.ini')] |
184 return [os.path.join(os.path.dirname(filename), 'mercurial.ini')] |
185 |
185 |
186 class posixfile(object): |
186 class posixfile_nt(object): |
187 '''file object with posix-like semantics. on windows, normal |
187 '''file object with posix-like semantics. on windows, normal |
188 files can not be deleted or renamed if they are open. must open |
188 files can not be deleted or renamed if they are open. must open |
189 with win32file.FILE_SHARE_DELETE. this flag does not exist on |
189 with win32file.FILE_SHARE_DELETE. this flag does not exist on |
190 windows <= nt.''' |
190 windows < nt, so do not use this class there.''' |
191 |
191 |
192 # tried to use win32file._open_osfhandle to pass fd to os.fdopen, |
192 # tried to use win32file._open_osfhandle to pass fd to os.fdopen, |
193 # but does not work at all. wrap win32 file api instead. |
193 # but does not work at all. wrap win32 file api instead. |
194 |
194 |
195 def __init__(self, name, mode='rb'): |
195 def __init__(self, name, mode='rb'): |