You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,6 +139,44 @@ The set of repositories to operate on can optionally be restricted by the type:
139
139
140
140
If the command should work on multiple repositories make sure to pass only generic arguments which work for all of these repository types.
141
141
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.
0 commit comments