Skip to content

Commit

Permalink
Improve the output of "pub deps".
Browse files Browse the repository at this point in the history
Previously, if a dependency depended on the entrypoint package, the
entrypoint would have all its direct dependencies re-printed. This fixes
that.

[email protected]

Review URL: https://codereview.chromium.org//1274763010 .
  • Loading branch information
nex3 committed Aug 10, 2015
1 parent 7ae772d commit 8707131
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/src/command/deps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class DepsCommand extends PubCommand {
// being added to the tree, and the parent map that will receive that
// package.
var toWalk = new Queue<Pair<Package, Map>>();
var visited = new Set<String>();
var visited = new Set<String>.from([entrypoint.root.name]);

// Start with the root dependencies.
var packageTree = {};
Expand Down
6 changes: 4 additions & 2 deletions test/deps_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ main() {
builder.serve("transitive", "1.2.3", deps: {"shared": "any"});
builder.serve("shared", "1.2.3", deps: {"other": "any"});
builder.serve("unittest", "1.2.3", deps: {"shared": "any"});
builder.serve("other", "1.0.0");
builder.serve("other", "1.0.0", deps: {"myapp": "any"});
builder.serve("overridden", "1.0.0");
builder.serve("overridden", "2.0.0");
builder.serve("override_only", "1.2.3");
Expand Down Expand Up @@ -69,7 +69,7 @@ main() {
transitive dependencies:
- circular_a 1.2.3 [circular_b]
- circular_b 1.2.3 [circular_a]
- other 1.0.0
- other 1.0.0 [myapp]
- shared 1.2.3 [other]
- transitive 1.2.3 [shared]
''');
Expand Down Expand Up @@ -101,6 +101,7 @@ main() {
- circular_b 1.2.3
- circular_a any
- other 1.0.0
- myapp any
- shared 1.2.3
- other any
- transitive 1.2.3
Expand All @@ -124,6 +125,7 @@ main() {
'-- unittest 1.2.3
'-- shared 1.2.3
'-- other 1.0.0
'-- myapp...
''');
});
}

0 comments on commit 8707131

Please sign in to comment.