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

In-place patch/revert #92

Merged
merged 2 commits into from Oct 10, 2017
Merged

In-place patch/revert #92

merged 2 commits into from Oct 10, 2017

Conversation

mikaelho
Copy link
Contributor

Adding an in-place patch/revert capability, i.e. option for performing these operations without copying the target structure.

This would be a useful performance optimization in some large-volume use cases. I also have a functional need of patching in place while recording all changes made to the structure.

Implemented as an additional, optional parameter to patch and revert.

@jirikuncar
Copy link
Member

@mikaelho can you also extend the documentation so developers know how to use this feature?


:param diff_result: Changes returned by ``diff``.
:param destination: Structure to apply the changes to.
:param in_place: By default, destination dictionary is deep copied before applying the patch, and the copy is returned. Setting ``in_place=True`` means that patch will apply the changes directly to and return the destination structure.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please break the lines so they are not longer then 79 chars. Thanks

Copy link
Member

@jirikuncar jirikuncar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikaelho it looks good now. I will come back to your PR after #93 is merged.

@jirikuncar jirikuncar self-assigned this Mar 31, 2017
* NEW Adds new option for patching and reverting patches in-place.
@jirikuncar jirikuncar merged commit c9b5a8e into inveniosoftware:master Oct 10, 2017
@jirikuncar jirikuncar mentioned this pull request Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants