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

faster pointless commit detection (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
    
71
71
    # all clients should supply tree roots.
72
72
    record_root_entry = True
 
73
    # the default CommitBuilder does not manage trees whose root is versioned.
 
74
    _versioned_root = False
73
75
 
74
76
    def __init__(self, repository, parents, config, timestamp=None, 
75
77
                 timezone=None, committer=None, revprops=None, 
216
218
        :param path: The path the entry is at in the tree.
217
219
        :param tree: The tree which contains this entry and should be used to 
218
220
        obtain content.
 
221
        :return: True if a new version of the entry has been recorded.
 
222
            (Committing a merge where a file was only changed on the other side
 
223
            will not return True.)
219
224
        """
220
225
        if self.new_inventory.root is None:
221
226
            self._check_root(ie, parent_invs, tree)
225
230
        # for committing. ie.snapshot will record the correct revision 
226
231
        # which may be the sole parent if it is untouched.
227
232
        if ie.revision is not None:
228
 
            return
 
233
            return ie.revision == self._new_revision_id and (path != '' or
 
234
                self._versioned_root)
229
235
 
230
236
        parent_candiate_entries = ie.parent_candidates(parent_invs)
231
237
        heads = self.repository.get_graph().heads(parent_candiate_entries.keys())
236
242
        # we are creating a new revision for ie in the history store and
237
243
        # inventory.
238
244
        ie.snapshot(self._new_revision_id, path, previous_entries, tree, self)
 
245
        return ie.revision == self._new_revision_id and (path != '' or
 
246
            self._versioned_root)
239
247
 
240
248
    def modified_directory(self, file_id, file_parents):
241
249
        """Record the presence of a symbolic link.
313
321
class RootCommitBuilder(CommitBuilder):
314
322
    """This commitbuilder actually records the root id"""
315
323
    
 
324
    # the root entry gets versioned properly by this builder.
 
325
    _versioned_root = True
 
326
 
316
327
    def _check_root(self, ie, parent_invs, tree):
317
328
        """Helper for record_entry_contents.
318
329