dirstate-cext: properly invalidate mtime and data in `set_untracked`
This was forgotten about in the initial implementation and was revealed while
adding the `dirstate-v2` variant of `test-
issue660.t`. Neither the existing
Python implementation nor the upcoming Rust implementation suffer from this
bug since they respectively have `None` and `Option<T>` to represent the lack
of information.
Differential Revision: https://phab.mercurial-scm.org/D12414
pytype: disable a few errors about Windows specific module attributes
These were flagged by pytype 2022.03.21.
Differential Revision: https://phab.mercurial-scm.org/D12401
rhg: sort unsupported extensions in error message
This caused some flakiness in test output, and is also just better for users.
Differential Revision: https://phab.mercurial-scm.org/D12389
hgignore: ignore .testtimes in more location
See the inline comment.
Differential Revision: https://phab.mercurial-scm.org/D12393
partial-merge: add support for `.args` config (`$local` etc.)
It will be useful to be able to define custom command-line arguments
per partial merge tool just like we have for regular merge tools. In
particular, I expect the same binary to handle multiple languages, so
it will be useful to be able to pass some argument indicating the
language, or perhaps simply an argument defining a regex that's used
for finding lines to merge as a sorted set.
Differential Revision: https://phab.mercurial-scm.org/D12383
filemerge: add support for partial conflict resolution by external tool
A common class of merge conflicts is in imports/#includes/etc. It's
relatively easy to write a tool that can resolve these conflicts,
perhaps by naively just unioning the statements and leaving any
cleanup to other tools to do later [1]. Such specialized tools cannot
generally resolve all conflicts in a file, of course. Let's therefore
call them "partial merge tools". Note that the internal simplemerge
algorithm is such a partial merge tool - one that only resolves
trivial "conflicts" where one side is unchanged or both sides change
in the same way.
One can also imagine having smarter language-aware partial tools that
merge the AST. It may be useful for such tools to interactively let
the user resolve any conflicts it can't resolve itself. However,
having the option of implementing it as a partial merge tool means
that the developer doesn't *need* to create a UI for it. Instead, the
user can resolve any remaining conflicts with their regular merge tool
(e.g. `:merge3` or `meld).
We don't currently have a way to let the user define such partial
merge tools. That's what this patch addresses. It lets the user
configure partial merge tools to run. Each tool can be configured to
run only on files matching certain patterns (e.g. "*.py"). The tool
takes three inputs (local, base, other) and resolves conflicts by
updating these in place. For example, let's say the inputs are these:
base:
```
import sys
def main():
print('Hello')
```
local:
```
import os
import sys
def main():
print('Hi')
```
other:
```
import re
import sys
def main():
print('Howdy')
```
A partial merge tool could now resolve the conflicting imports by
replacing the import statements in *all* files by the following
snippet, while leaving the remainder of the files unchanged.
```
import os
import re
import sys
```
As a result, simplemerge and any regular merge tool that runs after
the partial merge tool(s) will consider the imports to be
non-conflicting and will only present the conflict in `main()` to the
user.
Differential Revision: https://phab.mercurial-scm.org/D12356