anchor.diff:    /// Returns a string describing the dependency chain if it does, or `null` if
     /// there is no dependency.
     String _getDependencyPath(PackageId depender, String dependent) {
  +    // TODO(rnystrom): This is O(n^2) where n is the number of selected
  +    // packages. Could store the reverse dependency graph to address that. If
  +    // we do that, we need to make sure it gets correctly rolled back when
  +    // backtracking occurs.
       var visited = new Set<String>();
  -    var resultPath;
  -    var currentPath = '${depender.name}';
  -
  -    walkDeps(PackageId package) {
  -      if (visited.contains(package.name)) return false;
  +
  +    walkDeps(PackageId package, String currentPath) {
  +      if (visited.contains(package.name)) return null;
         visited.add(package.name);
   
         var pubspec = cache.getCachedPubspec(package);
  -      if (pubspec == null) return false;
  +      if (pubspec == null) return null;
   
         for (var dep in pubspec.dependencies) {
  -        var previousPath = currentPath;
  -        currentPath = '$currentPath -> ${dep.name}';
  -
  -        if (dep.name == dependent) {
  -          resultPath = currentPath;
  -          return true;
  -        }
  +        if (dep.name == dependent) return currentPath;
   
           var selected = getSelected(dep.name);
           // Ignore unselected dependencies. We haven't traversed into them yet,
           // so they can't affect backjumping.
           if (selected == null) continue;
   
  -        if (walkDeps(selected)) return true;
  -
  -        currentPath = previousPath;
  -      }
  -
  -      return false;
  -    }
  -
  -    return walkDeps(depender) ? resultPath : null;
  +        var depPath = walkDeps(selected, '$currentPath -> ${dep.name}');
  +        if (depPath != null) return depPath;
  +      }
  +
  +      return null;
  +    }
  +
  +    return walkDeps(depender, depender.name);
     }
   
     /// Logs [message] in the context of the current selected packages. If
  
positive.code:           // If it fails for any reason, just treat that as no versions. This
            // will sort this reference higher so that we can traverse into it
            // and report the error more properly.
            return new Pair<PackageRef, int>(ref, 0);
          });
        }
  
negative.code:       if (_selected.isEmpty) {
          message = "* start at root";
        } else {
          var count = _selected.last.length;
          message = "* select ${_selected.last.first} ($count versions)";
        }
      } else {
        // Otherwise, indent it under the current selected package.
  