Merge branch 'aevri/bst_track_guidance' into 'master'

Fixup refs to 'bst track' and 'bst fetch'

See merge request BuildStream/buildstream!1086
diff --git a/NEWS b/NEWS
index 4576f76..ae1485d 100644
--- a/NEWS
+++ b/NEWS
@@ -20,7 +20,7 @@
     an element's sources and generated build scripts you can do the command
     `bst source-checkout --include-build-scripts --tar foo.bst some-file.tar`
 
-  o BREAKING CHANGE: `bst track` and `bst fetch` commands are now osbolete.
+  o BREAKING CHANGE: `bst track` and `bst fetch` commands are now obsolete.
     Their functionality is provided by `bst source track` and
     `bst source fetch` respectively.
 
diff --git a/buildstream/_gitsourcebase.py b/buildstream/_gitsourcebase.py
index 1d33bd5..b986f75 100644
--- a/buildstream/_gitsourcebase.py
+++ b/buildstream/_gitsourcebase.py
@@ -605,7 +605,7 @@
                 detail = "The ref provided for the element does not exist locally " + \
                          "in the provided track branch / tag '{}'.\n".format(self.tracking) + \
                          "You may wish to track the element to update the ref from '{}' ".format(self.tracking) + \
-                         "with `bst track`,\n" + \
+                         "with `bst source track`,\n" + \
                          "or examine the upstream at '{}' for the specific ref.".format(self.mirror.url)
 
                 self.warn("{}: expected ref '{}' was not found in given track '{}' for staged repository: '{}'\n"
diff --git a/buildstream/_loader/loader.py b/buildstream/_loader/loader.py
index 16e8803..13761fb 100644
--- a/buildstream/_loader/loader.py
+++ b/buildstream/_loader/loader.py
@@ -557,7 +557,7 @@
                         ticker(filename, 'Fetching subproject from {} source'.format(source.get_kind()))
                     source._fetch(sources[0:idx])
                 else:
-                    detail = "Try fetching the project with `bst fetch {}`".format(filename)
+                    detail = "Try fetching the project with `bst source fetch {}`".format(filename)
                     raise LoadError(LoadErrorReason.SUBPROJECT_FETCH_NEEDED,
                                     "Subproject fetch needed for junction: {}".format(filename),
                                     detail=detail)
@@ -565,7 +565,7 @@
             # Handle the case where a subproject has no ref
             #
             elif source.get_consistency() == Consistency.INCONSISTENT:
-                detail = "Try tracking the junction element with `bst track {}`".format(filename)
+                detail = "Try tracking the junction element with `bst source track {}`".format(filename)
                 raise LoadError(LoadErrorReason.SUBPROJECT_INCONSISTENT,
                                 "Subproject has no ref for junction: {}".format(filename),
                                 detail=detail)
diff --git a/buildstream/_pipeline.py b/buildstream/_pipeline.py
index 3dc3019..7cf36f5 100644
--- a/buildstream/_pipeline.py
+++ b/buildstream/_pipeline.py
@@ -373,7 +373,7 @@
                     if source._get_consistency() == Consistency.INCONSISTENT:
                         detail += "    {} is missing ref\n".format(source)
                 detail += '\n'
-            detail += "Try tracking these elements first with `bst track`\n"
+            detail += "Try tracking these elements first with `bst source track`\n"
 
             raise PipelineError("Inconsistent pipeline", detail=detail, reason="inconsistent-pipeline")
 
@@ -406,7 +406,7 @@
                     if source._get_consistency() != Consistency.CACHED:
                         detail += "    {}\n".format(source)
                 detail += '\n'
-            detail += "Try fetching these elements first with `bst fetch`,\n" + \
+            detail += "Try fetching these elements first with `bst source fetch`,\n" + \
                       "or run this command with `--fetch` option\n"
 
             raise PipelineError("Uncached sources", detail=detail, reason="uncached-sources")
diff --git a/buildstream/plugins/elements/junction.py b/buildstream/plugins/elements/junction.py
index 7f98173..2550e1f 100644
--- a/buildstream/plugins/elements/junction.py
+++ b/buildstream/plugins/elements/junction.py
@@ -79,7 +79,7 @@
 
    Therefore, if you require the most up-to-date version of a subproject,
    you must explicitly track the junction element by invoking:
-   `bst track JUNCTION_ELEMENT`.
+   `bst source track JUNCTION_ELEMENT`.
 
    Furthermore, elements within the subproject are also not tracked by default.
    For this, we must specify the `--track-cross-junctions` option. This option
@@ -93,7 +93,7 @@
 
 .. code::
 
-   bst fetch junction.bst
+   bst source fetch junction.bst
 
 Other commands such as ``bst build`` implicitly fetch junction sources.
 
@@ -146,7 +146,7 @@
 
     def get_unique_key(self):
         # Junctions do not produce artifacts. get_unique_key() implementation
-        # is still required for `bst fetch`.
+        # is still required for `bst source fetch`.
         return 1
 
     def configure_sandbox(self, sandbox):
diff --git a/buildstream/plugins/sources/bzr.py b/buildstream/plugins/sources/bzr.py
index 5b993c0..de5dbdc 100644
--- a/buildstream/plugins/sources/bzr.py
+++ b/buildstream/plugins/sources/bzr.py
@@ -46,7 +46,7 @@
    # but revisions on a branch are of the form
    # <revision-branched-from>.<branch-number>.<revision-since-branching>
    # e.g. 6622.1.6.
-   # The ref must be specified to build, and 'bst track' will update the
+   # The ref must be specified to build, and 'bst source track' will update the
    # revision number to the one on the tip of the branch specified in 'track'.
    ref: 6622
 
diff --git a/buildstream/plugins/sources/deb.py b/buildstream/plugins/sources/deb.py
index 1b7dafd..e459949 100644
--- a/buildstream/plugins/sources/deb.py
+++ b/buildstream/plugins/sources/deb.py
@@ -34,7 +34,7 @@
    kind: deb
 
    # Specify the deb url. Using an alias defined in your project
-   # configuration is encouraged. 'bst track' will update the
+   # configuration is encouraged. 'bst source track' will update the
    # sha256sum in 'ref' to the downloaded file's sha256sum.
    url: upstream:foo.deb
 
diff --git a/buildstream/plugins/sources/git.py b/buildstream/plugins/sources/git.py
index 4160797..5e68349 100644
--- a/buildstream/plugins/sources/git.py
+++ b/buildstream/plugins/sources/git.py
@@ -112,7 +112,7 @@
    #     o Enable `track-tags` feature
    #     o Set the `track` parameter to the desired commit sha which
    #       the current `ref` points to
-   #     o Run `bst track` for these elements, this will result in
+   #     o Run `bst source track` for these elements, this will result in
    #       populating the `tags` portion of the refs without changing
    #       the refs
    #     o Restore the `track` parameter to the branches which you have
diff --git a/buildstream/plugins/sources/remote.py b/buildstream/plugins/sources/remote.py
index a6b02fd..562a8f2 100644
--- a/buildstream/plugins/sources/remote.py
+++ b/buildstream/plugins/sources/remote.py
@@ -37,7 +37,7 @@
    # executable: true
 
    # Specify the url. Using an alias defined in your project
-   # configuration is encouraged. 'bst track' will update the
+   # configuration is encouraged. 'bst source track' will update the
    # sha256sum in 'ref' to the downloaded file's sha256sum.
    url: upstream:foo
 
diff --git a/buildstream/plugins/sources/tar.py b/buildstream/plugins/sources/tar.py
index 195c059..d4e30d9 100644
--- a/buildstream/plugins/sources/tar.py
+++ b/buildstream/plugins/sources/tar.py
@@ -33,7 +33,7 @@
    kind: tar
 
    # Specify the tar url. Using an alias defined in your project
-   # configuration is encouraged. 'bst track' will update the
+   # configuration is encouraged. 'bst source track' will update the
    # sha256sum in 'ref' to the downloaded file's sha256sum.
    url: upstream:foo.tar
 
diff --git a/buildstream/plugins/sources/zip.py b/buildstream/plugins/sources/zip.py
index f5fac3a..03efcef 100644
--- a/buildstream/plugins/sources/zip.py
+++ b/buildstream/plugins/sources/zip.py
@@ -29,7 +29,7 @@
    kind: zip
 
    # Specify the zip url. Using an alias defined in your project
-   # configuration is encouraged. 'bst track' will update the
+   # configuration is encouraged. 'bst source track' will update the
    # sha256sum in 'ref' to the downloaded file's sha256sum.
    url: upstream:foo.zip
 
diff --git a/doc/source/format_project_refs.rst b/doc/source/format_project_refs.rst
index 799b5e7..8dcb244 100644
--- a/doc/source/format_project_refs.rst
+++ b/doc/source/format_project_refs.rst
@@ -21,9 +21,9 @@
 in the :ref:`inline source declarations <format_sources>` are considered
 invalid and will be ignored, and a warning will be emitted for them.
 
-When ``bst track`` is run for your project, the ``project.refs`` file
+When ``bst source track`` is run for your project, the ``project.refs`` file
 will be updated instead of the inline source declarations. In the absence
-of a ``project.refs`` file, ``bst track`` will create one automatically
+of a ``project.refs`` file, ``bst source track`` will create one automatically
 with the tracking results.
 
 An interesting property of ``project.refs`` is that it allows for
diff --git a/tests/frontend/completions.py b/tests/frontend/completions.py
index 8b549e3..007064f 100644
--- a/tests/frontend/completions.py
+++ b/tests/frontend/completions.py
@@ -160,7 +160,7 @@
     ('bst show --deps b', 3, ['build ']),
     ('bst show --deps=b', 2, ['build ']),
     ('bst show --deps r', 3, ['run ']),
-    ('bst track --deps ', 3, ['all ', 'none ']),
+    ('bst source track --deps ', 4, ['all ', 'none ']),
 ])
 def test_option_choice(cli, cmd, word_idx, expected):
     assert_completion(cli, cmd, word_idx, expected)