All the examples cloned from Mercurial should use the new
os.mbed.com domain. Thus update corrects that.
A new option has been added to the update.py script , -s which shows
the status of any PRs raised against the examples that are tagged with
the current release label.
Previously the script used
cmd =['git','checkout', branch]
syntax. This does not work well cross platform. The solution it to
actually use strings. E.g.
cmd = "git checkout " + branch
Currently when checking if the destination branch already exists the
command 'git branch' is used. This only returns local branches. What is
actually required is the list of remote branches. This can be obtained
by the command 'git branch -r' and filtering the result.
Previously if updating a branch in the ARMmbed version of an example
repo, the branch would be created initially from master. This update
allows the new branch to be created by any pre-existing branch.
This update also moves the branch / fork / tag configuration data to the
json config file. It thus simplifies the command line.
-b on its own now indicates use the branch information in the config
-f on its own now indicates use the fork information in the config
The function headers have been updated to follow the standard format
that should be being used for tools in mbed. This is a one line summary
followed by a descriptive block with more detail.
Updated the handling of the main function so that the logger becomes
global and thus works across all the functions. This has been tested
with both the fork and branch options, and for levels INFO and DEBUG.
Added the ability to specify a branch to update rather than a fork
Replaced print commands with the use of a logger
Updated the run_cmd functions in line with previous improvements
example specified in the supplied .json file, in a user specified fork.
A pull request is then made from each fork to the ARMmbed master repo.
New usage:
python update.py <args>
Where <args> are:
[-c <file.json>] optional argument for example list, default
example.json
-U <github user with forked repos>
-T <github authorisation token>
tag
If an example's GitHub repository contains multiple child examples, the
script was incorrectly filtering out all the child examples when
compiling and exporting. This patch now handles this case correctly.
This adds an example clone and deploy step that allows you to modify
each top level repository before pulling in the rest of the example's
dependencies. This allows us to not pull in a copy of mbed-os for each
example in CI and instead symbolic link the already cloned copy, saving
valuable time and disk space