From 4f26b8ffcf1b1e8b123969d8b495c2ea47c1930c Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 29 Mar 2014 09:13:45 -0700 Subject: [PATCH] Remove "Release Counter" from Releeph Summary: Fixes T3658. This field doesn't make much sense and doesn't appear to ever have actually been implemented. Particularly, the `%N` pattern doesn't actually work and I can't find anything which actually calls this stuff or exposes it externally. Facebook doesn't use it (see T3658) and I don't think it's useful in general. Test Plan: Used `grep` to look for stuff, edited a project. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T3658 Differential Revision: https://secure.phabricator.com/D8628 --- .../project/ReleephProjectEditController.php | 19 --------------- .../releeph/storage/ReleephProject.php | 23 ------------------- 2 files changed, 42 deletions(-) diff --git a/src/applications/releeph/controller/project/ReleephProjectEditController.php b/src/applications/releeph/controller/project/ReleephProjectEditController.php index 1f10d94b32..ce9fde0b61 100644 --- a/src/applications/releeph/controller/project/ReleephProjectEditController.php +++ b/src/applications/releeph/controller/project/ReleephProjectEditController.php @@ -31,10 +31,6 @@ final class ReleephProjectEditController extends ReleephProjectController { $test_paths = $this->getReleephProject()->getDetail('testPaths', array()); } - $release_counter = $request->getInt( - 'releaseCounter', - $this->getReleephProject()->getCurrentReleaseNumber()); - $arc_project_id = $this->getReleephProject()->getArcanistProjectID(); if ($request->isFormPost()) { @@ -52,10 +48,6 @@ final class ReleephProjectEditController extends ReleephProjectController { pht('You must specify which branch you will be picking from.'); } - if ($release_counter && !is_int($release_counter)) { - $errors[] = pht("Release counter must be a positive integer!"); - } - $other_releeph_projects = id(new ReleephProject()) ->loadAllWhere('id <> %d', $this->getReleephProject()->getID()); $other_releeph_project_names = mpull($other_releeph_projects, @@ -83,10 +75,6 @@ final class ReleephProjectEditController extends ReleephProjectController { ->setDetail('commitWithAuthor', $commit_author) ->setDetail('testPaths', $test_paths); - if ($release_counter) { - $project->setDetail('releaseCounter', $release_counter); - } - $fake_commit_handle = ReleephBranchTemplate::getFakeCommitHandleFor($arc_project_id); @@ -169,13 +157,6 @@ final class ReleephProjectEditController extends ReleephProjectController { ->setValue($trunk_branch) ->setName('trunkBranch') ->setError($e_trunk_branch)) - ->appendChild( - id(new AphrontFormTextControl()) - ->setLabel(pht('Release counter')) - ->setValue($release_counter) - ->setName('releaseCounter') - ->setCaption( - pht("Used by the command line branch cutter's %%N field"))) ->appendChild( id(new AphrontFormTextAreaControl()) ->setLabel(pht('Pick Instructions')) diff --git a/src/applications/releeph/storage/ReleephProject.php b/src/applications/releeph/storage/ReleephProject.php index acd2c2f788..068c6febde 100644 --- a/src/applications/releeph/storage/ReleephProject.php +++ b/src/applications/releeph/storage/ReleephProject.php @@ -68,10 +68,6 @@ final class ReleephProject extends ReleephDAO $this->name, implode(', ', $banned_names))); } - - if (!$this->getDetail('releaseCounter')) { - $this->setDetail('releaseCounter', 0); - } } public function loadArcanistProject() { @@ -120,25 +116,6 @@ final class ReleephProject extends ReleephDAO 'getRepositoryPHID'); } - public function getCurrentReleaseNumber() { - $current_release_numbers = array(); - - // From the project... - $current_release_numbers[] = $this->getDetail('releaseCounter', 0); - - // From any branches... - $branches = id(new ReleephBranch())->loadAllWhere( - 'releephProjectID = %d', $this->getID()); - if ($branches) { - $release_numbers = array(); - foreach ($branches as $branch) { - $current_release_numbers[] = $branch->getDetail('releaseNumber', 0); - } - } - - return max($current_release_numbers); - } - public function getReleephFieldSelector() { return new ReleephDefaultFieldSelector(); }