anchor.diff:    /// 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);
  +  /// All [PackageNodes] indexed by package name.
  +  final Map<String, PackageNode> allPackages;
   
  -    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);
  +  PackageGraph._(this.root, Map<String, PackageNode> allPackages)
  +      : allPackages = new Map.unmodifiable(allPackages);
   
     /// Creates a [PackageGraph] for the package in which you are currently
     /// running.
  
positive.code:         {bool isRoot: false}) {
        var name = yaml['name'];
        assert(!nodes.containsKey(name));
        var node = new PackageNode._(name, yaml['version'], type);
        nodes[name] = node;
  
        _depsFromYaml(yaml, withOverrides: isRoot).forEach((name, source) {
  
negative.code:     /// Read in the pubspec file and parse it as yaml.
      var pubspec = new File('pubspec.yaml');
      if (!pubspec.existsSync()) {
        throw 'Unable to generate package graph, no `pubspec.yaml` found. '
            'This program must be ran from the root directory of your package.';
      }
      var yaml = loadYaml(pubspec.readAsStringSync());
  
      /// Read in the `.packages` file to get the locations of all packages.
      var packagesFile = new File('.packages');
      if (!packagesFile.existsSync()) {
        throw 'Unable to generate package graph, no `.packages` found. '
            'This program must be ran from the root directory of your package.';
      }
      var packageLocations = <String, Uri>{};
      packagesFile.readAsLinesSync().skip(1).forEach((line) {
  