# HG changeset patch # User Alexis S. L. Carvalho # Date 1174955786 10800 # Node ID 384672d8080f50ee48d3856558bbbc2fc3148539 # Parent a9336520a4ee99629d8266a726f50f577f38aee7 add util.lexists diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -585,6 +585,15 @@ def system(cmd, environ={}, cwd=None, on if cwd is not None and oldcwd != cwd: os.chdir(oldcwd) +# os.path.lexists is not available on python2.3 +def lexists(filename): + "test whether a file with this name exists. does not follow symlinks" + try: + os.lstat(filename) + except: + return False + return True + def rename(src, dst): """forcibly rename a file""" try: