~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisiontree.py

  • Committer: John Arbash Meinel
  • Date: 2009-07-29 21:35:05 UTC
  • mfrom: (4576 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4577.
  • Revision ID: john@arbash-meinel.com-20090729213505-tkqsvy1zfpocu75w
Merge bzr.dev 4576 in prep for NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
                      default_revision=revision.CURRENT_REVISION):
88
88
        """See Tree.annotate_iter"""
89
89
        text_key = (file_id, self.inventory[file_id].revision)
90
 
        annotations = self._repository.texts.annotate(text_key)
 
90
        annotator = self._repository.texts.get_annotator()
 
91
        annotations = annotator.annotate_flat(text_key)
91
92
        return [(key[-1], line) for key, line in annotations]
92
93
 
93
94
    def get_file_size(self, file_id):
114
115
    def has_filename(self, filename):
115
116
        return bool(self.inventory.path2id(filename))
116
117
 
117
 
    def list_files(self, include_root=False):
 
118
    def list_files(self, include_root=False, from_dir=None, recursive=True):
118
119
        # The only files returned by this are those from the version
119
 
        entries = self.inventory.iter_entries()
120
 
        # skip the root for compatability with the current apis.
121
 
        if self.inventory.root is not None and not include_root:
 
120
        inv = self.inventory
 
121
        if from_dir is None:
 
122
            from_dir_id = None
 
123
        else:
 
124
            from_dir_id = inv.path2id(from_dir)
 
125
            if from_dir_id is None:
 
126
                # Directory not versioned
 
127
                return
 
128
        entries = inv.iter_entries(from_dir=from_dir_id, recursive=recursive)
 
129
        if inv.root is not None and not include_root and from_dir is None:
122
130
            # skip the root for compatability with the current apis.
123
131
            entries.next()
124
132
        for path, entry in entries: