Skip to content

Commit 3273edb

Browse files
author
Oren Cohen
committed
Allow comments in commit SHA list
1 parent e15068d commit 3273edb

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tools/importer/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Note: Only files present in folder will be copied, directories inside the folder
1616
`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.
1717
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.
1818

19+
```json
1920
{
2021
"files" : [
2122
{
@@ -41,9 +42,10 @@ Note: You must resolve any conflicts that arise during this cherry-pick process.
4142
],
4243
"commit_sha" : [
4344
"428acae1b2ac15c3ad523e8d40755a9301220822",
44-
"d9d622afe0ca8c7ab9d24c17f9fe59b54dcc61c9",
45+
{"sha": "d9d622afe0ca8c7ab9d24c17f9fe59b54dcc61c9", "msg": "Fix ..."}
4546
]
4647
}
48+
```
4749

4850
### Input to importer.py
4951
1. Repository: -r <repo_path> ( Example: CMSIS / Mbed-tls)

tools/importer/importer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ def get_last_cherry_pick_sha(branch):
157157
return sha
158158

159159

160+
def normalize_commit_sha(sha_lst):
161+
return [_sha['sha'] if isinstance(_sha, dict) else _sha for _sha in sha_lst]
162+
163+
160164
if __name__ == "__main__":
161165

162166
parser = argparse.ArgumentParser(description=__doc__,
@@ -269,7 +273,7 @@ def get_last_cherry_pick_sha(branch):
269273

270274
# Checkout the feature branch
271275
branch_checkout(branch)
272-
commit_sha = json_data["commit_sha"]
276+
commit_sha = normalize_commit_sha(json_data["commit_sha"])
273277
last_sha = get_last_cherry_pick_sha(branch)
274278

275279
# Few commits are already applied, check the next in sequence

0 commit comments

Comments
 (0)