Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 10898:5589110e9170
merge with stable
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Tue, 13 Apr 2010 22:10:24 +0200 |
parents | ef3668450cd0 2d61b612a09d |
children | cd21bf199d17 |
comparison
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) |