[PATCH evolve-ext] label: make sure labelled message is a string

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH evolve-ext] label: make sure labelled message is a string

Martin von Zweigbergk via Mercurial-devel
# HG changeset patch
# User Martin von Zweigbergk <[hidden email]>
# Date 1495209634 25200
#      Fri May 19 09:00:34 2017 -0700
# Node ID 100581f7a6dd2a66e4ddc27e8f72dfd2cd84b4ed
# Parent  80b5fc054219d17f33c3d2fda6d46d3c5fe9908a
label: make sure labelled message is a string

When color is enabled, it tries to split the message on newlines,
which fails because we currently pass a context object as the
message. It seems to make sense for ui.label() to require its message
to be a string, so let's make sure that's what we pass.

diff --git a/hgext3rd/evolve/__init__.py b/hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py
+++ b/hgext3rd/evolve/__init__.py
@@ -2064,7 +2064,7 @@
                                    False, lambda: None, category='unstable')
                 if not result:
                     ui.status(_('working directory now at %s\n')
-                              % ui.label(repo['.'], 'evolve.node'))
+                              % ui.label(str(repo['.']), 'evolve.node'))
                 return result
             return 1
         return result
@@ -2271,7 +2271,7 @@
                     repo._bookmarks.recordchange(tr)
                 commands.update(ui, repo, newnode.rev())
                 ui.status(_('working directory now at %s\n')
-                          % ui.label(newnode, 'evolve.node'))
+                          % ui.label(str(newnode), 'evolve.node'))
                 if movebookmark:
                     bookmarksmod.activate(repo, bookactive)
 
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH evolve-ext] label: make sure labelled message is a string

Pierre-Yves David-2


On 05/19/2017 06:06 PM, Martin von Zweigbergk via Mercurial-devel wrote:

> # HG changeset patch
> # User Martin von Zweigbergk <[hidden email]>
> # Date 1495209634 25200
> #      Fri May 19 09:00:34 2017 -0700
> # Node ID 100581f7a6dd2a66e4ddc27e8f72dfd2cd84b4ed
> # Parent  80b5fc054219d17f33c3d2fda6d46d3c5fe9908a
> label: make sure labelled message is a string
>
> When color is enabled, it tries to split the message on newlines,
> which fails because we currently pass a context object as the
> message. It seems to make sense for ui.label() to require its message
> to be a string, so let's make sure that's what we pass.

I've already pushed a fix for that today. Thanks for looking into it!

--
Pierre-Yves David
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel