~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-06 22:44:57 UTC
  • mfrom: (6436 +trunk)
  • mto: (6437.3.11 2.5)
  • mto: This revision was merged to the branch mainline in revision 6444.
  • Revision ID: jelmer@samba.org-20120106224457-re0pcy0fz31xob77
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
 
18
 
17
19
import os
18
20
import errno
19
21
from stat import S_ISREG, S_IEXEC
761
763
 
762
764
    def _set_executability(self, path, trans_id):
763
765
        """Set the executability of versioned files """
764
 
        if supports_executable():
 
766
        if self._tree._supports_executable():
765
767
            new_executability = self._new_executability[trans_id]
766
768
            abspath = self._tree.abspath(path)
767
769
            current_mode = os.stat(abspath).st_mode
1231
1233
        finally:
1232
1234
            TreeTransformBase.finalize(self)
1233
1235
 
 
1236
    def _limbo_supports_executable(self):
 
1237
        """Check if the limbo path supports the executable bit."""
 
1238
        # FIXME: Check actual file system capabilities of limbodir
 
1239
        return osutils.supports_executable()
 
1240
 
1234
1241
    def _limbo_name(self, trans_id):
1235
1242
        """Generate the limbo name of a file"""
1236
1243
        limbo_name = self._limbo_files.get(trans_id)
2319
2326
            if kind == 'file':
2320
2327
                statval = os.lstat(limbo_name)
2321
2328
                size = statval.st_size
2322
 
                if not supports_executable():
 
2329
                if not tt._limbo_supports_executable():
2323
2330
                    executable = False
2324
2331
                else:
2325
2332
                    executable = statval.st_mode & S_IEXEC