From ed508247ba1ae8d4512f718ba35dd1a06223680a Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 4 Sep 2011 10:11:12 -0700 Subject: [PATCH] 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 --- .../svn/PhabricatorRepositorySvnCommitChangeParserWorker.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/applications/repository/worker/commitchangeparser/svn/PhabricatorRepositorySvnCommitChangeParserWorker.php b/src/applications/repository/worker/commitchangeparser/svn/PhabricatorRepositorySvnCommitChangeParserWorker.php index f365552475..bb92e0e9c0 100644 --- a/src/applications/repository/worker/commitchangeparser/svn/PhabricatorRepositorySvnCommitChangeParserWorker.php +++ b/src/applications/repository/worker/commitchangeparser/svn/PhabricatorRepositorySvnCommitChangeParserWorker.php @@ -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');