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

Martin von Zweigbergk martinvonz at google.com
Fri May 19 16:06:18 UTC 2017


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# 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)
 


More information about the Mercurial-devel mailing list