diff --git a/src/applications/differential/parser/changeset/DifferentialChangesetParser.php b/src/applications/differential/parser/changeset/DifferentialChangesetParser.php index 1c71ce87c4..9cf45434c0 100644 --- a/src/applications/differential/parser/changeset/DifferentialChangesetParser.php +++ b/src/applications/differential/parser/changeset/DifferentialChangesetParser.php @@ -404,12 +404,14 @@ class DifferentialChangesetParser { } $data = null; -/* + + $changeset = new DifferentialChangeset(); + $conn_r = $changeset->establishConnection('r'); $data = queryfx_one( - smc_get_db('cdb.differential', 'r'), - 'SELECT * FROM changeset_parse_cache WHERE id = %d', + $conn_r, + 'SELECT * FROM %T WHERE id = %d', + $changeset->getTableName().'_parse_cache', $this->changesetID); -*/ if (!$data) { return false; @@ -479,14 +481,15 @@ class DifferentialChangesetParser { $cache = json_encode($cache); try { -/* + $changeset = new DifferentialChangeset(); + $conn_w = $changeset->establishConnection('w'); queryfx( - smc_get_db('cdb.differential', 'w'), - 'INSERT INTO changeset_parse_cache (id, cache) VALUES (%d, %s) + $conn_w, + 'INSERT INTO %T (id, cache) VALUES (%d, %s) ON DUPLICATE KEY UPDATE cache = VALUES(cache)', + $changeset->getTableName().'_parse_cache', $this->changesetID, $cache); -*/ } catch (QueryException $ex) { // TODO: uhoh } @@ -571,7 +574,7 @@ class DifferentialChangesetParser { $result = $this->highlightEngine->highlightSource( $this->filetype, $corpus); - + $result_lines = explode("\n", $result); foreach ($data as $key => $info) { if (!$info) { diff --git a/src/applications/differential/parser/changeset/__init__.php b/src/applications/differential/parser/changeset/__init__.php index 0df1f24c87..5c540dfa42 100644 --- a/src/applications/differential/parser/changeset/__init__.php +++ b/src/applications/differential/parser/changeset/__init__.php @@ -10,13 +10,16 @@ phutil_require_module('arcanist', 'difference'); phutil_require_module('arcanist', 'parser/diff'); phutil_require_module('phabricator', 'applications/differential/constants/changetype'); +phutil_require_module('phabricator', 'applications/differential/storage/changeset'); phutil_require_module('phabricator', 'applications/differential/storage/diff'); phutil_require_module('phabricator', 'applications/files/uri'); +phutil_require_module('phabricator', 'storage/queryfx'); phutil_require_module('phutil', 'filesystem'); phutil_require_module('phutil', 'filesystem/tempfile'); phutil_require_module('phutil', 'future/exec'); phutil_require_module('phutil', 'markup'); +phutil_require_module('phutil', 'markup/syntax/engine/default'); phutil_require_module('phutil', 'utils');