4 * Execute and parse a low-level Mercurial paths query using `hg locate`.
6 final class DiffusionLowLevelMercurialPathsQuery
7 extends DiffusionLowLevelQuery
{
12 public function withCommit($commit) {
13 $this->commit
= $commit;
17 public function withPath($path) {
22 protected function executeQuery() {
23 $repository = $this->getRepository();
25 $commit = $this->commit
;
27 $has_files = PhutilBinaryAnalyzer
::getForBinary('hg')
28 ->isMercurialFilesCommandAvailable();
30 $hg_paths_command = 'files --print0 --rev %s -I %s';
32 $hg_paths_command = 'locate --print0 --rev %s -I %s';
36 $match_against = trim($path, '/');
37 $prefix = trim('./'.$match_against, '/');
41 list($entire_manifest) = $repository->execxLocalCommand(
43 hgsprintf('%s', $commit),
45 return explode("\0", $entire_manifest);