~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Aaron Bentley
  • Date: 2006-08-22 18:40:32 UTC
  • mto: (1910.2.43 format-bumps)
  • mto: This revision was merged to the branch mainline in revision 1997.
  • Revision ID: abentley@panoramicfeedback.com-20060822184032-6417522b3ab98f69
Implement creation of knits for tree roots

Show diffs side-by-side

added added

removed removed

Lines of Context:
284
284
class Knit1to2Fetcher(KnitRepoFetcher):
285
285
    """Fetch from a Knit1 repository into a Knit2 repository"""
286
286
 
287
 
    pass
 
287
    def _fetch_weave_texts(self, revs):
 
288
        KnitRepoFetcher._fetch_weave_texts(self, revs)
 
289
        # Now generate a weave for the tree root
 
290
        revision_trees = self.from_repository.revision_trees(revs)
 
291
        inventory_weave = self.from_repository.get_inventory_weave()
 
292
        for tree in revision_trees:
 
293
            parent_texts = {}
 
294
            revision_id = tree.inventory.root.revision
 
295
            parents = inventory_weave.get_parents(revision_id)
 
296
            versionedfile = self.to_repository.weave_store.get_weave_or_empty(
 
297
                tree.inventory.root.file_id, 
 
298
                self.to_repository.get_transaction())
 
299
            parent_texts = versionedfile.add_lines(revision_id, parents, [], 
 
300
                                                   parent_texts)
 
301
        versionedfile.clear_cache()
288
302
 
289
303
 
290
304
class Fetcher(object):