/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: Martin Pool
  • Date: 2008-05-07 06:03:09 UTC
  • mto: This revision was merged to the branch mainline in revision 3411.
  • Revision ID: mbp@sourcefrog.net-20080507060309-3z69hj7on7cud6wb
Remove erroneous handling of branch.conf for RemoteBranch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
1158
1158
        self._dir_mode = None
1159
1159
        self._file_mode = None
1160
1160
 
1161
 
    def get(self, path):
1162
 
        """'get' a remote path as per the LockableFiles interface.
1163
 
 
1164
 
        :param path: the file to 'get'. If this is 'branch.conf', we do not
1165
 
             just retrieve a file, instead we ask the smart server to generate
1166
 
             a configuration for us - which is retrieved as an INI file.
1167
 
        """
1168
 
        if path == 'branch.conf':
1169
 
            path = self.bzrdir._path_for_remote_call(self._client)
1170
 
            response = self._client.call_expecting_body(
1171
 
                'Branch.get_config_file', path)
1172
 
            assert response[0][0] == 'ok', \
1173
 
                'unexpected response code %s' % (response[0],)
1174
 
            return StringIO(response[1].read_body_bytes())
1175
 
        else:
1176
 
            # VFS fallback.
1177
 
            return LockableFiles.get(self, path)
1178
 
 
1179
1161
 
1180
1162
class RemoteBranchFormat(branch.BranchFormat):
1181
1163
 
1470
1452
        self._ensure_real()
1471
1453
        return self._real_branch.set_parent(url)
1472
1454
        
1473
 
    def get_config(self):
1474
 
        return RemoteBranchConfig(self)
1475
 
 
1476
1455
    def sprout(self, to_bzrdir, revision_id=None):
1477
1456
        # Like Branch.sprout, except that it sprouts a branch in the default
1478
1457
        # format, because RemoteBranches can't be created at arbitrary URLs.
1547
1526
            other, stop_revision=stop_revision, overwrite=overwrite)
1548
1527
 
1549
1528
 
1550
 
class RemoteBranchConfig(BranchConfig):
1551
 
 
1552
 
    def username(self):
1553
 
        self.branch._ensure_real()
1554
 
        return self.branch._real_branch.get_config().username()
1555
 
 
1556
 
    def _get_branch_data_config(self):
1557
 
        self.branch._ensure_real()
1558
 
        if self._branch_data_config is None:
1559
 
            self._branch_data_config = TreeConfig(self.branch._real_branch)
1560
 
        return self._branch_data_config
1561
 
 
1562
 
 
1563
1529
def _extract_tar(tar, to_dir):
1564
1530
    """Extract all the contents of a tarfile object.
1565
1531