Select the types of activity you want to include in your feed.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
Select the types of activity you want to include in your feed.
Move 'phd parse-commit' to a dedicated script; allow message parsing tasks to
be executed in isolation, provide a script to requeue all message reparses,
stop parse-commit from inserting side-effect tasks.
···169169170170 break;
171171172172- case 'parse-commit':
173173- $commit = isset($argv[2]) ? $argv[2] : null;
174174- if (!$commit) {
175175- throw new Exception("Provide a commit to parse!");
176176- }
177177- $matches = null;
178178- if (!preg_match('/r([A-Z]+)([a-z0-9]+)/', $commit, $matches)) {
179179- throw new Exception("Can't parse commit identifier!");
180180- }
181181- $repo = id(new PhabricatorRepository())->loadOneWhere(
182182- 'callsign = %s',
183183- $matches[1]);
184184- if (!$repo) {
185185- throw new Exception("Unknown repository!");
186186- }
187187- $commit = id(new PhabricatorRepositoryCommit())->loadOneWhere(
188188- 'repositoryID = %d AND commitIdentifier = %s',
189189- $repo->getID(),
190190- $matches[2]);
191191- if (!$commit) {
192192- throw new Exception('Unknown commit.');
193193- }
194194-195195- $workers = array();
196196-197197-198198- switch ($repo->getVersionControlSystem()) {
199199- case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
200200- $workers[] = new PhabricatorRepositoryGitCommitMessageParserWorker(
201201- $commit->getID());
202202- $workers[] = new PhabricatorRepositoryGitCommitChangeParserWorker(
203203- $commit->getID());
204204- break;
205205- case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
206206- $workers[] = new PhabricatorRepositorySvnCommitMessageParserWorker(
207207- $commit->getID());
208208- $workers[] = new PhabricatorRepositorySvnCommitChangeParserWorker(
209209- $commit->getID());
210210- break;
211211- default:
212212- throw new Exception("Unknown repository type!");
213213- }
214214-215215- ExecFuture::pushEchoMode(true);
216216-217217- foreach ($workers as $worker) {
218218- echo "Running ".get_class($worker)."...\n";
219219- $worker->doWork();
220220- }
221221-222222- echo "Done.\n";
223223-224224- break;
225172 case '--help':
226173 case 'help':
227174 default:
+83
scripts/repository/parse_one_commit.php
···11+#!/usr/bin/env php
22+<?php
33+44+/*
55+ * Copyright 2011 Facebook, Inc.
66+ *
77+ * Licensed under the Apache License, Version 2.0 (the "License");
88+ * you may not use this file except in compliance with the License.
99+ * You may obtain a copy of the License at
1010+ *
1111+ * http://www.apache.org/licenses/LICENSE-2.0
1212+ *
1313+ * Unless required by applicable law or agreed to in writing, software
1414+ * distributed under the License is distributed on an "AS IS" BASIS,
1515+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1616+ * See the License for the specific language governing permissions and
1717+ * limitations under the License.
1818+ */
1919+2020+$root = dirname(dirname(dirname(__FILE__)));
2121+require_once $root.'/scripts/__init_script__.php';
2222+require_once $root.'/scripts/__init_env__.php';
2323+2424+if (empty($argv[1])) {
2525+ echo "usage: parse_one_commit.php <commit_name>\n";
2626+ die(1);
2727+}
2828+2929+$commit = isset($argv[1]) ? $argv[1] : null;
3030+if (!$commit) {
3131+ throw new Exception("Provide a commit to parse!");
3232+}
3333+$matches = null;
3434+if (!preg_match('/r([A-Z]+)([a-z0-9]+)/', $commit, $matches)) {
3535+ throw new Exception("Can't parse commit identifier!");
3636+}
3737+$repo = id(new PhabricatorRepository())->loadOneWhere(
3838+ 'callsign = %s',
3939+ $matches[1]);
4040+if (!$repo) {
4141+ throw new Exception("Unknown repository!");
4242+}
4343+$commit = id(new PhabricatorRepositoryCommit())->loadOneWhere(
4444+ 'repositoryID = %d AND commitIdentifier = %s',
4545+ $repo->getID(),
4646+ $matches[2]);
4747+if (!$commit) {
4848+ throw new Exception('Unknown commit.');
4949+}
5050+5151+$workers = array();
5252+5353+$spec = array(
5454+ 'commitID' => $commit->getID(),
5555+ 'only' => true,
5656+);
5757+5858+switch ($repo->getVersionControlSystem()) {
5959+ case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
6060+ $workers[] = new PhabricatorRepositoryGitCommitMessageParserWorker(
6161+ $spec);
6262+ $workers[] = new PhabricatorRepositoryGitCommitChangeParserWorker(
6363+ $spec);
6464+ break;
6565+ case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
6666+ $workers[] = new PhabricatorRepositorySvnCommitMessageParserWorker(
6767+ $spec);
6868+ $workers[] = new PhabricatorRepositorySvnCommitChangeParserWorker(
6969+ $spec);
7070+ break;
7171+ default:
7272+ throw new Exception("Unknown repository type!");
7373+}
7474+7575+ExecFuture::pushEchoMode(true);
7676+7777+foreach ($workers as $worker) {
7878+ echo "Running ".get_class($worker)."...\n";
7979+ $worker->doWork();
8080+}
8181+8282+echo "Done.\n";
8383+
···145145 **help**
146146 Show this help.
147147148148- **parse-commit** __rXnnnn__
149149- Parse a single commit.
150150-151148 **repository-launch-master**
152149 Launches daemons to update and parse all tracked repositories. You
153150 must also launch Taskmaster daemons, either on the same machine or