Patchwork D7478: repoview: display stack trace along side the debug message

login
register
mail settings
Submitter phabricator
Date Nov. 23, 2019, 4:07 a.m.
Message ID <01514f691c2bc090270b24a88a210db7@localhost.localdomain>
Download mbox | patch
Permalink /patch/43457/
State Not Applicable
Headers show

Comments

phabricator - Nov. 23, 2019, 4:07 a.m.
Closed by commit rHGb9e4226ff1db: repoview: display stack trace along side the debug message (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7478?vs=18285&id=18330

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7478/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7478

AFFECTED FILES
  mercurial/repoview.py

CHANGE DETAILS




To: marmoute, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -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)