Skip to content

Commit 641fefb

Browse files
committed
Add -r/--recursive option to update
1 parent 41e271a commit 641fefb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mbed/mbed.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,12 +1943,13 @@ def publish(all_refs=None, msg=None, top=True):
19431943
dict(name=['-I', '--ignore'], action='store_true', help='Ignore errors related to unpublished libraries, unpublished or uncommitted changes, and attempt to update from associated remote repository URLs.'),
19441944
dict(name='--depth', nargs='?', help='Number of revisions to fetch from the remote repository. Default: all revisions.'),
19451945
dict(name='--protocol', nargs='?', help='Transport protocol for the source control management. Supported: https, http, ssh, git. Default: inferred from URL.'),
1946+
dict(name=['-r', '--recursive'], action='store_true', help='Update all dependencies to the latest revision of their current branch.'),
19461947
help='Update to branch, tag, revision or latest',
19471948
description=(
19481949
"Updates the current program or library and its dependencies to specified\nbranch, tag or revision.\n"
19491950
"Alternatively fetches from associated remote repository URL and updates to the\n"
19501951
"latest revision in the current branch."))
1951-
def update(rev=None, clean=False, clean_files=False, clean_deps=False, ignore=False, top=True, depth=None, protocol=None):
1952+
def update(rev=None, clean=False, clean_files=False, clean_deps=False, ignore=False, top=True, depth=None, protocol=None, recursive=False):
19521953
if top and clean:
19531954
sync()
19541955

@@ -2037,7 +2038,7 @@ def update(rev=None, clean=False, clean_files=False, clean_deps=False, ignore=Fa
20372038
repo.ignore(relpath(repo.path, lib.path))
20382039
else:
20392040
with cd(lib.path):
2040-
update(lib.rev, clean=clean, clean_files=clean_files, clean_deps=clean_deps, ignore=ignore, top=False)
2041+
update(None if recursive else lib.rev, clean=clean, clean_files=clean_files, clean_deps=clean_deps, ignore=ignore, top=False)
20412042

20422043
if top:
20432044
program = Program(repo.path)

0 commit comments

Comments
 (0)