~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to knit.py

  • Committer: Martin Pool
  • Date: 2005-06-27 07:44:40 UTC
  • mto: This revision was merged to the branch mainline in revision 852.
  • Revision ID: mbp@sourcefrog.net-20050627074440-3bafe312199c5881
tidy up

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
        pure delete.  (Similar to difflib.)
150
150
        """
151
151
 
152
 
        from pprint import pprint
 
152
        ##from pprint import pprint
153
153
 
154
154
        # first get basis for comparison
155
155
        # basis holds (lineno, origin, line)
156
156
        basis = []
157
157
 
158
 
        print 'my lines:'
159
 
        pprint(self._l)
 
158
        ##print 'my lines:'
 
159
        ##pprint(self._l)
160
160
        
161
161
        lineno = 0
162
162
        for origin, line in self._l:
178
178
        from difflib import SequenceMatcher
179
179
        s = SequenceMatcher(None, basis_lines, lines)
180
180
 
181
 
        print 'basis sequence:'
182
 
        pprint(basis)
 
181
        ##print 'basis sequence:'
 
182
        ##pprint(basis)
183
183
 
184
184
        for tag, i1, i2, j1, j2 in s.get_opcodes():
185
 
            print tag, i1, i2, j1, j2
 
185
            ##print tag, i1, i2, j1, j2
186
186
 
187
187
            if tag == 'equal':
188
188
                continue
196
196
            if j1 == j2:
197
197
                newlines = []
198
198
            else:
199
 
                assert j1 >= 0
200
 
                assert j2 >= j1
 
199
                assert 0 <= j1
 
200
                assert j1 <= j2
201
201
                assert j2 <= len(lines)
202
202
                newlines = lines[j1:j2]
203
203