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

  • Committer: Aaron Bentley
  • Date: 2009-05-20 17:20:14 UTC
  • mto: This revision was merged to the branch mainline in revision 4374.
  • Revision ID: aaron@aaronbentley.com-20090520172014-c3met75t69n8ilo9
Simplify by using CommitBuilder directly

Show diffs side-by-side

added added

removed removed

Lines of Context:
1119
1119
                   (from_executable, to_executable)))
1120
1120
        return iter(sorted(results, key=lambda x:x[1]))
1121
1121
 
1122
 
    def get_preview_tree(self, repository=None):
 
1122
    def get_preview_tree(self):
1123
1123
        """Return a tree representing the result of the transform.
1124
1124
 
1125
1125
        This tree only supports the subset of Tree functionality required
1126
1126
        by show_diff_trees.  It must only be compared to tt._tree.
1127
1127
        """
1128
 
        return _PreviewTree(self, repository)
 
1128
        return _PreviewTree(self)
1129
1129
 
1130
1130
    def _text_parent(self, trans_id):
1131
1131
        file_id = self.tree_file_id(trans_id)
1556
1556
class _PreviewTree(tree.Tree):
1557
1557
    """Partial implementation of Tree to support show_diff_trees"""
1558
1558
 
1559
 
    def __init__(self, transform, repository=None):
 
1559
    def __init__(self, transform):
1560
1560
        self._transform = transform
1561
1561
        self._final_paths = FinalPaths(transform)
1562
1562
        self.__by_parent = None
1564
1564
        self._all_children_cache = {}
1565
1565
        self._path2trans_id_cache = {}
1566
1566
        self._final_name_cache = {}
1567
 
        self._repository = repository
1568
1567
 
1569
1568
    def _changes(self, file_id):
1570
1569
        for changes in self._transform.iter_changes():
1948
1947
    def get_parent_ids(self):
1949
1948
        return self._parent_ids
1950
1949
 
1951
 
    def last_revision(self):
1952
 
        if len(self._parent_ids) == 0:
1953
 
            return _mod_revision.NULL_REVISION
1954
 
        return self._parent_ids[0]
1955
 
 
1956
 
    def basis_tree(self):
1957
 
        return self._repository.revision_tree(self.last_revision())
1958
 
 
1959
1950
    def set_parent_ids(self, parent_ids):
1960
1951
        self._parent_ids = parent_ids
1961
1952