Skip to content
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

Implement an order-aware MapDiffer #4

Closed
JeroenDeDauw opened this issue Mar 1, 2014 · 1 comment
Closed

Implement an order-aware MapDiffer #4

JeroenDeDauw opened this issue Mar 1, 2014 · 1 comment

Comments

@JeroenDeDauw
Copy link
Collaborator

Posted by Daniel Kinzler on 2013-12-10 14:55:12 UTC at https://bugzilla.wikimedia.org/show_bug.cgi?id=58274

One problem with implementing this is that following the naive approach (representing a change in order as a remove and an insert operation), both such operations would have the same key in the (Map)Diff, so one would override the other. Also, for the insert operation, it would need some context specifying where to insert it.

An alternative approach is to represent the order explicitly as a list of keys, and attach that list as an extra field to the MapDiff.

Note that the class tree based in the Diff class contains some overburdened and some deprecated classes. Some refactoring may be in order.

Also, care must be taken to allow for reliably application of Diffs as patches.

@JeroenDeDauw
Copy link
Collaborator Author

The original motivation for this was tracked at https://phabricator.wikimedia.org/T60274. Not clear this should be done in Diff at all, and not clear how this could be done nicely either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant