dirstate: ignore mode changes if the fs does not supports the exec bit
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Fri, 14 Mar 2008 09:56:58 -0300
changeset 6257 bfd49ce0db64
parent 6256 69c75d063c7a
child 6258 c24f4b3f156b
dirstate: ignore mode changes if the fs does not supports the exec bit This can make a difference when e.g. the repo is exported through NFS (which support exec bits) and CIFS (which does not).
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Fri Mar 14 09:56:58 2008 -0300
+++ b/mercurial/dirstate.py	Fri Mar 14 09:56:58 2008 -0300
@@ -63,6 +63,9 @@
         elif name == '_slash':
             self._slash = self._ui.configbool('ui', 'slash') and os.sep != '/'
             return self._slash
+        elif name == '_checkexec':
+            self._checkexec = util.checkexec(self._root)
+            return self._checkexec
         else:
             raise AttributeError, name
 
@@ -578,8 +581,9 @@
             if type_ == 'n':
                 if not st:
                     st = lstat(_join(fn))
-                if (size >= 0 and (size != st.st_size
-                                   or (mode ^ st.st_mode) & 0100)
+                if (size >= 0 and
+                    (size != st.st_size
+                     or ((mode ^ st.st_mode) & 0100 and self._checkexec))
                     or size == -2
                     or fn in self._copymap):
                     madd(fn)