mercurial/util.py
branchstable
changeset 10896 2d61b612a09d
parent 10789 1b45468d3deb
child 10898 5589110e9170
child 10901 997173e49115
equal deleted inserted replaced
10885:9e4d120e3c32 10896:2d61b612a09d
   662     # a FS remount. Frequently we can detect it if files are created
   662     # a FS remount. Frequently we can detect it if files are created
   663     # with exec bit on.
   663     # with exec bit on.
   664 
   664 
   665     try:
   665     try:
   666         EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
   666         EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
   667         fh, fn = tempfile.mkstemp("", "", path)
   667         fh, fn = tempfile.mkstemp(dir=path, prefix='hg-checkexec-')
   668         try:
   668         try:
   669             os.close(fh)
   669             os.close(fh)
   670             m = os.stat(fn).st_mode & 0777
   670             m = os.stat(fn).st_mode & 0777
   671             new_file_has_exec = m & EXECFLAGS
   671             new_file_has_exec = m & EXECFLAGS
   672             os.chmod(fn, m ^ EXECFLAGS)
   672             os.chmod(fn, m ^ EXECFLAGS)