Page MenuHomePhabricator

D8630.id20471.diff
No OneTemporary

D8630.id20471.diff

diff --git a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_nextrequest_Method.php b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_nextrequest_Method.php
--- a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_nextrequest_Method.php
+++ b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_nextrequest_Method.php
@@ -127,27 +127,14 @@
$diff_name = $handles[$diff_phid]->getName();
}
- // Calculate the new-author information (if any)
- $new_author = null;
$new_author_phid = null;
- switch ($project->getDetail('commitWithAuthor')) {
- case ReleephProject::COMMIT_AUTHOR_NONE:
- break;
-
- case ReleephProject::COMMIT_AUTHOR_FROM_DIFF:
- if ($diff_rev) {
- $new_author_phid = $diff_rev->getAuthorPHID();
- } else {
- $pr_commit = $releeph_request->loadPhabricatorRepositoryCommit();
- if ($pr_commit) {
- $new_author_phid = $pr_commit->getAuthorPHID();
- }
- }
- break;
-
- case ReleephProject::COMMIT_AUTHOR_REQUESTOR:
- $new_author_phid = $releeph_request->getRequestUserPHID();
- break;
+ if ($diff_rev) {
+ $new_author_phid = $diff_rev->getAuthorPHID();
+ } else {
+ $pr_commit = $releeph_request->loadPhabricatorRepositoryCommit();
+ if ($pr_commit) {
+ $new_author_phid = $pr_commit->getAuthorPHID();
+ }
}
return array(
diff --git a/src/applications/releeph/controller/project/ReleephProjectEditController.php b/src/applications/releeph/controller/project/ReleephProjectEditController.php
--- a/src/applications/releeph/controller/project/ReleephProjectEditController.php
+++ b/src/applications/releeph/controller/project/ReleephProjectEditController.php
@@ -22,8 +22,6 @@
}
$pick_failure_instructions = $request->getStr('pickFailureInstructions',
$this->getReleephProject()->getDetail('pick_failure_instructions'));
- $commit_author = $request->getStr('commitWithAuthor',
- $this->getReleephProject()->getDetail('commitWithAuthor'));
$test_paths = $request->getStr('testPaths');
if ($test_paths !== null) {
$test_paths = array_filter(explode("\n", $test_paths));
@@ -72,7 +70,6 @@
->setDetail('pushers', $pusher_phids)
->setDetail('pick_failure_instructions', $pick_failure_instructions)
->setDetail('branchTemplate', $branch_template)
- ->setDetail('commitWithAuthor', $commit_author)
->setDetail('testPaths', $test_paths);
$fake_commit_handle =
@@ -188,8 +185,6 @@
->setDatasource('/typeahead/common/users/')
->setValue($pusher_handles));
- $commit_author_inset = $this->buildCommitAuthorInset($commit_author);
-
// Build the Template inset
$help_markup = PhabricatorMarkupEngine::renderOneObject(
id(new PhabricatorMarkupOneOff())->setContent($this->getBranchHelpText()),
@@ -224,7 +219,6 @@
->setUser($request->getUser())
->appendChild($basic_inset)
->appendChild($pushers_inset)
- ->appendChild($commit_author_inset)
->appendChild($template_inset);
$form
@@ -243,80 +237,6 @@
array('title' => pht('Edit Releeph Project')));
}
- private function buildCommitAuthorInset($current) {
- $vcs_type = $this->getReleephProject()
- ->loadPhabricatorRepository()
- ->getVersionControlSystem();
-
- switch ($vcs_type) {
- case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
- case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
- break;
-
- case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
- return;
- break;
- }
-
- $vcs_name = PhabricatorRepositoryType::getNameForRepositoryType($vcs_type);
-
- // pht?
- $help_markup = hsprintf(<<<EOTEXT
-When your project's release engineers run <tt>arc releeph</tt>, they will be
-listed as the <strong>committer</strong> of the code committed to release
-branches.
-
-%s allows you to specify a separate author when committing code. Some
-tools use the author of a commit (rather than the committer) when they need to
-notify someone about a build or test failure.
-
-Releeph can use one of the following to set the <strong>author</strong> of the
-commits it makes:
-EOTEXT
- , $vcs_name);
-
- $trunk = $this->getReleephProject()->getTrunkBranch();
-
- $options = array(
- array(
- 'value' => ReleephProject::COMMIT_AUTHOR_FROM_DIFF,
- 'label' => pht('Original Author'),
- 'caption' =>
- pht('The author of the original commit in: %s.', $trunk),
- ),
- array(
- 'value' => ReleephProject::COMMIT_AUTHOR_REQUESTOR,
- 'label' => pht('Requestor'),
- 'caption' =>
- pht('The person who requested that this code go into the release.'),
- ),
- array(
- 'value' => ReleephProject::COMMIT_AUTHOR_NONE,
- 'label' => pht('None'),
- 'caption' =>
- pht('Only record the default committer information.'),
- ),
- );
-
- if (!$current) {
- $current = ReleephProject::COMMIT_AUTHOR_FROM_DIFF;
- }
-
- $control = id(new AphrontFormRadioButtonControl())
- ->setLabel(pht('Author'))
- ->setName('commitWithAuthor')
- ->setValue($current);
-
- foreach ($options as $dict) {
- $control->addButton($dict['value'], $dict['label'], $dict['caption']);
- }
-
- return id(new AphrontFormInsetView())
- ->setTitle(pht('Authors'))
- ->appendChild($help_markup)
- ->appendChild($control);
- }
-
private function getBranchHelpText() {
return <<<EOTEXT
diff --git a/src/applications/releeph/storage/ReleephProject.php b/src/applications/releeph/storage/ReleephProject.php
--- a/src/applications/releeph/storage/ReleephProject.php
+++ b/src/applications/releeph/storage/ReleephProject.php
@@ -6,10 +6,6 @@
const DEFAULT_BRANCH_NAMESPACE = 'releeph-releases';
const SYSTEM_AGENT_USERNAME_PREFIX = 'releeph-agent-';
- const COMMIT_AUTHOR_NONE = 'commit-author-none';
- const COMMIT_AUTHOR_FROM_DIFF = 'commit-author-is-from-diff';
- const COMMIT_AUTHOR_REQUESTOR = 'commit-author-is-requestor';
-
protected $name;
// Specifying the place to pick from is a requirement for svn, though not

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 10, 9:59 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7367822
Default Alt Text
D8630.id20471.diff (6 KB)

Event Timeline