Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 262:3db700146536
implement demand loading hack
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
implement demand loading hack
This attempts to speed up start-up times without pushing imports down
into local scopes.
manifest hash: f9c18897e67f7872b44f5c89bdde00edfc3628ce
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCo0kHywK+sNU5EO8RAg5HAKCxRKAz3FXDyv4wScq1ZbwTgfPa2gCfW9K+
dg5nC3Uvp4FilP8waF6liAY=
=dolF
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Sun, 05 Jun 2005 10:48:39 -0800 |
parents | 45c293b71341 |
children | 4c1d7072d5cd |
comparison
equal
deleted
inserted
replaced
261:3dae0296551d | 262:3db700146536 |
---|---|
3 # Copyright 2005 Matt Mackall <mpm@selenic.com> | 3 # Copyright 2005 Matt Mackall <mpm@selenic.com> |
4 # | 4 # |
5 # This software may be used and distributed according to the terms | 5 # This software may be used and distributed according to the terms |
6 # of the GNU General Public License, incorporated herein by reference. | 6 # of the GNU General Public License, incorporated herein by reference. |
7 | 7 |
8 import os, re, sys, signal, time, mdiff | 8 import os, re, sys, signal |
9 from mercurial import fancyopts, ui, hg | 9 import fancyopts, ui, hg |
10 from demandload import * | |
11 demandload(globals(), "mdiff time hgweb traceback") | |
10 | 12 |
11 class UnknownCommand(Exception): pass | 13 class UnknownCommand(Exception): pass |
12 | 14 |
13 def filterfiles(filters, files): | 15 def filterfiles(filters, files): |
14 l = [ x for x in files if x in filters ] | 16 l = [ x for x in files if x in filters ] |
395 """remove the specified files on the next commit""" | 397 """remove the specified files on the next commit""" |
396 repo.remove(relpath(repo, (file,) + files)) | 398 repo.remove(relpath(repo, (file,) + files)) |
397 | 399 |
398 def serve(ui, repo, **opts): | 400 def serve(ui, repo, **opts): |
399 """export the repository via HTTP""" | 401 """export the repository via HTTP""" |
400 from mercurial import hgweb | |
401 hgweb.server(repo.root, opts["name"], opts["templates"], | 402 hgweb.server(repo.root, opts["name"], opts["templates"], |
402 opts["address"], opts["port"]) | 403 opts["address"], opts["port"]) |
403 | 404 |
404 def status(ui, repo): | 405 def status(ui, repo): |
405 '''show changed files in the working directory | 406 '''show changed files in the working directory |
592 if inst.errno == 32: | 593 if inst.errno == 32: |
593 u.warn("broken pipe\n") | 594 u.warn("broken pipe\n") |
594 else: | 595 else: |
595 raise | 596 raise |
596 except TypeError, inst: | 597 except TypeError, inst: |
597 import traceback | |
598 # was this an argument error? | 598 # was this an argument error? |
599 tb = traceback.extract_tb(sys.exc_info()[2]) | 599 tb = traceback.extract_tb(sys.exc_info()[2]) |
600 if len(tb) > 2: # no | 600 if len(tb) > 2: # no |
601 raise | 601 raise |
602 u.warn("%s: invalid arguments\n" % i[0].__name__) | 602 u.warn("%s: invalid arguments\n" % i[0].__name__) |