mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +01:00
Rename DifferentialLandingStrategy
subclasses for consistency
Summary: Ref T5655. Test Plan: `grep` Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: avivey, Korvin, epriestley Maniphest Tasks: T5655 Differential Revision: https://secure.phabricator.com/D11186
This commit is contained in:
parent
97cd8c1c75
commit
3c64cb4d0a
5 changed files with 23 additions and 52 deletions
|
@ -355,8 +355,11 @@ phutil_register_library_map(array(
|
|||
'DifferentialGetRevisionCommentsConduitAPIMethod' => 'applications/differential/conduit/DifferentialGetRevisionCommentsConduitAPIMethod.php',
|
||||
'DifferentialGetRevisionConduitAPIMethod' => 'applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php',
|
||||
'DifferentialGetWorkingCopy' => 'applications/differential/DifferentialGetWorkingCopy.php',
|
||||
'DifferentialGitHubLandingStrategy' => 'applications/differential/landing/DifferentialGitHubLandingStrategy.php',
|
||||
'DifferentialGitSVNIDField' => 'applications/differential/customfield/DifferentialGitSVNIDField.php',
|
||||
'DifferentialHostField' => 'applications/differential/customfield/DifferentialHostField.php',
|
||||
'DifferentialHostedGitLandingStrategy' => 'applications/differential/landing/DifferentialHostedGitLandingStrategy.php',
|
||||
'DifferentialHostedMercurialLandingStrategy' => 'applications/differential/landing/DifferentialHostedMercurialLandingStrategy.php',
|
||||
'DifferentialHovercardEventListener' => 'applications/differential/event/DifferentialHovercardEventListener.php',
|
||||
'DifferentialHunk' => 'applications/differential/storage/DifferentialHunk.php',
|
||||
'DifferentialHunkLegacy' => 'applications/differential/storage/DifferentialHunkLegacy.php',
|
||||
|
@ -374,9 +377,6 @@ phutil_register_library_map(array(
|
|||
'DifferentialJIRAIssuesField' => 'applications/differential/customfield/DifferentialJIRAIssuesField.php',
|
||||
'DifferentialLandingActionMenuEventListener' => 'applications/differential/landing/DifferentialLandingActionMenuEventListener.php',
|
||||
'DifferentialLandingStrategy' => 'applications/differential/landing/DifferentialLandingStrategy.php',
|
||||
'DifferentialLandingToGitHub' => 'applications/differential/landing/DifferentialLandingToGitHub.php',
|
||||
'DifferentialLandingToHostedGit' => 'applications/differential/landing/DifferentialLandingToHostedGit.php',
|
||||
'DifferentialLandingToHostedMercurial' => 'applications/differential/landing/DifferentialLandingToHostedMercurial.php',
|
||||
'DifferentialLintField' => 'applications/differential/customfield/DifferentialLintField.php',
|
||||
'DifferentialLintStatus' => 'applications/differential/constants/DifferentialLintStatus.php',
|
||||
'DifferentialLocalCommitsView' => 'applications/differential/view/DifferentialLocalCommitsView.php',
|
||||
|
@ -3414,8 +3414,11 @@ phutil_register_library_map(array(
|
|||
'DifferentialGetRawDiffConduitAPIMethod' => 'DifferentialConduitAPIMethod',
|
||||
'DifferentialGetRevisionCommentsConduitAPIMethod' => 'DifferentialConduitAPIMethod',
|
||||
'DifferentialGetRevisionConduitAPIMethod' => 'DifferentialConduitAPIMethod',
|
||||
'DifferentialGitHubLandingStrategy' => 'DifferentialLandingStrategy',
|
||||
'DifferentialGitSVNIDField' => 'DifferentialCustomField',
|
||||
'DifferentialHostField' => 'DifferentialCustomField',
|
||||
'DifferentialHostedGitLandingStrategy' => 'DifferentialLandingStrategy',
|
||||
'DifferentialHostedMercurialLandingStrategy' => 'DifferentialLandingStrategy',
|
||||
'DifferentialHovercardEventListener' => 'PhabricatorEventListener',
|
||||
'DifferentialHunk' => array(
|
||||
'DifferentialDAO',
|
||||
|
@ -3434,9 +3437,6 @@ phutil_register_library_map(array(
|
|||
'DifferentialInlineCommentView' => 'AphrontView',
|
||||
'DifferentialJIRAIssuesField' => 'DifferentialStoredCustomField',
|
||||
'DifferentialLandingActionMenuEventListener' => 'PhabricatorEventListener',
|
||||
'DifferentialLandingToGitHub' => 'DifferentialLandingStrategy',
|
||||
'DifferentialLandingToHostedGit' => 'DifferentialLandingStrategy',
|
||||
'DifferentialLandingToHostedMercurial' => 'DifferentialLandingStrategy',
|
||||
'DifferentialLintField' => 'DifferentialCustomField',
|
||||
'DifferentialLocalCommitsView' => 'AphrontView',
|
||||
'DifferentialMail' => 'PhabricatorMail',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
final class DifferentialLandingToGitHub
|
||||
final class DifferentialGitHubLandingStrategy
|
||||
extends DifferentialLandingStrategy {
|
||||
|
||||
private $account;
|
||||
|
@ -17,15 +17,10 @@ final class DifferentialLandingToGitHub
|
|||
$workspace = $this->getGitWorkspace($repository);
|
||||
|
||||
try {
|
||||
id(new DifferentialLandingToHostedGit())
|
||||
->commitRevisionToWorkspace(
|
||||
$revision,
|
||||
$workspace,
|
||||
$viewer);
|
||||
id(new DifferentialHostedGitLandingStrategy())
|
||||
->commitRevisionToWorkspace($revision, $workspace, $viewer);
|
||||
} catch (Exception $e) {
|
||||
throw new PhutilProxyException(
|
||||
'Failed to commit patch',
|
||||
$e);
|
||||
throw new PhutilProxyException('Failed to commit patch', $e);
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -38,14 +33,12 @@ final class DifferentialLandingToGitHub
|
|||
}
|
||||
|
||||
// Else, throw what git said.
|
||||
throw new PhutilProxyException(
|
||||
'Failed to push changes upstream',
|
||||
$e);
|
||||
throw new PhutilProxyException('Failed to push changes upstream', $e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* returns PhabricatorActionView or an array of PhabricatorActionView or null.
|
||||
* Returns PhabricatorActionView or an array of PhabricatorActionView or null.
|
||||
*/
|
||||
public function createMenuItem(
|
||||
PhabricatorUser $viewer,
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
final class DifferentialLandingToHostedGit
|
||||
final class DifferentialHostedGitLandingStrategy
|
||||
extends DifferentialLandingStrategy {
|
||||
|
||||
public function processLandRequest(
|
||||
|
@ -9,29 +9,18 @@ final class DifferentialLandingToHostedGit
|
|||
PhabricatorRepository $repository) {
|
||||
|
||||
$viewer = $request->getUser();
|
||||
|
||||
$workspace = $this->getGitWorkspace($repository);
|
||||
|
||||
try {
|
||||
$this->commitRevisionToWorkspace(
|
||||
$revision,
|
||||
$workspace,
|
||||
$viewer);
|
||||
$this->commitRevisionToWorkspace($revision, $workspace, $viewer);
|
||||
} catch (Exception $e) {
|
||||
throw new PhutilProxyException(
|
||||
'Failed to commit patch',
|
||||
$e);
|
||||
throw new PhutilProxyException('Failed to commit patch', $e);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->pushWorkspaceRepository(
|
||||
$repository,
|
||||
$workspace,
|
||||
$viewer);
|
||||
$this->pushWorkspaceRepository($repository, $workspace, $viewer);
|
||||
} catch (Exception $e) {
|
||||
throw new PhutilProxyException(
|
||||
'Failed to push changes upstream',
|
||||
$e);
|
||||
throw new PhutilProxyException('Failed to push changes upstream', $e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +85,6 @@ final class DifferentialLandingToHostedGit
|
|||
$message);
|
||||
}
|
||||
|
||||
|
||||
public function pushWorkspaceRepository(
|
||||
PhabricatorRepository $repository,
|
||||
ArcanistRepositoryAPI $workspace,
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
final class DifferentialLandingToHostedMercurial
|
||||
final class DifferentialHostedMercurialLandingStrategy
|
||||
extends DifferentialLandingStrategy {
|
||||
|
||||
public function processLandRequest(
|
||||
|
@ -13,25 +13,15 @@ final class DifferentialLandingToHostedMercurial
|
|||
$workspace = $this->getMercurialWorkspace($repository);
|
||||
|
||||
try {
|
||||
$this->commitRevisionToWorkspace(
|
||||
$revision,
|
||||
$workspace,
|
||||
$viewer);
|
||||
$this->commitRevisionToWorkspace($revision, $workspace, $viewer);
|
||||
} catch (Exception $e) {
|
||||
throw new PhutilProxyException(
|
||||
'Failed to commit patch',
|
||||
$e);
|
||||
throw new PhutilProxyException('Failed to commit patch', $e);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->pushWorkspaceRepository(
|
||||
$repository,
|
||||
$workspace,
|
||||
$viewer);
|
||||
$this->pushWorkspaceRepository($repository, $workspace, $viewer);
|
||||
} catch (Exception $e) {
|
||||
throw new PhutilProxyException(
|
||||
'Failed to push changes upstream',
|
||||
$e);
|
||||
throw new PhutilProxyException('Failed to push changes upstream', $e);
|
||||
}
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ abstract class DifferentialLandingStrategy {
|
|||
*/
|
||||
protected function getGitWorkspace(PhabricatorRepository $repository) {
|
||||
try {
|
||||
return DifferentialGetWorkingCopy::getCleanGitWorkspace($repository);
|
||||
return DifferentialGetWorkingCopy::getCleanGitWorkspace($repository);
|
||||
} catch (Exception $e) {
|
||||
throw new PhutilProxyException('Failed to allocate a workspace', $e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue