[PATCH] histedit: fix diff colors

2023-03-15 Thread Jordi GutiƩrrez Hermoso
# HG changeset patch
# User Jordi GutiƩrrez Hermoso 
# Date 1666906442 14400
#  Thu Oct 27 17:34:02 2022 -0400
# Node ID 28cad0a7eb26a3bb0edd4623d1ec1c9169eb49e2
# Parent  dd42156b6441f6b8356100b4228fa16fbf95f669
histedit: fix diff colors

The problem here is that indexing a bytestring gives you integers, not
chars, so the comparison to b'+' ends up being wrong.

We don't really have a way to test curses output, so no tests to
verify the correctness of this behaviour.

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1427,11 +1427,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.startswith(b'+'):
 win.addstr(
 y, 0, line, curses.color_pair(COLOR_DIFF_ADD_LINE)
 )
-elif line and line[0] == b'-':
+elif 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@50330: new changeset (1 on stable)

2023-03-15 Thread Mercurial Commits
New changeset (1 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/9fc0d244a753
changeset:   50330:9fc0d244a753
branch:  stable
tag: tip
user:Pierre-Yves David 
date:Wed Mar 15 05:49:56 2023 +0100
summary: dirstate: fix a potential traceback when in `copy` and `rename`

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@lists.mercurial-scm.org
https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@50329: 2 new changesets (2 on stable)

2023-03-15 Thread Mercurial Commits
2 new changesets (2 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/97a6d6bdbc08
changeset:   50328:97a6d6bdbc08
branch:  stable
user:Arseniy Alekseyev 
date:Tue Mar 14 14:01:47 2023 +
summary: tests: demonstrate a bug with committed dirs

https://www.mercurial-scm.org/repo/hg/rev/edcc35a4f1dc
changeset:   50329:edcc35a4f1dc
branch:  stable
tag: tip
user:Arseniy Alekseyev 
date:Tue Mar 14 14:08:38 2023 +
summary: dirstate: fix the bug in [status] dealing with committed 
directories

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@lists.mercurial-scm.org
https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel