--- a/mercurial/posix.py Mon Feb 14 11:12:22 2011 +0100
+++ b/mercurial/posix.py Mon Feb 14 11:12:26 2011 +0100
@@ -13,6 +13,7 @@
nulldev = '/dev/null'
normpath = os.path.normpath
samestat = os.path.samestat
+os_link = os.link
unlink = os.unlink
rename = os.rename
expandglobs = False
@@ -24,6 +25,10 @@
'''return true if it is safe to hold open file handles to hardlinks'''
return True
+def nlinks(name):
+ '''return number of hardlinks for the given file'''
+ return os.lstat(name).st_nlink
+
def rcfiles(path):
rcs = [os.path.join(path, 'hgrc')]
rcdir = os.path.join(path, 'hgrc.d')