stringutil: teach pprint about sets
This is the old (Python 2) way of printing sets. I actually prefer the
Python 3 version of the repr, but this will result in less test churn
in the short term.
Differential Revision: https://phab.mercurial-scm.org/D4243
--- a/mercurial/utils/stringutil.py Fri Aug 10 00:12:55 2018 -0400
+++ b/mercurial/utils/stringutil.py Fri Aug 10 01:41:31 2018 -0400
@@ -59,6 +59,9 @@
'%s: %s' % (pprint(k, bprefix=bprefix),
pprint(v, bprefix=bprefix))
for k, v in sorted(o.items())))
+ elif isinstance(o, set):
+ return 'set([%s])' % (b', '.join(
+ pprint(k, bprefix=bprefix) for k in sorted(o)))
elif isinstance(o, tuple):
return '(%s)' % (b', '.join(pprint(a, bprefix=bprefix) for a in o))
else: