1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00

Fix a bug in the SVN parser which causes it to find commit refs in other SVN

repositories

Summary:
This query isn't scoped correctly to the repository ID, so we may identify
commits from other repositories.

This causes a somewhat subtle issue since we only use it to manage file
copies/moves, so you end up with a file "copied from" the same revision in
another repository. I think the UI probably even renders correctly.

Once I finish T325 and better understand what's going on here, I'll see how much
work is involved in writing an SQL patch to fix this.

Test Plan: Parsed the test repo from T325 with the expected error.

Reviewers: jungejason, nh, tuomaspelkonen, aran

Reviewed By: jungejason

CC: aran, jungejason

Differential Revision: 891
This commit is contained in:
epriestley 2011-09-04 10:11:12 -07:00
parent 3ecd11a634
commit ed508247ba

View file

@ -496,8 +496,10 @@ class PhabricatorRepositorySvnCommitChangeParserWorker
$commit_table = new PhabricatorRepositoryCommit();
$commit_data = queryfx_all(
$commit_table->establishConnection('w'),
'SELECT id, commitIdentifier FROM %T WHERE commitIdentifier in (%Ld)',
'SELECT id, commitIdentifier FROM %T
WHERE repositoryID = %d AND commitIdentifier in (%Ld)',
$commit_table->getTableName(),
$repository->getID(),
$commits);
return ipull($commit_data, 'id', 'commitIdentifier');