Skip to content

Commit

Permalink
Merge pull request #379 from screamerbg/development
Browse files Browse the repository at this point in the history
Improve documentation (0.9.10)
  • Loading branch information
screamerbg authored Oct 20, 2016
2 parents 01266cd + 441e827 commit fbbc9dd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ mbed CLI is supported on Windows, Linux and Mac OS X. We're keen to learn about

### Requirements

* **Python** - mbed CLI is a Python script, so you'll need Python in order to use it. mbed CLI was tested with version 2.7.9 of Python. You can download that or a newer version [here](https://www.python.org/downloads/).
* **Python** - mbed CLI is a Python script, so you'll need Python in order to use it. mbed CLI was tested with [version 2.7.11 of Python](https://www.python.org/downloads/release/python-2711/) and is not compatible with Python 3.

* **Git and Mercurial** - mbed CLI supports both Git and Mercurial repositories, so you'll need to install both:
* [Git](https://git-scm.com/).
* [Mercurial](https://www.mercurial-scm.org/).
* [Git](https://git-scm.com/) - version 1.9.5 or later
* [Mercurial](https://www.mercurial-scm.org/) - version 2.2.2 or later

<span class="tips">**Note:** The directories of Git and Mercurial executables (`git` and `hg`) need to be in your system's PATH.</span>

Expand Down Expand Up @@ -659,6 +659,24 @@ my-mbed-os-example (a5ac4bf2e468)

Let's assume that you make changes to `iot-client`. `publish` detects the change on the leaf `iot-client` dependency and asks you to commit it. Then it detects that `my-libs` depends on `iot-client`, updates the `my-libs` dependency on `iot-client` to its latest version (by updating the `iot-client.lib` file) and asks you to commit it. This propagates up to `my-libs` and finally to your program `my-mbed-os-example`.

## Publishing a local program or library

When you create a new (local) source-control managed program or library, its revision history exists only locally; the repository is not associated with the remote one. To publish the local repository without losing its revision history, please follow these steps:

1. Create a new empty repository on the remote site. This can be based on a public repository hosting service (GitHub, Bitbucket, mbed.org), your own service or even a different location on your system.
2. Copy the URL/location of the new repository in your clipboard and open command line in the local repository directory (for example change directory to `mbed-os-example/local-lib`).
3. To associate the local repository:
* For Git - run `git remote add origin <url-or-paht-to-your-remote-repo>`.
* For Mercurial - edit .hg/hgrc and add (or replace if exists):

```
[paths]
default = <url-or-paht-to-your-remote-repo>
```
4. Run `mbed publish` to publish your changes.

In scanario with nested local repositories, start with the leaf repositories first.

### Forking workflow

Git enables asymmetric workflow where the publish/push repository might be different than the original ("origin") one. This allows new revisions to land in a fork repository, while maintaining an association with the original repository.
Expand Down
2 changes: 1 addition & 1 deletion mbed/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,7 @@ def publish(all_refs=None, msg=None, top=True):
if repo.is_local:
error(
"%s \"%s\" in \"%s\" is a local repository.\nPlease associate it with a remote repository URL before attempting to publish.\n"
"Read more about %s repositories here:\nhttp://developer.mbed.org/handbook/how-to-publish-with-%s/" % ("Program" if top else "Library", repo.name, repo.path, repo.scm.name, repo.scm.name), 1)
"Read more about publishing local repositories here:\nhttps://github.com/ARMmbed/mbed-cli/#publishing-local-program-or-library" % ("Program" if top else "Library", repo.name, repo.path, repo.scm.name), 1)

for lib in repo.libs:
if lib.check_repo():
Expand Down

0 comments on commit fbbc9dd

Please sign in to comment.