Mercurial > hg
comparison mercurial/util.py @ 4000:3297aa945cf2
symlinks: add a linkfunc
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 29 Dec 2006 20:04:31 -0600 |
parents | 0b740dcf0cf1 |
children | d7b9ec589546 |
comparison
equal
deleted
inserted
replaced
3999:0b740dcf0cf1 | 4000:3297aa945cf2 |
---|---|
723 os.unlink(name) | 723 os.unlink(name) |
724 return True | 724 return True |
725 except OSError: | 725 except OSError: |
726 return False | 726 return False |
727 | 727 |
728 def linkfunc(path, fallback): | |
729 '''return an is_link() function with default to fallback''' | |
730 if checklink(path): | |
731 return lambda x: is_link(os.path.join(path, x)) | |
732 return fallback | |
733 | |
728 # Platform specific variants | 734 # Platform specific variants |
729 if os.name == 'nt': | 735 if os.name == 'nt': |
730 import msvcrt | 736 import msvcrt |
731 nulldev = 'NUL:' | 737 nulldev = 'NUL:' |
732 | 738 |