/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/smart/vfs.py

Get test_remote.BasicRemoteObjectTests.test_open_remote_branch passing by implementing a remote method BzrDir.find_repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        return int(mode)
40
40
 
41
41
 
 
42
def vfs_enabled():
 
43
    """Is the VFS enabled ?
 
44
 
 
45
    the VFS is disabled when the NO_SMART_VFS environment variable is set.
 
46
 
 
47
    :return: True if it is enabled.
 
48
    """
 
49
    return not 'NO_SMART_VFS' in os.environ
 
50
 
 
51
 
42
52
class VfsRequest(request.SmartServerRequest):
43
53
    """Base class for VFS requests.
44
54
    
45
 
    VFS requests are disabled if the NO_SMART_VFS environment variable is set.
 
55
    VFS requests are disabled if vfs_enabled() returns False.
46
56
    """
47
57
 
48
58
    def _check_enabled(self):
49
 
        if 'NO_SMART_VFS' in os.environ:
 
59
        if not vfs_enabled():
50
60
            raise errors.DisabledMethod(self.__class__.__name__)
51
61
 
52
62