Re: [PATCH] histedit: fix diff colors
Am Mon, Oct 24, 2022 at 05:05:18PM -0400 schrieb Jordi Gutiérrez Hermoso: > I don't know what was up here, but seems like checking for the first > byte isn't the same thing as "startswith", so the colours in chistedit > diffs were broken. Can you also please build a test case for this? Joerg ___ Mercurial-devel mailing list Mercurial-devel@lists.mercurial-scm.org https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] histedit: fix diff colors
On Mon, Oct 24, 2022 at 05:05:18PM -0400, Jordi Gutiérrez Hermoso wrote: > diff --git a/hgext/histedit.py b/hgext/histedit.py > --- a/hgext/histedit.py > +++ b/hgext/histedit.py > @@ -1428,11 +1428,11 @@ pgup/K: move patch up, pgdn/J: move patc > for y in range(0, length): > line = output[y] > if diffcolors: > -if line and line[0] == b'+': > +if line and line.startswith(b'+'): > win.addstr( > y, 0, line, curses.color_pair(COLOR_DIFF_ADD_LINE) > ) > -elif line and line[0] == b'-': > +elif line and line.startswith(b'-'): > win.addstr( > y, 0, line, curses.color_pair(COLOR_DIFF_DEL_LINE) > ) Do we still need the "line and" part of the check? Joerg ___ Mercurial-devel mailing list Mercurial-devel@lists.mercurial-scm.org https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] histedit: fix diff colors
This patch looks obviously-correct to me and should be pushed. What’s going on here is that byte_string[index] returns an int, not a byte, so the .startswith() is a strict correctness improvement. Thanks! > On Oct 24, 2022, at 5:05 PM, Jordi Gutiérrez Hermoso > wrote: > > # HG changeset patch > # User Jordi Gutiérrez Hermoso > # Date 145456 14400 > # Mon Oct 24 17:04:16 2022 -0400 > # Node ID 5287d8898362935f06b482b236ca6ba948c6850d > # Parent f68d285158b21d7d13c2a70c8db85e83a83ee392 > histedit: fix diff colors > > I don't know what was up here, but seems like checking for the first > byte isn't the same thing as "startswith", so the colours in chistedit > diffs were broken. > > diff --git a/hgext/histedit.py b/hgext/histedit.py > --- a/hgext/histedit.py > +++ b/hgext/histedit.py > @@ -1428,11 +1428,11 @@ pgup/K: move patch up, pgdn/J: move patc > for y in range(0, length): > line = output[y] > if diffcolors: > -if line and line[0] == b'+': > +if line and line.startswith(b'+'): > win.addstr( > y, 0, line, curses.color_pair(COLOR_DIFF_ADD_LINE) > ) > -elif line and line[0] == b'-': > +elif line and line.startswith(b'-'): > win.addstr( > y, 0, line, curses.color_pair(COLOR_DIFF_DEL_LINE) > ) > ___ > Mercurial-devel mailing list > Mercurial-devel@lists.mercurial-scm.org > https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@lists.mercurial-scm.org https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel
Mercurial Conference Paris 2023 - Scheduling poll
Dear Mercurial Users, We have some new date proposals for the Mercurial Conference Paris 2023. Please fill in the scheduling poll at the link above to tell us what suit you best: https://framadate.org/B3ub99ayikTS7C8p Thank you for your trust. Best regards --- Franck Bret Software Developer @octobus Mercurial Conference Paris Organization Committee +33(0)6 03 90 65 98 ___ Mercurial-devel mailing list Mercurial-devel@lists.mercurial-scm.org https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel