Differential D14813 Diff 35813 src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
Show First 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | if ($err && $repository->canDestroyWorkingCopy()) { | ||||
throw new Exception($message); | throw new Exception($message); | ||||
} | } | ||||
$retry = false; | $retry = false; | ||||
do { | do { | ||||
// This is a local command, but needs credentials. | // This is a local command, but needs credentials. | ||||
if ($repository->isWorkingCopyBare()) { | if ($repository->isWorkingCopyBare()) { | ||||
// For bare working copies, we need this magic incantation. | // For bare working copies, we need this magic incantation. | ||||
$future = $repository->getRemoteCommandFuture( | $future = $repository->getRemoteCommandFuture( | ||||
paladox: @epriestley
If I was to do something like
$future = $repository->getRemoteCommandFuture… | |||||
'fetch origin %s --prune', | 'fetch origin %s --prune', | ||||
'+refs/heads/*:refs/heads/*'); | '+refs/heads/*:refs/heads/*', | ||||
'+refs/changes/*:refs/changes/*', | |||||
'+refs/meta/*:refs/meta/*' | |||||
); | |||||
} else { | } else { | ||||
$future = $repository->getRemoteCommandFuture( | $future = $repository->getRemoteCommandFuture( | ||||
'fetch --all --prune'); | 'fetch --all --prune'); | ||||
} | } | ||||
$future->setCWD($path); | $future->setCWD($path); | ||||
list($err, $stdout, $stderr) = $future->resolve(); | list($err, $stdout, $stderr) = $future->resolve(); | ||||
▲ Show 20 Lines • Show All 235 Lines • Show Last 20 Lines |
@epriestley
If I was to do something like
$future = $repository->getRemoteCommandFuture(
'fetch origin %s --prune',
'+refs/heads/*:refs/heads/*',
require_once DIR . '../../../../ref_config_settings.php';
);
Would that work. And are the files above related to what I am trying to do.
I am trying to when phabricator is used as viewing a repo that is not in phabricator and is located for example on gerrit and you pull it from there it only does the changes that are on refs/heads not refs/changes even though that ref is for refs that have not been merged it is useful for example on Wikimedia phabricator which lets you see the changes before they are merged.
The ref_config_settings.php' file would look like this for example
'+refs/changes/*:refs/changes/*',
and would allow us to not hard code refs that aren't used by phabricator but other repos.