mercurial/util.py
changeset 10898 5589110e9170
parent 10790 ef3668450cd0
parent 10896 2d61b612a09d
child 10903 cd21bf199d17
equal deleted inserted replaced
10897:adb6a291bbdb 10898:5589110e9170
   669     # a FS remount. Frequently we can detect it if files are created
   669     # a FS remount. Frequently we can detect it if files are created
   670     # with exec bit on.
   670     # with exec bit on.
   671 
   671 
   672     try:
   672     try:
   673         EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
   673         EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
   674         fh, fn = tempfile.mkstemp("", "", path)
   674         fh, fn = tempfile.mkstemp(dir=path, prefix='hg-checkexec-')
   675         try:
   675         try:
   676             os.close(fh)
   676             os.close(fh)
   677             m = os.stat(fn).st_mode & 0777
   677             m = os.stat(fn).st_mode & 0777
   678             new_file_has_exec = m & EXECFLAGS
   678             new_file_has_exec = m & EXECFLAGS
   679             os.chmod(fn, m ^ EXECFLAGS)
   679             os.chmod(fn, m ^ EXECFLAGS)