Commit Graph

116 Commits

Author SHA1 Message Date
Dan Villiom Podlaski Christiansen
eb569c8b47 color: use ui.formatted(). 2010-06-07 15:28:54 +02:00
FUJIWARA Katsunori
ce06b102df help: show value requirement and multiple occurrence of options
this helps users to know what kind of option is:

  - no value is required(flag option)
  - value is required
  - value is required, and multiple occurrences are allowed

each kinds are shown as below:

 -f --force              force push
 -e --ssh CMD            specify ssh command to use
 -b --branch BRANCH [+]  a specific branch you would like to push

if one or more 3rd type options are shown, explanation for '[+]' mark
is also shown as footnote.
2010-06-06 17:25:00 +09:00
Steve Borho
b82bd4f289 Backed out changeset: 1bfde817782c 2010-06-08 15:52:41 -05:00
Steve Borho
e91613380a color: labeled text should be passed to ui.write() as ui.labeled
Some implementations of ui.label() (HTML versions in particular) must escape
the provided text and then markup the text with their tags.  When this marked
up text is then passed to ui.write(), we must label the text as 'ui.labeled'
so the implementation knows not to escape it a second time (exposing the initial
markup).

This required the addition of a 'ui.plain' label for text that is purposefully
not marked up.

I was a little pedantic here, passing even ' ' strings to ui.label() when it
would be included with other labeled text in a ui.write() call.   But it seemed
appropriate to lean to the side of caution.
2010-06-03 23:18:18 -05:00
Yuya Nishihara
be0949be33 color: bring back colors with pager
It's introduced by f77a63ba3f8f, but missing in merge changeset
at fe99ec3fe2d0.
2010-05-18 18:55:14 +09:00
Stanimir Stamenkov
268f6af2e2 color: add some missing background colors for win32 console 2010-05-07 15:19:37 -05:00
Steve Borho
146627c709 color: fix typo in w32effect for bold_background 2010-05-01 16:57:02 -05:00
Patrick Mezard
ed31d6901d color: handle non-standard stdout on win32 2010-04-23 14:29:44 +02:00
Steve Borho
bde27d9380 color: respect HGPLAIN 2010-04-06 08:54:18 -05:00
Steve Borho
898c5adf56 color: add support for Windows consoles
Introduces color.mode configurable with values 'auto', 'ansi', or 'win32'.  Any
other value disables coloring.  When 'auto' is selected, the win32 console
method will be used if the win32console Python module is detected (requires
pywin32 to be installed).
2010-04-06 08:49:19 -05:00
Steve Borho
b2f2de10b6 color: remove unused import 2010-04-06 08:44:13 -05:00
Brodie Rao
2f064ecab9 color: concatenate effects correctly and avoid printing empty effects 2010-04-04 22:53:50 -05:00
Brodie Rao
1ad67ea95f color: don't split colors across lines (which confuses less -R)
Currently, less -R doesn't support colors spanning multiple lines; only
the first line will be colorized.

Instead of allowing colors to span multiple lines, the color extension
now applies colors to each line it receives, even when ui.write() is
given multiple lines in one call.
2010-04-02 15:22:19 -05:00
Brodie Rao
e46074c7b3 color: colorize based on output labels instead of parsing output
By overriding ui.write(), ui.write_err(), ui.popbuffer(), and ui.label(),
the color extension can avoid parsing command output and simply colorize
output based on labels.

As before, the color extension provides a list of default colors for
core commands/labels. Other extensions can provide their own defaults by
specifying a colortable dict (similar to cmdtable).

In this process, --color is promoted to a global option and the deprecated
--no-color option is removed.
2010-04-02 15:22:17 -05:00
Martin Geisler
eeedee37da Merge with default 2010-02-15 00:14:16 +01:00
Brodie Rao
459206adee color: don't crash on invalid status codes (issue2036)
If an unknown file with a newline appears in the status output, color
shouldn't raise a KeyError trying to parse second line in the filename.
2010-02-14 17:08:52 -05:00
Brodie Rao
892ba5a830 remove unused imports 2010-02-14 01:52:31 -05:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Georg Brandl
c212597377 color: colorize output of hg resolve -l 2010-01-09 10:47:47 +01:00
Benoit Boissinot
3153270fb3 color: improve coding style 2010-01-08 20:56:28 +01:00
David Soria Parra
f9a3794d26 color: Add support for bookmarks 2009-12-11 11:04:31 +01:00
David Soria Parra
ac2717c956 color: Do not pass --color, --no-color parameters to wrapped function
Passing the --color and --no-color parameter to the wrapped function
can cause a invalid argument exception if the wrapped function doesn't
accepts a **opts dict.
2009-12-11 11:04:31 +01:00
Alexander Solovyov
54cea46a20 color: add support for churn --diffstat 2009-11-30 23:10:21 +02:00
Martin Geisler
769cf16d06 color: wrap qrecord
The qrecord command is registered in uisetup phase, so we do our
wrapping in extsetup phase.
2009-11-05 01:11:28 +01:00
Brodie Rao
2306a92219 color: colorize diff --stat 2009-10-25 02:52:36 +02:00
Kevin Bullock
a530135c8c color: allow multiple args to ui.write() 2009-10-07 14:01:20 -05:00
TK Soh
3b5f06859c color: add support for record extension 2009-10-08 09:27:22 +08:00
Matt Mackall
13b406f027 Merge with -stable 2009-10-03 14:39:57 -05:00
Brodie Rao
b2c79b09c7 color: mark --no-color as deprecated (--color=never has the same effect)
This should've been marked deprecated when --color was first introduced, but
it was something I overlooked.
2009-09-23 15:58:07 +02:00
Martin Geisler
f54126693a color: do all setup in uisetup
Now that extensions are loaded in phases, we are guaranteed to always
find mq in uisetup with extensions.find and we know that the mq
commands are not yet copied into commands.table.
2009-08-29 00:30:03 +02:00
Kevin Bullock
fda783faa0 color: allow multiple args to ui.write() 2009-09-29 23:49:42 -05:00
Patrick Mezard
cb35e02c8f color: no need for itertools, zip() is good enough 2009-08-21 14:29:54 +02:00
Dan Villiom Podlaski Christiansen
bb3b8f666c color: simplify & improve colorization of qseries
Use 'repo.mq.series' to obtain patch names, instead of deriving them
from the qseries output. This is both simpler and more robust, and
fixes colorization of patches without a message with -s/--summary.
2009-08-05 15:00:44 +02:00
Martin Geisler
05765f5c37 color: wrap docstrings at 70 characters 2009-07-26 01:42:15 +02:00
Martin Geisler
c5502ce5fe color: use reST syntax for literal block 2009-07-23 00:22:35 +02:00
Martin Geisler
25f523698d color: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Dan Villiom Podlaski Christiansen
aeb7f3fa9c color: don't highlight the summary part of the qseries command 2009-06-27 13:09:11 +02:00
Brodie Rao
3ca9735590 color: wrap qdiff/qseries after all extensions are loaded 2009-05-06 16:27:50 -04:00
Greg Ward
e4e711f7e0 color: don't blow up if configured with unknown color (just warn). 2009-06-25 09:23:33 -04:00
Cédric Duval
dbcec5595d extensions: improve the consistency of synopses
Trying as much as possible to consistently:
 - use a present tense predicate followed by a direct object
 - verb referring directly to the functionality provided
   (ie. not "add command that does this" but simple "do that")
 - keep simple and to the point, leaving details for the long help
   (width is tight, possibly even more so for translations)

