Commit Graph

273 Commits

Author SHA1 Message Date
Matt Mackall
e2ffc933dc ui: simplify parent overlay logic 2009-04-23 15:40:10 -05:00
Matt Mackall
87a779b162 ui: always have ucdata
simplify readconfig logic
2009-04-23 15:40:10 -05:00
Matt Mackall
97699b4b90 ui: fold verbosity_constraints into fixconfig, simplify 2009-04-23 15:40:10 -05:00
Matt Mackall
0174734c46 ui: kill updateopts
Move setconfig into dispatch._parseconfig
2009-04-23 15:40:10 -05:00
Matt Mackall
ebffe5ccb8 ui: refactor option setting
No more passing options as constructor keywords. Basic options are now
always stored in the overlay for simplicity and consistency.
2009-04-23 15:40:10 -05:00
Matt Mackall
cc041814d1 ui: kill redundant call to verbosity_constraints 2009-04-23 15:40:10 -05:00
Matt Mackall
f21df2587f ui: always have an overlay 2009-04-23 15:40:10 -05:00
Matt Mackall
3243d007af ui: kill check_trusted 2009-04-23 15:40:10 -05:00
Matt Mackall
db4f571c07 ui: move _isatty near user 2009-04-23 15:40:10 -05:00
Steve Borho
6e4ca6d775 catch CTRL-D at password prompt
We caught this exception in ui.prompt(), but not here.  Without
this, hitting CTRL-D at the password prompt gives a long traceback.
2009-02-21 17:46:06 -06:00
Martin Geisler
bcc3bda9f7 lowercase prompts
The prompts are interactive and not meant for scripts.
2009-01-03 17:15:21 +01:00
Brendan Cully
8fa18a6932 Merge with crew-stable 2008-12-09 17:02:52 -08:00
Brendan Cully
3cfb5b4e74 issue1419: catch strange readline import error on windows 2008-12-09 17:01:14 -08:00
Benoit Boissinot
d954d76b97 use repr() instead of backticks 2008-12-06 14:27:31 +01:00
Peter Arrenbrecht
63d1bb911f ui: log non-interactive default response to stdout when verbose
This allows test scripts that feed their output into documentation
to properly show the session as it would appear to an end-user.
2008-11-07 10:27:39 +01:00
Benoit Boissinot
0c4a5ee0aa ui: add an option to prompt for the username when it isn't provided
When ui.askusername is set and not username are specified on the command line,
in hgrc or in the variables $HGUSER or $EMAIL, then hg will prompt for the
username.
Feature requested, and documentation provided by Mark Edgington.
2008-08-06 15:10:05 +02:00
Matt Mackall
a65ef7bc5d util: add sort helper 2008-06-27 18:28:45 -05:00
Matt Mackall
06bb84cfa6 ui: disallow newlines in usernames (issue1034) 2008-03-22 13:50:59 -05:00
Dirkjan Ochtman
ade2841b93 ui: copy overlay from both direct and indirect parentui 2008-03-20 22:46:35 +01:00
Matt Mackall
4794cecf39 pager: remove pager code from core 2008-03-20 11:12:35 -05:00
Peter Arrenbrecht
27b0107abf ui: make chuild ui feed output to parentui's active buffer 2008-03-20 11:12:35 -05:00
Alexis S. L. Carvalho
1c6d82d6fb two fixes for the pager stuff
- open pipe in binary mode

- don't start a pager if stdout is not a tty (this prevents test-ssh
  from hanging if you set ui.usepager=True in run-tests.py)
2008-03-19 16:54:35 -03:00
David Soria Parra
fba7246b03 Use the pager given by the environment to display long output
Unix systems usually have a PAGER environment variable set.
If it is set, mercurial will use the pager application to display
output.

Two configuration variables are available to influence the behaviour of the
pager. ui.pager sets the pager application. The pager is
only used if ui.usepager is true. By default ui.usepager is disabled.
2008-03-18 22:12:34 +01:00
Jesse Glick
b63e70848a Ensure that absolutized paths from hgrc do not contain ../ segments. 2008-01-08 22:40:51 -05:00
Kirill Smelkov
cbdc1f53db prompt: kill matchflags
Python already lets one to embed RE flags directly in a regex, which
is a much nicer way to do things:

