Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 3997:3f0ba82c103f
exec: remove last flag from is_exec
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 29 Dec 2006 20:04:31 -0600 |
parents | c190df14338c |
children | 315d47991fd4 |
comparison
equal
deleted
inserted
replaced
3996:c190df14338c | 3997:3f0ba82c103f |
---|---|
708 return r | 708 return r |
709 | 709 |
710 def execfunc(path, fallback): | 710 def execfunc(path, fallback): |
711 '''return an is_exec() function with default to fallback''' | 711 '''return an is_exec() function with default to fallback''' |
712 if checkexec(path): | 712 if checkexec(path): |
713 return lambda x: is_exec(os.path.join(path, x), False) | 713 return lambda x: is_exec(os.path.join(path, x)) |
714 return fallback | 714 return fallback |
715 | 715 |
716 # Platform specific variants | 716 # Platform specific variants |
717 if os.name == 'nt': | 717 if os.name == 'nt': |
718 import msvcrt | 718 import msvcrt |
769 return pf | 769 return pf |
770 | 770 |
771 def testpid(pid): | 771 def testpid(pid): |
772 '''return False if pid dead, True if running or not known''' | 772 '''return False if pid dead, True if running or not known''' |
773 return True | 773 return True |
774 | |
775 def is_exec(f, last): | |
776 return last | |
777 | 774 |
778 def set_exec(f, mode): | 775 def set_exec(f, mode): |
779 pass | 776 pass |
780 | 777 |
781 def set_binary(fd): | 778 def set_binary(fd): |
847 pf = output_line[14:] | 844 pf = output_line[14:] |
848 if pf.startswith("'") and pf.endswith("'") and " " in pf: | 845 if pf.startswith("'") and pf.endswith("'") and " " in pf: |
849 pf = pf[1:-1] # Remove the quotes | 846 pf = pf[1:-1] # Remove the quotes |
850 return pf | 847 return pf |
851 | 848 |
852 def is_exec(f, last): | 849 def is_exec(f): |
853 """check whether a file is executable""" | 850 """check whether a file is executable""" |
854 return (os.lstat(f).st_mode & 0100 != 0) | 851 return (os.lstat(f).st_mode & 0100 != 0) |
855 | 852 |
856 def set_exec(f, mode): | 853 def set_exec(f, mode): |
857 s = os.lstat(f).st_mode | 854 s = os.lstat(f).st_mode |