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

login
register
mail settings
Submitter phabricator
Date Nov. 23, 2019, 11:53 a.m.
Message ID <19e96c711ceac2d06225d6f043549227@localhost.localdomain>
Download mbox | patch
Permalink /patch/43471/
State Not Applicable
Headers show

Comments

phabricator - Nov. 23, 2019, 11:53 a.m.
marmoute updated this revision to Diff 18345.

REPOSITORY
  rHG Mercurial

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

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)