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

merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib.lazy_import import lazy_import
21
21
lazy_import(globals(), """
22
22
from bzrlib import (
 
23
    check,
23
24
    debug,
24
25
    fetch as _mod_fetch,
25
26
    fifo_cache,
104
105
        super(VersionedFileCommitBuilder, self).__init__(repository,
105
106
            parents, config, timestamp, timezone, committer, revprops,
106
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
107
113
        self.new_inventory = Inventory(None)
108
114
        self._basis_delta = []
109
115
        self.__heads = graph.HeadsCache(repository.get_graph()).heads
123
129
        builder.record_delete().
124
130
        """
125
131
        self._recording_deletes = True
126
 
        try:
127
 
            basis_id = self.parents[0]
128
 
        except IndexError:
129
 
            basis_id = _mod_revision.NULL_REVISION
130
 
        self.basis_delta_revision = basis_id
131
132
 
132
133
    def any_changes(self):
133
134
        """Return True if any entries were changed.
536
537
        else:
537
538
            raise NotImplementedError('unknown kind')
538
539
        ie.revision = self._new_revision_id
539
 
        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
540
545
        return self._get_delta(ie, basis_inv, path), True, fingerprint
541
546
 
542
547
    def record_iter_changes(self, tree, basis_revision_id, iter_changes,
798
803
            if new_path == '':
799
804
                seen_root = True
800
805
        self.new_inventory = None
801
 
        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)):
802
810
            # This should perhaps be guarded by a check that the basis we
803
811
            # commit against is the basis for the commit and if not do a delta
804
812
            # against the basis.
1204
1212
            # result['size'] = t
1205
1213
        return result
1206
1214
 
1207
 
 
1208
1215
    def get_commit_builder(self, branch, parents, config, timestamp=None,
1209
1216
                           timezone=None, committer=None, revprops=None,
1210
1217
                           revision_id=None, lossy=False):
1815
1822
        known_graph = self.revisions.get_known_graph_ancestry(revision_keys)
1816
1823
        return graph.GraphThunkIdsToKeys(known_graph)
1817
1824
 
 
1825
    @needs_read_lock
 
1826
    def get_file_graph(self):
 
1827
        """Return the graph walker for text revisions."""
 
1828
        return graph.Graph(self.texts)
 
1829
 
1818
1830
    def _get_versioned_file_checker(self, text_key_references=None,
1819
1831
        ancestors=None):
1820
1832
        """Return an object suitable for checking versioned files.
1850
1862
            raise errors.NoSuchRevision(self, revision_id)
1851
1863
        return record.get_bytes_as('fulltext')
1852
1864
 
 
1865
    @needs_read_lock
 
1866
    def _check(self, revision_ids, callback_refs, check_repo):
 
1867
        result = check.VersionedFileCheck(self, check_repo=check_repo)
 
1868
        result.check(callback_refs)
 
1869
        return result
 
1870
 
1853
1871
    def _find_inconsistent_revision_parents(self, revisions_iterator=None):
1854
1872
        """Find revisions with different parent lists in the revision object
1855
1873
        and in the index graph.