Skip to content

Commit 441e827

Browse files
committed
Improve documentation (0.9.10)
Add documentation for publishing local/new repositories #362 Add documentation regarding the specific Python, Git and Mercurial versions that mbed CLI supports #376
1 parent 01266cd commit 441e827

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ mbed CLI is supported on Windows, Linux and Mac OS X. We're keen to learn about
5454

5555
### Requirements
5656

57-
* **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/).
57+
* **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.
5858

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

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

@@ -659,6 +659,24 @@ my-mbed-os-example (a5ac4bf2e468)
659659

660660
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`.
661661

662+
## Publishing a local program or library
663+
664+
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:
665+
666+
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.
667+
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`).
668+
3. To associate the local repository:
669+
* For Git - run `git remote add origin <url-or-paht-to-your-remote-repo>`.
670+
* For Mercurial - edit .hg/hgrc and add (or replace if exists):
671+
672+
```
673+
[paths]
674+
default = <url-or-paht-to-your-remote-repo>
675+
```
676+
4. Run `mbed publish` to publish your changes.
677+
678+
In scanario with nested local repositories, start with the leaf repositories first.
679+
662680
### Forking workflow
663681

664682
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.

mbed/mbed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,7 @@ def publish(all_refs=None, msg=None, top=True):
17761776
if repo.is_local:
17771777
error(
17781778
"%s \"%s\" in \"%s\" is a local repository.\nPlease associate it with a remote repository URL before attempting to publish.\n"
1779-
"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)
1779+
"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)
17801780

17811781
for lib in repo.libs:
17821782
if lib.check_repo():

0 commit comments

Comments
 (0)