/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

  • Committer: Robert Collins
  • Date: 2007-09-21 06:10:31 UTC
  • mfrom: (2844 +trunk)
  • mto: (2592.3.144 repository)
  • mto: This revision was merged to the branch mainline in revision 2879.
  • Revision ID: robertc@robertcollins.net-20070921061031-p945q13ra1jjcli2
Merge bzr.dev.

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, 
221
223
            content - stat, length, exec, sha/link target. This is only
222
224
            accessed when the entry has a revision of None - that is when it is
223
225
            a candidate to commit.
 
226
        :return: True if a new version of the entry has been recorded.
 
227
            (Committing a merge where a file was only changed on the other side
 
228
            will not return True.)
224
229
        """
225
230
        if self.new_inventory.root is None:
226
231
            self._check_root(ie, parent_invs, tree)
241
246
        self.new_inventory.add(ie)
242
247
 
243
248
        # ie.revision is always None if the InventoryEntry is considered
244
 
        # for committing. ie.snapshot will record the correct revision 
245
 
        # which may be the sole parent if it is untouched.
 
249
        # for committing. We may record the previous parents revision if the
 
250
        # content is actually unchanged against a sole head.
246
251
        if ie.revision is not None:
247
 
            return
 
252
            return ie.revision == self._new_revision_id and (path != '' or
 
253
                self._versioned_root)
248
254
 
249
255
        # XXX: Friction: parent_candidates should return a list not a dict
250
256
        #      so that we don't have to walk the inventories again.
361
367
        else:
362
368
            raise NotImplementedError('unknown kind')
363
369
        ie.revision = self._new_revision_id
 
370
        return True
364
371
 
365
372
    def _add_text_to_weave(self, file_id, new_lines, parents, nostore_sha):
366
373
        versionedfile = self.repository.weave_store.get_weave_or_empty(
385
392
class RootCommitBuilder(CommitBuilder):
386
393
    """This commitbuilder actually records the root id"""
387
394
    
 
395
    # the root entry gets versioned properly by this builder.
 
396
    _versioned_root = True
 
397
 
388
398
    def _check_root(self, ie, parent_invs, tree):
389
399
        """Helper for record_entry_contents.
390
400