]> khamidou — GitHub mirrors - arcanist.git/commit
Fix arc ArcanistSvnHookPreCommitWorkflow
authorJason Ge <jungejason@fb.com>
Wed, 23 May 2012 23:26:20 +0000 (16:26 -0700)
committerJason Ge <jungejason@fb.com>
Wed, 23 May 2012 23:29:27 +0000 (16:29 -0700)
commited7034ab383a6776caf1ee99780f0a740ccd2475
treecb46c965ebc19309eb4d244723eeaf948f1206d0
parent2c72779c7d3024e3c7b9a8ce454754f727a9ef14
Fix arc ArcanistSvnHookPreCommitWorkflow

Summary:
there are two problems making the ArcanistSvnHookPreCommitWorkflow not working.

  - pathExists($path) will always return false because it hasn't loaded the path yet. Because of this, PhutilLintEngine will unset the path at https://secure.phabricator.com/diffusion/ARC/browse/master/src/lint/engine/phutil/PhutilLintEngine.php;032b9b30b0721c3f$46, so ArcanistSvnHookPreCommitWorkflow will have no path to lint against and never detects a problem.
  - In ArcanistSubversionHookAPI::getCurrentFileData(), the $path is already the full path in svnroot (path got from https://secure.phabricator.com/diffusion/ARC/browse/master/src/workflow/svn-hook-pre-commit/ArcanistSvnHookPreCommitWorkflow.php;032b9b30b0721c3f$72). Prepending the project root to it will make the file path to be wrong so that the file content is empty. Again, ArcanistSvnHookPreCommitWorkflow never detects a problem.

Test Plan:
changed --transaction to --revision in related code and manually ran the following command. It detected the syntaxt error correctly. 558937 is a revision with syntax error.

/usr/local/bin/php -f /home/jungejason/nfs_devtools/arcanist/bin/arc svn-hook-pre-commit     --load-phutil-library=/tmp/testwww/www/lib/arcanist --load-phutil-library=/home/jungejason/nfs_devtools/facebook/src /svnroot 558937 2>&1

Reviewers: epriestley, nh

Reviewed By: nh

CC: aran, Girish, Koolvin
Differential Revision: https://secure.phabricator.com/D2485
src/lint/engine/base/ArcanistLintEngine.php
src/repository/hookapi/subversion/ArcanistSubversionHookAPI.php