# HG changeset patch # User Augie Fackler # Date 2018-04-14 03:56:11 # Node ID 483de34f23b16c2da923b806605a120f8079f55b # Parent f7194c9250034440fbc2b1187c999a7b93b1d4e1 hook: use stringutil.pprint instead of reinventing it Differential Revision: https://phab.mercurial-scm.org/D3360 diff --git a/mercurial/hook.py b/mercurial/hook.py --- a/mercurial/hook.py +++ b/mercurial/hook.py @@ -21,6 +21,7 @@ from . import ( ) from .utils import ( procutil, + stringutil, ) def _pythonhook(ui, repo, htype, hname, funcname, args, throw): @@ -137,11 +138,7 @@ def _exthook(ui, repo, htype, name, cmd, if callable(v): v = v() if isinstance(v, dict): - # make the dictionary element order stable across Python - # implementations - v = ('{' + - ', '.join('%r: %r' % i for i in sorted(v.iteritems())) + - '}') + v = stringutil.pprint(v, bprefix=False) env['HG_' + k.upper()] = v if repo: