Skip to content

Commit 20d2f2a

Browse files
Document 'extends' feature in README
1 parent eb14aa5 commit 20d2f2a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,44 @@ The set of repositories to operate on can optionally be restricted by the type:
139139

140140
If the command should work on multiple repositories make sure to pass only generic arguments which work for all of these repository types.
141141

142+
Extend a repositories file
143+
~~~~~~~~~~~~~~~~~~~~~~~~~~
144+
145+
It is possible to write a ``.repos`` file that extends another one.
146+
For example, this ``extension.repos`` file:
147+
148+
.. code-block:: yaml
149+
150+
# extension.repos
151+
extends: base.repos
152+
repositories:
153+
a/repo:
154+
type: git
155+
url: https://github.com/a/repo.git
156+
version: my-branch
157+
158+
extends this ``base.repos`` file:
159+
160+
.. code-block:: yaml
161+
162+
# base.repos
163+
repositories:
164+
a/repo:
165+
type: git
166+
url: https://github.com/a/repo.git
167+
version: master
168+
another/repo:
169+
type: git
170+
url: https://github.com/another/repo.git
171+
version: 1.2.3
172+
173+
174+
Running ``vcs import --input extension.repos`` would checkout ``a/repo`` @ ``my-branch`` (instead of ``master``) as well as ``another/repo`` @ ``1.2.3``.
175+
176+
If the initial file is passed to ``vcs`` using ``stdin`` (i.e. ``vcs import < extension.repos``), the path to the extended file is relative to the current diretory.
177+
If the initial file is passed to ``vcs`` using the ``--input`` option, the path to the extended file is relative to the initial file's directory.
178+
This is applied recursively for any subsequent extended file, i.e. the second extended file's path is relative to the first extended file's directory.
179+
There is no hard limit as to how many extensions can be performed, as long as there is no loop.
142180

143181
How to install vcstool?
144182
=======================

0 commit comments

Comments
 (0)