Thanks to timeless, Martin Geisler, Rafael Villar Burke, Dan Villiom
Podlaski Christiansen and others for the helpful suggestions.
2009-06-22 15:48:08 +02:00
Cédric Duval
0caffe860f help: remove per-extension paragraph on how to enable it
The central place to find this information is the "extensions" help topic.
2009-06-20 20:57:13 +02:00
Martin Geisler
5d25b57f99 color: yet another typo 2009-06-01 00:56:29 +02:00
Martin Geisler
c624e91552 fixed typos found in translatable strings
This is from a spell-check of hg.pot.
2009-05-31 14:55:51 +02:00
Martin Geisler
39cc7c7ced color: cleanup extra commas 2009-05-26 22:09:39 +02:00
Martin Geisler
4176f5b789 replace xrange(0, n) with xrange(n) 2009-05-25 23:06:11 +02:00
Martin Geisler
09b1280157 color: replace re.split with ui.configlist 2009-05-25 22:54:16 +02:00
Martin Geisler
cb4aca83ce color: use lists instead of tuples for effects 2009-05-25 22:44:53 +02:00
Martin Geisler
7b8faf1ad9 color: look for mq with extensions.find 2009-05-02 21:09:37 +02:00
Martin Geisler
196a7c04c9 color: word-wrap help texts at 70 characters 2009-04-04 23:16:32 +02:00
Martin Geisler
04b0d911a3 Change double spaces to single spaces in help texts. 2009-04-04 21:09:43 +02:00
Gilles Moris
5483cf6270 color: fix colorization of the 'old mode' git diff metadata 2008-12-19 22:32:08 +01:00
Brodie Rao
f47cc3cffa color: replace effect-specific reset control codes with general purpose one 2008-12-01 10:45:22 -05:00
Georg Brandl
ff1607f996 diff colorization: finish highlighting trailing whitespace 2008-11-26 22:58:07 +01:00
Brodie Rao
299e22d23f color: diff colorization
This colorizes diff, qdiff, log -p, outgoing -p, incoming -p, and tip -p.
2008-12-02 16:46:45 +01:00
Brodie Rao
a86ee910f0 color: add --color switch
--color works like GNU grep --color. --color=auto only colorizes output
for non-dumb terminals that are TTYs.
2008-11-26 08:58:31 -05:00
Brendan Cully
6f67d9ec16 color: don't run status twice for -n
Just cut off the status characters.
2008-11-25 18:32:44 -08:00
Brendan Cully
a712d45c18 color: fix status -n 2008-11-25 18:21:00 -08:00
Matt Mackall
e564d351f3 extensions: use new wrapper functions 2008-10-22 17:34:52 -05:00
Matt Mackall
bebeb261d5 findcmd: have dispatch look up strict flag 2008-10-22 17:34:08 -05:00
Kevin Christen
c645a04c2d Add a reset before and after colorized output
This is how GNU's ls --color works, and it clears up problems in xterm and
Windows command prompt windows.
2008-07-15 18:10:37 -05:00
Kevin Christen
86047a7399 Apply color to output of qseries --verbose
Fixes issue 1173.
2008-07-23 20:33:23 -05:00
Patrick Mezard
1bb123d6bf color: improve mq extension detection 2008-08-02 13:49:13 +02:00
Joel Rosdahl
4f8012378a Remove unused imports 2008-03-06 22:23:41 +01:00
Thomas Arendsen Hein
47ae80ebb9 Fix status char in color extension for deleted (missing) files. 2008-01-04 14:25:04 +01:00
Kevin Christen
61f976c787 color extension: change from GPL3 to 2 2008-01-03 20:27:32 -06:00
Kevin Christen
b4e5110cee Add colored output to status and qseries commands 2007-12-31 09:15:39 -06:00