/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/remote.py

  • Committer: Andrew Bennetts
  • Date: 2007-03-29 09:08:25 UTC
  • mto: (2018.18.6 hpss-faster-copy)
  • mto: This revision was merged to the branch mainline in revision 2435.
  • Revision ID: andrew.bennetts@canonical.com-20070329090825-n2imszarc27gf6ls
All TestLockableFiles_RemoteLockDir tests passing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
615
615
    def __init__(self, bzrdir, _client):
616
616
        self.bzrdir = bzrdir
617
617
        self._client = _client
618
 
        LockableFiles.__init__(self, bzrdir.root_transport, 'lock',
619
 
                lockdir.LockDir)
 
618
        # XXX: This assumes that the branch control directory is .bzr/branch,
 
619
        # which isn't necessarily true.
 
620
        LockableFiles.__init__(
 
621
            self, bzrdir.root_transport.clone('.bzr/branch'),
 
622
            'lock', lockdir.LockDir)
620
623
 
621
624
    def get(self, path):
622
625
        """'get' a remote path as per the LockableFiles interface.
625
628
             just retrieve a file, instead we ask the smart server to generate
626
629
             a configuration for us - which is retrieved as an INI file.
627
630
        """
628
 
        if path != 'branch.conf':
629
 
            raise errors.NoSuchFile(path)
630
 
        assert path == 'branch.conf'
631
 
        path = self.bzrdir._path_for_remote_call(self._client)
632
 
        response = self._client.call2('Branch.get_config_file', path)
633
 
        assert response[0][0] == 'ok', \
634
 
            'unexpected response code %s' % (response[0],)
635
 
        return StringIO(response[1].read_body_bytes())
 
631
        if path == 'branch.conf':
 
632
            path = self.bzrdir._path_for_remote_call(self._client)
 
633
            response = self._client.call2('Branch.get_config_file', path)
 
634
            assert response[0][0] == 'ok', \
 
635
                'unexpected response code %s' % (response[0],)
 
636
            return StringIO(response[1].read_body_bytes())
 
637
        else:
 
638
            # VFS fallback.
 
639
            return LockableFiles.get(self, path)
636
640
 
637
641
 
638
642
class RemoteBranchFormat(branch.BranchFormat):