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
@@ -137,6 +137,44 @@ The set of repositories to operate on can optionally be restricted by the type:
137
137
138
138
If the command should work on multiple repositories make sure to pass only generic arguments which work for all of these repository types.
139
139
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.
0 commit comments