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

Add script to move files to the framework #145

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

davidhorstmann-arm
Copy link
Contributor

Pushing a small script that moves files to the framework repo from Mbed TLS, while retaining history.

This script works but may not be in a fully-polished state.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This is useful for building file-moves on top of other not-yet-merged
file moves.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
When there are no dirs to make we try anyway.

This is bad and causes an error. Fix this.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
To allow branches to be built on other branches, resolve conflicts
'manually' when the 2 branches delete each others' files.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
Allow passing the --except flag, which stops a file from being moved
(and perform the necessary path manipulation acrobatics to make that
work).

Created to be able to move tests/include except for
tests/include/alt-dummy, like so:

--path tests/include:include --except tests/include/alt-dummy

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This was failing if no exceptions were supplied.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This causes the script to not perform the operation, but simply print
the self._file_map dictionary of files to rename (this is useful for
debugging the file-moving logic, especially with combinations of
--path and --except options).

Signed-off-by: David Horstmann <david.horstmann@arm.com>
When files are moved to the exact same location in the framework repo
as they were in Mbed TLS, there is a problem.

Since no git change has taken place on the Mbed TLS side, the most
recent change to the file is its deletion when a previous set of files
were moved to the framework (since all other files are deleted in this
kind of move).

As a result the moved files are deleted and do not appear in the final
branch. Deal with this edge case explicitly by taking files which are
not renamed from the file map and checking them out to the state in
the temporary branch, before amending the resulting commit.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size-m Estimated task size: medium (~1w)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant