~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
            want_unversioned=want_unversioned,
94
94
            )
95
95
 
96
 
    def _iter_changes(self, from_tree, include_unchanged=False,
 
96
    @symbol_versioning.deprecated_method(symbol_versioning.one_three)
 
97
    def _iter_changes(self, *args, **kwargs):
 
98
        return self.iter_changes(*args, **kwargs)
 
99
 
 
100
    def iter_changes(self, from_tree, include_unchanged=False,
97
101
                     specific_files=None, pb=None, extra_trees=None,
98
102
                     require_versioned=True, want_unversioned=False):
99
103
        intertree = InterTree.get(from_tree, self)
100
 
        return intertree._iter_changes(include_unchanged, specific_files, pb,
 
104
        return intertree.iter_changes(include_unchanged, specific_files, pb,
101
105
            extra_trees, require_versioned, want_unversioned=want_unversioned)
102
106
    
103
107
    def conflicts(self):
145
149
    def __iter__(self):
146
150
        return iter(self.inventory)
147
151
 
 
152
    def all_file_ids(self):
 
153
        """Iterate through all file ids, including ids for missing files."""
 
154
        return set(self.inventory)
 
155
 
148
156
    def id2path(self, file_id):
149
157
        """Return the path for a file id.
150
158
 
185
193
        raise NotImplementedError("Tree subclass %s must implement kind"
186
194
            % self.__class__.__name__)
187
195
 
 
196
    def stored_kind(self, file_id):
 
197
        """File kind stored for this file_id.
 
198
 
 
199
        May not match kind on disk for working trees.  Always available
 
200
        for versioned files, even when the file itself is missing.
 
201
        """
 
202
        return self.kind(file_id)
 
203
 
188
204
    def path_content_summary(self, path):
189
205
        """Get a summary of the information about path.
190
206
        
281
297
        """Return the file_id for the root of this tree."""
282
298
        raise NotImplementedError(self.get_root_id)
283
299
 
284
 
    def annotate_iter(self, file_id):
 
300
    def annotate_iter(self, file_id,
 
301
                      default_revision=_mod_revision.CURRENT_REVISION):
285
302
        """Return an iterator of revision_id, line tuples.
286
303
 
287
304
        For working trees (and mutable trees in general), the special
288
305
        revision_id 'current:' will be used for lines that are new in this
289
306
        tree, e.g. uncommitted changes.
290
307
        :param file_id: The file to produce an annotated version from
 
308
        :param default_revision: For lines that don't match a basis, mark them
 
309
            with this revision id. Not all implementations will make use of
 
310
            this value.
291
311
        """
292
312
        raise NotImplementedError(self.annotate_iter)
293
313
 
706
726
            require_versioned=require_versioned,
707
727
            want_unversioned=want_unversioned)
708
728
 
709
 
    def _iter_changes(self, include_unchanged=False,
 
729
    def iter_changes(self, include_unchanged=False,
710
730
                      specific_files=None, pb=None, extra_trees=[],
711
731
                      require_versioned=True, want_unversioned=False):
712
732
        """Generate an iterator of changes between trees.