# HG changeset patch # User Matt Mackall # Date 1234827443 21600 # Node ID 2c5b2abfb8be4e0cb286a5420ffc0f7b585103b3 # Parent 140429276b63d0b6268a1975601911900227044a patch: teach selectfile about symlinks (issue1438) diff -r 140429276b63 -r 2c5b2abfb8be mercurial/patch.py --- a/mercurial/patch.py Mon Feb 16 17:37:23 2009 -0600 +++ b/mercurial/patch.py Mon Feb 16 17:37:23 2009 -0600 @@ -751,7 +751,7 @@ nulla = afile_orig == "/dev/null" nullb = bfile_orig == "/dev/null" abase, afile = pathstrip(afile_orig, strip) - gooda = not nulla and os.path.exists(afile) + gooda = not nulla and util.lexists(afile) bbase, bfile = pathstrip(bfile_orig, strip) if afile == bfile: goodb = gooda diff -r 140429276b63 -r 2c5b2abfb8be tests/test-issue1438 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-issue1438 Mon Feb 16 17:37:23 2009 -0600 @@ -0,0 +1,16 @@ +#!/bin/sh +"$TESTDIR/hghave" symlink || exit 80 + +rm -rf a +hg init a +cd a + +ln -s foo link +hg add link +hg ci -mbad link +hg rm link +hg ci -mok +hg diff -g -r 0:1 > bad.patch +hg up 0 +hg import --no-commit bad.patch +hg st diff -r 140429276b63 -r 2c5b2abfb8be tests/test-issue1438.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-issue1438.out Mon Feb 16 17:37:23 2009 -0600 @@ -0,0 +1,4 @@ +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +applying bad.patch +R link +? bad.patch