Commit Graph

277 Commits

Author SHA1 Message Date
Thomas Arendsen Hein
1be2af280f Abort on empty username so specifying a username can be forced.
This behaviour was introduced by d5601ef79d86 and broken by c608116532fe.
Added test for this.
2007-01-24 23:04:51 +01:00
Alexis S. L. Carvalho
6dc09d1834 Fix hg showconfig traceback with values that aren't strings 2007-02-15 10:15:08 -02:00
Thomas Arendsen Hein
f599c21b8e merge with stable 2007-01-24 23:07:09 +01:00
Patrick Mezard
784a42ef92 Flush stderr after write.
stderr can be buffered under win32 when redirected to a file,
including stdout.
2007-01-10 20:35:27 +01:00
Matt Mackall
296d6a7cb8 Simplify i18n imports 2006-12-14 20:25:19 -06:00
Matt Mackall
4492623506 Fix a pygettext complaint 2006-12-14 17:32:25 -06:00
Matt Mackall
4a935821ae Fix a pygettext complaint 2006-12-14 17:32:25 -06:00
Matt Mackall
f17a4e1934 Replace demandload with new demandimport 2006-12-13 13:27:09 -06:00
Matt Mackall
5ee2088301 add a simple nested buffering scheme to ui 2006-12-01 01:28:18 -06:00
Benoit Boissinot
3bad25e752 only print a warning when no username is specified
- revert most of 8b55c0ba
- display the username during interactive commit
2006-11-28 21:16:05 +01:00
Alexis S. L. Carvalho
3508dfb573 Update trusted_users only after we've seen a file not owned by the user 2006-11-18 23:51:15 -02:00
Alexis S. L. Carvalho
6e218edeb5 Avoid looking up usernames if the current user owns the .hgrc file
Converting uids into usernames may be somewhat expensive when NIS
or LDAP is involved.
2006-11-18 23:51:14 -02:00
Alexis S. L. Carvalho
ad6b588b55 Use a variable to explicitly trust global config files 2006-11-18 23:51:13 -02:00
Matt Mackall
0809871d9a ui: remove last vestiges of header buffering 2006-11-15 15:51:58 -06:00
Matt Mackall
b0f86b4331 refactor header handling for changelog formatting 2006-11-13 13:26:57 -06:00
Thomas Arendsen Hein
f26c110d43 Turn of "Not trusting file" logging when running hgweb and hgwebdir
(hg serve still shows the warning)
2006-10-26 19:25:45 +02:00
Alexis S. L. Carvalho
cb59e4de82 save settings from untrusted config files in a separate configparser
This untrusted configparser is a superset of the trusted configparser,
so that interpolation still works.

Also add an "untrusted" argument to ui.config* to allow querying
ui.ucdata.

With --debug, we print a warning when we read an untrusted config
file, and when we try to access a trusted setting that has one value
in the trusted configparser and another in the untrusted configparser.
2006-10-26 19:25:45 +02:00
Alexis S. L. Carvalho
c44cea1532 Only read .hg/hgrc files from trusted users/groups
The list of trusted users and groups is specified in the [trusted]
section of a hgrc; the current user is always trusted; "*" can be
used to trust all users/groups.

Global hgrc files are always read.

