util: filter all st_mode with 0777 in checkexec
authorPatrick Mezard <pmezard@gmail.com>
Sat, 29 Dec 2007 01:14:45 +0100
changeset 5759 027264e720aa
parent 5758 3aa0af7d539d
child 5760 0145f9afb0e7
util: filter all st_mode with 0777 in checkexec
mercurial/util.py
--- a/mercurial/util.py	Fri Dec 28 17:10:57 2007 +0100
+++ b/mercurial/util.py	Sat Dec 29 01:14:45 2007 +0100
@@ -843,7 +843,7 @@
             m = os.stat(fn).st_mode & 0777
             new_file_has_exec = m & EXECFLAGS
             os.chmod(fn, m ^ EXECFLAGS)
-            exec_flags_cannot_flip = (os.stat(fn).st_mode == m)
+            exec_flags_cannot_flip = ((os.stat(fn).st_mode & 0777) == m)
         finally:
             os.unlink(fn)
     except (IOError, OSError):