##// END OF EJS Templates
util: use absolute_import
Gregory Szorc -
r27358:ac839ee4 default
parent child Browse files
Show More
@@ -13,26 +13,47 b' This contains helper routines that are i'
13 hide platform-specific details from the core.
13 hide platform-specific details from the core.
14 """
14 """
15
15
16 import i18n
16 from __future__ import absolute_import
17 _ = i18n._
17
18 import error, osutil, encoding, parsers
18 import bz2
19 import errno, shutil, sys, tempfile, traceback
19 import calendar
20 import collections
21 import datetime
22 import errno
23 import gc
24 import hashlib
25 import imp
26 import os
20 import re as remod
27 import re as remod
21 import os, time, datetime, calendar, textwrap, signal, collections
28 import shutil
22 import imp, socket, urllib
29 import signal
23 import gc
30 import socket
24 import bz2
31 import subprocess
32 import sys
33 import tempfile
34 import textwrap
35 import time
36 import traceback
37 import urllib
25 import zlib
38 import zlib
26 import hashlib
39
40 from . import (
41 encoding,
42 error,
43 i18n,
44 osutil,
45 parsers,
46 )
27
47
28 if os.name == 'nt':
48 if os.name == 'nt':
29 import windows as platform
49 from . import windows as platform
30 else:
50 else:
31 import posix as platform
51 from . import posix as platform
32
52
33 md5 = hashlib.md5
53 md5 = hashlib.md5
34 sha1 = hashlib.sha1
54 sha1 = hashlib.sha1
35 sha512 = hashlib.sha512
55 sha512 = hashlib.sha512
56 _ = i18n._
36
57
37 cachestat = platform.cachestat
58 cachestat = platform.cachestat
38 checkexec = platform.checkexec
59 checkexec = platform.checkexec
@@ -200,7 +221,6 b' except NameError:'
200 def buffer(sliceable, offset=0):
221 def buffer(sliceable, offset=0):
201 return memoryview(sliceable)[offset:]
222 return memoryview(sliceable)[offset:]
202
223
203 import subprocess
204 closefds = os.name == 'posix'
224 closefds = os.name == 'posix'
205
225
206 _chunksize = 4096
226 _chunksize = 4096
@@ -326,7 +346,7 b' def popen4(cmd, env=None, newlines=False'
326 def version():
346 def version():
327 """Return version information if available."""
347 """Return version information if available."""
328 try:
348 try:
329 import __version__
349 from . import __version__
330 return __version__.version
350 return __version__.version
331 except ImportError:
351 except ImportError:
332 return 'unknown'
352 return 'unknown'
@@ -128,7 +128,6 b''
128 mercurial/scmwindows.py not using absolute_import
128 mercurial/scmwindows.py not using absolute_import
129 mercurial/similar.py not using absolute_import
129 mercurial/similar.py not using absolute_import
130 mercurial/store.py not using absolute_import
130 mercurial/store.py not using absolute_import
131 mercurial/util.py not using absolute_import
132 mercurial/windows.py not using absolute_import
131 mercurial/windows.py not using absolute_import
133 setup.py not using absolute_import
132 setup.py not using absolute_import
134 tests/filterpyflakes.py requires print_function
133 tests/filterpyflakes.py requires print_function
General Comments 0
You need to be logged in to leave comments. Login now