Matt Harbison <matt_harbison@yahoo.com> [Sat, 25 Mar 2017 21:12:00 -0400] rev 31690
ui: defer setting pager related properties until the pager has spawned
When --pager=on is given, dispatch.py spawns a pager before setting up color.
If the pager failed to launch, ui.pageractive was left set to True, so color
configured itself based on 'color.pagermode'. A typical MSYS setting would be
'color.mode=auto, color.pagermode=ansi'. In the failure case, this would print
a warning, disable the pager, and then print the raw ANSI codes to the terminal.
Care needs to be taken, because it appears that leaving ui.pageractive=True was
the only thing that prevented an attempt at running the pager again from inside
the command. This results in a double warning message, so pager is simply
disabled on failure.
The ui config settings didn't need to be moved to fix this, but it seemed like
the right thing to do for consistency.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 25 Mar 2017 13:50:17 -0400] rev 31689
color: stop mutating the default effects map
A future change will make color.setup() callable a second time when the pager is
spawned, in order to honor the 'color.pagermode' setting. The problem was that
when 'color.mode=auto' was resolved to 'win32' in the first pass, the default
ANSI effects were overwritten, making it impossible to honor 'pagermode=ansi'.
Also, the two separate maps didn't have the same keys. The symmetric difference
is 'dim' and 'italic' (from ANSI), and 'bold_background' (from win32). Thus,
the update left entries that didn't belong for the current mode. This bled
through `hg debugcolor`, where the unsupported ANSI keys were listed in 'win32'
mode.
As an added bonus, this now correctly enables color with MSYS `less` for a
command like this, where pager is forced on:
$ hg log --config color.pagermode=ansi --pager=yes --color=auto
Previously, the output was corrupted. The raw output, as seen through the ANSI
blind `more.com` was:
<-[-1;6mchangeset: 34840:
3580d1197af9<-[-1m
...
which MSYS `less -FRX` rendered as:
1;6mchangeset: 34840:
3580d1197af91m
...
(The two '<-' instances were actually an arrow character that TortoiseHg warned
couldn't be encoded, and notepad++ translated to a single '?'.)
Returning an empty map for 'ui._colormode == None' seems better that defaulting
to '_effects' (since some keys are mode dependent), and is better than None,
which blows up `hg debugcolor --color=never`.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 21:43:47 -0700] rev 31688
pager: do not read from environment variable
$PAGER is converted to the pager.pager config item. So it's no longer
necessary to read $PAGER in ui.pager().
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 21:41:42 -0700] rev 31687
ui: simplify geteditor
Now $EDITOR and $VISUAL will affect ui.editor directly. So it's no longer
necessary to test them in ui.geteditor.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 21:40:22 -0700] rev 31686
debugconfig: list environment variables in debug output
Since we print "read config from" for config files, printing environment
variables will make it more consistent.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 21:33:37 -0700] rev 31685
rcutil: let environ override system configs (BC)
This is BC because system configs won't be able to override $EDITOR, $PAGER.
The new behavior is arguably more rational.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 21:27:02 -0700] rev 31684
rcutil: add a method to convert environment variables to config items
Handling config and environ priorities has been messy. Partially because we
don't have config layers - you either get all configs (sys + user), or none.
Ideally, environ like $EDITOR, $PAGER should be able to override the system
configs "ui.editor", "pager.pager". This patch provides the ability to
convert them into config items, so they can be inserted into the middle
config layer between system rc and user rc.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 21:04:29 -0700] rev 31683
rcutil: let rccomponents return different types of configs (API)
The next patches will convert environ to raw config items, and insert the
config items between systemrcpath and userrcpath. This patch teaches
rccomponents to return the type information so the caller could distinguish
between "path" and raw config "items".
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 20:48:00 -0700] rev 31682
rcutil: rename rcpath to rccomponents (API)
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 20:46:05 -0700] rev 31681
rcutil: extract rc directory listing logic
The logic of listing a ".rc" directory is duplicated in two functions,
extract it to a single function to make the code cleaner.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 20:21:32 -0700] rev 31680
rcutil: split osrcpath to return default.d paths (API)
After this change, there are 3 rcpath functions:
- defaultrcpath
- systemrcpath
- userrcpath
This will allow us to insert another config layer in the middle.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 20:18:42 -0700] rev 31679
rcutil: move scmutil.*rcpath to rcutil (API)
As discussed at [1], the logic around "actual config"s seem to be
non-trivial enough that it's worth a new module.
This patch creates the module and move "scmutil.*rcpath" functions there as
the first step. More methods will be moved to the module in the future.
The module is different from config.py because the latter only cares about
data structure and parsing, and does not care about special case, or system
config paths, or environment variables.
[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-March/095503.html
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Mar 2017 17:25:23 +0900] rev 31678
statfs: make getfstype() raise OSError
It's better for getfstype() function to not suppress an error. Callers can
handle it as necessary. Now "hg debugfsinfo" will report OSError.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Mar 2017 17:24:11 +0900] rev 31677
statfs: rename pygetfstype to getfstype
There's no ambiguity now.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Mar 2017 17:23:21 +0900] rev 31676
statfs: refactor inner function as a mapping from statfs to string
The major difference between BSD and Linux is how to get a fstype string.
Let's split the longest part of getfstype() as a pure function.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Mar 2017 17:13:12 +0900] rev 31675
statfs: simplify handling of return value
Py_BuildValue() can translate NULL pointer to None.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Mar 2017 18:22:27 +0900] rev 31674
hghave: use util.getfstype
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 19:57:17 -0700] rev 31673
runtests: change local IP glob pattern from "127.0.0.1" to "$LOCALIP"
This is similar to what
348b2b9da703 does. Since
636cf3f7620d has changed
"127.0.0.1" to "$LOCALIP". The glob pattern needs update accordingly. It is
expected to fix tests running in some BSD jails.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 27 Mar 2017 16:00:47 +0200] rev 31672
tags: deprecated 'repo.tag'
All user are gone. We can now celebrate the removal of some extra line from the
'localrepo' class.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 27 Mar 2017 18:08:05 +0200] rev 31671
drawdag: use 'tagsmod.tag' instead of 'repo.tag'
The former is about to be deprecated.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 27 Mar 2017 16:00:34 +0200] rev 31670
tags: use the 'tag' function from the 'tags' module in the 'tag' command
There is No need to go through the 'repo' object method anymore.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 27 Mar 2017 15:58:31 +0200] rev 31669
tags: move 'repo.tag' in the 'tags' module
Similar logic, pretty much nobody use this method (that creates a tag) so we
move it into the 'tags' module were it belong.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 27 Mar 2017 15:55:07 +0200] rev 31668
tags: move '_tags' from 'repo' to 'tags' module
As far as I understand, that function do not needs to be on the local repository
class, so we extract it in the 'tags' module were it will be nice and
comfortable. We keep the '_' in the name since its only user will follow in the
next changeset.
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 13 Mar 2017 15:17:20 +0100] rev 31667
hgweb: filter diff hunks when 'linerange' and 'patch' are specified in filelog