##// END OF EJS Templates
separate import lines from mercurial and general python modules
Simon Heimberg -
r8312:b87a50b7 default
parent child Browse files
Show More
@@ -7,7 +7,8 b''
7
7
8 from i18n import _
8 from i18n import _
9 from node import hex
9 from node import hex
10 import cStringIO, os, stat, tarfile, time, util, zipfile
10 import util
11 import cStringIO, os, stat, tarfile, time, zipfile
11 import zlib, gzip
12 import zlib, gzip
12
13
13 def tidyprefix(dest, prefix, suffixes):
14 def tidyprefix(dest, prefix, suffixes):
@@ -13,7 +13,8 b' were part of the actual repository.'
13
13
14 from node import nullid
14 from node import nullid
15 from i18n import _
15 from i18n import _
16 import changegroup, util, os, struct, bz2, zlib, tempfile, shutil, mdiff
16 import os, struct, bz2, zlib, tempfile, shutil
17 import changegroup, util, mdiff
17 import localrepo, changelog, manifest, filelog, revlog, error
18 import localrepo, changelog, manifest, filelog, revlog, error
18
19
19 class bundlerevlog(revlog.revlog):
20 class bundlerevlog(revlog.revlog):
@@ -6,7 +6,8 b''
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9 import struct, os, bz2, zlib, util, tempfile
9 import util
10 import struct, os, bz2, zlib, tempfile
10
11
11 def getchunk(source):
12 def getchunk(source):
12 """get a chunk from a changegroup"""
13 """get a chunk from a changegroup"""
@@ -7,8 +7,8 b''
7
7
8 from node import hex, nullid, nullrev, short
8 from node import hex, nullid, nullrev, short
9 from i18n import _
9 from i18n import _
10 import os, sys, bisect, stat, encoding
10 import os, sys, bisect, stat, errno
11 import mdiff, bdiff, util, templater, templatefilters, patch, errno, error
11 import mdiff, bdiff, util, templater, templatefilters, patch, error, encoding
12 import match as _match
12 import match as _match
13
13
14 revrangesep = ':'
14 revrangesep = ':'
@@ -8,10 +8,11 b''
8 from node import hex, nullid, nullrev, short
8 from node import hex, nullid, nullrev, short
9 from lock import release
9 from lock import release
10 from i18n import _, gettext
10 from i18n import _, gettext
11 import os, re, sys, textwrap, subprocess
11 import os, re, sys, textwrap, subprocess, difflib, time
12 import hg, util, revlog, bundlerepo, extensions, copies, context, error
12 import hg, util, revlog, bundlerepo, extensions, copies, context, error
13 import difflib, patch, time, help, mdiff, tempfile, url, encoding
13 import patch, help, mdiff, tempfile, url, encoding
14 import archival, changegroup, cmdutil, hgweb.server, sshserver, hbisect
14 import archival, changegroup, cmdutil, sshserver, hbisect
15 from hgweb import server
15 import merge as merge_
16 import merge as merge_
16
17
17 # Commands start here, listed alphabetically
18 # Commands start here, listed alphabetically
@@ -2698,7 +2699,7 b' def serve(ui, repo, **opts):'
2698 class service:
2699 class service:
2699 def init(self):
2700 def init(self):
2700 util.set_signal_handler()
2701 util.set_signal_handler()
2701 self.httpd = hgweb.server.create_server(baseui, repo)
2702 self.httpd = server.create_server(baseui, repo)
2702
2703
2703 if not ui.verbose: return
2704 if not ui.verbose: return
2704
2705
@@ -6,7 +6,8 b''
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9 import re, error, os
9 import error
10 import re, os
10
11
11 class sortdict(dict):
12 class sortdict(dict):
12 'a simple sorted dictionary'
13 'a simple sorted dictionary'
@@ -7,7 +7,8 b''
7
7
8 from node import nullid, nullrev, short, hex
8 from node import nullid, nullrev, short, hex
9 from i18n import _
9 from i18n import _
10 import ancestor, bdiff, error, util, os, errno
10 import ancestor, bdiff, error, util
11 import os, errno
11
12
12 propertycache = util.propertycache
13 propertycache = util.propertycache
13
14
@@ -6,7 +6,8 b''
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9 import util, heapq
9 import util
10 import heapq
10
11
11 def _nonoverlap(d1, d2, d3):
12 def _nonoverlap(d1, d2, d3):
12 "Return list of elements in d1 not in d2 or d3"
13 "Return list of elements in d1 not in d2 or d3"
@@ -7,8 +7,9 b''
7
7
8 from node import nullid
8 from node import nullid
9 from i18n import _
9 from i18n import _
10 import struct, os, stat, util, errno, ignore
10 import util, ignore, osutil, parsers
11 import cStringIO, osutil, sys, parsers
11 import struct, os, stat, errno
12 import cStringIO, sys
12
13
13 _unknown = ('?', 0, 0, 0)
14 _unknown = ('?', 0, 0, 0)
14 _format = ">cllll"
15 _format = ">cllll"
@@ -5,7 +5,8 b''
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, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 import sys, unicodedata, locale, os, error
8 import error
9 import sys, unicodedata, locale, os
9
10
10 _encodingfixup = {'646': 'ascii', 'ANSI_X3.4-1968': 'ascii'}
11 _encodingfixup = {'646': 'ascii', 'ANSI_X3.4-1968': 'ascii'}
11
12
@@ -7,7 +7,8 b''
7
7
8 from node import short
8 from node import short
9 from i18n import _
9 from i18n import _
10 import util, os, tempfile, simplemerge, re, filecmp
10 import util, simplemerge
11 import os, tempfile, re, filecmp
11
12
12 def _toolstr(ui, tool, part, default=""):
13 def _toolstr(ui, tool, part, default=""):
13 return ui.config("merge-tools", tool + "." + part, default)
14 return ui.config("merge-tools", tool + "." + part, default)
@@ -9,9 +9,10 b''
9 from i18n import _
9 from i18n import _
10 from lock import release
10 from lock import release
11 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo
11 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo
12 import errno, lock, os, shutil, util, extensions, error
12 import lock, util, extensions, error
13 import merge as _merge
13 import merge as _merge
14 import verify as _verify
14 import verify as _verify
15 import errno, os, shutil
15
16
16 def _local(path):
17 def _local(path):
17 return (os.path.isfile(util.drop_scheme('file', path)) and
18 return (os.path.isfile(util.drop_scheme('file', path)) and
@@ -6,8 +6,8 b''
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9 import util, os, sys
9 import os, sys
10 from mercurial import extensions
10 import extensions, util
11
11
12 def _pythonhook(ui, repo, name, hname, funcname, args, throw):
12 def _pythonhook(ui, repo, name, hname, funcname, args, throw):
13 '''call python hook. hook is callable object, looked up as
13 '''call python hook. hook is callable object, looked up as
@@ -8,8 +8,9 b''
8
8
9 from node import bin, hex, nullid
9 from node import bin, hex, nullid
10 from i18n import _
10 from i18n import _
11 import repo, os, urllib, urllib2, urlparse, zlib, util, httplib
11 import repo, changegroup, statichttprepo, error, url, util
12 import errno, socket, changegroup, statichttprepo, error, url
12 import os, urllib, urllib2, urlparse, zlib, httplib
13 import errno, socket
13
14
14 def zgenerator(f):
15 def zgenerator(f):
15 zd = zlib.decompressobj()
16 zd = zlib.decompressobj()
@@ -5,7 +5,8 b''
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, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 import gettext, sys, os, encoding
8 import encoding
9 import gettext, sys, os
9
10
10 # modelled after templater.templatepath:
11 # modelled after templater.templatepath:
11 if hasattr(sys, 'frozen'):
12 if hasattr(sys, 'frozen'):
@@ -6,7 +6,8 b''
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9 import util, re
9 import util
10 import re
10
11
11 _commentre = None
12 _commentre = None
12
13
@@ -8,13 +8,13 b''
8 from node import bin, hex, nullid, nullrev, short
8 from node import bin, hex, nullid, nullrev, short
9 from i18n import _
9 from i18n import _
10 import repo, changegroup
10 import repo, changegroup
11 import changelog, dirstate, filelog, manifest, context, weakref
11 import changelog, dirstate, filelog, manifest, context
12 import lock, transaction, stat, errno, ui, store, encoding
12 import lock, transaction, ui, store, encoding
13 import os, time, util, extensions, hook, inspect, error
13 import util, extensions, hook, error
14 import match as match_
14 import match as match_
15 import merge as merge_
15 import merge as merge_
16
17 from lock import release
16 from lock import release
17 import weakref, stat, errno, os, time, inspect
18 propertycache = util.propertycache
18 propertycache = util.propertycache
19
19
20 class localrepository(repo.repository):
20 class localrepository(repo.repository):
@@ -5,7 +5,8 b''
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, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 import errno, os, socket, time, util, error
8 import util, error
9 import errno, os, socket, time
9 import warnings
10 import warnings
10
11
11 class lock(object):
12 class lock(object):
@@ -6,9 +6,9 b''
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9 import util, encoding
9 import os, smtplib, socket
10 import os, smtplib, socket
10 import email.Header, email.MIMEText, email.Utils
11 import email.Header, email.MIMEText, email.Utils
11 import util, encoding
12
12
13 def _smtp(ui):
13 def _smtp(ui):
14 '''build an smtp connection and return a function to send mail'''
14 '''build an smtp connection and return a function to send mail'''
@@ -6,7 +6,8 b''
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9 import array, struct, mdiff, parsers, util, error, revlog
9 import mdiff, parsers, util, error, revlog
10 import array, struct
10
11
11 class manifestdict(dict):
12 class manifestdict(dict):
12 def __init__(self, mapping=None, flags=None):
13 def __init__(self, mapping=None, flags=None):
@@ -6,7 +6,8 b''
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9 import bdiff, mpatch, re, struct, util
9 import bdiff, mpatch, util
10 import re, struct
10
11
11 def splitnewlines(text):
12 def splitnewlines(text):
12 '''like str.splitlines, but only split on newlines.'''
13 '''like str.splitlines, but only split on newlines.'''
@@ -7,7 +7,8 b''
7
7
8 from node import nullid, nullrev, hex, bin
8 from node import nullid, nullrev, hex, bin
9 from i18n import _
9 from i18n import _
10 import errno, util, os, filemerge, copies, shutil
10 import util, filemerge, copies
11 import errno, os, shutil
11
12
12 class mergestate(object):
13 class mergestate(object):
13 '''track 3-way merge state of individual files'''
14 '''track 3-way merge state of individual files'''
@@ -6,7 +6,8 b''
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9 import os, sys, osutil, errno, stat, getpass, pwd, grp
9 import osutil
10 import os, sys, errno, stat, getpass, pwd, grp
10
11
11 posixfile = file
12 posixfile = file
12 nulldev = '/dev/null'
13 nulldev = '/dev/null'
@@ -6,9 +6,10 b''
6 # This software may be used and distributed according to the terms of the
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2, incorporated herein by reference.
7 # GNU General Public License version 2, incorporated herein by reference.
8
8
9 import changegroup, os
9 import changegroup
10 from node import nullrev, short
10 from node import nullrev, short
11 from i18n import _
11 from i18n import _
12 import os
12
13
13 def _bundle(repo, bases, heads, node, suffix, extranodes=None):
14 def _bundle(repo, bases, heads, node, suffix, extranodes=None):
14 """create a bundle with the specified revisions as a backup"""
15 """create a bundle with the specified revisions as a backup"""
@@ -14,8 +14,8 b' and O(changes) merge between branches.'
14 # import stuff from node for others to import from revlog
14 # import stuff from node for others to import from revlog
15 from node import bin, hex, nullid, nullrev, short #@UnusedImport
15 from node import bin, hex, nullid, nullrev, short #@UnusedImport
16 from i18n import _
16 from i18n import _
17 import changegroup, errno, ancestor, mdiff, parsers
17 import changegroup, ancestor, mdiff, parsers, error, util
18 import struct, util, zlib, error
18 import struct, zlib, errno
19
19
20 _pack = struct.pack
20 _pack = struct.pack
21 _unpack = struct.unpack
21 _unpack = struct.unpack
@@ -19,7 +19,8 b''
19 # s: "i hate that."
19 # s: "i hate that."
20
20
21 from i18n import _
21 from i18n import _
22 import util, mdiff, sys, os
22 import util, mdiff
23 import sys, os
23
24
24 class CantReprocessAndShowBase(Exception):
25 class CantReprocessAndShowBase(Exception):
25 pass
26 pass
@@ -7,7 +7,8 b''
7
7
8 from node import bin, hex
8 from node import bin, hex
9 from i18n import _
9 from i18n import _
10 import repo, re, util, error
10 import repo, util, error
11 import re
11
12
12 class remotelock(object):
13 class remotelock(object):
13 def __init__(self, repo):
14 def __init__(self, repo):
@@ -8,7 +8,8 b''
8
8
9 from i18n import _
9 from i18n import _
10 from node import bin, hex
10 from node import bin, hex
11 import os, streamclone, sys, tempfile, util, hook
11 import streamclone, util, hook
12 import os, sys, tempfile
12
13
13 class sshserver(object):
14 class sshserver(object):
14 def __init__(self, ui, repo):
15 def __init__(self, ui, repo):
@@ -6,7 +6,8 b''
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9 import os, stat, osutil, util
9 import osutil, util
10 import os, stat
10
11
11 _sha = util.sha1
12 _sha = util.sha1
12
13
@@ -7,7 +7,7 b''
7
7
8 from i18n import _
8 from i18n import _
9 import re, sys, os
9 import re, sys, os
10 from mercurial import util, config
10 import util, config
11
11
12 path = ['templates', '../templates']
12 path = ['templates', '../templates']
13
13
@@ -6,8 +6,8 b''
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9 import errno, getpass, os, re, socket, sys, tempfile
9 import errno, getpass, os, re, socket, sys, tempfile, traceback
10 import config, traceback, util, error
10 import config, util, error
11
11
12 _booleans = {'1': True, 'yes': True, 'true': True, 'on': True,
12 _booleans = {'1': True, 'yes': True, 'true': True, 'on': True,
13 '0': False, 'no': False, 'false': False, 'off': False}
13 '0': False, 'no': False, 'false': False, 'off': False}
@@ -14,8 +14,9 b' hide platform-specific details from the '
14 """
14 """
15
15
16 from i18n import _
16 from i18n import _
17 import cStringIO, errno, re, shutil, sys, tempfile, traceback, error
17 import error, osutil
18 import os, stat, threading, time, calendar, glob, osutil, random
18 import cStringIO, errno, re, shutil, sys, tempfile, traceback
19 import os, stat, threading, time, calendar, glob, random
19 import imp
20 import imp
20
21
21 # Python compatibility
22 # Python compatibility
@@ -6,7 +6,8 b''
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9 import errno, msvcrt, os, osutil, re, sys, error
9 import osutil, error
10 import errno, msvcrt, os, re, sys
10 nulldev = 'NUL:'
11 nulldev = 'NUL:'
11
12
12 umask = 002
13 umask = 002
General Comments 0
You need to be logged in to leave comments. Login now