mercurial/util.py
changeset 5351 efe7ef325737
parent 5293 32ec518ee3cb
parent 5350 1df76921aab3
child 5356 b98c377b3c16
equal deleted inserted replaced
5349:9189ae05467d 5351:efe7ef325737
  1093         """check whether a file is executable"""
  1093         """check whether a file is executable"""
  1094         return (os.lstat(f).st_mode & 0100 != 0)
  1094         return (os.lstat(f).st_mode & 0100 != 0)
  1095 
  1095 
  1096     def set_exec(f, mode):
  1096     def set_exec(f, mode):
  1097         s = os.lstat(f).st_mode
  1097         s = os.lstat(f).st_mode
  1098         if (s & 0100 != 0) == mode:
  1098         if stat.S_ISLNK(s) or (s & 0100 != 0) == mode:
  1099             return
  1099             return
  1100         if mode:
  1100         if mode:
  1101             # Turn on +x for every +r bit when making a file executable
  1101             # Turn on +x for every +r bit when making a file executable
  1102             # and obey umask.
  1102             # and obey umask.
  1103             os.chmod(f, s | (s & 0444) >> 2 & ~_umask)
  1103             os.chmod(f, s | (s & 0444) >> 2 & ~_umask)