merge-driver: support removes and changes

This commit is contained in:
dberenbaum
2022-09-23 23:22:08 +03:00
committed by Ruslan Kuprieiev
parent 10cfa0d5d7
commit c039e9a6e7
5 changed files with 34 additions and 17 deletions
+19 -6
View File
@@ -39,6 +39,22 @@ def _gen(tmp_dir, struct, name):
(None, {"foo": "foo"}, {"bar": "bar"}, {"foo": "foo", "bar": "bar"}),
(None, None, {"bar": "bar"}, {"bar": "bar"}),
(None, {"foo": "foo"}, None, {"foo": "foo"}),
(
{"foo": "foo"},
{"foo": "bar"},
{"foo": "foo", "baz": "baz"},
{"foo": "bar", "baz": "baz"},
),
({"foo": "foo"}, {}, {"foo": "foo", "bar": "bar"}, {"bar": "bar"}),
(
{"common": "common", "subdir": {"foo": "foo", "bar": "bar"}},
{"common": "common", "subdir": {"foo": "foo", "bar": "baz"}},
{"common": "common", "subdir": {"bar": "bar", "bizz": "bizz"}},
{
"common": "common",
"subdir": {"bar": "baz", "bizz": "bizz"},
},
),
],
)
def test_merge(tmp_dir, dvc, ancestor, our, their, merged):
@@ -74,18 +90,15 @@ def test_merge(tmp_dir, dvc, ancestor, our, their, merged):
{"foo": "foo"},
{"foo": "bar"},
{"foo": "baz"},
(
"unable to auto-merge directories with "
"diff that contains 'change'ed files"
),
("unable to auto-merge the following paths:\nfoo"),
),
(
{"common": "common", "foo": "foo"},
{"common": "common", "bar": "bar"},
{"baz": "baz"},
(
"unable to auto-merge directories with "
"diff that contains 'remove'ed files"
"unable to auto-merge the following paths:\n"
"both deleted: ('foo',)"
),
),
],