Skip to content

Commit d89e704

Browse files
Apply documentation changes and improve error handling for inheritance in import command.
Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
1 parent 16e1be6 commit d89e704

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,12 @@ Currently there are two ways to specify the path to the repository file passed t
248248

249249
* For instance: `vcs import < my.repos <destination-path>`
250250

251-
* The extended files are searched relative to the current working directory.
251+
* The extended files are searched relative to the current working directory.
252252

253-
* 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.
253+
* Therefore, you have to be in the **same** directory as `my.repos` to run the command.
254+
255+
The files being directly extended by the file provided through `stdin` are relative to the current working directory.
256+
Any other file being extended is relative to the file extending it.
254257

255258
### Delete set of repositories
256259

vcs2l/commands/import_.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,11 @@ def get_repositories(yaml_file, visited_files=None):
154154
with open(parent_file, 'r', encoding='utf-8') as parent_f:
155155
parent_repos = get_repositories(parent_f, visited_files.copy())
156156
combined_repos.update(parent_repos)
157+
158+
except CircularImportError:
159+
raise
160+
157161
except Exception as e:
158-
if isinstance(e, CircularImportError):
159-
raise
160162
raise RuntimeError(
161163
f'Error reading parent file {parent_file}: \n{str(e)}'
162164
) from e

0 commit comments

Comments
 (0)