170
170
return get_url(p, compressed=True)
174
"""For experimental purposes, traverse many parts of a remote branch"""
175
from bzrlib.revision import Revision
176
from bzrlib.branch import Branch
177
from bzrlib.inventory import Inventory
178
from bzrlib.xml import unpack_xml
184
history = get_url('/.bzr/revision-history').readlines()
185
num_revs = len(history)
186
for i, rev_id in enumerate(history):
187
rev_id = rev_id.rstrip()
188
print 'read revision %d/%d' % (i, num_revs)
190
# python gzip needs a seekable file (!!) but the HTTP response
191
# isn't, so we need to buffer it
193
rev_f = get_url('/.bzr/revision-store/%s' % rev_id,
196
rev = unpack_xml(Revision, rev_f)
198
inv_id = rev.inventory_id
199
if inv_id not in got_invs:
200
print 'get inventory %s' % inv_id
201
inv_f = get_url('/.bzr/inventory-store/%s' % inv_id,
203
inv = Inventory.read_xml(inv_f)
204
print '%4d inventory entries' % len(inv)
206
for path, ie in inv.iter_entries():
210
if text_id in got_texts:
212
print ' fetch %s text {%s}' % (path, text_id)
213
text_f = get_url('/.bzr/text-store/%s' % text_id,
215
got_texts[text_id] = True
217
got_invs.add[inv_id] = True
223
BASE_URL = 'http://bazaar-ng.org/bzr/bzr.dev/'
224
b = RemoteBranch(BASE_URL)
225
## print '\n'.join(b.revision_history())
226
from log import show_log
230
if __name__ == '__main__':