-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate entries with the same repo nickname ends up cloning only one of them, without notifying so #210
Comments
do you think it should simply print a warning or should it error out? I think being able to concatenate two files (especially two Example:
with just diff --git a/vcstool/commands/import_.py b/vcstool/commands/import_.py
index 55b3e18..5093fe0 100644
--- a/vcstool/commands/import_.py
+++ b/vcstool/commands/import_.py
@@ -114,6 +114,14 @@ def get_repos_in_vcstool_format(repositories):
'information: %s' % (path, e)) + ansi('reset'),
file=sys.stderr)
continue
+ if path in repos:
+ print(
+ ansi('yellowf') + (
+ "Repository '%s' is defined twice: "
+ 'using %s instead of %s'
+ % (path, repo['url'], repos[path]['url'])
+ ) + ansi('reset'),
+ file=sys.stderr)
repos[path] = repo
return repos
@@ -145,6 +153,14 @@ def get_repos_in_rosinstall_format(root):
'information: %s' % (path, e)) + ansi('reset'),
file=sys.stderr)
continue
+ if path in repos:
+ print(
+ ansi('yellowf') + (
+ "Repository '%s' is defined twice: "
+ 'using %s instead of %s'
+ % (path, repo['url'], repos[path]['url'])
+ ) + ansi('reset'),
+ file=sys.stderr)
repos[path] = repo
return repos
|
Maybe hybrid? By default only print warning but with an option the tool can fail? |
I might be wrong, but with the current state of the tool, I can't really think of a situation where having duplicate entries is not an error, so I'd make it fail by default and have an option to just print a warning (or even just keep going without any warning). This could change, for example with #148 or something else, but there isn't anything like that currently. |
I think with my OP a user didn't have a way to get notified of non-standard condition. |
Yeah, sorry! By "error" I meant "bad situation/bad configuration/user error" so the fact that it doesn't currently throw an error in that case would be a bug. |
The file format of the file I won't be able to spend any time on enhance the user experience for this compatibility format. If anyone would like to work on a patch, the logic for checking for duplicate entries should added within the |
Problem
When there are multiple entries with the same nickname (?) I see only the last entry is cloned, which might be fine. But I do see it a problem that the tool doesn't let the user know there was a duplicate entry.
I just had an issue where a repo defined earlier than the last duplicated entry didn't get cloned, which I didn't notice for awhile.
Demo
foo.repos
.I do not see any mention about
robolectric
in the result below.The text was updated successfully, but these errors were encountered: