Mercurial > hg
comparison mercurial/util.py @ 3877:abaee83ce0a6
Replace demandload with new demandimport
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 13 Dec 2006 13:27:09 -0600 |
parents | 8e907b86126b |
children | 6b4127c7d52a |
comparison
equal
deleted
inserted
replaced
3876:1e0b94cfba0e | 3877:abaee83ce0a6 |
---|---|
11 This contains helper routines that are independent of the SCM core and hide | 11 This contains helper routines that are independent of the SCM core and hide |
12 platform-specific details from the core. | 12 platform-specific details from the core. |
13 """ | 13 """ |
14 | 14 |
15 from i18n import gettext as _ | 15 from i18n import gettext as _ |
16 from demandload import * | 16 import cStringIO, errno, getpass, popen2, re, shutil, sys, tempfile |
17 demandload(globals(), "cStringIO errno getpass popen2 re shutil sys tempfile") | 17 import os, threading, time, calendar, ConfigParser, locale |
18 demandload(globals(), "os threading time calendar ConfigParser locale") | |
19 | 18 |
20 _encoding = os.environ.get("HGENCODING") or locale.getpreferredencoding() \ | 19 _encoding = os.environ.get("HGENCODING") or locale.getpreferredencoding() \ |
21 or "ascii" | 20 or "ascii" |
22 _encodingmode = os.environ.get("HGENCODINGMODE", "strict") | 21 _encodingmode = os.environ.get("HGENCODINGMODE", "strict") |
23 _fallbackencoding = 'ISO-8859-1' | 22 _fallbackencoding = 'ISO-8859-1' |
691 except: | 690 except: |
692 return True | 691 return True |
693 | 692 |
694 # Platform specific variants | 693 # Platform specific variants |
695 if os.name == 'nt': | 694 if os.name == 'nt': |
696 demandload(globals(), "msvcrt") | 695 import msvcrt |
697 nulldev = 'NUL:' | 696 nulldev = 'NUL:' |
698 | 697 |
699 class winstdout: | 698 class winstdout: |
700 '''stdout on windows misbehaves if sent through a pipe''' | 699 '''stdout on windows misbehaves if sent through a pipe''' |
701 | 700 |