context: handle untracked files in filectx.fileflags()
authorPatrick Mezard <pmezard@gmail.com>
Sat, 12 Apr 2008 21:08:03 +0200
changeset 6519 a7582980d654
parent 6494 c30849d4c8ba
child 6520 ba0b2dacc623
child 6529 0c611355481b
context: handle untracked files in filectx.fileflags()
mercurial/context.py
--- a/mercurial/context.py	Thu Apr 10 14:24:27 2008 +0200
+++ b/mercurial/context.py	Sat Apr 12 21:08:03 2008 +0200
@@ -521,8 +521,10 @@
         pnode = self._parents[0].changeset()[0]
         orig = self._repo.dirstate.copies().get(path, path)
         node, flag = self._repo.manifest.find(pnode, orig)
-        is_link = util.linkfunc(self._repo.root, lambda p: 'l' in flag)
-        is_exec = util.execfunc(self._repo.root, lambda p: 'x' in flag)
+        is_link = util.linkfunc(self._repo.root,
+                                lambda p: flag and 'l' in flag)
+        is_exec = util.execfunc(self._repo.root,
+                                lambda p: flag and 'x' in flag)
         try:
             return (is_link(path) and 'l' or '') + (is_exec(path) and 'e' or '')
         except OSError: