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.md
+97-18Lines changed: 97 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,29 +92,108 @@ Only for this command vcs2l supports the pseudo clients `tar` and `zip` which fe
92
92
93
93
### Import with extends functionality
94
94
95
-
The `vcs import` command supports an `extends` key at the top level of the YAML file.
96
-
The value of that key is a path or URL to another YAML file which is imported first.
97
-
This parent file can itself also contain the key to chain multiple files.
98
-
The child is given precedence over the parent in case of duplicate repository entries.
95
+
The `vcs import` command supports an `extends` key at the top level of the YAML file. The value of that key is a path or URL to another YAML file which is imported first.
96
+
This base file can itself also contain the key to chain multiple files. The extension to this base file is given precedence over the parent in case of duplicate repository entries.
97
+
98
+
#### Normal Extension
99
+
100
+
For instance, consider the following two files:
101
+
102
+
- **`base.repos`**: contains three repositories `vcs2l`, `immutable/hash` and `immutable/tag`, checked out at specific versions.
The resulting extension import would import vcs2l at version `main`, `immutable/hash` at version `25e4ae2` and `immutable/tag` at version `1.1.5`.
137
+
138
+
#### Circular Loop Protection
139
+
99
140
In order to avoid infinite loops in case of circular imports the tool detects already imported files and raises an error if such a file is encountered again.
100
141
101
-
```yaml
102
-
# parent.repos
103
-
repositories:
104
-
vcs2l:
105
-
type: git
106
-
url: git@github.com:ros-infrastructure/vcs2l.git
107
-
version: main
142
+
For instance, consider the following two files:
143
+
144
+
- **`loop_base.repos`**: extends the `loop_extension.repos` file, and contains two repositories `vcs2l` and `immutable/tag`.
Currently there are two ways to specify the path to the repository file passed to `vcs import`:
180
+
181
+
1. **Recommended**: Using `--input`.
182
+
183
+
* For instance: `vcs import --input my.repos <destination-path>`
184
+
185
+
* The extended files are searched relative to the location of `my.repos`.
186
+
187
+
* You do not require to be in the same directory as `my.repos` to run the command.
188
+
189
+
2. Using the input redirection operator `<` to pass a local file path via `stdin`.
190
+
191
+
* For instance: `vcs import < my.repos <destination-path>`
192
+
193
+
* The extended files are searched relative to the current working directory.
194
+
195
+
* Therefore, you have to be in the **same** directory as `my.repos` to run the command. In addition, all the extended files must also be relative to the current working directory.
196
+
118
197
### Delete set of repositories
119
198
120
199
The `vcs delete` command removes all directories of repositories which are passed in via `stdin` in YAML format.
0 commit comments