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

Patch only 'changes' ignore add/remove #163

Open
disgusdad opened this issue Jul 24, 2021 · 1 comment
Open

Patch only 'changes' ignore add/remove #163

disgusdad opened this issue Jul 24, 2021 · 1 comment

Comments

@disgusdad
Copy link

Need to apply values from previous dictionaries to new dictionaries that contain keys not in previous.
So as to run patch but only apply the 'change' values and nothing else so current/new dictionary will still contain unique keys.

@ZeitgeberH
Copy link

Hi @disgusdad ,
I have similar need, but for "add" only: the "change" values are usually made by user in his/her configuration file of the application, so I do not want to overwrite it when updating the application. But I may add some additional keys/values to the file.

I add a line in the dictdiffer.patch function with one additional parameter actions_flags to select desired actions. In my case, I set actions_flags='a'. Any other combinations ('c' in your case) is supported.
See my PR

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

No branches or pull requests

2 participants