Mercurial > hg
diff tests/test-merge-partial-tool.t @ 48982:9dfbea54b680
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 17 Mar 2022 11:19:06 -0700 |
parents | f3aafd785e65 |
children | 7af798e497f5 |
line wrap: on
line diff
--- a/tests/test-merge-partial-tool.t Tue Jan 18 13:05:21 2022 -0800 +++ b/tests/test-merge-partial-tool.t Thu Mar 17 11:19:06 2022 -0700 @@ -207,3 +207,35 @@ c d e3 + +Test that arguments get passed as expected. + + $ cat >> "$TESTTMP/log-args.sh" <<'EOF' + > #!/bin/sh + > echo "$@" > args.log + > EOF + $ chmod +x "$TESTTMP/log-args.sh" + $ cat >> "$HGRCPATH" <<EOF + > [partial-merge-tools] + > log-args.executable=$TESTTMP/log-args.sh + > EOF + $ hg up -C 2 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg merge 1 + merging file + warning: conflicts while merging file! (edit, then use 'hg resolve --mark') + 0 files updated, 0 files merged, 0 files removed, 1 files unresolved + use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon + [1] + $ cat args.log + */hgmerge-*/file~local */hgmerge-*/file~base */hgmerge-*/file~other (glob) + $ hg up -C 2 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg merge 1 --config partial-merge-tools.log-args.args='--other $other $base --foo --local $local --also-other $other' + merging file + warning: conflicts while merging file! (edit, then use 'hg resolve --mark') + 0 files updated, 0 files merged, 0 files removed, 1 files unresolved + use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon + [1] + $ cat args.log + --other */hgmerge-*/file~other */hgmerge-*/file~base --foo --local */hgmerge-*/file~local --also-other */hgmerge-*/file~other (glob)