comparison mercurial/statprof.py @ 40196:2864f8d3fcd6

py3: use raw strings for stack names These are used for simple compares. We don't need to normalize to bytes. As part of this, I expanded a set literal so entries are 1 per line. Differential Revision: https://phab.mercurial-scm.org/D5013
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 12 Oct 2018 18:37:42 +0200
parents 4b7eb862692e
children 113adb1b3f24
comparison
equal deleted inserted replaced
40195:720355c7b7c9 40196:2864f8d3fcd6
123 defaultdict = collections.defaultdict 123 defaultdict = collections.defaultdict
124 contextmanager = contextlib.contextmanager 124 contextmanager = contextlib.contextmanager
125 125
126 __all__ = ['start', 'stop', 'reset', 'display', 'profile'] 126 __all__ = ['start', 'stop', 'reset', 'display', 'profile']
127 127
128 skips = {"util.py:check", "extensions.py:closure", 128 skips = {
129 "color.py:colorcmd", "dispatch.py:checkargs", 129 r"util.py:check",
130 "dispatch.py:<lambda>", "dispatch.py:_runcatch", 130 r"extensions.py:closure",
131 "dispatch.py:_dispatch", "dispatch.py:_runcommand", 131 r"color.py:colorcmd",
132 "pager.py:pagecmd", "dispatch.py:run", 132 r"dispatch.py:checkargs",
133 "dispatch.py:dispatch", "dispatch.py:runcommand", 133 r"dispatch.py:<lambda>",
134 "hg.py:<module>", "evolve.py:warnobserrors", 134 r"dispatch.py:_runcatch",
135 r"dispatch.py:_dispatch",
136 r"dispatch.py:_runcommand",
137 r"pager.py:pagecmd",
138 r"dispatch.py:run",
139 r"dispatch.py:dispatch",
140 r"dispatch.py:runcommand",
141 r"hg.py:<module>",
142 r"evolve.py:warnobserrors",
135 } 143 }
136 144
137 ########################################################################### 145 ###########################################################################
138 ## Utils 146 ## Utils
139 147
645 self.children[site] = child 653 self.children[site] = child
646 654
647 if len(stack) > 1: 655 if len(stack) > 1:
648 i = 1 656 i = 1
649 # Skip boiler plate parts of the stack 657 # Skip boiler plate parts of the stack
650 while i < len(stack) and '%s:%s' % (stack[i].filename(), stack[i].function) in skips: 658 name = r'%s:%s' % (stack[i].filename(), stack[i].function)
659 while i < len(stack) and name in skips:
651 i += 1 660 i += 1
652 if i < len(stack): 661 if i < len(stack):
653 child.add(stack[i:], time) 662 child.add(stack[i:], time)
654 663
655 root = HotNode(None) 664 root = HotNode(None)