# HG changeset patch # User John Coomes # Date 1417646009 28800 # Node ID afa3fbbcabd3a4ac4000f06fe108b4e200dfc229 # Parent ffef6d503ab2b6c732ae6c786066b6ac9f6e858d add: use lexists so that broken symbolic links are added This restores the add behavior prior to d8cdd46f426d and matches the behavior of addremove. diff -r ffef6d503ab2 -r afa3fbbcabd3 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Tue Dec 02 05:12:59 2014 +0100 +++ b/mercurial/cmdutil.py Wed Dec 03 14:33:29 2014 -0800 @@ -1984,7 +1984,7 @@ cca = scmutil.casecollisionauditor(ui, abort, repo.dirstate) for f in wctx.walk(match): exact = match.exact(f) - if exact or not explicitonly and f not in wctx and repo.wvfs.exists(f): + if exact or not explicitonly and f not in wctx and repo.wvfs.lexists(f): if cca: cca(f) names.append(f) diff -r ffef6d503ab2 -r afa3fbbcabd3 tests/test-symlinks.t --- a/tests/test-symlinks.t Tue Dec 02 05:12:59 2014 +0100 +++ b/tests/test-symlinks.t Wed Dec 03 14:33:29 2014 -0800 @@ -3,12 +3,18 @@ == tests added in 0.7 == $ hg init test-symlinks-0.7; cd test-symlinks-0.7; - $ touch foo; ln -s foo bar; + $ touch foo; ln -s foo bar; ln -s nonexistent baz + +import with add and addremove -- symlink walking should _not_ screwup. -import with addremove -- symlink walking should _not_ screwup. - + $ hg add + adding bar + adding baz + adding foo + $ hg forget bar baz foo $ hg addremove adding bar + adding baz adding foo commit -- the symlink should _not_ appear added to dir state