Read rename information from DB instead of repository

Summary:
We already have this information for all VCSes, there's no point in parsing it again.
We currently support it only for Git and I remember there were some bugs in it.
It should also be faster.

Test Plan: Blamed previous revision of a file which was moved in SVN.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3564
This commit is contained in:
vrana
2012-09-28 14:36:47 -07:00
parent 713225e296
commit b43f84d6dc
7 changed files with 116 additions and 204 deletions

View File

@@ -754,8 +754,8 @@ final class DiffusionBrowseFileController extends DiffusionController {
$parent->getCommitIdentifier());
if ($grandparent) {
$rename_query = DiffusionRenameHistoryQuery::newFromDiffusionRequest(
$drequest);
$rename_query = new DiffusionRenameHistoryQuery();
$rename_query->setRequest($drequest);
$rename_query->setOldCommit($grandparent->getCommitIdentifier());
$old_filename = $rename_query->loadOldFilename();
$was_created = $rename_query->getWasCreated();
@@ -783,7 +783,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
$path = $drequest->getPath();
$renamed = null;
if ($old_filename !== null &&
$old_filename !== $path) {
$old_filename !== '/'.$path) {
$renamed = $path;
$path = $old_filename;
}