changeset 2475:7a77934ece46

merge with crew.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Wed, 21 Jun 2006 09:32:31 -0700
parents 1e32e2fe8a67 (current diff) 6904e1ef8ad1 (diff)
children 0f7e4a39d9af
files mercurial/hg.py mercurial/localrepo.py
diffstat 11 files changed, 21 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changegroup.py	Wed Jun 21 09:28:48 2006 -0700
+++ b/mercurial/changegroup.py	Wed Jun 21 09:32:31 2006 -0700
@@ -6,10 +6,9 @@
 This software may be used and distributed according to the terms
 of the GNU General Public License, incorporated herein by reference.
 """
-import struct
 from i18n import gettext as _
 from demandload import *
-demandload(globals(), "util")
+demandload(globals(), "struct util")
 
 def getchunk(source):
     """get a chunk from a changegroup"""
--- a/mercurial/dirstate.py	Wed Jun 21 09:28:48 2006 -0700
+++ b/mercurial/dirstate.py	Wed Jun 21 09:32:31 2006 -0700
@@ -7,11 +7,10 @@
 of the GNU General Public License, incorporated herein by reference.
 """
 
-import struct, os
 from node import *
 from i18n import gettext as _
 from demandload import *
-demandload(globals(), "time bisect stat util re errno")
+demandload(globals(), "struct os time bisect stat util re errno")
 
 class dirstate(object):
     format = ">cllll"
--- a/mercurial/filelog.py	Wed Jun 21 09:28:48 2006 -0700
+++ b/mercurial/filelog.py	Wed Jun 21 09:32:31 2006 -0700
@@ -5,10 +5,9 @@
 # This software may be used and distributed according to the terms
 # of the GNU General Public License, incorporated herein by reference.
 
-import os
 from revlog import *
 from demandload import *
-demandload(globals(), "bdiff")
+demandload(globals(), "bdiff os")
 
 class filelog(revlog):
     def __init__(self, opener, path, defversion=REVLOG_DEFAULT_VERSION):
--- a/mercurial/localrepo.py	Wed Jun 21 09:28:48 2006 -0700
+++ b/mercurial/localrepo.py	Wed Jun 21 09:32:31 2006 -0700
@@ -5,14 +5,13 @@
 # This software may be used and distributed according to the terms
 # of the GNU General Public License, incorporated herein by reference.
 
-import os, util
-import filelog, manifest, changelog, dirstate, repo
 from node import *
 from i18n import gettext as _
 from demandload import *
 demandload(globals(), "appendfile changegroup")
+demandload(globals(), "changelog dirstate filelog manifest repo")
 demandload(globals(), "re lock transaction tempfile stat mdiff errno ui")
-demandload(globals(), "revlog")
+demandload(globals(), "os revlog util")
 
 class localrepository(object):
     capabilities = ()
--- a/mercurial/manifest.py	Wed Jun 21 09:28:48 2006 -0700
+++ b/mercurial/manifest.py	Wed Jun 21 09:32:31 2006 -0700
@@ -5,11 +5,10 @@
 # This software may be used and distributed according to the terms
 # of the GNU General Public License, incorporated herein by reference.
 
-import struct
 from revlog import *
 from i18n import gettext as _
 from demandload import *
-demandload(globals(), "bisect array")
+demandload(globals(), "array bisect struct")
 
 class manifest(revlog):
     def __init__(self, opener, defversion=REVLOGV0):
--- a/mercurial/mdiff.py	Wed Jun 21 09:28:48 2006 -0700
+++ b/mercurial/mdiff.py	Wed Jun 21 09:32:31 2006 -0700
@@ -6,8 +6,8 @@
 # of the GNU General Public License, incorporated herein by reference.
 
 from demandload import demandload
-import struct, bdiff, util, mpatch
-demandload(globals(), "re")
+import bdiff, mpatch
+demandload(globals(), "re struct util")
 
 def splitnewlines(text):
     '''like str.splitlines, but only split on newlines.'''
--- a/mercurial/node.py	Wed Jun 21 09:28:48 2006 -0700
+++ b/mercurial/node.py	Wed Jun 21 09:32:31 2006 -0700
@@ -7,7 +7,8 @@
 of the GNU General Public License, incorporated herein by reference.
 """
 
-import binascii
+from demandload import demandload
+demandload(globals(), "binascii")
 
 nullid = "\0" * 20
 
--- a/mercurial/templater.py	Wed Jun 21 09:28:48 2006 -0700
+++ b/mercurial/templater.py	Wed Jun 21 09:32:31 2006 -0700
@@ -5,7 +5,6 @@
 # This software may be used and distributed according to the terms
 # of the GNU General Public License, incorporated herein by reference.
 
-import re
 from demandload import demandload
 from i18n import gettext as _
 from node import *
@@ -194,11 +193,16 @@
     walk(thing)
     return cs.getvalue()
 
-para_re = re.compile('(\n\n|\n\\s*[-*]\\s*)', re.M)
-space_re = re.compile(r'  +')
+para_re = None
+space_re = None
 
 def fill(text, width):
     '''fill many paragraphs.'''
+    global para_re, space_re
+    if para_re is None:
+        para_re = re.compile('(\n\n|\n\\s*[-*]\\s*)', re.M)
+        space_re = re.compile(r'  +')
+        
     def findparas():
         start = 0
         while True:
--- a/mercurial/transaction.py	Wed Jun 21 09:28:48 2006 -0700
+++ b/mercurial/transaction.py	Wed Jun 21 09:32:31 2006 -0700
@@ -11,8 +11,9 @@
 # This software may be used and distributed according to the terms
 # of the GNU General Public License, incorporated herein by reference.
 
-import os
+from demandload import demandload
 from i18n import gettext as _
+demandload(globals(), 'os')
 
 class transaction(object):
     def __init__(self, report, opener, journal, after=None):
--- a/mercurial/ui.py	Wed Jun 21 09:28:48 2006 -0700
+++ b/mercurial/ui.py	Wed Jun 21 09:32:31 2006 -0700
@@ -5,11 +5,10 @@
 # This software may be used and distributed according to the terms
 # of the GNU General Public License, incorporated herein by reference.
 
-import ConfigParser
 from i18n import gettext as _
 from demandload import *
 demandload(globals(), "errno getpass os re smtplib socket sys tempfile")
-demandload(globals(), "templater traceback util")
+demandload(globals(), "ConfigParser templater traceback util")
 
 class ui(object):
     def __init__(self, verbose=False, debug=False, quiet=False,
--- a/mercurial/util.py	Wed Jun 21 09:28:48 2006 -0700
+++ b/mercurial/util.py	Wed Jun 21 09:32:31 2006 -0700
@@ -10,11 +10,10 @@
 platform-specific details from the core.
 """
 
-import os, errno
 from i18n import gettext as _
 from demandload import *
 demandload(globals(), "cStringIO errno popen2 re shutil sys tempfile")
-demandload(globals(), "threading time")
+demandload(globals(), "os threading time")
 
 class SignalInterrupt(Exception):
     """Exception raised on SIGTERM and SIGHUP."""