Skip to content

Commit bd4b248

Browse files
mbolivar-nordiccarlescufi
authored andcommitted
doc: west: add v0.6.1 documentation
West v0.6.1 has been released. The main feature is that "west update" now avoids communicating with the network by default when project revisions have already been fetched. This allows for offline operation and significantly speeds up the command (it's 10 times faster on my machine and home network). There are other miscellaneous changes as well; document them also. Signed-off-by: Marti Bolivar <[email protected]>
1 parent 1620d29 commit bd4b248

File tree

4 files changed

+112
-13
lines changed

4 files changed

+112
-13
lines changed

doc/guides/west/config.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ commands are documented in the pages for those commands.
139139
- String, relative path from the :term:`west installation` root directory
140140
to the manifest repository used by ``west update`` and other commands
141141
which parse the manifest. Set locally by ``west init``.
142+
* - ``update.fetch``
143+
- String, one of ``"smart"`` (the default behavior starting in v0.6.1) or
144+
``"always"`` (the previous behavior). If set to ``"smart"``, the
145+
:ref:`west update <west-multi-repo-cmds>` command will skip fetching
146+
from project remotes when those projects' revisions in the manifest file
147+
are SHAs or tags which are already available locally. The ``"always"``
148+
behavior is to unconditionally fetch from the remote.
142149
* - ``zephyr.base``
143150
- String, default value to set for the :envvar:`ZEPHYR_BASE` environment
144151
variable while the west command is running. By default, this is set to

doc/guides/west/release-notes.rst

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,48 @@
11
West Release Notes
22
##################
33

4-
v0.6.x
4+
v0.6.1
5+
******
6+
7+
The user-visible features in this point release are:
8+
9+
- The `west update <west-multi-repo-cmds>` command has a new ``--fetch``
10+
command line flag and ``update.fetch`` :ref:`configuration option
11+
<west-config>`. The default value, "smart", skips fetching SHAs and tags
12+
which are available locally.
13+
- Better and more consistent error-handling in the ``west diff``, ``west
14+
status``, ``west forall``, and ``west update`` commands. Each of these
15+
commands can operate on multiple projects; if a subprocess related to one
16+
project fails, these commands now continue to operate on the rest of the
17+
projects. All of them also now report a nonzero error code from the west
18+
process if any of these subprocesses fails (this was previously not true of
19+
``west forall`` in particular).
20+
- The :ref:`west manifest <west-multi-repo-misc>` command also handles errors
21+
better.
22+
- The :ref:`west list <west-multi-repo-misc>` command now works even when the
23+
projects are not cloned, as long as its format string only requires
24+
information which can be read from the manifest file. It still fails if the
25+
format string requires data stored in the project repository, e.g. if it
26+
includes the ``{sha}`` format string key.
27+
- Commands and options which operate on git revisions now accept abbreviated
28+
SHAs. For example, ``west init --mr SHA_PREFIX`` now works. Previously, the
29+
``--mr`` argument needed to be the entire 40 character SHA if it wasn't a
30+
branch or a tag.
31+
32+
The developer-visible changes to the :ref:`west-apis` are:
33+
34+
- west.log.banner(): new
35+
- west.log.small_banner(): new
36+
- west.manifest.Manifest.get_projects(): new
37+
- west.manifest.Project.is_cloned(): new
38+
- west.commands.WestCommand instances can now access the parsed
39+
Manifest object via a new self.manifest property during the
40+
do_run() call. If read, it returns the Manifest object or
41+
aborts the command if it could not be parsed.
42+
- west.manifest.Project.git() now has a capture_stderr kwarg
43+
44+
45+
v0.6.0
546
******
647

748
- No separate bootstrapper

doc/guides/west/repo-tool.rst

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ This distribution also includes a launcher executable, also named ``west``. When
155155
west is installed, the launcher is placed by :file:`pip3` somewhere in the
156156
user's ``PATH``. This is the command-line entry point.
157157

158+
.. _west-manifest-rev:
159+
158160
The ``manifest-rev`` branch
159161
***************************
160162

@@ -223,13 +225,27 @@ important to understand.
223225
(``-m`` defaults to https://github.com/zephyrproject-rtos/zephyr, and
224226
the ``-mr`` default is overridden to ``v1.15.0``).
225227

226-
- ``west update [--rebase] [--keep-descendants] [--exclude-west] [PROJECT
227-
...]``: clone and update the specified projects based
228+
- ``west update [--fetch {always,smart}] [--rebase] [--keep-descendants]
229+
[PROJECT ...]``: clone and update the specified projects based
228230
on the current :term:`west manifest`.
229231

230-
This command parses the manifest, clones any project repositories that are
231-
not already present locally, and checks out the project revisions specified
232-
in the manifest file, updating ``manifest-rev`` branches along the way.
232+
By default, this command:
233+
234+
#. Parses the manifest file, :file:`west.yml`
235+
#. Clones any project repositories that are not already present locally
236+
#. Fetches any project revisions in the manifest file which are not already
237+
pulled from the remote
238+
#. Sets each project's :ref:`manifest-rev <west-manifest-rev>` branch to the
239+
current manifest revision
240+
#. Checks out those revisions in local working trees
241+
242+
To operate on a subset of projects only, specify them using the ``PROJECT``
243+
positional arguments, which can be either project names as given in the
244+
manifest file, or paths to the local project clones.
245+
246+
To force this command to fetch from project remotes even if the revisions
247+
appear to be available locally, either use ``--fetch always`` or set the
248+
``update.fetch`` :ref:`configuration option <west-config>` to ``"always"``.
233249

234250
For safety, ``west update`` uses ``git checkout --detach`` to check out a
235251
detached ``HEAD`` at the manifest revision for each updated project, leaving

doc/guides/west/west-apis.rst

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ provided.
4141
4242
.. automethod:: __init__
4343

44-
.. versionadded:: 0.6
44+
.. versionadded:: 0.6.0
4545
The *requires_installation* parameter.
4646

4747
Methods:
4848

4949
.. automethod:: run
5050

51-
.. versionchanged:: 0.6
51+
.. versionchanged:: 0.6.0
5252
The *topdir* argument was added.
5353

5454
.. automethod:: add_parser
@@ -86,6 +86,16 @@ provided.
8686
8787
The argument parser created by calling ``WestCommand.add_parser()``.
8888

89+
Instance properties:
90+
91+
.. py:attribute:: manifest
92+
93+
A read-only property which returns the :py:class:`west.manifest.Manifest`
94+
instance for the current manifest file or aborts the program if one was
95+
not provided. This is only safe to use from the ``do_run()`` method.
96+
97+
.. versionadded:: 0.6.1
98+
8999
.. autoclass:: west.commands.CommandError
90100
:show-inheritance:
91101

@@ -119,7 +129,7 @@ west.configuration
119129

120130
.. autofunction:: west.configuration.read_config
121131

122-
.. versionchanged:: 0.6
132+
.. versionchanged:: 0.6.0
123133
Errors due to an inability to find a local configuration file are ignored.
124134

125135
.. autofunction:: west.configuration.update_config
@@ -136,7 +146,7 @@ west.log
136146
********
137147

138148
.. automodule:: west.log
139-
:members: set_verbosity, VERBOSE_NONE, VERBOSE_NORMAL, VERBOSE_VERY, VERBOSE_EXTREME, dbg, inf, wrn, err, die
149+
:members: set_verbosity, VERBOSE_NONE, VERBOSE_NORMAL, VERBOSE_VERY, VERBOSE_EXTREME, dbg, inf, wrn, err, die, banner, small_banner
140150

141151
.. _west-apis-manifest:
142152

@@ -163,6 +173,10 @@ west.manifest
163173

164174
.. automethod:: get_remote
165175

176+
.. automethod:: get_projects
177+
178+
.. versionadded:: 0.6.1
179+
166180
.. automethod:: as_frozen_dict
167181

168182
.. autoclass:: west.manifest.Defaults
@@ -174,14 +188,35 @@ west.manifest
174188
:member-order: groupwise
175189

176190
.. autoclass:: west.manifest.Project
177-
:members:
178-
:member-order: groupwise
191+
192+
.. automethod:: __init__
193+
194+
.. automethod:: as_dict
195+
196+
.. automethod:: format
197+
198+
.. automethod:: git
199+
200+
.. versionchanged:: 0.6.1
201+
The ``capture_stderr`` kwarg.
202+
203+
.. automethod:: sha
204+
205+
.. automethod:: is_ancestor_of
206+
207+
.. automethod:: is_cloned
208+
209+
.. versionadded:: 0.6.1
210+
211+
.. automethod:: is_up_to_date_with
212+
213+
.. automethod:: is_up_to_date
179214

180215
.. autoclass:: west.manifest.ManifestProject
181216
:members:
182217
:member-order: groupwise
183218

184-
.. versionadded:: 0.6
219+
.. versionadded:: 0.6.0
185220

186221
.. autoclass:: west.manifest.MalformedManifest
187222
:show-inheritance:

0 commit comments

Comments
 (0)