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

  • Committer: Martin Pool
  • Date: 2005-05-17 08:34:38 UTC
  • Revision ID: mbp@sourcefrog.net-20050517083438-1cb322f539833768
- new RemoteStore class
- use this for inventory_store and text_store in RemoteBranch
- log -v now works (slowly)  on remote branches

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
            self.baseurl = baseurl
113
113
            self._check_format()
114
114
 
 
115
        self.inventory_store = RemoteStore(baseurl + '/.bzr/inventory-store/')
 
116
        self.text_store = RemoteStore(baseurl + '/.bzr/text-store/')
 
117
 
115
118
    def __str__(self):
116
119
        return '%s(%r)' % (self.__class__.__name__, self.baseurl)
117
120
 
145
148
            raise BzrCheckError('revision stored as {%s} actually contains {%s}'
146
149
                                % (revision_id, r.revision_id))
147
150
        return r
 
151
 
 
152
 
 
153
class RemoteStore:
 
154
    def __init__(self, baseurl):
 
155
        self._baseurl = baseurl
 
156
        
 
157
 
 
158
    def _path(self, name):
 
159
        if '/' in name:
 
160
            raise ValueError('invalid store id', name)
 
161
        return self._baseurl + '/' + name
 
162
        
 
163
    def __getitem__(self, fileid):
 
164
        p = self._path(fileid)
 
165
        return get_url(p, compressed=True)
148
166
    
149
167
 
150
168
def simple_walk():
 
169
    """For experimental purposes, traverse many parts of a remote branch"""
151
170
    from revision import Revision
152
171
    from branch import Branch
153
172
    from inventory import Inventory