/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/_patiencediff_py.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 18:15:40 UTC
  • mto: (7143.16.20 even-more-cleanups)
  • mto: This revision was merged to the branch mainline in revision 7175.
  • Revision ID: jelmer@jelmer.uk-20181116181540-7y2wbhqzjk067mqy
Fix repo acquisition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
 
18
from __future__ import absolute_import
18
19
 
19
20
from bisect import bisect
20
21
import difflib
21
22
 
22
 
from bzrlib.trace import mutter
23
 
 
24
 
 
25
 
__all__ = ['PatienceSequenceMatcher', 'unified_diff', 'unified_diff_files']
 
23
from .trace import mutter
26
24
 
27
25
 
28
26
def unique_lcs_py(a, b):
42
40
    # set index[line in a] = position of line in a unless
43
41
    # a is a duplicate, in which case it's set to None
44
42
    index = {}
45
 
    for i in xrange(len(a)):
46
 
        line = a[i]
 
43
    for i, line in enumerate(a):
47
44
        if line in index:
48
45
            index[line] = None
49
46
        else:
161
158
            nbhi -= 1
162
159
        recurse_matches_py(a, b, last_a_pos+1, last_b_pos+1,
163
160
                           nahi, nbhi, answer, maxrecursion - 1)
164
 
        for i in xrange(ahi - nahi):
 
161
        for i in range(ahi - nahi):
165
162
            answer.append((nahi + i, nbhi + i))
166
163
 
167
164