Skip to content

Commit 6d6f04c

Browse files
Document 'extends' feature in README
1 parent 89d5af5 commit 6d6f04c

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
@@ -137,6 +137,44 @@ The set of repositories to operate on can optionally be restricted by the type:
137137

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

140+
Extend a repositories file
141+
~~~~~~~~~~~~~~~~~~~~~~~~~~
142+
143+
It is possible to write a ``.repos`` file that extends another one.
144+
For example, this ``extension.repos`` file:
145+
146+
.. code-block:: yaml
147+
148+
# extension.repos
149+
extends: base.repos
150+
repositories:
151+
a/repo:
152+
type: git
153+
url: https://github.com/a/repo.git
154+
version: my-branch
155+
156+
extends this ``base.repos`` file:
157+
158+
.. code-block:: yaml
159+
160+
# base.repos
161+
repositories:
162+
a/repo:
163+
type: git
164+
url: https://github.com/a/repo.git
165+
version: master
166+
another/repo:
167+
type: git
168+
url: https://github.com/another/repo.git
169+
version: 1.2.3
170+
171+
172+
Running ``vcs import --input extension.repos`` would checkout ``a/repo`` @ ``my-branch`` (instead of ``master``) as well as ``another/repo`` @ ``1.2.3``.
173+
174+
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.
175+
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.
176+
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.
177+
There is no hard limit as to how many extensions can be performed, as long as there is no loop.
140178

141179
How to install vcstool?
142180
=======================

0 commit comments

Comments
 (0)