/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

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
    """
55
55
    
56
56
    def changes_from(self, other, want_unchanged=False, specific_files=None,
57
 
        extra_trees=None, require_versioned=False):
 
57
        extra_trees=None, require_versioned=False, include_root=False):
58
58
        """Return a TreeDelta of the changes from other to this tree.
59
59
 
60
60
        :param other: A tree to compare with.
81
81
            specific_files=specific_files,
82
82
            extra_trees=extra_trees,
83
83
            require_versioned=require_versioned,
 
84
            include_root=include_root
84
85
            )
85
86
    
86
87
    def conflicts(self):
119
120
    def id2path(self, file_id):
120
121
        return self.inventory.id2path(file_id)
121
122
 
 
123
    def is_control_filename(self, filename):
 
124
        """True if filename is the name of a control file in this tree.
 
125
        
 
126
        :param filename: A filename within the tree. This is a relative path
 
127
        from the root of this tree.
 
128
 
 
129
        This is true IF and ONLY IF the filename is part of the meta data
 
130
        that bzr controls in this tree. I.E. a random .bzr directory placed
 
131
        on disk will not be a control file for this tree.
 
132
        """
 
133
        return self.bzrdir.is_control_filename(filename)
 
134
 
122
135
    def iter_entries_by_dir(self):
123
136
        """Walk the tree in 'by_dir' order.
124
137
 
135
148
    def _get_inventory(self):
136
149
        return self._inventory
137
150
    
 
151
    def get_file(self, file_id):
 
152
        """Return a file object for the file file_id in the tree."""
 
153
        raise NotImplementedError(self.get_file)
 
154
    
138
155
    def get_file_by_path(self, path):
139
156
        return self.get_file(self._inventory.path2id(path))
140
157
 
147
164
        fp = fingerprint_file(f)
148
165
        f.seek(0)
149
166
        
150
 
        if ie.text_size != None:
 
167
        if ie.text_size is not None:
151
168
            if ie.text_size != fp['size']:
152
169
                raise BzrError("mismatched size for file %r in %r" % (ie.file_id, self._store),
153
170
                        ["inventory expects %d bytes" % ie.text_size,
160
177
                     "file is actually %s" % fp['sha1'],
161
178
                     "store is probably damaged/corrupt"])
162
179
 
 
180
    def path2id(self, path):
 
181
        """Return the id for path in this tree."""
 
182
        return self._inventory.path2id(path)
163
183
 
164
184
    def print_file(self, file_id):
165
185
        """Print file with id `file_id` to stdout."""
423
443
    will pass through to InterTree as appropriate.
424
444
    """
425
445
 
426
 
    _optimisers = set()
 
446
    _optimisers = []
427
447
 
428
448
    @needs_read_lock
429
449
    def compare(self, want_unchanged=False, specific_files=None,
430
 
        extra_trees=None, require_versioned=False):
 
450
        extra_trees=None, require_versioned=False, include_root=False):
431
451
        """Return the changes from source to target.
432
452
 
433
453
        :return: A TreeDelta.
455
475
            # _compare_trees would think we want a complete delta
456
476
            return delta.TreeDelta()
457
477
        return delta._compare_trees(self.source, self.target, want_unchanged,
458
 
            specific_file_ids)
 
478
            specific_file_ids, include_root)