/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 breezy/weave.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 18:10:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521181028-zn04pdfw0od9hfj3
Rename brzlib => breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
from cStringIO import StringIO
71
71
import os
72
72
 
73
 
from brzlib.lazy_import import lazy_import
 
73
from breezy.lazy_import import lazy_import
74
74
lazy_import(globals(), """
75
 
from brzlib import tsort
 
75
from breezy import tsort
76
76
""")
77
 
from brzlib import (
 
77
from breezy import (
78
78
    errors,
79
79
    osutils,
80
80
    )
81
 
from brzlib.errors import (WeaveError, WeaveFormatError, WeaveParentMismatch,
 
81
from breezy.errors import (WeaveError, WeaveFormatError, WeaveParentMismatch,
82
82
        RevisionAlreadyPresent,
83
83
        RevisionNotPresent,
84
84
        UnavailableRepresentation,
85
85
        )
86
 
from brzlib.osutils import dirname, sha, sha_strings, split_lines
87
 
import brzlib.patiencediff
88
 
from brzlib.revision import NULL_REVISION
89
 
from brzlib.symbol_versioning import *
90
 
from brzlib.trace import mutter
91
 
from brzlib.versionedfile import (
 
86
from breezy.osutils import dirname, sha, sha_strings, split_lines
 
87
import breezy.patiencediff
 
88
from breezy.revision import NULL_REVISION
 
89
from breezy.symbol_versioning import *
 
90
from breezy.trace import mutter
 
91
from breezy.versionedfile import (
92
92
    AbsentContentFactory,
93
93
    adapter_registry,
94
94
    ContentFactory,
95
95
    sort_groupcompress,
96
96
    VersionedFile,
97
97
    )
98
 
from brzlib.weavefile import _read_weave_v5, write_weave_v5
 
98
from breezy.weavefile import _read_weave_v5, write_weave_v5
99
99
 
100
100
 
101
101
class WeaveContentFactory(ContentFactory):
231
231
        self._name_map = {}
232
232
        self._weave_name = weave_name
233
233
        if matcher is None:
234
 
            self._matcher = brzlib.patiencediff.PatienceSequenceMatcher
 
234
            self._matcher = breezy.patiencediff.PatienceSequenceMatcher
235
235
        else:
236
236
            self._matcher = matcher
237
237
        if get_scope is None:
688
688
        WFE = WeaveFormatError
689
689
 
690
690
        # wow.
691
 
        #  449       0   4474.6820   2356.5590   brzlib.weave:556(_extract)
 
691
        #  449       0   4474.6820   2356.5590   breezy.weave:556(_extract)
692
692
        #  +285282   0   1676.8040   1676.8040   +<isinstance>
693
693
        # 1.6 seconds in 'isinstance'.
694
694
        # changing the first isinstance:
695
 
        #  449       0   2814.2660   1577.1760   brzlib.weave:556(_extract)
 
695
        #  449       0   2814.2660   1577.1760   breezy.weave:556(_extract)
696
696
        #  +140414   0    762.8050    762.8050   +<isinstance>
697
697
        # note that the inline time actually dropped (less function calls)
698
698
        # and total processing time was halved.
699
699
        # we're still spending ~1/4 of the method in isinstance though.
700
700
        # so lets hard code the acceptable string classes we expect:
701
 
        #  449       0   1202.9420    786.2930   brzlib.weave:556(_extract)
 
701
        #  449       0   1202.9420    786.2930   breezy.weave:556(_extract)
702
702
        # +71352     0    377.5560    377.5560   +<method 'append' of 'list'
703
703
        #                                          objects>
704
704
        # yay, down to ~1/4 the initial extract time, and our inline time
705
705
        # has shrunk again, with isinstance no longer dominating.
706
706
        # tweaking the stack inclusion test to use a set gives:
707
 
        #  449       0   1122.8030    713.0080   brzlib.weave:556(_extract)
 
707
        #  449       0   1122.8030    713.0080   breezy.weave:556(_extract)
708
708
        # +71352     0    354.9980    354.9980   +<method 'append' of 'list'
709
709
        #                                          objects>
710
710
        # - a 5% win, or possibly just noise. However with large istacks that