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

EdkRepo: Update the Sync Command to Support Local Directory Renames and URL Changes #5

Merged
merged 2 commits into from
Jun 4, 2021

Conversation

ashedesimone
Copy link
Contributor

No description provided.

Reset print formatting in SYNC_REMOVE_LIST_END_FORMATTING
by changing it to Style.RESET_ALL

Signed-off-by: Ashley E Desimone <[email protected]>
@@ -57,7 +57,12 @@
FETCHING = 'Fetching latest code for {0} from {1} branch ...'
NO_SYNC_DETACHED_HEAD = 'No need to sync repo {0} since it is in detached HEAD state'
SYNC_MANIFEST_UPDATE = 'To update to the latest manifest please run edkrepo sync --update-local-manifest. {}'.format(Fore.RESET)
SYNC_REMOVE_LIST_END_FORMATTING = '{}'.format(Fore.RESET)
SYNC_REMOVE_LIST_END_FORMATTING = '{}'.format(Style.RESET_ALL)
SYNC_MOVE_FAILED = '''{}{}WARNING:{}{} Moving {{}} to {{}} failed.
Copy link
Member

Choose a reason for hiding this comment

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

We should make this a little more readable. Adding labels like {{old_dir}} and {{new_dir}} should make this much more readable.

try:
shutil.move(old_dir, new_dir)
except:
print(SYNC_MOVE_FAILED.format(source.root, new_dir, new_dir, new_dir, source.root))
Copy link
Member

Choose a reason for hiding this comment

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

With the comment below, this would need to change to:

print(SYNC_MOVE_FAILED.format(old_dir=source.root, new_dir=new_dir))

@ashedesimone ashedesimone deleted the sync_pr branch June 4, 2021 00:13
@ashedesimone ashedesimone restored the sync_pr branch June 4, 2021 00:17
@ashedesimone ashedesimone reopened this Jun 4, 2021
…d/or URL changes

Updated comments to better describe the process of updating the
local manifest file.

Removed the exception that was raised when a URL change was
detected.

Updated the calculation of sources_to_move, sources_to_remove
and sources_to_clone so that the inital repository is moved
to an archival location and the updated respository is cloned.

Signed-off-by: Ashley E Desimone <[email protected]>
@ashedesimone ashedesimone merged commit 19fd597 into tianocore:main Jun 4, 2021
@ashedesimone ashedesimone deleted the sync_pr branch June 4, 2021 01:46
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

Successfully merging this pull request may close these issues.

2 participants