yuja added a comment.

  `rawline` can be removed after the rewrite of +/- lines handling.
  
    -        for rawline in mdiff.splitnewlines(chunk):
    -            line = rawline.rstrip('\n')
    +        for line in mdiff.splitnewlines(chunk):
                 if head:
                     if line.startswith('@'):
                         head = False
                 else:
    -                if line and not line.startswith((' ', '+', '-', '@', 
'\\')):
    +                if not line.startswith((' ', '+', '-', '@', '\\', '\n')):
                         head = True
     
    @@ -2525,13 +2523,15 @@ def difflabel(func, *args, **kw):
                 if head:
                     prefixes = headprefixes
                 for prefix, label in prefixes:
    -                if stripline.startswith(prefix):
    -                    yield (stripline, label)
    +                if line.startswith(prefix):
    +                    if line.endswith('\n'):
    +                        yield (line[:-1], label)
    +                        yield ('\n', '')
    +                    else:
    +                        yield (line, label)
                         break
                 else:
                     yield (line, '')
    -            if rawline != line:
    -                yield (rawline[len(line):], '')

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3210

To: quark, #hg-reviewers
Cc: yuja, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to