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

Selectively append changes to exported config files #10118

Merged
merged 1 commit into from
Mar 17, 2019
Merged

Selectively append changes to exported config files #10118

merged 1 commit into from
Mar 17, 2019

Conversation

arskanov
Copy link

@arskanov arskanov commented Mar 15, 2019

Description

For #10117
In case of a non-overwriting change to an exported config file
the previous logic appended a new block of text to the previous file
every time the to-be-written block of text was not exactly matched.

This parses the old config file and the to-be-written changes into
sets, which can then be compared. If all of the incoming lines are
found in the old config file set, no changes are made. If some
incoming lines are not found in the old config file, only these are
appended.

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

Not tested on windows or python 2.
Uses .splitlines(), and newlines should be correctly handled by the file read and write functions.

In case of a non-overwriting change to an exported config file
the previous logic appended a new block of text to the previous file
every time the to-be-written block of text was not exactly matched.

This parses the old config file and the to-be-written changes into
sets, which can then be compared. If all of the incoming lines are
found in the old config file set, no changes are made. If some
incoming lines are not found in the old config file, only these are
appended.
@ciarmcom
Copy link
Member

@arskanov, thank you for your changes.
@ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

@ciarmcom ciarmcom requested review from a team March 15, 2019 12:00
Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

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

Great diff. This should help!

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 16, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Mar 16, 2019

Test run: SUCCESS

Summary: 13 of 13 test jobs passed
Build number : 1
Build artifacts

cmonr pushed a commit to cmonr/mbed-os that referenced this pull request Mar 16, 2019
cmonr pushed a commit to cmonr/mbed-os that referenced this pull request Mar 16, 2019
Selectively append changes to exported config files
@cmonr cmonr merged commit 2b7fee3 into ARMmbed:master Mar 17, 2019
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.

6 participants