Commit Graph

277 Commits

Author SHA1 Message Date
Eric Hopper
dd6718fc31 Convert all classes to new-style classes by deriving them from object. 2005-11-18 22:48:47 -08:00
Soh Tk-r28629
d46c7428a7 Fix traceback on bad system hgrc files 2005-10-31 09:57:54 -08:00
Benoit Boissinot
e25f65575b make readconfig take a filename instead of a file pointer as argument
catch parse error while reading a config file
add a testcase for parse error
2005-10-27 13:40:56 -07:00
tonfa@arakou.lan
c039642ffc Fix relative pull in a subdir 2005-10-24 17:41:45 -07:00
Benoit Boissinot
06e39e559b i18n part2: use '_' for all strings who are part of the user interface 2005-10-18 18:38:39 -07:00
Benoit Boissinot
e38e94088a i18n first part: make '_' available for files who need it 2005-10-18 18:37:48 -07:00
Bryan O'Sullivan
1cc739dd2e Use platform-appropriate rc file names. 2005-09-21 09:56:30 -07:00
bos@serpentine.internal.keyresearch.com
d8c746ea08 Merge with TAH. 2005-08-29 10:31:41 -07:00
Thomas Arendsen Hein
9129755767 Move generating short username to display in hg/hgweb annotate to ui module. 2005-08-28 17:29:28 +02:00
mason@suse.com
777af4d76b Add support for extension modules
This adds support for an [extensions] section to hgrc.  This has the form of:

[extensions]
mod=[path]

If a path is specified, the python module found at that path is load.
Otherwise, __import__ is used to find the module.

Each module must implement a dict called cmdtable where the command line
options for that module live.  Each module must also implement a reposetup
function:

cmdtable = {}
def reposetup(ui, repo): pass

Index: hg/mercurial/ui.py
===================================================================
2005-08-26 14:05:52 -07:00
benoit.boissinot@ens-lyon.fr
95b97f01ed pep-0008 cleanup
- Don't use spaces around the '=' sign when used to indicate a
      keyword argument or a default parameter value.
2005-08-26 13:06:58 +02:00
Bryan O'Sullivan
c575ae97dc Add commands.debugconfig.
This lets us both view the actual config data that hg is using, and
drive editors that need to see this information.
2005-08-23 21:30:12 -07:00
mpm@selenic.com
8fe07a9a3f Add ui.setconfig overlay
This can simplify option passing
2005-08-19 21:25:25 -08:00
Thomas Arendsen Hein
40a409ddd8 Read global config file /etc/mercurial/hgrc and fix reading hgrc on Windows. 2005-08-18 21:35:36 +01:00
mpm@selenic.com
09e51635fb HG environment variables take precedence over hgrc
manifest hash: c128b53429f861c0b75c2a81c6ad4907e4779810
2005-07-13 01:48:03 -08:00
Radoslaw "AstralStorm" Szkodzinski
f70194b3b9 Pass username to hgeditor, remove temporary file
# HG changeset patch
# User Radoslaw "AstralStorm" Szkodzinski <astralstorm@gorzow.mm.pl>
# Node ID 5c5d1484b51a53918575a199ab8985160f0ce2d7
# Parent  5155a0b6300820be38eb7e04d26525be39307df2
Pass username to hgeditor, remove temporary file
2005-07-10 16:00:17 -08:00
Bryan O'Sullivan
920a086a80 Demand-load most modules in the commands and ui modules.
# HG changeset patch
# User Bryan O'Sullivan <bos@serpentine.com>
# Node ID 059c6e42fc4221816e26a72bef8cf780891989ca
# Parent  4309b0a5a6010dd2e5811b77d2bc29a51acf290f
Demand-load most modules in the commands and ui modules.

This improves response times for a number of simple commands, as the
Python interpreter doesn't end up loading modules that it never uses.

There's less benefit to demand-loading in other modules.
2005-07-04 12:16:27 -08:00
Matt Mackall
c77de876fa Add username/merge/editor to .hgrc
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Add username/merge/editor to .hgrc

These take priority over the equivalent environment vars
Deprecate HGMERGE, HGUSER, and HGEDITOR in docs
Add ui section to docs
Remove undocumented HG_OPTS
Raise username code out of changelog class
Make tests ignore ~/.hgrc

manifest hash: d127ef02bc5266036b4c77a55319519e91bd475b
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCyM5NywK+sNU5EO8RAuU7AJ9zKk1TFrJXHM04jOOJJeBSp8jlTgCeP+tr
qwGFd+WaNqTepZ0wun5g9Uc=
=QEBu
-----END PGP SIGNATURE-----
2005-07-03 21:51:09 -08:00
mpm@selenic.com
3f8a95f419 [PATCH] Make ui.warn write to stderr
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[PATCH] Make ui.warn write to stderr

From: Bryan O'Sullivan <bos@serpentine.com>

> Someone is probably using ui.write instead of ui.warn.

Actually, ui.warn uses ui.write.  So hg never prints to stderr right
now.  Here's a patch to fix that.

[mpm: add sys.stdout.flush()]

