mercurial/commands.py
changeset 39078 2525c4943c09
parent 38984 f3f109971359
child 39079 9126a4034621
equal deleted inserted replaced
39077:f76c1343859d 39078:2525c4943c09
  2606             m.append(s)
  2606             m.append(s)
  2607 
  2607 
  2608     def difflinestates(a, b):
  2608     def difflinestates(a, b):
  2609         sm = difflib.SequenceMatcher(None, a, b)
  2609         sm = difflib.SequenceMatcher(None, a, b)
  2610         for tag, alo, ahi, blo, bhi in sm.get_opcodes():
  2610         for tag, alo, ahi, blo, bhi in sm.get_opcodes():
  2611             if tag == 'insert':
  2611             if tag == r'insert':
  2612                 for i in pycompat.xrange(blo, bhi):
  2612                 for i in pycompat.xrange(blo, bhi):
  2613                     yield ('+', b[i])
  2613                     yield ('+', b[i])
  2614             elif tag == 'delete':
  2614             elif tag == r'delete':
  2615                 for i in pycompat.xrange(alo, ahi):
  2615                 for i in pycompat.xrange(alo, ahi):
  2616                     yield ('-', a[i])
  2616                     yield ('-', a[i])
  2617             elif tag == 'replace':
  2617             elif tag == r'replace':
  2618                 for i in pycompat.xrange(alo, ahi):
  2618                 for i in pycompat.xrange(alo, ahi):
  2619                     yield ('-', a[i])
  2619                     yield ('-', a[i])
  2620                 for i in pycompat.xrange(blo, bhi):
  2620                 for i in pycompat.xrange(blo, bhi):
  2621                     yield ('+', b[i])
  2621                     yield ('+', b[i])
  2622 
  2622