`lp undoedits <code>`
Laarryy opened this issue ยท 5 comments
Description
Proposed command would take the bytebin data and apply the opposite of whatever changes were made (additions become removals and removals become additions).
Proposed behaviour
Will allow the effective undoing of misdone applyedits commands, and will make screwing up with the editor less final.
After further investigation this is a bit more complex then I thought, so no PR from me. However, @Fefo6644 suggested in the discord to potentially merge this with #2501.
Not quite as easy as just doing the reverse -- with group deletions for example, the deleted data isn't actually in the payload.
Nice idea, but don't think an implementation in this way is viable.
Group deletions was precisely the example that was put when discussing the "applying the opposite changes" reversion; that's where something like an export to bytebin before applying the changes would come in handy.
Another possible problem would be the fact that importing data doesn't fully revert on a snapshot-like the entire state of the system. Yes, --replace
and --merge
exist but that is in case of conflicting nodes, all the other ones would simply get added. So maybe yes, for editor changes it probably isn't the best solution since added nodes from the editor would stay (unless it was a mixture of import + reversion but it gets a bit complicated), but it is one solution.
This also questions the same solution idea for #2501, as nodes can be changed (effectively, adding ones and removing others in exchange).