(?iLmsux)
        (One or more letters from the set "i", "L", "m", "s", "u", "x".)
        ...

matchflags was introduced in 14a7e862c60f, and the record extension is the only
user. I've killed matchflag, and adjusted record code appropriately.
2007-12-28 00:03:55 -06:00
Matt Mackall
faa2e2041c ui: allow default when prompting 2007-12-27 22:49:01 -06:00
Thomas Arendsen Hein
d02cbcaa88 merge with crew-stable 2007-12-27 13:39:59 +01:00
Thomas Arendsen Hein
0a782ae200 Make ui.prompt repeat on "unrecognized response" again (issue897)
(this was accidentally changed in 18945c2eb022)
2007-12-27 10:32:33 +01:00
Osku Salerma
7f9d71b715 Use VISUAL in addition to EDITOR when choosing the editor to use. 2007-12-05 20:40:01 +09:00
Steve Borho
465647eece workaround for raw_input() on Windows
Since change 0f20f68c768c, Mercurial has set_binary() on stdin, stdout, and stderr.
On Windows, this had the side effect of causing raw_input() to emit trailing carriage
returns on it's returned strings.  This was causing web authentication problems.
2007-12-03 17:28:26 -06:00
Dirkjan Ochtman
7b9cb3b6fc Don't try to determine interactivity if ui() called with interactive=False.
WSGI applications are not supposed to refer to sys.stdin. In af5aceab19f4,
hgweb and hgwebdir were fixed to pass interactive=False to their ui()'s, but
sys.stdin.isatty() was still called by the ui objects. This change makes sure
only the ui.fixconfig() method will call ui.isatty() (by making the
ui._readline() method, which is currently only called from ui.prompt(),
private). ui.fixconfig() is changed to let config files override the initial
interactivity setting, but not check isatty() if interactive=False was
specified in the creation of the ui.
2007-09-25 19:05:34 +02:00
Bryan O'Sullivan
46880a1c4f record: improve docs, improve prompts 2007-08-09 17:29:16 -07:00
Thomas Arendsen Hein
e05f361209 os.isatty isn't available on Windows, so use sys.stdin.isatty() 2007-08-01 10:33:21 +02:00
Bryan O'Sullivan
80c88dabf8 ui: get readline and prompt to behave better depending on interactivity 2007-07-31 16:28:05 -07:00
Thomas Arendsen Hein
c6d47ef08c Catch illegal boolean values in hgrc nicely.
With hg 0.9.3 the section and parameter name wasn't printed,
with hg 0.9.4 there was a traceback for ValueError.
2007-06-26 20:37:15 +02:00
Thomas Arendsen Hein
61d51838df New config option: ui.report_untrusted (defaults to True) 2007-06-25 22:41:15 +02:00
Thomas Arendsen Hein
4d29c6dc8e Updated copyright notices and add "and others" to "hg version" 2007-06-19 08:51:34 +02:00
Thomas Arendsen Hein
483231d996 Cleanup of whitespace, indentation and line continuation. 2007-06-19 08:06:37 +02:00
Matt Mackall
b99ae11550 dirstate: pull ignore smarts out of ui 2007-06-18 13:24:34 -05:00
Matt Mackall
cdeb6ec2da extensions: kill ui readhooks
Move .hgrc extension loading into localrepo
2007-06-18 13:24:34 -05:00
Matt Mackall
8395ca26f3 extensions: pull extension-aware bits out of ui 2007-06-18 13:24:34 -05:00
Patrick Mezard
a55efff966 ui: make readsections() abort when configuration cannot be read. 2007-06-03 22:11:25 +02:00
Bryan O'Sullivan
ebb57c99be ui: Rename has_config to has_section. 2007-05-27 13:50:59 -07:00
Matt Mackall
04561e556e revlog: simplify revlog version handling
- pass the default version as an attribute on the opener
- eliminate config option mess
2007-03-22 19:52:38 -05:00
Thomas Arendsen Hein
c019d21898 merge with crew-stable 2007-03-14 22:43:57 +01:00
Thomas Arendsen Hein
678e517eae Only hg repositories override [paths], not simple directories (fixes issue510) 2007-03-14 22:38:40 +01:00
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