Mercurial > public > mercurial-scm > hg
diff tests/test-trusted.py @ 13493:95b0d4c1c9e1 stable
ui: always report untrusted hgrc files when debug enabled
It was suggested in IRC that people disabling the reporting of unstructed hgrc
files can masquerade as problems. This makes sure untrusted hgrc files are
always reported if --debug is used.
author | Ry4an Brase <ry4an-hg@ry4an.org> |
---|---|
date | Fri, 25 Feb 2011 23:26:24 -0600 |
parents | 543597fae51d |
children | 681f7b9213a4 |
line wrap: on
line diff
--- a/tests/test-trusted.py Thu Feb 24 13:57:52 2011 -0300 +++ b/tests/test-trusted.py Fri Feb 25 23:26:24 2011 -0600 @@ -11,7 +11,8 @@ f.close() def testui(user='foo', group='bar', tusers=(), tgroups=(), - cuser='foo', cgroup='bar', debug=False, silent=False): + cuser='foo', cgroup='bar', debug=False, silent=False, + report=True): # user, group => owners of the file # tusers, tgroups => trusted users/groups # cuser, cgroup => user/group of the current process @@ -61,6 +62,7 @@ u = ui.ui() u.setconfig('ui', 'debug', str(bool(debug))) + u.setconfig('ui', 'report_untrusted', str(bool(report))) u.readconfig('.hg/hgrc') if silent: return u @@ -131,6 +133,12 @@ print "# prints debug warnings" u = testui(user='abc', group='def', cuser='foo', debug=True) +print "# report_untrusted enabled without debug hides warnings" +u = testui(user='abc', group='def', cuser='foo', report=False) + +print "# report_untrusted enabled with debug shows warnings" +u = testui(user='abc', group='def', cuser='foo', debug=True, report=False) + print "# ui.readconfig sections" filename = 'foobar' f = open(filename, 'w')