comparison 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
comparison
equal deleted inserted replaced
43754:02ededbef627 43755:d2a7f0aab540
216 visibilityexceptions is a set of revs which must are exceptions for 216 visibilityexceptions is a set of revs which must are exceptions for
217 hidden-state and must be visible. They are dynamic and hence we should not 217 hidden-state and must be visible. They are dynamic and hence we should not
218 cache it's result""" 218 cache it's result"""
219 if filtername not in repo.filteredrevcache: 219 if filtername not in repo.filteredrevcache:
220 if repo.ui.configbool(b'devel', b'debug.repo-filters'): 220 if repo.ui.configbool(b'devel', b'debug.repo-filters'):
221 msg = b'debug.filters: computing revision filter for "%s"\n' 221 msg = b'computing revision filter for "%s"'
222 repo.ui.debug(msg % filtername) 222 msg %= filtername
223 if repo.ui.tracebackflag and repo.ui.debugflag:
224 # XXX use ui.write_err
225 util.debugstacktrace(
226 msg,
227 f=repo.ui._fout,
228 otherf=repo.ui._ferr,
229 prefix=b'debug.filters: ',
230 )
231 else:
232 repo.ui.debug(b'debug.filters: %s\n' % msg)
223 func = filtertable[filtername] 233 func = filtertable[filtername]
224 if visibilityexceptions: 234 if visibilityexceptions:
225 return func(repo.unfiltered, visibilityexceptions) 235 return func(repo.unfiltered, visibilityexceptions)
226 repo.filteredrevcache[filtername] = func(repo.unfiltered()) 236 repo.filteredrevcache[filtername] = func(repo.unfiltered())
227 return repo.filteredrevcache[filtername] 237 return repo.filteredrevcache[filtername]