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