Mercurial > public > mercurial-scm > hg
comparison tests/test-ui-config.py @ 37942:32bc3815efae
stringutil: flip the default of pprint() to bprefix=False
If we use pprint() as a drop-in replacement for repr(), bprefix=False is more
appropriate. Let's make it the default to remove bprefix=False noise.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 10 May 2018 21:08:32 +0900 |
parents | a2cfea193040 |
children | 2372284d9457 |
comparison
equal
deleted
inserted
replaced
37941:af83a0ed0afb | 37942:32bc3815efae |
---|---|
49 b'date.birth=2005-04-19T00:00:00', | 49 b'date.birth=2005-04-19T00:00:00', |
50 b'date.invalid=0' | 50 b'date.invalid=0' |
51 ]) | 51 ]) |
52 | 52 |
53 def pprint(obj): | 53 def pprint(obj): |
54 return stringutil.pprint(obj, bprefix=False).decode('ascii') | 54 return stringutil.pprint(obj).decode('ascii') |
55 | 55 |
56 print(pprint(testui.configitems(b'values'))) | 56 print(pprint(testui.configitems(b'values'))) |
57 print(pprint(testui.configitems(b'lists'))) | 57 print(pprint(testui.configitems(b'lists'))) |
58 print("---") | 58 print("---") |
59 print(pprint(testui.config(b'values', b'string'))) | 59 print(pprint(testui.config(b'values', b'string'))) |