On Windows (and other systems that don't have the pwd and grp modules),
all .hg/hgrc files are read.

This is essentially the same patch that was previously applied as
revision f077d29b114d.
2006-10-26 19:25:44 +02:00
Thomas Arendsen Hein
37655ca869 Commit username: Better error message, abort on empty name, fix documentation. 2006-10-23 14:56:51 +02:00
Benoit Boissinot
7c004b60e9 fix errors spotted by pychecker 2006-10-19 16:55:34 +02:00
Benoit Boissinot
dc9483558a makes username mandatory 2006-10-18 22:24:03 +02:00
Alexis S. L. Carvalho
0ef46c9478 add ui.readsections
Given a file name and a set of sections, this function reads the file
and adds only the specified sections to the configuration data.
2006-10-17 16:59:24 -03:00
Alexis S. L. Carvalho
a85d162373 Use a case-sensitive version of SafeConfigParser everywhere
This change has the potential to break existing setups, but the current
behaviour (the keys in configuration files are always lower-cased) can
bite us in a few places:

- no way to use a Command in [defaults]
- hgext.Extension doesn't work in [extensions]
- you can't use an Upper/case/PATH in the [paths] section of hgweb.config
- you can't (easily) protect paths with upper-case letters with the
  acl extension
- you can't specify a /Path/TO/a/rEPO in the [reposubs] section for
  the notify extension
2006-10-16 15:38:53 -03:00
Thomas Arendsen Hein
c923f5a65a Removed unused imports of mdiff and templater from ui.py 2006-10-13 19:35:08 +02:00
Alexis S. L. Carvalho
3eeaf02465 update ui.quiet/verbose/debug/interactive every time the config changes
- ui.quiet/verbose/debug/interactive become just a cache of the ui.cdata
  settings

- the quiet, verbose, debug and interactive options from the [ui] section
  from .hg/hgrc files are respected for commands that open the repo

- setting ui.quiet/verbose/debug/interactive with --config works

- the command line options always override the hgrc settings - previously
  it wasn't possible to override a [ui] debug = True.  --debug still
  takes precedence over --quiet and --verbose.
2006-10-10 18:43:20 -03:00
Alexis S. L. Carvalho
105915ca0d ui.py: untangle updateopts
The code in ui.updateopts that handles ui.quiet, ui.verbose and
ui.debugflag is too smart, making it somewhat hard to see what
are the exact constraints placed on the values of these variables,
hiding some buglets.

This patch makes these constraints more explicit, fixing these
buglets and changing the behaviour slightly.  It also adds a test
to make sure things work as expected in the future.

The buglets:
- setting ui.debug = True in a hgrc wouldn't turn on verbose mode
- additionally, setting ui.quiet = True or using --quiet would give
  you a "quiet debug" mode.

The behaviour change:
- previously, in a hgrc file, ui.quiet wins against ui.verbose (i.e.
  the final result would be quiet mode), but --verbose wins against
  --quiet
- now ui.quiet nullifies ui.verbose and --verbose nullifies --quiet.
  As a consequence, using -qv always gives you normal mode (unless
  debug mode was turned on somewhere)
2006-10-10 18:43:20 -03:00
Alexis S. L. Carvalho
b5be394282 ui.py: normalize settings every time the configuration changes
Previously, we would normalize settings (e.g. turn relative paths into
absolute ones) only after reading a config file.

Now "--config paths.foo=bar" will use the cwd to make "bar" an absolute
path.
2006-10-10 18:43:20 -03:00
Alexis S. L. Carvalho
0cc9fd2297 move the parsing of --config options to commands.py 2006-10-10 18:43:20 -03:00
Alexis S. L. Carvalho
0b096956bb ui.py: use the overlay to hold --config data
This allows the ui class to know that these items have a higher priority
without further help from commands.py.
2006-10-10 18:43:20 -03:00
Alexis S. L. Carvalho
e108a1d368 ui.py: change the overlay from a dict to a SafeConfigParser.
This also fixes what's probably a bug - configitems was ignoring the overlay.
2006-10-10 18:43:20 -03:00
Alexis S. L. Carvalho
2a77e52007 ui.py: don't query parentui.cdata when looking up config items.
We copied the contents of parentui.cdata on initialization.
2006-10-10 18:43:20 -03:00
Alexis S. L. Carvalho
615137ec99 ui.py: make walkconfig use configitems
Also make it sort the available config sections while we're at it.
2006-10-10 18:43:20 -03:00
Alexis S. L. Carvalho
f33b5d1816 ui.py: move common code out of config and configbool 2006-10-10 18:43:20 -03:00
Alexis S. L. Carvalho
2182538090 ui.py: remove revlogopts and (unused) diffcache variables
This should make the [revlog] section in a .hg/hgrc file be respected
when there's still no changelog.
2006-10-10 18:43:20 -03:00
Alexis S. L. Carvalho
5ea7f93fd6 ui.py: don't let parent and child ui objects share header and prev_header 2006-10-10 18:43:20 -03:00
Alexis S. L. Carvalho
4cb87ef8d8 ui.py: use correct parentui while copying readhooks 2006-10-10 18:43:20 -03:00
Matt Mackall
d031f12c1d Merge with backout 2006-09-15 16:01:16 -05:00
Matt Mackall
277fde1fea Back out trusted hgrc change for now
Backed out changeset f077d29b114d4
2006-09-15 16:00:16 -05:00
Thomas Arendsen Hein
005fbb4e58 Include section name and parameter name (if available) in config errors.
Added tests for this.
2006-09-08 10:01:45 +02:00
Alexis S. L. Carvalho
fa133e9e4f Only read .hg/hgrc files from trusted users/groups
The list of trusted users and groups is specified in the [trusted]
section of a hgrc; the current user is always trusted; "*" can be
used to trust all users/groups.

Global hgrc files are always read.

On Windows (and other systems that don't have the pwd and grp modules),
all .hg/hgrc files are read.
2006-08-22 20:45:03 -03:00
Vadim Gelfer
305475cdb6 merge with self. 2006-08-18 14:13:44 -07:00
Vadim Gelfer
f50eed7943 load extensions from every hgrc.
before this change only extensions in global hgrc files were loaded.
now extensions in per-repo hgrc are loaded.
2006-08-18 14:13:24 -07:00
Matt Mackall
f849bdf704 Move ui.sendmail to mail.connect/sendmail 2006-08-15 14:06:50 -05:00
Matt Mackall
6ecbc46d1a Move ui.diffopts to patch.diffopts where it belongs 2006-08-15 11:34:08 -05:00
Vadim Gelfer
13d751feaf refactor text diff/patch code.
rename commands.dodiff to patch.diff.
rename commands.doexport to patch.export.
move some functions from commands to new mercurial.cmdutil module.
turn list of diff options into mdiff.diffopts class.

patch.diff and patch.export now has clean api for call from 3rd party
python code.
2006-08-12 16:13:27 -07:00
Vadim Gelfer
dc377b58c1 update copyrights. 2006-08-12 12:30:02 -07:00
Matt Mackall
fb73e75b58 Kill ui.setconfig_remoteopts
This brought too much knowledge about command line particulars into
the ui code. Moved to commands.py.
2006-07-31 00:47:43 -05:00
Vadim Gelfer
07de9b45fd fix windows username problem. 2006-07-24 09:11:26 -07:00
Benoit Boissinot
2be128d29b expand the path if destination is not a directory 2006-07-16 00:01:41 +02:00
Thomas Arendsen Hein
56e267824a Add ui method to set --ssh/--remotecmd, use it in init/clone/pull/push/in/out.
The only user visible change is that 'hg init' now accepts this options, too.
2006-07-12 08:57:18 +02:00
Benoit Boissinot
1433da063e merge with crew 2006-07-09 14:42:18 +02:00
Valentino Volonghi aka dialtone
1caa939c7d adding local_hostname option to smtp configuration 2006-07-09 14:12:19 +02:00
Haakon Riiser
7b06333d1a diff: add -b/-B options 2006-06-29 15:16:25 +02:00
Benoit Boissinot
7dd019b60b use __contains__, index or split instead of str.find
str.find return -1 when the substring is not found, -1 evaluate
to True and is a valid index, which can lead to bugs.
Using alternatives when possible makes the code clearer and less
prone to bugs. (and __contains__ is faster in microbenchmarks)
2006-07-09 01:30:30 +02:00
Benoit Boissinot
0a4260fa0b do not enable verbose output if quiet is specified in the cmdline 2006-09-03 02:28:39 +02:00
Alexis S. L. Carvalho
16c4d42a8d load extensions only after the ui object has been completely initialized
This fixes a traceback printed when hg tries to print another traceback
after an extension fails to be loaded.  Add a test for that.
2006-08-22 22:49:30 -03:00
Thomas Arendsen Hein
609fc3aa7b Allow using default values with ui.configlist, too, and add a test for this. 2006-06-26 22:44:48 +02:00
Thomas Arendsen Hein
a8184486dc Added ui.configlist method to get comma/space separated lists of strings.
For example:
 users = alice, bob
 colors = red green blue
2006-06-26 14:52:26 +02:00
Thomas Arendsen Hein
6ed54e7d77 Fix ui.expandpath problem and broken test introduced by 5460bea2cce9. 2006-06-26 14:49:18 +02:00
Vadim Gelfer
b32329ed97 make ui.expandpath better with default path. 2006-06-23 18:23:32 -07:00
Vadim Gelfer
67d092ce02 push, outgoing, bundle: fall back to "default" if "default-push" not defined 2006-06-23 18:09:44 -07:00
Vadim Gelfer
9a0c813fdc use demandload more. 2006-06-20 23:58:21 -07:00
Thomas Arendsen Hein
531e4e3573 Further cleanup of ui.py (changeset 158595c3f09e used one-char variable names). 2006-06-05 12:24:00 +02:00
Vadim Gelfer
c2592d7d3d merge with crew. 2006-06-01 15:55:09 -07:00
Markus F.X.J. Oberhumer
a0e21775b5 Cleanup: unifiy the coding style in the ui.py configitems forwarders.
No functional changes.
2006-06-01 15:54:31 -07:00
Markus F.X.J. Oberhumer
54c6cdc1d8 Expand '~' in path to extensions. 2006-06-01 15:53:43 -07:00
Vadim Gelfer
88b27ca967 add ui.has_config method. 2006-05-23 14:57:45 -07:00
Vadim Gelfer
b8bc35963b add ui.print_exc(), make all traceback printing central. 2006-05-22 08:47:53 -07:00
Vadim Gelfer
bbb33944e9 add --config global option. allows to set hgrc option on command line.
syntax: --config section.name=value

also add new test-globalopts to test all global options in one place.
2006-05-15 11:16:32 -07:00
Vadim Gelfer
de0a3b422b allow to send email using sendmail.
default is still smtp.
update hgrc doc with sendmail info.
2006-05-15 10:25:17 -07:00
Vadim Gelfer
222b04bf94 do not set smtp host by default - raise error instead 2006-05-15 08:47:42 -07:00
Vadim Gelfer
2b273c6862 prompt user for http authentication info
in interactive mode, mercurial now asks the user for the username and
password when the server requires it. the previous behavior was to fail
with an http 401.

based on patch from eric jaffe <jaffe.eric@gmail.com>.
2006-05-14 17:37:17 -07:00
Stephen Darnell
df126198c9 Use text rather than binary mode for editing commit messages 2006-05-04 15:42:14 -07:00
Vadim Gelfer
f906ed16e7 move mail sending code into core, so extensions can share it.
document hgrc settings used.
2006-05-04 12:23:01 -07:00
Vadim Gelfer
b5e4f14fb3 do not check sys.argv from localrepo when running hooks.
instead add traceback field to ui class.
2006-04-30 16:30:39 -07:00
mason@suse.com
ed26ff0cae Implement revlogng.
revlogng results in smaller indexes, can address larger data files, and
supports flags and version numbers.

By default the original revlog format is used.  To use the new format,
use the following .hgrc field:

[revlog]
# format choices are 0 (classic revlog format) and 1 revlogng
format=1
2006-04-04 16:38:43 -04:00
Thomas Arendsen Hein
ee03ece428 Group changes done by the same developer on the same with --style=changelog
Changeset and tags are appended to the change message for non-quiet and
non-verbose output, so grouping works.

Fixes last bit of issue110.
2006-04-01 21:37:08 +02:00
Eung-Ju Park
e46cb8a4f8 Fix error on Windows if "hg log | more" exits. 2006-03-28 09:24:29 -08:00
mcmillen@cs.cmu.edu
dc6517d798 Implementation of per-user .hgignore.
Reference: http://www.selenic.com/mercurial/bts/issue166

If the [ui] section of .hgrc contains keys like "ignore" or
"ignore.something", the values corresponding to these keys are
treated as per-user hgignore files. These hgignore files apply to all
repositories used by that user.
2006-03-24 20:18:02 +01:00
Benoit Boissinot
a918bc84a6 ignore EPIPE in ui.err_write
It avoids not being able to abort a transaction when a push via ssh fails.
Maybe some other place should ignore EPIPE too.
2006-03-23 23:16:41 +01:00
Thomas Arendsen Hein
b54f0a71cb Adapted behaviour of ui.username() to documentation and mention it explicitly:
Searched in this order: $HGUSER, [ui] section of hgrcs, $EMAIL
and stop searching if one of these is set.
Abort if found username is an empty string to force specifying
the commit user elsewhere, e.g. with line option or repo hgrc.
If not found, use $LOGNAME or $USERNAME +"@full.hostname".
2006-03-21 15:33:29 +01:00
Thomas Arendsen Hein
590bf663b7 Improved ui.edit():
- Use descriptive name for temporary file: hg-editor-*.txt
- Don't import tempfile in the method, but use demandload()
- Remove tempfile file even if editor aborts.
2006-03-21 12:54:32 +01:00
Thomas Arendsen Hein
eb82c531cb Pass correct username as $HGUSER to hgeditor if "commit -u" is used.
And only use the new util.system parameter to set the environment.
2006-03-21 12:45:27 +01:00
Vadim Gelfer
9504f432e5 add HGRCPATH env var, list of places to look for hgrc files.
if set, override default hgrc search path.
if empty, only .hg/hgrc of current repo read.

for each element, if directory, all entries in directory with end in
".rc" are added to path.  else, element is added to path.

big thing about this change is that user "~/.hgrc" and system hgrc not
longer breaks tests.  run-tests makes HGRCPATH empty now.
2006-03-14 21:40:46 -08:00
Vadim Gelfer
ad2e396d0d merge with crew. 2006-03-13 08:25:33 -08:00
Vadim Gelfer
03ca08b56f merge with crew. 2006-03-12 16:21:59 -08:00
Thomas Arendsen Hein
df5b337b83 Don't expand empty [paths] so later interpolation can do the right thing.
Example:
[paths]
default =
default-push = %(default)s
2006-03-12 20:34:09 +01:00
Thomas Arendsen Hein
cb1befe216 Read paths specified in .hg/hgrc relative to repo root, otherwise to home dir. 2006-03-12 20:13:58 +01:00
Thomas Arendsen Hein
c61039ce71 Directory names take precedence over symbolic names consistently.
Previously this was only done for clone.
2006-03-12 18:05:13 +01:00
Vadim Gelfer
97a9d5c4ee merge util.esystem and util.system. 2006-03-10 22:42:59 -08:00
Thomas Arendsen Hein
1a56073d58 Catch hgrc interpolation errors nicely. 2006-03-10 11:34:02 +01:00
Thomas Arendsen Hein
009dc70ef5 Inherit config from real parentui and don't use ConfigParser internals.
Added comments for the meaning of parentui.
2006-03-10 11:06:45 +01:00
Vadim Gelfer
78c4823c69 inherit hgrc so "%" interpolation works. 2006-03-08 14:53:57 -08:00
Thomas Arendsen Hein
85c11080a4 Merge with crew 2006-03-06 17:53:11 +01:00
Thomas Arendsen Hein
ed3a95a497 Create local ui object per repository, so .hg/hgrc don't get mixed.
This is needed for hooks, but may be important for other settings, too.
Fixes issue113, also integrated push-hook-lock.sh as a test case for this.
2006-03-06 17:47:41 +01:00
Vadim Gelfer
6fe3d3306f make ui flush output. this makes error happen if printing to /dev/full.
before this change, error happened with some pythons, but not others.
now always happens.
fixes issue 155.
2006-03-06 08:35:15 -08:00
Vadim Gelfer
75d0535141 move shortuser into util module. 2006-02-27 11:32:10 -08:00
mason@suse.com
7bc44b52d9 Add new bdiff based unidiff generation. 2006-01-24 15:02:10 +13:00
Vadim Gelfer
ff1f653af7 eliminate backtrace when piping output on windows.
this fixes issue 54.
2006-01-02 15:25:33 -08:00
Benoit Boissinot
5cdaee582b quote the filename when calling HGEDITOR 2005-12-14 20:38:11 -06:00
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