changeset 5536:fdee5d614fcc

convert: force svn:executable when execute-bit is not supported The util.is_exec fallback would be to ask subversion for the current value of svn:executable. Setting it directly is just simpler.
author Patrick Mezard <pmezard@gmail.com>
date Sun, 11 Nov 2007 19:34:00 +0100
parents 7501ef26402b
children e01c748cb632
files hgext/convert/subversion.py
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/subversion.py	Sun Nov 11 14:17:30 2007 +0100
+++ b/hgext/convert/subversion.py	Sun Nov 11 19:34:00 2007 +0100
@@ -740,6 +740,7 @@
         self.opener = util.opener(self.wc)
         self.wopener = util.opener(self.wc)
         self.childmap = mapfile(ui, self.join('hg-childmap'))
+        self.is_exec = util.checkexec(self.wc) and util.is_exec or None
 
         if created:
             hook = os.path.join(created, 'hooks', 'pre-revprop-change')
@@ -761,7 +762,15 @@
             except OSError:
                 pass
             self.wopener(filename, 'w').write(data)
-            was_exec = util.is_exec(self.wjoin(filename))
+
+            if self.is_exec:
+                was_exec = self.is_exec(self.wjoin(filename))
+            else:
+                # On filesystems not supporting execute-bit, there is no way
+                # to know if it is set but asking subversion. Setting it
+                # systematically is just as expensive and much simpler.
+                was_exec = 'x' not in flags
+
             util.set_exec(self.wjoin(filename), 'x' in flags)
             if was_exec:
                 if 'x' not in flags: