@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
phorge
phabricator
1<?php
2
3final class DiffusionSvnBlameQuery extends DiffusionBlameQuery {
4
5 protected function newBlameFuture(DiffusionRequest $request, $path) {
6 $repository = $request->getRepository();
7 $commit = $request->getCommit();
8
9 return $repository->getRemoteCommandFuture(
10 'blame --force %s',
11 $repository->getSubversionPathURI($path, $commit));
12 }
13
14 protected function resolveBlameFuture(ExecFuture $future) {
15 list($err, $stdout) = $future->resolve();
16
17 if ($err) {
18 return null;
19 }
20
21 $result = array();
22 $matches = null;
23
24 $lines = phutil_split_lines($stdout);
25 foreach ($lines as $line) {
26 if (preg_match('/^\s*(\d+)/', $line, $matches)) {
27 $result[] = (int)$matches[1];
28 } else {
29 $result[] = null;
30 }
31 }
32
33 return $result;
34 }
35
36}