* See http://youtrack.jetbrains.com/issue/IDEA-89347 for detailed explanation of the problem.
* If a file is renamed several times, and at once it get renamed to the name which it already have had previously (cyclic rename), git log -- <file path> will display the all history for this path.
* Improve the algorithm in GitHistoryUtils so that it tracks when the file was ADDED, and stops looking at the history if there is any. Then the traditional "git show --name-status -M" will capture that the file was renamed, and query for the history of the old path, etc.
* Write a test for cyclic renames in the history.
Looks like the problem is that editor scroll animator has enough time to tick before paint request scheduled by the DirtyRegionManager is actually executed
For merge revisions collect correct information about file paths of the file, how it was named in both parent revisions.
For it call git diff -M --name-status <parent>..<current> for both parents: if the file was renamed in one of merged branches, it will be noted in the diff output.
This process happens in the background, along with check if the file was touched in the revision.
Btw, use correct path to check if the file was touched in the merge revision (the file can be renamed after this merge, and current name can be different).
Moved file has other path in the parent revision => constructing a fake GitFileRevision using the same file path is incorrect approach.
Modified the DiffFromHistoryHandler to pass the previous revision from the file history panel (and renamed the interface methods to avoid confusion between them). This is somewhat incorrect, because the previous revision in the list is not necessarily a direct parent of current revision (it is an ancestor though; the file can be not changed in the parent revision).
At best, we should query Git (git show <current revision>) to know the previous part, but it would require one more Git command. Current approach is acceptable until file history gets the graph log.
Merge commits, however, should be handled separately. The fix will come in the next commit.