I was confused by the other design, because I intuitively expected West
metadata to go in .west/. To me the other design feels a little bit like
having an empty /home/foo/user/ directory that marks the /home/foo/
directory as containing the user's files.
Use west/ instead of .west/ to avoid "hiding" the implementation of the
building/flashing commands. I would've preferred to split them from the
repo-like functionality instead, but if they're going to be in the same
repository, then it's a decent comprise.
Remove the code that hides the west directory on Windows (via 'attrib')
as well, since it doesn't make much sense anymore.
This commit also fixes a small bug in west_topdir(): A west/ in the root
directory wasn't found.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Analogous to running 'git branch', except for all projects. Also lists
the project(s) each branch appears in.
Example output:
$ python3 -m west branch
FIX-FOO zephyr, Kconfiglib
manifest-rev zephyr, net-tools, Kconfiglib
master zephyr, net-tools
zephyr Kconfiglib
I'm planning to change 'git clone' into 'git init' + 'git remote add' +
'git fetch' later, which avoids creating the last two local branches.
Maybe manifest-rev should be hidden as well.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Passes its command as-is to the shell, within the repositories of each
of the specified projects (or all cloned projects by default).
I was thinking of making the shell quoting for long commands optional,
by joining all the words with a space or the like, but it might get
tricky with argparse. Could look into it more later.
Piggyback some cleanup: Make the absolute path of a project available in
project.abspath, to avoid having to do a bunch of join()s with
util.west_topdir().
Fix some copy-paste comment mess-ups in the tests too.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Add simple Google repo-like functionality, for dealing with multiple Git
repositories.
The command set is mirrored after Git. All commands except
'list-projects' accept an optional list of projects, and default to all
(cloned) projects.
- west list-projects
Lists projects and their repositories
- west fetch
Clone/fetch projects. Supports 'clone-depth', for making shallow
clones.
- west rebase
Rebase local branches to the revision specified in the manifest
- west pull
'west fetch' + 'west rebase' (similar to 'sync' in Google repo)
- west branch
Create a new branch in one or more repositories (for working on some
issue)
- west checkout
Check out a branch in each repository that has it. Supports a -b
flag for creating the branch first.
- west diff
Run 'git diff' in each repository
- west status
Run 'git status' in reach repository
There's no way to submit a multi-repository change for review yet.
Currently, a convenience branch 'manifest-rev' is created in each
project, which points to the revision specified for the project in the
manifest. 'manifest-rev' is updated by 'west fetch' and 'west pull'.
Local branches created with 'west branch' are set to track
'manifest-rev'. This makes e.g. a plain 'git status' or 'git pull' work
sensibly even when the manifest revision is an SHA.
We'll see if 'manifest-rev' is too magic later. It's explained in the
help texts of all the relevant commands at least.
It might be nicer to create 'manifest-rev' in e.g. refs/remotes instead
of refs/heads. Git doesn't seem to like trying to create a branch that
tracks a branch in refs/remotes unless it's a "proper" upstream branch
though.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Add an exhaustive test suite.
Check expected results for all combinations of runner constructor
parameters, both when instantiating the runner directly via its
constructor and when using command line arguments via its create()
method. Ensure consistent results.
Signed-off-by: Marti Bolivar <marti@foundries.io>
Add test coverage for flash, debug, and debugserver commands, using
runners created directly with their constructors, as well as via
command line arguments, with methods that would run syscalls mocked
out.
Signed-off-by: Marti Bolivar <marti@foundries.io>
Follow along with what the cool kids are doing and add py.test
integration.
This patch doesn't add any test cases, but sets up packages to
test the runner classes as additional work.
To run the test suite, use:
$ python3 setup.py test
Since there are no tests, these pass.
Signed-off-by: Marti Bolivar <marti@foundries.io>