Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 5759:027264e720aa
util: filter all st_mode with 0777 in checkexec
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sat, 29 Dec 2007 01:14:45 +0100 |
parents | df09fad0059e |
children | 0145f9afb0e7 |
comparison
equal
deleted
inserted
replaced
5758:3aa0af7d539d | 5759:027264e720aa |
---|---|
841 try: | 841 try: |
842 os.close(fh) | 842 os.close(fh) |
843 m = os.stat(fn).st_mode & 0777 | 843 m = os.stat(fn).st_mode & 0777 |
844 new_file_has_exec = m & EXECFLAGS | 844 new_file_has_exec = m & EXECFLAGS |
845 os.chmod(fn, m ^ EXECFLAGS) | 845 os.chmod(fn, m ^ EXECFLAGS) |
846 exec_flags_cannot_flip = (os.stat(fn).st_mode == m) | 846 exec_flags_cannot_flip = ((os.stat(fn).st_mode & 0777) == m) |
847 finally: | 847 finally: |
848 os.unlink(fn) | 848 os.unlink(fn) |
849 except (IOError, OSError): | 849 except (IOError, OSError): |
850 # we don't care, the user probably won't be able to commit anyway | 850 # we don't care, the user probably won't be able to commit anyway |
851 return False | 851 return False |