Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15389894
D11186.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
9 KB
Referenced Files
None
Subscribers
None
D11186.id.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -355,8 +355,11 @@
'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 @@
'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 @@
'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 @@
'DifferentialInlineCommentView' => 'AphrontView',
'DifferentialJIRAIssuesField' => 'DifferentialStoredCustomField',
'DifferentialLandingActionMenuEventListener' => 'PhabricatorEventListener',
- 'DifferentialLandingToGitHub' => 'DifferentialLandingStrategy',
- 'DifferentialLandingToHostedGit' => 'DifferentialLandingStrategy',
- 'DifferentialLandingToHostedMercurial' => 'DifferentialLandingStrategy',
'DifferentialLintField' => 'DifferentialCustomField',
'DifferentialLocalCommitsView' => 'AphrontView',
'DifferentialMail' => 'PhabricatorMail',
diff --git a/src/applications/differential/landing/DifferentialLandingToGitHub.php b/src/applications/differential/landing/DifferentialGitHubLandingStrategy.php
rename from src/applications/differential/landing/DifferentialLandingToGitHub.php
rename to src/applications/differential/landing/DifferentialGitHubLandingStrategy.php
--- a/src/applications/differential/landing/DifferentialLandingToGitHub.php
+++ b/src/applications/differential/landing/DifferentialGitHubLandingStrategy.php
@@ -1,6 +1,6 @@
<?php
-final class DifferentialLandingToGitHub
+final class DifferentialGitHubLandingStrategy
extends DifferentialLandingStrategy {
private $account;
@@ -17,15 +17,10 @@
$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 @@
}
// 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,
diff --git a/src/applications/differential/landing/DifferentialLandingToHostedGit.php b/src/applications/differential/landing/DifferentialHostedGitLandingStrategy.php
rename from src/applications/differential/landing/DifferentialLandingToHostedGit.php
rename to src/applications/differential/landing/DifferentialHostedGitLandingStrategy.php
--- a/src/applications/differential/landing/DifferentialLandingToHostedGit.php
+++ b/src/applications/differential/landing/DifferentialHostedGitLandingStrategy.php
@@ -1,6 +1,6 @@
<?php
-final class DifferentialLandingToHostedGit
+final class DifferentialHostedGitLandingStrategy
extends DifferentialLandingStrategy {
public function processLandRequest(
@@ -9,29 +9,18 @@
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 @@
$message);
}
-
public function pushWorkspaceRepository(
PhabricatorRepository $repository,
ArcanistRepositoryAPI $workspace,
diff --git a/src/applications/differential/landing/DifferentialLandingToHostedMercurial.php b/src/applications/differential/landing/DifferentialHostedMercurialLandingStrategy.php
rename from src/applications/differential/landing/DifferentialLandingToHostedMercurial.php
rename to src/applications/differential/landing/DifferentialHostedMercurialLandingStrategy.php
--- a/src/applications/differential/landing/DifferentialLandingToHostedMercurial.php
+++ b/src/applications/differential/landing/DifferentialHostedMercurialLandingStrategy.php
@@ -1,6 +1,6 @@
<?php
-final class DifferentialLandingToHostedMercurial
+final class DifferentialHostedMercurialLandingStrategy
extends DifferentialLandingStrategy {
public function processLandRequest(
@@ -13,25 +13,15 @@
$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);
}
}
diff --git a/src/applications/differential/landing/DifferentialLandingStrategy.php b/src/applications/differential/landing/DifferentialLandingStrategy.php
--- a/src/applications/differential/landing/DifferentialLandingStrategy.php
+++ b/src/applications/differential/landing/DifferentialLandingStrategy.php
@@ -62,7 +62,7 @@
*/
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);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 5:45 AM (3 w, 13 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7626397
Default Alt Text
D11186.id.diff (9 KB)
Attached To
Mode
D11186: Rename `DifferentialLandingStrategy` subclasses for consistency
Attached
Detach File
Event Timeline
Log In to Comment