Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 11 Dec 2019 17:35:29 +0100] rev 43911
nodetree: simplify a conditionnal in shortesthexnodeidprefix
instead of try to catch some attribute error, we could just nicely look if the
attribute will be available. This make the code simpler to follow and less error
prone since we no longer rely on a wider attribute catching.
Differential Revision: https://phab.mercurial-scm.org/D7651
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 15:06:09 -0800] rev 43910
config: close file even if we fail to read it
If we get an exception from cfg.read(), we would not close the file
before this patch. This patch uses a context manager to make sure we
close it.
Differential Revision: https://phab.mercurial-scm.org/D7626
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 15:33:07 -0800] rev 43909
config: catch intended exception when failing to parse config
When a new config parser was introduced in
fca54469480e (ui: introduce
new config parser, 2009-04-23), the reading side would raise a
ConfigError which was then caught in the ui code. Then, in
2123aad24d56 (error: add new ParseError for various parsing errors,
2010-06-04), a ParseError was raised instead, but the call site was
not updated. Let's start catching that ParseError. We still don't
print it in a friendly way, but that's not worse than before.
Differential Revision: https://phab.mercurial-scm.org/D7625
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 09:39:14 -0800] rev 43908
rust-hg-path: implement more readable custom Debug for HgPath{,Buf}
The default prints the vector of bytes as a list of integers. I
considered instead getting rid of the Debug trait, but we use the
Debug format in lots of derived Debug instances, so we probably do
want to implement it.
Differential Revision: https://phab.mercurial-scm.org/D7604
Martin von Zweigbergk <martinvonz@google.com> [Mon, 16 Dec 2019 15:58:47 -0800] rev 43907
util: implement sortdict.insert()
As flagged by pytype (reported via Matt Harbison, thanks). This was
broken by
bd0fd3ff9916 (util: rewrite sortdict using Python 2.7's
OrderedDict, 2017-05-16). We actually call insert() on
namespaces.py:100, but we clearly don't have test coverage of that an
no users have reported it AFAIK.
Differential Revision: https://phab.mercurial-scm.org/D7680
Matt Harbison <matt_harbison@yahoo.com> [Mon, 16 Dec 2019 23:27:17 -0500] rev 43906
patch: make __repr__() return str
Caught by pytype:
line 969, in __repr__: Function bytes.join was called with the wrong arguments [wrong-arg-types]
Expected: (self, iterable: Iterable[bytes])
Actually passed: (self, iterable: Iterator[str])
Differential Revision: https://phab.mercurial-scm.org/D7682
Matt Harbison <matt_harbison@yahoo.com> [Sun, 15 Dec 2019 23:46:10 -0500] rev 43905
pytype: suppress warnings about no 'open_binary' on importlib.resources
Fixes these pytype warnings:
line 43, in <module>: No attribute 'open_binary' on module 'importlib.resources' [module-attr]
line 47, in open_resource: No attribute 'open_binary' on module 'importlib.resources' [module-attr]
For some reason, I can't upgrade from 3.6.8 in my WSL environment.
Differential Revision: https://phab.mercurial-scm.org/D7681
Augie Fackler <augie@google.com> [Mon, 16 Dec 2019 17:10:51 -0500] rev 43904
windows: if username(uid=None) is loaded, just use getpass
This is at least consistent with what we do on other platforms in the
base case. I don't know enough about Windows to fill in other cases
that might exist here, but this at least should be a start.
Differential Revision: https://phab.mercurial-scm.org/D7679
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 14:12:14 -0800] rev 43903
transplant: use check_incompatible_arguments()
Differential Revision: https://phab.mercurial-scm.org/D7663
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 14:31:51 -0800] rev 43902
bookmarks: use check_incompatible_arguments() for inactive+action
Differential Revision: https://phab.mercurial-scm.org/D7662
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 23:32:47 -0800] rev 43901
bookmarks: use cmdutil.check_incompatible_arguments() for action+rev
Differential Revision: https://phab.mercurial-scm.org/D7648
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 23:31:17 -0800] rev 43900
bookmarks: use cmdutil.check_at_most_one_arg() for action
Differential Revision: https://phab.mercurial-scm.org/D7647
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 15:55:33 -0800] rev 43899
rebase: use cmdutil.check_at_most_one_arg() for action
Here we also needed to know what the action was (if any), so I've
updated the helper to return any specified option.
Differential Revision: https://phab.mercurial-scm.org/D7640
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 22:30:59 -0800] rev 43898
releasenotes: extract helper for checking for incompatible arguments
This patch extracts a new check_incompatible_arguments() function
similar to check_at_most_one_arg(). The difference is that the new
function is for checking for arguments that are disallowed together
with some other argument but not mutually exclusive among themselves.
Differential Revision: https://phab.mercurial-scm.org/D7639