tests/test-revlog-raw.py.out
author Martin von Zweigbergk <martinvonz@google.com>
Tue, 18 Jan 2022 13:05:21 -0800
changeset 49060 f3aafd785e65
parent 41090 797a416a91bd
permissions -rw-r--r--
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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31757
f424fb180fea revlog: use raw content when building delta
Jun Wu <quark@fb.com>
parents: 31756
diff changeset
     1
local test passed
31758
5d11b5edcb0b revlog: use raw revisions in revdiff
Jun Wu <quark@fb.com>
parents: 31757
diff changeset
     2
addgroupcopy test passed
31759
5b93c6fdb391 revlog: use raw revisions in clone
Jun Wu <quark@fb.com>
parents: 31758
diff changeset
     3
clone test passed
31760
ec48d57de110 revlog: make _addrevision only accept rawtext
Jun Wu <quark@fb.com>
parents: 31759
diff changeset
     4
lowlevelcopy test passed
41037
cca12a31ede5 revlog: add some direct testing of the slicing logic
Boris Feld <boris.feld@octobus.net>
parents: 31760
diff changeset
     5
slicing test passed
41038
15f78383d3c8 revlog: add an explicit test for `issnapshot`
Boris Feld <boris.feld@octobus.net>
parents: 41037
diff changeset
     6
issnapshot test passed
41090
797a416a91bd revlog: add test case for _findsnapshots
Boris Feld <boris.feld@octobus.net>
parents: 41038
diff changeset
     7
findsnapshot test passed