# HG changeset patch # User Giorgos Keramidas # Date 1168025329 -7200 # Node ID eb5d4fec148723f00c655d43055341f1597a9c5c # Parent 6cb6cfe43c5d1ca3b4a46d90546bb039bce6245f Fix addremove for symlinks to non-existent files diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -185,7 +185,8 @@ def addremove(repo, pats=[], opts={}, wl mapping[abs] = rel, exact if repo.ui.verbose or not exact: repo.ui.status(_('adding %s\n') % ((pats and rel) or abs)) - if repo.dirstate.state(abs) != 'r' and not os.path.exists(rel): + islink = os.path.islink(rel) + if repo.dirstate.state(abs) != 'r' and not islink and not os.path.exists(rel): remove.append(abs) mapping[abs] = rel, exact if repo.ui.verbose or not exact: