@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Unban releeph product name "branch"

Summary:
Fixes T3657. We no longer construct ambiguous URIs, so product names are no longer restricted.

Also fix some minor URI construction stuff.

Test Plan: Created a product called "branch".

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T3657

Differential Revision: https://secure.phabricator.com/D8767

+13 -28
+1 -1
src/applications/releeph/application/PhabricatorApplicationReleeph.php
··· 58 58 '(?P<action>close|re-open)/(?P<branchID>[1-9]\d*)/' => 59 59 'ReleephBranchAccessController', 60 60 'preview/' => 'ReleephBranchNamePreviewController', 61 - '(?P<branchID>[^/]+)/' => array( 61 + '(?P<branchID>[1-9]\d*)/' => array( 62 62 'history/' => 'ReleephBranchHistoryController', 63 63 '(?:query/(?P<queryKey>[^/]+)/)?' => 'ReleephBranchViewController', 64 64 ),
+3 -1
src/applications/releeph/controller/branch/ReleephBranchCreateController.php
··· 79 79 $branch_date, 80 80 $symbolic_name); 81 81 82 + $branch_uri = $this->getApplicationURI('branch/'.$branch->getID()); 83 + 82 84 return id(new AphrontRedirectResponse()) 83 - ->setURI($branch->getURI()); 85 + ->setURI($branch_uri); 84 86 } 85 87 } 86 88
+9 -7
src/applications/releeph/controller/branch/ReleephBranchViewController.php
··· 86 86 $crumbs = parent::buildApplicationCrumbs(); 87 87 88 88 $branch = $this->getBranch(); 89 - 90 - $crumbs->addAction( 91 - id(new PHUIListItemView()) 92 - ->setHref($this->getApplicationURI('branch/pull/'.$branch->getID().'/')) 93 - ->setName(pht('New Pull Request')) 94 - ->setIcon('create') 95 - ->setDisabled(!$branch->isActive())); 89 + if ($branch) { 90 + $pull_uri = $this->getApplicationURI('branch/pull/'.$branch->getID().'/'); 91 + $crumbs->addAction( 92 + id(new PHUIListItemView()) 93 + ->setHref($pull_uri) 94 + ->setName(pht('New Pull Request')) 95 + ->setIcon('create') 96 + ->setDisabled(!$branch->isActive())); 97 + } 96 98 97 99 return $crumbs; 98 100 }
-19
src/applications/releeph/storage/ReleephProject.php
··· 53 53 return $this; 54 54 } 55 55 56 - public function willSaveObject() { 57 - // Do this first, to generate the PHID 58 - parent::willSaveObject(); 59 - 60 - $banned_names = $this->getBannedNames(); 61 - if (in_array($this->name, $banned_names)) { 62 - throw new Exception(sprintf( 63 - "The name '%s' is in the list of banned project names!", 64 - $this->name, 65 - implode(', ', $banned_names))); 66 - } 67 - } 68 - 69 56 public function loadArcanistProject() { 70 57 return $this->loadOneRelative( 71 58 new PhabricatorRepositoryArcanistProject(), ··· 114 101 115 102 public function getReleephFieldSelector() { 116 103 return new ReleephDefaultFieldSelector(); 117 - } 118 - 119 - private function getBannedNames() { 120 - return array( 121 - 'branch', // no one's tried this... yet! 122 - ); 123 104 } 124 105 125 106 public function isTestFile($filename) {