~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/vfs.py

  • Committer: Ian Clatworthy
  • Date: 2009-03-20 04:22:44 UTC
  • mfrom: (3368.2.54 bzr.content-filters)
  • mto: This revision was merged to the branch mainline in revision 4173.
  • Revision ID: ian.clatworthy@canonical.com-20090320042244-xwqpk6gc4t9y9pbi
Content filters (Ian Clatworthy)

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 
52
52
class VfsRequest(request.SmartServerRequest):
53
53
    """Base class for VFS requests.
54
 
    
 
54
 
55
55
    VFS requests are disabled if vfs_enabled() returns False.
56
56
    """
57
57
 
72
72
 
73
73
    def do(self, relpath):
74
74
        relpath = self.translate_client_path(relpath)
75
 
        try:
76
 
            backing_bytes = self._backing_transport.get_bytes(relpath)
77
 
        except errors.ReadError:
78
 
            # cannot read the file
79
 
            return request.FailedSmartServerResponse(('ReadError', ))
80
 
        except errors.PermissionDenied:
81
 
            return request.FailedSmartServerResponse(('PermissionDenied',))
 
75
        backing_bytes = self._backing_transport.get_bytes(relpath)
82
76
        return request.SuccessfulSmartServerResponse(('ok',), backing_bytes)
83
77
 
84
78
 
88
82
        relpath = self.translate_client_path(relpath)
89
83
        self._relpath = relpath
90
84
        self._mode = _deserialise_optional_mode(mode)
91
 
    
 
85
 
92
86
    def do_body(self, body_bytes):
93
87
        old_length = self._backing_transport.append_bytes(
94
88
            self._relpath, body_bytes, self._mode)