comparison mercurial/util.py @ 13375:f1fa8f481c7c

port win32.py to using the Python ctypes library The pywin32 package is no longer needed. ctypes is now required for running Mercurial on Windows. ctypes is included in Python since version 2.5. For Python 2.4, ctypes is available as an extra installer package for Windows. Moved spawndetached() from windows.py to win32.py and fixed it, using ctypes as well. spawndetached was defunct with Python 2.6.6 because Python removed their undocumented subprocess.CreateProcess. This fixes 'hg serve -d' on Windows.
author Adrian Buehlmann <adrian@cadifra.com>
date Mon, 14 Feb 2011 11:12:26 +0100
parents 2dc7a2a96cfd
children 777cef34a890
comparison
equal deleted inserted replaced
13374:1c613c1ae43d 13375:f1fa8f481c7c
552 self.audited.add(path) 552 self.audited.add(path)
553 # only add prefixes to the cache after checking everything: we don't 553 # only add prefixes to the cache after checking everything: we don't
554 # want to add "foo/bar/baz" before checking if there's a "foo/.hg" 554 # want to add "foo/bar/baz" before checking if there's a "foo/.hg"
555 self.auditeddir.update(prefixes) 555 self.auditeddir.update(prefixes)
556 556
557 def nlinks(pathname):
558 """Return number of hardlinks for the given file."""
559 return os.lstat(pathname).st_nlink
560
561 if hasattr(os, 'link'):
562 os_link = os.link
563 else:
564 def os_link(src, dst):
565 raise OSError(0, _("Hardlinks not supported"))
566
567 def lookup_reg(key, name=None, scope=None): 557 def lookup_reg(key, name=None, scope=None):
568 return None 558 return None
569 559
570 def hidewindow(): 560 def hidewindow():
571 """Hide current shell window. 561 """Hide current shell window.