equal
deleted
inserted
replaced
11 |
11 |
12 posixfile = open |
12 posixfile = open |
13 nulldev = '/dev/null' |
13 nulldev = '/dev/null' |
14 normpath = os.path.normpath |
14 normpath = os.path.normpath |
15 samestat = os.path.samestat |
15 samestat = os.path.samestat |
|
16 os_link = os.link |
16 unlink = os.unlink |
17 unlink = os.unlink |
17 rename = os.rename |
18 rename = os.rename |
18 expandglobs = False |
19 expandglobs = False |
19 |
20 |
20 umask = os.umask(0) |
21 umask = os.umask(0) |
21 os.umask(umask) |
22 os.umask(umask) |
22 |
23 |
23 def openhardlinks(): |
24 def openhardlinks(): |
24 '''return true if it is safe to hold open file handles to hardlinks''' |
25 '''return true if it is safe to hold open file handles to hardlinks''' |
25 return True |
26 return True |
|
27 |
|
28 def nlinks(name): |
|
29 '''return number of hardlinks for the given file''' |
|
30 return os.lstat(name).st_nlink |
26 |
31 |
27 def rcfiles(path): |
32 def rcfiles(path): |
28 rcs = [os.path.join(path, 'hgrc')] |
33 rcs = [os.path.join(path, 'hgrc')] |
29 rcdir = os.path.join(path, 'hgrc.d') |
34 rcdir = os.path.join(path, 'hgrc.d') |
30 try: |
35 try: |