##// END OF EJS Templates
dispatch: start profiling earlier...
Bryan O'Sullivan -
r30934:6d642ecf default
parent child Browse files
Show More
@@ -668,6 +668,7 b' def _dispatch(req):'
668 668 for ui_ in uis:
669 669 ui_.setconfig('profiling', 'enabled', 'true', '--profile')
670 670
671 with profiling.maybeprofile(lui):
671 672 # Configure extensions in phases: uisetup, extsetup, cmdtable, and
672 673 # reposetup. Programs like TortoiseHg will call _dispatch several
673 674 # times so we keep track of configured extensions in _loaded.
@@ -693,7 +694,6 b' def _dispatch(req):'
693 694 # Check abbreviation/ambiguity of shell alias.
694 695 shellaliasfn = _checkshellalias(lui, ui, args)
695 696 if shellaliasfn:
696 with profiling.maybeprofile(lui):
697 697 return shellaliasfn()
698 698
699 699 # check for fallback encoding
@@ -710,8 +710,8 b' def _dispatch(req):'
710 710 raise error.Abort(_("option --cwd may not be abbreviated!"))
711 711 if options["repository"]:
712 712 raise error.Abort(_(
713 "option -R has to be separated from other options (e.g. not -qR) "
714 "and --repository may only be abbreviated as --repo!"))
713 "option -R has to be separated from other options (e.g. not "
714 "-qR) and --repository may only be abbreviated as --repo!"))
715 715
716 716 if options["encoding"]:
717 717 encoding.encoding = options["encoding"]
@@ -720,13 +720,15 b' def _dispatch(req):'
720 720 if options["time"]:
721 721 def get_times():
722 722 t = os.times()
723 if t[4] == 0.0: # Windows leaves this as zero, so use time.clock()
723 if t[4] == 0.0:
724 # Windows leaves this as zero, so use time.clock()
724 725 t = (t[0], t[1], t[2], t[3], time.clock())
725 726 return t
726 727 s = get_times()
727 728 def print_time():
728 729 t = get_times()
729 ui.warn(_("time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n") %
730 ui.warn(
731 _("time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n") %
730 732 (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3]))
731 733 atexit.register(print_time)
732 734
@@ -755,7 +757,6 b' def _dispatch(req):'
755 757 elif not cmd:
756 758 return commands.help_(ui, 'shortlist')
757 759
758 with profiling.maybeprofile(lui):
759 760 repo = None
760 761 cmdpats = args[:]
761 762 if not func.norepo:
General Comments 0
You need to be logged in to leave comments. Login now