Commit Graph

218 Commits

Author SHA1 Message Date
Martin Geisler
93008b71a6 ui: refer to "hg help config" when no username is set 2009-11-07 22:13:09 +01:00
Jesse Glick
7966725b4b Related to Issue919: ui.progress, apparently unused before now, is busted. 2009-11-05 16:40:48 -05:00
Martin Geisler
b10a5e234c ui: only use "user@host" as username in noninteractive mode
We regularly see people on IRC ask how they can correct commits they
accidentally made without having configured a username. This change
will make Mercurial abort when a commit is made without a username.

If Mercurial is run without a TTY (from a cronjob or similar), a
username is constructed as usual. Schematically the changes are as
follows:

With ui.askusername=False:

                  old         new
  interactive     user@host   abort
  noninteractive  user@host   user@host

With ui.askusername=True:

                  old         new
  interactive     prompt      prompt
  noninteractive  user@host   user@host
2009-10-20 00:17:36 +02:00
Alexander Solovyov
32999e4659 make path expanding more consistent
This expands ~user and $FOO constructs in ui.ignore files, [defaults],
[paths], extension paths, and HGRCPATH files.
2009-10-19 22:19:28 +03:00
Andrey Somov
2ccddf5ead improve code readability 2009-09-09 11:12:36 +02:00
Brodie Rao
d6fac35b34 ui: fix NameError in ui.progress due to unit/units typo 2009-08-18 14:47:41 -04:00
Dirkjan Ochtman
f692d68a57 kill trailing whitespace 2009-08-05 17:08:28 +02:00
Matt Mackall
a57f5b2b3b Add ui.progress API 2009-07-16 14:49:52 -05:00
Simon Heimberg
e0e4fc74e3 ui: extract choice from prompt
avoid translating single characters (as l for _local or sym_link)
2009-06-21 01:13:19 +02:00
Mads Kiilerich
4f97bc02c9 ui.prompt: Show prompt and selection in non-interactive mode
ui.prompt was completely silent in non-interactive mode, unless in verbose
mode. It is fine that it chooses the default automatically, but it is confusing
that the message and prompt shown interactively can't be found in scripted
tests.

The prompt and selection is now .write'ed instead of .note'ed.
2009-06-21 03:13:38 +02:00
Martin Geisler
cac71647b1 posix: do not use fstat in isowner
The fstat function was undefined, but never used since a stat object
was always passed in the optional st argument. Passing st is now
mandatory.

This bug crept in when util was split up into posix and windows
modules. The fstat function is still defined in util, but importing it
into posix would create an import cycle which seems unnecessary.
2009-05-30 23:42:35 +02:00
Martin Geisler
58e8fb6277 removed unused imports 2009-05-30 23:20:30 +02:00
Matt Mackall
07ba4cbe2d ui: fix two bugs in %% warning 2009-05-27 14:44:52 -05:00
Patrick Mezard
f8fb6f0d87 ui: honor interactive=off even if isatty() 2009-05-21 20:59:36 +02:00
Martin Geisler
0a365d5ca2 use 'x is None' instead of 'x == None'
The built-in None object is a singleton and it is therefore safe to
compare memory addresses with is. It is also faster, how much depends
on the object being compared. For a simple type like str I get:

            | s = "foo" | s = None
  ----------+-----------+----------
  s == None | 0.25 usec | 0.21 usec
  s is None | 0.17 usec | 0.17 usec
2009-05-20 00:52:46 +02:00
Martin Geisler
698fece124 ui: use set instead of dict 2009-05-17 16:20:27 +02:00
Matt Mackall
5534a9c3e3 editor: move HG: filtering from ui to commiteditor 2009-05-14 13:21:17 -05:00
Alexander Solovyov
038c7df455 hgwebdir: read --webdir-conf as actual configuration to ui (issue1586)
This cleans up code and allows specification of values more globally. For
example, it's now possible to specify web.contact in webdir-conf for all
repositories without a specified contact set.
2009-05-11 14:20:18 +02:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Steve Borho
52bf113f2e ui: replace regexp pattern with sequence of choices
Use ampersands (&) to delineate the response char in each choice.
ui.prompt() responses are now explicitly case insensitive.  GUIs
that subclass ui can generate dialogs from the full choice names.
2009-04-30 10:15:32 -05:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Dirkjan Ochtman
80de6974e4 more whitespace cleanup and some other style nits 2009-04-27 12:37:19 +02:00
Ronny Pfannschmidt
1d760927a4 ui: ui.copy() now takes the ui class into account
Helps subclassing by other API users.
2009-04-27 10:33:57 +02:00
Matt Mackall
c15de6b1b7 ui: make interactive a method 2009-04-26 16:50:44 -05:00
Matt Mackall
de487eacda ui: print_exc() -> traceback() 2009-04-26 16:50:44 -05:00
Matt Mackall
1be9517a0f ui: traceback -> _traceback 2009-04-26 16:50:44 -05:00
Matt Mackall
efc3ded95f ui: report_untrusted fixes
- report_untrusted -> _reportuntrusted
- only report config shadows if enabled
- config shadows are debug messages
2009-04-26 16:50:44 -05:00
Matt Mackall
77cc1dfdeb ui: privatize cdata vars 2009-04-26 16:50:44 -05:00
Matt Mackall
e84a8d1258 ui: buffers -> _buffers 2009-04-26 16:50:44 -05:00
Matt Mackall
30784dabe1 ui: trusted_users -> _trustusers, trusted_groups -> _trustgroups 2009-04-26 16:50:44 -05:00
Matt Mackall
4e3a9053dc ui: assumetrusted -> trust 2009-04-26 16:50:44 -05:00
Matt Mackall
00aa85afa3 ui: _get_cdata -> _data 2009-04-26 16:50:44 -05:00
Matt Mackall
86dab18ddb config: getsource -> source 2009-04-26 16:50:43 -05:00
Matt Mackall
286d20f8b7 ui: simplify fixconfig 2009-04-26 16:50:43 -05:00
Matt Mackall
59ffac0401 ui: fix-up and warn about deprecated %% 2009-04-26 16:50:43 -05:00
Matt Mackall
036f77e767 config: add section filter to read
move section filtering out of ui.readconfig
kill section filtering in config.update
2009-04-26 16:50:43 -05:00
Matt Mackall
be7d59ab85 ui: kill most users of parentui name and arg, replace with .copy() 2009-04-26 16:50:43 -05:00
Matt Mackall
88b13fecec ui: replace parentui mechanism with repo.baseui 2009-04-26 16:50:43 -05:00
Matt Mackall
10af375ad9 ui: less links to parentui 2009-04-26 16:50:43 -05:00
Matt Mackall
b7e5202883 showconfig: show source file and line with --debug 2009-04-26 16:50:43 -05:00
Benjamin Wohlwend
ef87785038 ui.isatty() accesses sys.stdin, causing mod_wsgi to throw IOError. 2009-04-26 13:36:08 -07:00
Matt Mackall
e8b3de6bf8 ui: introduce new config parser 2009-04-23 15:40:10 -05:00
Matt Mackall
b784fcf1a7 ui: simplify init, kill dupconfig 2009-04-23 15:40:10 -05:00
Matt Mackall
371257fd73 ui: fold readsections into readconfig
readconfig now reads only single files
readconfig takes an optional list of sections
readconfig trusts files we're looking for sections in
2009-04-23 15:40:10 -05:00
Matt Mackall
c85f431ef9 ui: cleanup _is_trusted a bit 2009-04-23 15:40:10 -05:00
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