anchor.diff:      }
   
       var root = addNodeAndDeps(yaml, PackageDependencyType.Path, isRoot: true);
  -    return new PackageGraph._(root);
  +    return new PackageGraph._(root, nodes);
     }
  +
  +  /// Shorthand to get a package by name.
  +  PackageNode operator[] (String packageName) => allPackages[packageName];
   
     String toString() {
       var buffer = new StringBuffer();
  -    for (var package in allPackages) {
  +    for (var package in allPackages.values) {
         buffer.writeln('$package');
       }
       return buffer.toString();
  
positive.code:   /// The root application package.
    final PackageNode root;
  
    /// All the package dependencies of [root], transitive and direct.
    Set<PackageNode> get allPackages {
      var seen = new Set<PackageNode>()..add(root);
  
      void addDeps(PackageNode package) {
        for (var dep in package.dependencies) {
          if (seen.contains(dep)) continue;
          seen.add(dep);
          addDeps(dep);
        }
      }
      addDeps(root);
  
      return seen;
    }
  
    PackageGraph._(this.root);
  
    /// Creates a [PackageGraph] for the package in which you are currently
    /// running.
  
negative.code:         {bool isRoot: false}) {
        var name = yaml['name'];
        assert(!nodes.containsKey(name));
        var node = new PackageNode._(
            name, yaml['version'], type, packageLocations[name]);
        nodes[name] = node;
  
        _depsFromYaml(yaml, withOverrides: isRoot).forEach((name, source) {
  