Mercurial > public > mercurial-scm > hg-stable
diff mercurial/context.py @ 12344:b6173aee4a47 stable
Use lexists() instead of exists() where appropriate
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 20 Sep 2010 21:46:56 +0200 |
parents | a4fbbe0fbc38 |
children | e0ee3e822a9a 4ae3e5dffa60 |
line wrap: on
line diff
--- a/mercurial/context.py Mon Sep 20 21:46:39 2010 +0200 +++ b/mercurial/context.py Mon Sep 20 21:46:56 2010 +0200 @@ -824,7 +824,7 @@ wlock = self._repo.wlock() try: for f in list: - if unlink and os.path.exists(self._repo.wjoin(f)): + if unlink and os.path.lexists(self._repo.wjoin(f)): self._repo.ui.warn(_("%s still exists!\n") % f) elif self._repo.dirstate[f] == 'a': self._repo.dirstate.forget(f) @@ -852,7 +852,7 @@ def copy(self, source, dest): p = self._repo.wjoin(dest) - if not (os.path.exists(p) or os.path.islink(p)): + if not os.path.lexists(p): self._repo.ui.warn(_("%s does not exist!\n") % dest) elif not (os.path.isfile(p) or os.path.islink(p)): self._repo.ui.warn(_("copy failed: %s is not a file or a "