~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Robert Collins
  • Date: 2010-05-06 23:54:05 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506235405-wii4elupfhzl3jvy
Add __str__ to the new helper classes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
        """
158
158
        return self.inventory.id2path(file_id)
159
159
 
 
160
    def is_control_filename(self, filename):
 
161
        """True if filename is the name of a control file in this tree.
 
162
 
 
163
        :param filename: A filename within the tree. This is a relative path
 
164
        from the root of this tree.
 
165
 
 
166
        This is true IF and ONLY IF the filename is part of the meta data
 
167
        that bzr controls in this tree. I.E. a random .bzr directory placed
 
168
        on disk will not be a control file for this tree.
 
169
        """
 
170
        return self.bzrdir.is_control_filename(filename)
 
171
 
160
172
    @needs_read_lock
161
173
    def iter_entries_by_dir(self, specific_file_ids=None, yield_parents=False):
162
174
        """Walk the tree in 'by_dir' order.
508
520
            parent_keys = [(file_id, self._file_revision(t, file_id)) for t in
509
521
                self._iter_parent_trees()]
510
522
            vf.add_lines((file_id, last_revision), parent_keys,
511
 
                         self.get_file_lines(file_id))
 
523
                         self.get_file(file_id).readlines())
512
524
            repo = self.branch.repository
513
525
            base_vf = repo.texts
514
526
        else:
570
582
            yield child.file_id
571
583
 
572
584
    def lock_read(self):
573
 
        """Lock this tree for multiple read only operations.
574
 
        
575
 
        :return: A bzrlib.lock.LogicalLockResult.
576
 
        """
577
585
        pass
578
586
 
579
587
    def revision_tree(self, revision_id):
766
774
    return 'wtf?'
767
775
 
768
776
 
 
777
@deprecated_function(deprecated_in((1, 9, 0)))
 
778
def find_renames(old_inv, new_inv):
 
779
    for file_id in old_inv:
 
780
        if file_id not in new_inv:
 
781
            continue
 
782
        old_name = old_inv.id2path(file_id)
 
783
        new_name = new_inv.id2path(file_id)
 
784
        if old_name != new_name:
 
785
            yield (old_name, new_name)
 
786
 
 
787
 
769
788
def find_ids_across_trees(filenames, trees, require_versioned=True):
770
789
    """Find the ids corresponding to specified filenames.
771
790
 
1107
1126
            if file_id in to_paths:
1108
1127
                # already returned
1109
1128
                continue
1110
 
            if not self.target.has_id(file_id):
 
1129
            if file_id not in self.target.all_file_ids():
1111
1130
                # common case - paths we have not emitted are not present in
1112
1131
                # target.
1113
1132
                to_path = None