/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 processors/generic_processor.py

fix support for rich-root (and subtree) repositories

Show diffs side-by-side

added added

removed removed

Lines of Context:
696
696
        self.revision_id = self.gen_revision_id()
697
697
        # cache of texts for this commit, indexed by file-id
698
698
        self.lines_for_commit = {}
 
699
        if self.repo.supports_rich_root():
 
700
            self.lines_for_commit[inventory.ROOT_ID] = []
699
701
 
700
702
        # Track the heads and get the real parent list
701
703
        parents = _track_heads(self.command, self.cache_mgr)
716
718
            inv = self.get_inventory(self.parents[0])
717
719
            # TODO: Shallow copy - deep inventory copying is expensive
718
720
            self.inventory = inv.copy()
719
 
        if not self.repo.supports_rich_root():
 
721
        if self.repo.supports_rich_root():
 
722
            self.inventory.revision_id = self.revision_id
 
723
        else:
720
724
            # In this repository, root entries have no knit or weave. When
721
725
            # serializing out to disk and back in, root.revision is always
722
726
            # the new revision_id.
845
849
    def gen_initial_inventory(self):
846
850
        """Generate an inventory for a parentless revision."""
847
851
        inv = inventory.Inventory(revision_id=self.revision_id)
 
852
        if self.repo.supports_rich_root():
 
853
            # The very first root needs to have the right revision
 
854
            inv.root.revision = self.revision_id
848
855
        return inv
849
856
 
850
857
    def gen_revision_id(self):