Mercurial > public > mercurial-scm > hg
diff mercurial/util.py @ 4275:81402b2b294d
use os.path.islink instead of util.is_link; remove util.is_link
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Fri, 23 Mar 2007 23:40:25 -0300 |
parents | 1eaa8d90c689 |
children | 384672d8080f |
line wrap: on
line diff
--- a/mercurial/util.py Fri Mar 23 23:40:24 2007 -0300 +++ b/mercurial/util.py Fri Mar 23 23:40:25 2007 -0300 @@ -792,7 +792,7 @@ def linkfunc(path, fallback): '''return an is_link() function with default to fallback''' if checklink(path): - return lambda x: is_link(os.path.join(path, x)) + return lambda x: os.path.islink(os.path.join(path, x)) return fallback # Platform specific variants @@ -968,10 +968,6 @@ else: os.chmod(f, s & 0666) - def is_link(f): - """check whether a file is a symlink""" - return (os.lstat(f).st_mode & 0120000 == 0120000) - def set_link(f, mode): """make a file a symbolic link/regular file @@ -979,7 +975,7 @@ if a link is changed to a file, its link data become its contents """ - m = is_link(f) + m = os.path.islink(f) if m == bool(mode): return