Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 298:91c9fd6a7c70
Turn on +x for every +r bit when making a file executable and obey umask.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Thu, 09 Jun 2005 09:24:08 +0100 |
parents | 0dbcf3c9ff20 |
children | 7c239fad0f27 |
comparison
equal
deleted
inserted
replaced
297:0dbcf3c9ff20 | 298:91c9fd6a7c70 |
---|---|
16 | 16 |
17 def set_exec(f, mode): | 17 def set_exec(f, mode): |
18 s = os.stat(f).st_mode | 18 s = os.stat(f).st_mode |
19 if (s & 0100 != 0) == mode: | 19 if (s & 0100 != 0) == mode: |
20 return | 20 return |
21 os.chmod(f, s & 0666 | (mode * 0111)) | 21 if mode: |
22 umask = os.umask(0) | |
23 os.umask(umask) | |
24 os.chmod(f, s | (s & 0444) >> 2 & ~umask) | |
25 else: | |
26 os.chmod(f, s & 0666) | |
22 | 27 |
23 class filelog(revlog): | 28 class filelog(revlog): |
24 def __init__(self, opener, path): | 29 def __init__(self, opener, path): |
25 revlog.__init__(self, opener, | 30 revlog.__init__(self, opener, |
26 os.path.join("data", path + ".i"), | 31 os.path.join("data", path + ".i"), |