fix a bug in dirstate.changes when cwd != repo.root
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Wed, 02 Nov 2005 16:13:41 -0800
changeset 1491 91c0e8d7ddcf
parent 1490 c3ffdb2c4091
child 1492 5f0522d31967
child 1499 874efc57e00a
fix a bug in dirstate.changes when cwd != repo.root - use lstat instead of stat - add a testcase (thanks to Johannes Hofmann)
mercurial/dirstate.py
tests/test-hgignore
tests/test-hgignore.out
--- a/mercurial/dirstate.py	Wed Nov 02 16:13:34 2005 -0800
+++ b/mercurial/dirstate.py	Wed Nov 02 16:13:41 2005 -0800
@@ -380,7 +380,8 @@
                 nonexistent = True
                 if not st:
                     try:
-                        st = os.lstat(fn)
+                        f = os.path.join(self.root, fn)
+                        st = os.lstat(f)
                     except OSError, inst:
                         if inst.errno != errno.ENOENT:
                             raise
--- a/tests/test-hgignore	Wed Nov 02 16:13:34 2005 -0800
+++ b/tests/test-hgignore	Wed Nov 02 16:13:41 2005 -0800
@@ -40,3 +40,6 @@
 
 echo "relglob:*" > .hgignore
 echo "--" ; hg status
+
+cd dir
+echo "--" ; hg status
--- a/tests/test-hgignore.out	Wed Nov 02 16:13:34 2005 -0800
+++ b/tests/test-hgignore.out	Wed Nov 02 16:13:41 2005 -0800
@@ -32,3 +32,5 @@
 ? dir/c.o
 --
 A dir/b.o
+--
+A b.o