Fix workingctx exec/link bit of copies on non-supporting systems
authorPatrick Mezard <pmezard@gmail.com>
Sun, 07 Oct 2007 15:07:35 +0200
changeset 5407 d7e7902bb190
parent 5406 f11554a097c8
child 5408 36794dbe66a3
Fix workingctx exec/link bit of copies on non-supporting systems
mercurial/context.py
--- a/mercurial/context.py	Sat Oct 06 22:30:24 2007 +0200
+++ b/mercurial/context.py	Sun Oct 07 15:07:35 2007 +0200
@@ -426,9 +426,11 @@
         """generate a manifest corresponding to the working directory"""
 
         man = self._parents[0].manifest().copy()
-        is_exec = util.execfunc(self._repo.root, man.execf)
-        is_link = util.linkfunc(self._repo.root, man.linkf)
         copied = self._repo.dirstate.copies()
+        is_exec = util.execfunc(self._repo.root,
+                                lambda p: man.execf(copied.get(p,p)))
+        is_link = util.linkfunc(self._repo.root,
+                                lambda p: man.linkf(copied.get(p,p)))
         modified, added, removed, deleted, unknown = self._status[:5]
         for i, l in (("a", added), ("m", modified), ("u", unknown)):
             for f in l:
@@ -482,7 +484,8 @@
                 return ''
         
         pnode = self._parents[0].changeset()[0]
-        node, flag = self._repo.manifest.find(pnode, path)
+        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)
         try: