[PATCH] set_exec: do not chmod a symlink

Steve Borho steve at borho.org
Tue Oct 2 09:52:55 CDT 2007


# HG changeset patch
# User Steve Borho <steve at ageia.com>
# Date 1191336709 18000
# Node ID bcc7eee41f17409bc9bd4447a5c409df4829e8a4
# Parent  9189ae05467d36217f85970b585177bb5bcdc23b
set_exec: do not chmod a symlink

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1095,7 +1095,7 @@ else:
 
     def set_exec(f, mode):
         s = os.lstat(f).st_mode
-        if (s & 0100 != 0) == mode:
+        if stat.S_ISLNK(s) or (s & 0100 != 0) == mode:
             return
         if mode:
             # Turn on +x for every +r bit when making a file executable


More information about the Mercurial-devel mailing list