~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

Make use of the transaction finalisation warning support to implement in-knit caching.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
        not present in file history.
89
89
        """
90
90
        self._check_write_ok()
91
 
        self._add_lines(version_id, parents, lines)
 
91
        return self._add_lines(version_id, parents, lines)
92
92
 
93
93
    def _add_lines(self, version_id, parents, lines):
94
94
        """Helper to do the class specific add_lines."""
97
97
    def add_lines_with_ghosts(self, version_id, parents, lines):
98
98
        """Add lines to the versioned file, allowing ghosts to be present."""
99
99
        self._check_write_ok()
100
 
        self._add_lines_with_ghosts(version_id, parents, lines)
 
100
        return self._add_lines_with_ghosts(version_id, parents, lines)
101
101
 
102
102
    def _add_lines_with_ghosts(self, version_id, parents, lines):
103
103
        """Helper to do class specific add_lines_with_ghosts."""
125
125
 
126
126
        Must raise RevisionAlreadyPresent if the new version is
127
127
        already present in file history."""
 
128
        self._check_write_ok()
 
129
        return self._clone_text(new_version_id, old_version_id, parents)
 
130
 
 
131
    def _clone_text(self, new_version_id, old_version_id, parents):
 
132
        """Helper function to do the _clone_text work."""
128
133
        raise NotImplementedError(self.clone_text)
129
134
 
130
135
    def create_empty(self, name, transport, mode=None):
145
150
        list.
146
151
        """
147
152
        self._check_write_ok()
148
 
        self._fix_parents(version, new_parents)
 
153
        return self._fix_parents(version, new_parents)
149
154
 
150
155
    def _fix_parents(self, version, new_parents):
151
156
        """Helper for fix_parents."""