Mercurial > hg
diff mercurial/repoview.py @ 43755:d2a7f0aab540
repoview: display stack trace along side the debug message
When a filter computation is triggered, If --traceback is provided, we will
display a traceback in addition to the debug message.
Differential Revision: https://phab.mercurial-scm.org/D7478
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 17 Nov 2019 06:27:00 +0100 |
parents | 2276a9a1c037 |
children | d4c2221240a6 |
line wrap: on
line diff
--- a/mercurial/repoview.py Sun Nov 17 06:26:41 2019 +0100 +++ b/mercurial/repoview.py Sun Nov 17 06:27:00 2019 +0100 @@ -218,8 +218,18 @@ cache it's result""" if filtername not in repo.filteredrevcache: if repo.ui.configbool(b'devel', b'debug.repo-filters'): - msg = b'debug.filters: computing revision filter for "%s"\n' - repo.ui.debug(msg % filtername) + msg = b'computing revision filter for "%s"' + msg %= filtername + if repo.ui.tracebackflag and repo.ui.debugflag: + # XXX use ui.write_err + util.debugstacktrace( + msg, + f=repo.ui._fout, + otherf=repo.ui._ferr, + prefix=b'debug.filters: ', + ) + else: + repo.ui.debug(b'debug.filters: %s\n' % msg) func = filtertable[filtername] if visibilityexceptions: return func(repo.unfiltered, visibilityexceptions)