diff mercurial/localrepo.py @ 6158:23ffe82615d8

repo.status: also compare flags for files in the lookup list. We might be able to do something smarter about this in dirstate.status for files in normallookup state, but that would require some extra care to keep backwards compatibility.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 21 Feb 2008 16:22:31 -0300
parents 989467e8e3a9
children d500aeb8092e
line wrap: on
line diff
--- a/mercurial/localrepo.py	Thu Feb 21 16:22:31 2008 -0300
+++ b/mercurial/localrepo.py	Thu Feb 21 16:22:31 2008 -0300
@@ -1003,8 +1003,15 @@
                     fixup = []
                     # do a full compare of any files that might have changed
                     ctx = self.changectx()
+                    mexec = lambda f: 'x' in ctx.fileflags(f)
+                    mlink = lambda f: 'l' in ctx.fileflags(f)
+                    is_exec = util.execfunc(self.root, mexec)
+                    is_link = util.linkfunc(self.root, mlink)
+                    def flags(f):
+                        return is_link(f) and 'l' or is_exec(f) and 'x' or ''
                     for f in lookup:
-                        if f not in ctx or ctx[f].cmp(self.wread(f)):
+                        if (f not in ctx or flags(f) != ctx.fileflags(f)
+                            or ctx[f].cmp(self.wread(f))):
                             modified.append(f)
                         else:
                             fixup.append(f)