mercurial/statprof.py
branchstable
changeset 50305 972f3e5c94b8
parent 49901 9eb69fa5a783
child 50952 18c8c18993f0
equal deleted inserted replaced
50304:805d4a462abb 50305:972f3e5c94b8
   538         % (b"time", b"seconds", b"seconds", b"name")
   538         % (b"time", b"seconds", b"seconds", b"name")
   539     )
   539     )
   540 
   540 
   541     for stat in stats:
   541     for stat in stats:
   542         site = stat.site
   542         site = stat.site
   543         sitelabel = b'%s:%d:%s' % (site.filename(), site.lineno, site.function)
   543         sitelabel = b'%s:%d:%s' % (
       
   544             site.filename(),
       
   545             site.lineno or -1,
       
   546             site.function,
       
   547         )
   544         fp.write(
   548         fp.write(
   545             b'%6.2f %9.2f %9.2f  %s\n'
   549             b'%6.2f %9.2f %9.2f  %s\n'
   546             % (
   550             % (
   547                 stat.selfpercent(),
   551                 stat.selfpercent(),
   548                 stat.totalseconds(),
   552                 stat.totalseconds(),
   611                     source = pycompat.bytestr(source)
   615                     source = pycompat.bytestr(source)
   612 
   616 
   613                 stattuple = (
   617                 stattuple = (
   614                     stat.selfpercent(),
   618                     stat.selfpercent(),
   615                     stat.selfseconds(),
   619                     stat.selfseconds(),
   616                     stat.site.lineno,
   620                     stat.site.lineno or -1,
   617                     source,
   621                     source,
   618                 )
   622                 )
   619 
   623 
   620                 fp.write(b'%33.0f%% %6.2f   line %d: %s\n' % stattuple)
   624                 fp.write(b'%33.0f%% %6.2f   line %d: %s\n' % stattuple)
   621 
   625