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

  • Committer: Robert Collins
  • Date: 2008-04-04 00:06:58 UTC
  • mto: This revision was merged to the branch mainline in revision 3350.
  • Revision ID: robertc@robertcollins.net-20080404000658-uw2nmrw8t5kcqbly
Remove manual notification of transaction finishing on versioned files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    Texts are identified by a version-id string.
56
56
    """
57
57
 
58
 
    def __init__(self, access_mode):
59
 
        self.finished = False
60
 
        self._access_mode = access_mode
61
 
 
62
58
    @staticmethod
63
59
    def check_not_reserved_id(version_id):
64
60
        revision.check_not_reserved_id(version_id)
161
157
            if '\n' in line[:-1]:
162
158
                raise errors.BzrBadParameterContainsNewline("lines")
163
159
 
164
 
    def _check_write_ok(self):
165
 
        """Is the versioned file marked as 'finished' ? Raise if it is."""
166
 
        if self.finished:
167
 
            raise errors.OutSideTransaction()
168
 
        if self._access_mode != 'w':
169
 
            raise errors.ReadOnlyObjectDirtiedError(self)
170
 
 
171
160
    def enable_cache(self):
172
161
        """Tell this versioned file that it should cache any data it reads.
173
162
        
297
286
        """
298
287
        raise NotImplementedError(self.get_sha1s)
299
288
 
300
 
    def get_suffixes(self):
301
 
        """Return the file suffixes associated with this versioned file."""
302
 
        raise NotImplementedError(self.get_suffixes)
303
 
    
304
289
    def get_text(self, version_id):
305
290
        """Return version contents as a text string.
306
291
 
488
473
        """
489
474
        return self.get_parent_map(version_ids).iteritems()
490
475
 
491
 
    def transaction_finished(self):
492
 
        """The transaction that this file was opened in has finished.
493
 
 
494
 
        This records self.finished = True and should cause all mutating
495
 
        operations to error.
496
 
        """
497
 
        self.finished = True
498
 
 
499
476
    def plan_merge(self, ver_a, ver_b):
500
477
        """Return pseudo-annotation indicating how the two versions merge.
501
478