~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/vf_repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-14 21:02:06 UTC
  • mfrom: (5847.3.2 use-public-basis-delta)
  • Revision ID: pqm@pqm.ubuntu.com-20110514210206-ez4ltcg5k90tidxe
(jelmer) CommitBuilder.any_changes() no longer returns True for changes that
 only set the tree root. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
        super(VersionedFileCommitBuilder, self).__init__(repository,
106
106
            parents, config, timestamp, timezone, committer, revprops,
107
107
            revision_id, lossy)
 
108
        try:
 
109
            basis_id = self.parents[0]
 
110
        except IndexError:
 
111
            basis_id = _mod_revision.NULL_REVISION
 
112
        self.basis_delta_revision = basis_id
108
113
        self.new_inventory = Inventory(None)
109
114
        self._basis_delta = []
110
115
        self.__heads = graph.HeadsCache(repository.get_graph()).heads
124
129
        builder.record_delete().
125
130
        """
126
131
        self._recording_deletes = True
127
 
        try:
128
 
            basis_id = self.parents[0]
129
 
        except IndexError:
130
 
            basis_id = _mod_revision.NULL_REVISION
131
 
        self.basis_delta_revision = basis_id
132
132
 
133
133
    def any_changes(self):
134
134
        """Return True if any entries were changed.
537
537
        else:
538
538
            raise NotImplementedError('unknown kind')
539
539
        ie.revision = self._new_revision_id
540
 
        self._any_changes = True
 
540
        # The initial commit adds a root directory, but this in itself is not
 
541
        # a worthwhile commit.
 
542
        if (self.basis_delta_revision != _mod_revision.NULL_REVISION or
 
543
            path != ""):
 
544
            self._any_changes = True
541
545
        return self._get_delta(ie, basis_inv, path), True, fingerprint
542
546
 
543
547
    def record_iter_changes(self, tree, basis_revision_id, iter_changes,
799
803
            if new_path == '':
800
804
                seen_root = True
801
805
        self.new_inventory = None
802
 
        if len(inv_delta):
 
806
        # The initial commit adds a root directory, but this in itself is not
 
807
        # a worthwhile commit.
 
808
        if ((len(inv_delta) > 0 and basis_revision_id != _mod_revision.NULL_REVISION) or
 
809
            (len(inv_delta) > 1 and basis_revision_id == _mod_revision.NULL_REVISION)):
803
810
            # This should perhaps be guarded by a check that the basis we
804
811
            # commit against is the basis for the commit and if not do a delta
805
812
            # against the basis.
1205
1212
            # result['size'] = t
1206
1213
        return result
1207
1214
 
1208
 
 
1209
1215
    def get_commit_builder(self, branch, parents, config, timestamp=None,
1210
1216
                           timezone=None, committer=None, revprops=None,
1211
1217
                           revision_id=None, lossy=False):