~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to groupcompress.py

  • Committer: John Arbash Meinel
  • Date: 2008-07-24 05:18:51 UTC
  • mto: (0.17.18 trunk)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20080724051851-5c96p66uwasrhp1v
A bit more work, not really usable yet.
I *do* have an idea of where I want to go with this.
And I think it can be quite a bit simpler than the patience-diff hash tables.

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
       left side.
111
111
    """
112
112
 
 
113
    _equivalence_table_class = equivalence_table.EquivalenceTable
 
114
 
113
115
    def __init__(self, delta=True):
114
116
        """Create a GroupCompressor.
115
117
 
119
121
        self.line_offsets = []
120
122
        self.endpoint = 0
121
123
        self.input_bytes = 0
122
 
        self.line_locations = equivalence_table.EquivalenceTable([])
 
124
        self.line_locations = self._equivalence_table_class([])
123
125
        self.lines = self.line_locations.lines
124
126
        self.labels_deltas = {}
125
127
 
136
138
        pos = 0
137
139
        line_locations = self.line_locations
138
140
        line_locations.set_right_lines(lines)
139
 
        get = line_locations._matching_lines.get
 
141
        # get = line_locations._matching_lines.get
140
142
        range_len = 0
141
143
        range_start = 0
142
144
        copy_ends = None
836
838
        basis_end = int(bits[2])
837
839
        delta_end = int(bits[3])
838
840
        return node[0], start, stop, basis_end, delta_end
 
841
 
 
842
 
 
843
try:
 
844
    from bzrlib.plugins.groupcompress import _groupcompress_c
 
845
except ImportError:
 
846
    pass
 
847
else:
 
848
    GroupCompressor._equivalence_table_class = _groupcompress_c.EquivalenceTable