Mercurial > public > mercurial-scm > hg
comparison mercurial/dispatch.py @ 25932:d491f289045f
dispatch: use absolute_import
A mixed, ambiguous import has been removed!
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 08 Aug 2015 14:42:48 -0700 |
parents | aca8ae2b0cb2 |
children | 7332bf4ae959 |
comparison
equal
deleted
inserted
replaced
25931:a0847285d207 | 25932:d491f289045f |
---|---|
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> | 3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> |
4 # | 4 # |
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 from i18n import _ | 8 from __future__ import absolute_import |
9 import os, sys, atexit, signal, pdb, socket, errno, shlex, time, traceback, re | 9 |
10 import atexit | |
10 import difflib | 11 import difflib |
11 import util, commands, hg, fancyopts, extensions, hook, error | 12 import errno |
12 import cmdutil, encoding | 13 import os |
13 import ui as uimod | 14 import pdb |
14 import demandimport | 15 import re |
16 import shlex | |
17 import signal | |
18 import socket | |
19 import sys | |
20 import time | |
21 import traceback | |
22 | |
23 | |
24 from .i18n import _ | |
25 | |
26 from . import ( | |
27 cmdutil, | |
28 commands, | |
29 demandimport, | |
30 encoding, | |
31 error, | |
32 extensions, | |
33 fancyopts, | |
34 hg, | |
35 hook, | |
36 ui as uimod, | |
37 util, | |
38 ) | |
15 | 39 |
16 class request(object): | 40 class request(object): |
17 def __init__(self, args, ui=None, repo=None, fin=None, fout=None, | 41 def __init__(self, args, ui=None, repo=None, fin=None, fout=None, |
18 ferr=None): | 42 ferr=None): |
19 self.args = args | 43 self.args = args |
907 ui.warn(_("unrecognized profiling format '%s'" | 931 ui.warn(_("unrecognized profiling format '%s'" |
908 " - Ignored\n") % format) | 932 " - Ignored\n") % format) |
909 format = 'text' | 933 format = 'text' |
910 | 934 |
911 try: | 935 try: |
912 from mercurial import lsprof | 936 from . import lsprof |
913 except ImportError: | 937 except ImportError: |
914 raise util.Abort(_( | 938 raise util.Abort(_( |
915 'lsprof not available - install from ' | 939 'lsprof not available - install from ' |
916 'http://codespeak.net/svn/user/arigo/hack/misc/lsprof/')) | 940 'http://codespeak.net/svn/user/arigo/hack/misc/lsprof/')) |
917 p = lsprof.Profiler() | 941 p = lsprof.Profiler() |
920 return func() | 944 return func() |
921 finally: | 945 finally: |
922 p.disable() | 946 p.disable() |
923 | 947 |
924 if format == 'kcachegrind': | 948 if format == 'kcachegrind': |
925 import lsprofcalltree | 949 from . import lsprofcalltree |
926 calltree = lsprofcalltree.KCacheGrind(p) | 950 calltree = lsprofcalltree.KCacheGrind(p) |
927 calltree.output(fp) | 951 calltree.output(fp) |
928 else: | 952 else: |
929 # format == 'text' | 953 # format == 'text' |
930 stats = lsprof.Stats(p.getstats()) | 954 stats = lsprof.Stats(p.getstats()) |