Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 23:11:33 -0800] rev 43928
rebase: inline single-use `dryrun` and `confirm` variables
Differential Revision: https://phab.mercurial-scm.org/D7642
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 14:50:42 -0800] rev 43927
rebase: use cmdutil.check_incompatible_arguments() for action+confirm/dryrun
Differential Revision: https://phab.mercurial-scm.org/D7661
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 14:49:48 -0800] rev 43926
rebase: use cmdutil.check_at_most_one_arg() for --confirm/--dry-run
I've also updated the helper to work with the hyphenated --dry-run
option.
Differential Revision: https://phab.mercurial-scm.org/D7641
Matt Harbison <matt_harbison@yahoo.com> [Tue, 17 Dec 2019 21:25:54 -0500] rev 43925
windows: factor the hgrc directory scan into a function
Differential Revision: https://phab.mercurial-scm.org/D7691
Matt Harbison <matt_harbison@yahoo.com> [Tue, 17 Dec 2019 21:21:36 -0500] rev 43924
windows: don't return early from building the hgrc search path
This will minimize the changes needed to add other sources.
Differential Revision: https://phab.mercurial-scm.org/D7690
Matt Harbison <matt_harbison@yahoo.com> [Tue, 17 Dec 2019 21:15:59 -0500] rev 43923
windows: clarify a comment about the hgrc search path
The exe relative hgrc.d and the registry paths are not mutually exclusive.
Differential Revision: https://phab.mercurial-scm.org/D7689
Matt Harbison <matt_harbison@yahoo.com> [Tue, 17 Dec 2019 21:12:17 -0500] rev 43922
windows: drop detection of Windows 95/98/ME
Support was removed in python 2.6.
Differential Revision: https://phab.mercurial-scm.org/D7688
Augie Fackler <augie@google.com> [Tue, 17 Dec 2019 14:04:02 -0500] rev 43921
examples: add an example configuration for go source files
Tested by timeless.
Differential Revision: https://phab.mercurial-scm.org/D7683
Matt Harbison <matt_harbison@yahoo.com> [Sun, 15 Dec 2019 21:34:00 -0500] rev 43920
util: move common proxyobserver attributes to the base class
Fixes the following pytype warnings:
line 791, in _writedata: No attribute 'logdata' on baseproxyobserver [attribute-error]
line 792, in _writedata: No attribute 'logdataapis' on baseproxyobserver [attribute-error]
line 793, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 794, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 799, in _writedata: No attribute 'logdataapis' on baseproxyobserver [attribute-error]
line 800, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 802, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 803, in _writedata: No attribute 'name' on baseproxyobserver [attribute-error]
line 805, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 809, in _writedata: No attribute 'logdataapis' on baseproxyobserver [attribute-error]
line 810, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 814, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 815, in _writedata: No attribute 'name' on baseproxyobserver [attribute-error]
line 817, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
Differential Revision: https://phab.mercurial-scm.org/D7675
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 22:23:42 -0800] rev 43919
config: drop debug messages saying where config was read from
`hg config --debug` includes lines like this:
set config by: $EDITOR
but also lines like this:
$EDITOR: ui.editor=emacs -nw
The `set config by` messages don't seem to provide much additional
information over what we get from the `$EDITOR:`-type message. I could
imagine wanting to see which values got overriden by a later entry,
but that information is already not present. So let's just remove the
first type of output. My next patch would otherwise amplify the
redundant output (there would be one `set config by` for each line in
`mergetools.rc`).
Differential Revision: https://phab.mercurial-scm.org/D7627
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 11:22:37 -0800] rev 43918
rcutil: don't check if defaultrc/ is a directory -- we know it is
`mercurial/defaultrc/` is a directory both in the Mercurial repo and
once installed on a target platform. The directory was created in
c4ce077588d0 (config: introduce "built-in" default configuration
settings in default.d, 2014-09-04). That commit has some more
information, but it still doesn't seem to say that `defaultrc/` (then
called `default.d/`) could be a file. Perhaps the check was there to
allow you to run the same code on an older install/repo?
Differential Revision: https://phab.mercurial-scm.org/D7624
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 17:30:57 +0100] rev 43917
rust-matchers: add support for `exactmatcher` in `dirstate.status`
`exactmatcher` is the name in the Python implementation and corresponds to
`FileMatcher` in Rust.
Differential Revision: https://phab.mercurial-scm.org/D7531
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 17:30:10 +0100] rev 43916
rust-dirstate-status: update bridge for new rust version of `dirstate.status`
Differential Revision: https://phab.mercurial-scm.org/D7530
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 17:29:06 +0100] rev 43915
rust-dirstate-status: add `walk_explicit` implementation, use `Matcher` trait
This is the first time we actually use the `Matcher` trait, still for a small
subset of all matchers defined in Python.
While I haven't yet actually measured the performance of this, I have tried
to avoid any unnecessary allocations. This forces the use of heavy lifetimes
annotations which I am not sure we can simplify, although I would be happy
to be proven wrong.
Differential Revision: https://phab.mercurial-scm.org/D7529
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 18:54:06 +0100] rev 43914
rust-matchers: add `FileMatcher` implementation
Mercurial defines an `exactmatcher`, I find `FileMatcher` to be clearer, but
am not opposed to using the old name.
This change also switched the order of `assert_eq` arguments as it is clearer
that way for most people.
Differential Revision: https://phab.mercurial-scm.org/D7528
Matt Harbison <matt_harbison@yahoo.com> [Thu, 12 Dec 2019 12:30:15 -0500] rev 43913
exchange: ensure all outgoing subrepo references are present before pushing
We've run into occasional problems with people committing a repo, and then
amending or rebasing in the subrepo. That makes it so that the revision in the
parent can't be checked out, and the problem gets propagated on push. Mercurial
already tries to defend against this sort of dangling reference by pushing *all*
subrepo revisions first. This reuses the checks that trigger warnings in
`hg verify` to bail on the push unless using `--force`.
I thought about putting this on the server side, but at that point, all of the
data has been transferred, only to bail out. Additionally, SCM Manager hosts
subrepos in a location that isn't nested in the parent, so normal subrepo code
would complain that the subrepo is missing when run on the server.
Because the push command pushes subrepos before calling this exchange code, a
subrepo will be pushed before the parent is verified. Not great, but no
dangling references are exchanged, so it solves the problem. This code isn't in
the loop that pushes the subrepos because:
1) the list of outgoing revisions is needed to limit the scope of the check
2) the loop only accesses the current revision, and therefore can miss
subrepos that were dropped in previous commits
3) this code is called when pushing a subrepo, so the protection is recursive
I'm not sure if there's a cheap check for the list of files in the outgoing
bundle. If there is, that would provide a fast path to bypass this check for
people not using subrepos (or if no subrepo changes were made). There's
probably also room for verifying other references like tags. But since that
doesn't break checkouts, it's much less of a problem.
Differential Revision: https://phab.mercurial-scm.org/D7616
Augie Fackler <augie@google.com> [Thu, 05 Dec 2019 16:19:16 -0500] rev 43912
procutil: try and avoid angering CoreFoundation on macOS
We've seen failures like this:
objc[57662]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[57662]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
I think this is due to forking off some background processes during
`hg update` or similar. I don't have any conclusive proof this is the
fork() call that's to blame, but it's the most likely one since the
regular `hg update` codepath uses the other fork() invocation (via
workers) and we don't get this report from non-Google macOS users.
Ugh.
Differential Revision: https://phab.mercurial-scm.org/D7615
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