~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-14 16:16:53 UTC
  • mto: (1946.2.6 reduce-knit-churn)
  • mto: This revision was merged to the branch mainline in revision 1919.
  • Revision ID: john@arbash-meinel.com-20060814161653-54cdcdadcd4e9003
Remove bogus entry from BRANCH.TODO

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 by Canonical Ltd
2
2
#
3
3
# Authors:
4
4
#   Johan Rydberg <jrydberg@gnu.org>
19
19
 
20
20
"""Versioned text file storage api."""
21
21
 
22
 
from bzrlib.lazy_import import lazy_import
23
 
lazy_import(globals(), """
 
22
 
24
23
from copy import deepcopy
25
 
import unittest
26
 
 
27
 
from bzrlib import (
28
 
    errors,
29
 
    tsort,
30
 
    ui,
31
 
    )
32
 
from bzrlib.transport.memory import MemoryTransport
33
 
""")
34
 
 
 
24
from unittest import TestSuite
 
25
 
 
26
 
 
27
import bzrlib.errors as errors
35
28
from bzrlib.inter import InterObject
36
29
from bzrlib.textmerge import TextMerge
 
30
from bzrlib.transport.memory import MemoryTransport
 
31
from bzrlib.tsort import topo_sort
 
32
from bzrlib import ui
37
33
from bzrlib.symbol_versioning import (deprecated_function,
38
34
        deprecated_method,
39
35
        zero_eight,
407
403
            version_ids,
408
404
            ignore_missing)
409
405
 
410
 
    def iter_lines_added_or_present_in_versions(self, version_ids=None, 
411
 
                                                pb=None):
 
406
    def iter_lines_added_or_present_in_versions(self, version_ids=None):
412
407
        """Iterate over the lines in the versioned file from version_ids.
413
408
 
414
409
        This may return lines from other versions, and does not return the
417
412
        thinks is relevant, but given that such hints are just guesses,
418
413
        its better not to have it if we don't need it.
419
414
 
420
 
        If a progress bar is supplied, it may be used to indicate progress.
421
 
        The caller is responsible for cleaning up progress bars (because this
422
 
        is an iterator).
423
 
 
424
415
        NOTES: Lines are normalised: they will all have \n terminators.
425
416
               Lines are returned in arbitrary order.
426
417
        """
477
468
        """
478
469
        raise NotImplementedError(VersionedFile.plan_merge)
479
470
        
480
 
    def weave_merge(self, plan, a_marker=TextMerge.A_MARKER,
 
471
    def weave_merge(self, plan, a_marker=TextMerge.A_MARKER, 
481
472
                    b_marker=TextMerge.B_MARKER):
482
473
        return PlanWeaveMerge(plan, a_marker, b_marker).merge_lines()[0]
483
474
 
567
558
    InterVersionedFile.get(other).method_name(parameters).
568
559
    """
569
560
 
570
 
    _optimisers = []
 
561
    _optimisers = set()
571
562
    """The available optimised InterVersionedFile types."""
572
563
 
573
564
    def join(self, pb=None, msg=None, version_ids=None, ignore_missing=False):
594
585
            target = temp_source
595
586
        version_ids = self._get_source_version_ids(version_ids, ignore_missing)
596
587
        graph = self.source.get_graph(version_ids)
597
 
        order = tsort.topo_sort(graph.items())
 
588
        order = topo_sort(graph.items())
598
589
        pb = ui.ui_factory.nested_progress_bar()
599
590
        parent_texts = {}
600
591
        try:
681
672
        self._formats = formats
682
673
    
683
674
    def adapt(self, test):
684
 
        result = unittest.TestSuite()
 
675
        result = TestSuite()
685
676
        for (interversionedfile_class,
686
677
             versionedfile_factory,
687
678
             versionedfile_factory_to) in self._formats: