Allow comments in commit SHA list

pull/10505/head
Oren Cohen 2019-04-28 20:05:41 +03:00
parent e15068d728
commit 3273edba8d
2 changed files with 8 additions and 2 deletions

View File

@ -16,6 +16,7 @@ Note: Only files present in folder will be copied, directories inside the folder
`commit_sha` is list of commits present in mbed-os repo. These commits will be applied after copying files and folders listed above.Each commit in the commit_sha list is cherry-picked and applied with the -x option, which records the SHA of the source commit in the commit message.
Note: You must resolve any conflicts that arise during this cherry-pick process. Make sure that the "(cherry picked from commit ...)" statement is present in the commit message. Re-execute the python script to apply rest of the SHA commits.
```json
{
"files" : [
{
@ -41,9 +42,10 @@ Note: You must resolve any conflicts that arise during this cherry-pick process.
],
"commit_sha" : [
"428acae1b2ac15c3ad523e8d40755a9301220822",
"d9d622afe0ca8c7ab9d24c17f9fe59b54dcc61c9",
{"sha": "d9d622afe0ca8c7ab9d24c17f9fe59b54dcc61c9", "msg": "Fix ..."}
]
}
```
### Input to importer.py
1. Repository: -r <repo_path> ( Example: CMSIS / Mbed-tls)

View File

@ -157,6 +157,10 @@ def get_last_cherry_pick_sha(branch):
return sha
def normalize_commit_sha(sha_lst):
return [_sha['sha'] if isinstance(_sha, dict) else _sha for _sha in sha_lst]
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__,
@ -269,7 +273,7 @@ if __name__ == "__main__":
# Checkout the feature branch
branch_checkout(branch)
commit_sha = json_data["commit_sha"]
commit_sha = normalize_commit_sha(json_data["commit_sha"])
last_sha = get_last_cherry_pick_sha(branch)
# Few commits are already applied, check the next in sequence