~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-05 16:03:11 UTC
  • mfrom: (6432 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6433.
  • Revision ID: jelmer@samba.org-20120105160311-12o5p67kin1v3zps
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
WorkingTree.open(dir).
23
23
"""
24
24
 
 
25
from __future__ import absolute_import
 
26
 
25
27
from cStringIO import StringIO
26
28
import os
27
29
import sys
476
478
            return False # Missing entries are not executable
477
479
        return entry[1][0][3] # Executable?
478
480
 
479
 
    if not osutils.supports_executable():
480
 
        def is_executable(self, file_id, path=None):
481
 
            """Test if a file is executable or not.
 
481
    def is_executable(self, file_id, path=None):
 
482
        """Test if a file is executable or not.
482
483
 
483
 
            Note: The caller is expected to take a read-lock before calling this.
484
 
            """
 
484
        Note: The caller is expected to take a read-lock before calling this.
 
485
        """
 
486
        if not self._supports_executable():
485
487
            entry = self._get_entry(file_id=file_id, path=path)
486
488
            if entry == (None, None):
487
489
                return False
488
490
            return entry[1][0][3]
489
 
 
490
 
        _is_executable_from_path_and_stat = \
491
 
            _is_executable_from_path_and_stat_from_basis
492
 
    else:
493
 
        def is_executable(self, file_id, path=None):
494
 
            """Test if a file is executable or not.
495
 
 
496
 
            Note: The caller is expected to take a read-lock before calling this.
497
 
            """
 
491
        else:
498
492
            self._must_be_locked()
499
493
            if not path:
500
494
                path = self.id2path(file_id)
1484
1478
        control_files = self._open_control_files(a_bzrdir)
1485
1479
        control_files.create_lock()
1486
1480
        control_files.lock_write()
1487
 
        transport.put_bytes('format', self.get_format_string(),
 
1481
        transport.put_bytes('format', self.as_string(),
1488
1482
            mode=a_bzrdir._get_file_mode())
1489
1483
        if from_branch is not None:
1490
1484
            branch = from_branch
2266
2260
    def update_format(self, tree):
2267
2261
        """Change the format marker."""
2268
2262
        tree._transport.put_bytes('format',
2269
 
            self.target_format.get_format_string(),
 
2263
            self.target_format.as_string(),
2270
2264
            mode=tree.bzrdir._get_file_mode())
2271
2265
 
2272
2266
 
2289
2283
    def update_format(self, tree):
2290
2284
        """Change the format marker."""
2291
2285
        tree._transport.put_bytes('format',
2292
 
            self.target_format.get_format_string(),
 
2286
            self.target_format.as_string(),
2293
2287
            mode=tree.bzrdir._get_file_mode())
2294
2288
 
2295
2289
 
2318
2312
    def update_format(self, tree):
2319
2313
        """Change the format marker."""
2320
2314
        tree._transport.put_bytes('format',
2321
 
            self.target_format.get_format_string(),
 
2315
            self.target_format.as_string(),
2322
2316
            mode=tree.bzrdir._get_file_mode())