changeset 5347:1df76921aab3

set_exec: do not chmod a symlink
author Steve Borho <steve@ageia.com>
date Tue, 02 Oct 2007 20:22:33 +0200
parents 8838fe5a236f
children efe7ef325737 645a40777fd4
files mercurial/util.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Sun Sep 30 16:36:22 2007 +0200
+++ b/mercurial/util.py	Tue Oct 02 20:22:33 2007 +0200
@@ -14,7 +14,7 @@
 
 from i18n import _
 import cStringIO, errno, getpass, popen2, re, shutil, sys, tempfile
-import os, threading, time, calendar, ConfigParser, locale, glob
+import os, stat, threading, time, calendar, ConfigParser, locale, glob
 
 try:
     set = set
@@ -1047,7 +1047,7 @@
 
     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