Avoid computing changed files for automerge commits using PatchListCache

ChangeFiles has 2 methods to compute changed files:

1. computeByComparingAgainstAutoMerge:
   This method uses the PatchListCache for computing the changed files,
   but PatchListCache can be slow (> 30s). Once the result is cached any
   further access is fast.
   The primary reason for using PatchListCache was that it takes care of
   creating the auto merge commit.

2. computeByComparingAgainstFirstParent:
   This method uses DiffFormatter (without rename detection) for
   computing the changed files. This seems to be fast also for changes
   that touch many files.

This change drops the usage of PatchListCache and uses DiffFormatter
also for case 1. This means that ChangedFiles now needs to take care of
creating the auto merge commit, but it's only a matter of invoking
AutoMerger.

Alternatively we could have used the new file diff cache for case 1, but
we do not because:
- This cache is very new and we do not know for sure that it's always
  fast (e.g. it may do some kind of rename detection).
- We cannot use the new file diff cache for case 2 as in this case we
  must use the provided RevWalk for loading commits and we cannot pass the
  RevWalk into the file diff cache. Hence for case 2 we would need to
  continue using DiffFormatter. Then we can also use this existing code
  for case 1 and avoid having a differentiation between computing
  changed files against first parent and against auto merge.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Ia5e2afae345e7af5eb5c5c73a068c934c1e685b0
5 files changed
tree: dc629317cf407ea6c63c85cedc29b4518a794c94
  1. java/
  2. javatests/
  3. proto/
  4. resources/
  5. test/
  6. ui/
  7. .eslintrc.json
  8. .gitignore
  9. .gitreview
  10. bower.json
  11. BUILD
  12. LICENSE
  13. package-lock.json
  14. package.json
  15. README.md
README.md

Gerrit Code Review code-owners plugin

This plugin provides support for defining code owners for files in a repository.

If the code-owners plugin is enabled, changes can only be submitted if all touched files are covered by approvals from code owners.

Also see resources/Documentation/about.md.

IMPORTANT: Before installing/enabling the plugin follow the instructions from the setup guide, see resources/Documentation/setup-guide.md.