changeset 38723:f9b2d996ffa5

hook: only print the note about native cmd translation if it actually changes This makes it so that it will never occur on a non Windows platform.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 15 Jul 2018 23:51:43 -0400
parents 2009d84f245a
children 02b5b5c1bba8
files mercurial/hook.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hook.py	Sun Jul 15 23:46:09 2018 -0400
+++ b/mercurial/hook.py	Sun Jul 15 23:51:43 2018 -0400
@@ -140,8 +140,10 @@
         env['HG_' + k.upper()] = v
 
     if ui.configbool('hooks', 'tonative.%s' % name, False):
-        ui.note(_('converting hook "%s" to native\n') % name)
+        oldcmd = cmd
         cmd = procutil.shelltonative(cmd, env)
+        if cmd != oldcmd:
+            ui.note(_('converting hook "%s" to native\n') % name)
 
     ui.note(_("running hook %s: %s\n") % (name, cmd))