~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to multiparent.py

  • Committer: Aaron Bentley
  • Date: 2007-04-13 16:09:03 UTC
  • mto: (2520.4.1 bzr.mpbundle)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: abentley@panoramicfeedback.com-20070413160903-dretiv0cjsv72hnk
Allow selecting MemoryVersionedFile from commandline

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from difflib import SequenceMatcher
 
1
import errno
2
2
from itertools import chain
 
3
import os
3
4
from StringIO import StringIO
4
5
import sys
5
6
 
380
381
    def get_diff(self, version_id):
381
382
        return self._diffs[version_id]
382
383
 
 
384
    def destroy(self):
 
385
        self._diffs = {}
 
386
 
383
387
 
384
388
class MultiVersionedFile(BaseVersionedFile):
385
389
 
419
423
        self._diff_offset[version_id] = (start, end-start)
420
424
        self._parents[version_id] = parent_ids
421
425
 
 
426
    def destroy(self):
 
427
        try:
 
428
            os.unlink(self._filename)
 
429
        except OSError, e:
 
430
            if e.errno != errno.ENOENT:
 
431
                raise
 
432
 
422
433
 
423
434
class _Reconstructor(object):
424
435
    """Build a text from the diffs, ancestry graph and cached lines"""