Commit Graph

135 Commits

Author SHA1 Message Date
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