-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better names for conflicting files #1820
Comments
@touilleMan @vxgmichel Thanks to the new test, I think, I find one new bug. local_a = EntryID.new()
remote_a = EntryID.new()
common_child = EntryID.new()
a1 = {"a": local_a}
a2 = {"a": remote_a}
# The remote manifest and the local manifest have one same child named "a (conflicting with a@a)"
# and one conflict on the child name "a"
base = {"a (conflicting with a@a)": common_child}
a3 = {**base, **a1}
b3 = {**base, **a2}
result = merge_folder_children(base, a3, b3, "a@a")
# I didn't know what was the logic to build the filename in this case
# so I used the same logic as the `get_conflict_filename` to my assert condition
assert result == {
"a": remote_a,
"a (conflicting with a@a)": common_child,
"a (conflicting with a@a - 2)": local_a
} This assert is always False, but two differents results happen randomly. First case: assert result == {
"a": remote_a,
"a (conflicting with a@a)": local_a
} In this case the common_child is removed and the local_a use its name. Second case: assert result == {
"a": remote_a,
"a (conflicting with a@a)": local_a,
"a (conflicting with a@a) (conflicting with a@a)": common_child
} In this case the logic detect the conflict on local_a, and rename it then it detect one conflict on common_child and rename it too. The reason of the two differents results is in the # All ids that might remain
ids = set(local_reversed) | set(remote_reversed) If the common_child variable is before the local_a variable in the ids list then we are in the first case else we are in the second case. |
Done in #1857 |
Quoting touilleMan:
There's also the problem of localization: the names should take into account the language configured in the global configuration.
My choice would go to either 1 or 3:
The text was updated successfully, but these errors were encountered: