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

  • Committer: John Arbash Meinel
  • Date: 2008-06-05 16:27:16 UTC
  • mfrom: (3475 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3476.
  • Revision ID: john@arbash-meinel.com-20080605162716-a3hn238tnctbfd8j
merge bzr.dev, resolve NEWS

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):
250
254
        """
251
255
        raise NotImplementedError(self.get_file_mtime)
252
256
 
 
257
    def get_file_size(self, file_id):
 
258
        """Return the size of a file in bytes.
 
259
 
 
260
        This applies only to regular files.  If invoked on directories or
 
261
        symlinks, it will return None.
 
262
        :param file_id: The file-id of the file
 
263
        """
 
264
        raise NotImplementedError(self.get_file_size)
 
265
 
253
266
    def get_file_by_path(self, path):
254
267
        return self.get_file(self._inventory.path2id(path), path)
255
268
 
293
306
        """Return the file_id for the root of this tree."""
294
307
        raise NotImplementedError(self.get_root_id)
295
308
 
296
 
    def annotate_iter(self, file_id):
 
309
    def annotate_iter(self, file_id,
 
310
                      default_revision=_mod_revision.CURRENT_REVISION):
297
311
        """Return an iterator of revision_id, line tuples.
298
312
 
299
313
        For working trees (and mutable trees in general), the special
300
314
        revision_id 'current:' will be used for lines that are new in this
301
315
        tree, e.g. uncommitted changes.
302
316
        :param file_id: The file to produce an annotated version from
 
317
        :param default_revision: For lines that don't match a basis, mark them
 
318
            with this revision id. Not all implementations will make use of
 
319
            this value.
303
320
        """
304
321
        raise NotImplementedError(self.annotate_iter)
305
322
 
511
528
        return False
512
529
 
513
530
    def kind(self, file_id):
514
 
        assert self._inventory[file_id].kind == "directory"
515
531
        return "directory"
516
532
 
517
533
    def list_files(self, include_root=False):
560
576
        # what happened to the file that used to have
561
577
        # this name.  There are two possibilities: either it was
562
578
        # deleted entirely, or renamed.
563
 
        assert old_id
564
579
        if new_inv.has_id(old_id):
565
580
            return 'X', old_inv.id2path(old_id), new_inv.id2path(old_id)
566
581
        else:
718
733
            require_versioned=require_versioned,
719
734
            want_unversioned=want_unversioned)
720
735
 
721
 
    def _iter_changes(self, include_unchanged=False,
 
736
    def iter_changes(self, include_unchanged=False,
722
737
                      specific_files=None, pb=None, extra_trees=[],
723
738
                      require_versioned=True, want_unversioned=False):
724
739
        """Generate an iterator of changes between trees.
887
902
            # the parent's path is necessarily known at this point.
888
903
            yield(file_id, (path, to_path), changed_content, versioned, parent,
889
904
                  name, kind, executable)
890
 
 
891
 
 
892
 
# This was deprecated before 0.12, but did not have an official warning
893
 
@symbol_versioning.deprecated_function(symbol_versioning.zero_twelve)
894
 
def RevisionTree(*args, **kwargs):
895
 
    """RevisionTree has moved to bzrlib.revisiontree.RevisionTree()
896
 
 
897
 
    Accessing it as bzrlib.tree.RevisionTree has been deprecated as of
898
 
    bzr 0.12.
899
 
    """
900
 
    from bzrlib.revisiontree import RevisionTree as _RevisionTree
901
 
    return _RevisionTree(*args, **kwargs)
902
 
 
903