manifest hash: c09c645a5985b640a7ad884afb0eeb11fcffbb19
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCxcEaywK+sNU5EO8RAhWUAJ9vVteAodKC9zIhIWUuPqVl2d915QCePp5S
asuv62w4Zv+o0gB3SoucYdQ=
=NYrs
-----END PGP SIGNATURE-----
2005-07-01 14:18:02 -08:00
mpm@selenic.com
0fb5db6915 Whitespace cleanups
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Whitespace cleanups

manifest hash: ac954bc3a4f034c12638a259ecd65841f5b63c5c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCwuubywK+sNU5EO8RAluIAJ98XQpNdZUpSmYKgDmrMRlbL76ZzQCfes0t
rknNUN/PhtyA4bzL646dOz4=
=UyCE
-----END PGP SIGNATURE-----
2005-06-29 10:42:35 -08:00
mpm@selenic.com
1c414eddc0 [PATCH] Harden os.system
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[PATCH] Harden os.system

From: Bryan O'Sullivan <bos@serpentine.com>

Add util.system function.  This is similar to os.system, but will
either succeed (if the process finishes with a zero exit code) or raise
a util.CommandError (if the process exits uncleanly or is killed by
a signal).

Add util.explain_exit function.  This tends to be ubiquitous in code
that calls other processes, and must describe what has gone wrong.

Change some uses of os.system over to util.system.

manifest hash: e3bf4adcac5b915432ec0af00efdbcef86bea4b1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCwSipywK+sNU5EO8RAr0RAJkBDt8XQ7mYQAWNHNgTOVt1eyWU1QCfe1oO
2OwxyWqpbRNACVJHHfZ3/Xw=
=OaRX
-----END PGP SIGNATURE-----
2005-06-28 02:38:33 -08:00
mpm@selenic.com
8d07742680 [PATCH] Add ui.expandpath command
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[PATCH] Add ui.expandpath command

From: Bryan O'Sullivan <bos@serpentine.com>

Add ui.expandpath function.

manifest hash: dd2b9e536b94b453b06604b88ba339d93698b2e0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCwSbMywK+sNU5EO8RAibuAJ9jAMqhR3cbTqbPG3g9M8INgFmbvACgjAU2
LpalLI+zhalEUIf1Uw8W5l8=
=fqB8
-----END PGP SIGNATURE-----
2005-06-28 02:30:36 -08:00
mpm@selenic.com
2bdabb4c9d Add support for .hg/hgrc file
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Add support for .hg/hgrc file

manifest hash: a6d2fc7ed8d56e2f0d65aad78a4d8359898ca246
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCr5QZywK+sNU5EO8RApnlAJ9nD65i2aEQcljV+Y39zgImpcdtgwCgpT9G
O2D8FDFpRNyYki/QPt5e/AQ=
=bQCZ
-----END PGP SIGNATURE-----
2005-06-14 18:36:09 -08:00
mpm@selenic.com
9299550092 ui: add configuration file support
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ui: add configuration file support

manifest hash: 2d0768a6f3797d4ccc870170b874bfd7aeb2f787
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCp3TyywK+sNU5EO8RArYYAJ4+wWQmO7HIXewuGwB3a5DjiWGHwgCcDpeF
Pz2lScnpVZPPbDQiS+VnBnM=
=ffwc
-----END PGP SIGNATURE-----
2005-06-08 14:45:06 -08:00
mpm@selenic.com
f95bf8d95c import and startup cleanups
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

import and startup cleanups

add commands:run()
add copyright notice to commands
eliminate/reorganize imports to speed up start time:

0.5b:
$ time bash -c 'for i in `seq 100`; do ~/bin/hg > /dev/null; done'

real    0m7.718s
user    0m6.719s
sys     0m0.794s

new:

$ time bash -c 'for i in `seq 100`; do hg > /dev/null; done'
real    0m2.171s
user    0m1.684s
sys     0m0.444s

just python:

$ time bash -c 'for i in `seq 100`; do python -c pass; done'
real    0m0.988s
user    0m0.771s
sys     0m0.207s

Ignoring the fixed cost of loading the Python interpreter, we're 5.6
times faster. With the Python load time, we're still 3.5 times faster.

manifest hash: acce5882a55c76eb165316f5741724c8ce4ef587
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCoihAywK+sNU5EO8RAqMdAJwMe6Ur0R9G6jjayNa5hH2C3c4k/gCeIYvc
N178vaWWGciX9zq+g5qCAls=
=buhv
-----END PGP SIGNATURE-----
2005-06-04 14:16:32 -08:00
Thomas Arendsen Hein
344b9ab253 ui.warn can use more than one argument like the other ui methods. 2005-06-02 07:06:29 +01:00
mpm@selenic.com
5064b78681 Move ui class to its own module
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Move ui class to its own module

manifest hash: f75c8f9cdfe16f143ab633d0072c14ba88ac88be
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCnVxxywK+sNU5EO8RAgPgAJ48p7w4Do/saCC8WkBvHj/rdnoiEgCgrSs9
Wu1fOSgST3rn/2JpZAdFRdA=
=91tt
-----END PGP SIGNATURE-----
2005-05-31 22:57:53 -08:00