D3211: patch: buffer lines for a same hunk

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Tue Apr 10 10:47:43 EDT 2018


yuja requested changes to this revision.
yuja added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> patch.py:2484
> +        stripline = chompline.rstrip()
> +        if line[0] == '-':
> +            label = 'diff.deleted'

Don't use `bytes[n]` since it returns an integer on Python 3.
That's why there were silly `startswith(char)`.

> patch.py:2548
> +                    bufferedline += "\n"
> +                hunkbuffer.append(bufferedline)
>              else:

I think `hunkbuffer` could be `(alines_without_pluses, blines_without_minuses)` so `difsinglehunkinline()` function
will be slightly simpler.

> patch.py:2572
> -
> -def _inlinediff(s1, s2, operation):
> -    '''Perform string diff to highlight specific changes.'''

Can you split this patch to

- drop the current inlinediff implementation
- and buffer hunk lines?

REPOSITORY
  rHG Mercurial

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

To: quark, #hg-reviewers, yuja
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list