Page MenuHomePhabricator

D8767.id.diff
No OneTemporary

D8767.id.diff

diff --git a/src/applications/releeph/application/PhabricatorApplicationReleeph.php b/src/applications/releeph/application/PhabricatorApplicationReleeph.php
--- a/src/applications/releeph/application/PhabricatorApplicationReleeph.php
+++ b/src/applications/releeph/application/PhabricatorApplicationReleeph.php
@@ -58,7 +58,7 @@
'(?P<action>close|re-open)/(?P<branchID>[1-9]\d*)/' =>
'ReleephBranchAccessController',
'preview/' => 'ReleephBranchNamePreviewController',
- '(?P<branchID>[^/]+)/' => array(
+ '(?P<branchID>[1-9]\d*)/' => array(
'history/' => 'ReleephBranchHistoryController',
'(?:query/(?P<queryKey>[^/]+)/)?' => 'ReleephBranchViewController',
),
diff --git a/src/applications/releeph/controller/branch/ReleephBranchCreateController.php b/src/applications/releeph/controller/branch/ReleephBranchCreateController.php
--- a/src/applications/releeph/controller/branch/ReleephBranchCreateController.php
+++ b/src/applications/releeph/controller/branch/ReleephBranchCreateController.php
@@ -79,8 +79,10 @@
$branch_date,
$symbolic_name);
+ $branch_uri = $this->getApplicationURI('branch/'.$branch->getID());
+
return id(new AphrontRedirectResponse())
- ->setURI($branch->getURI());
+ ->setURI($branch_uri);
}
}
diff --git a/src/applications/releeph/controller/branch/ReleephBranchViewController.php b/src/applications/releeph/controller/branch/ReleephBranchViewController.php
--- a/src/applications/releeph/controller/branch/ReleephBranchViewController.php
+++ b/src/applications/releeph/controller/branch/ReleephBranchViewController.php
@@ -86,13 +86,15 @@
$crumbs = parent::buildApplicationCrumbs();
$branch = $this->getBranch();
-
- $crumbs->addAction(
- id(new PHUIListItemView())
- ->setHref($this->getApplicationURI('branch/pull/'.$branch->getID().'/'))
- ->setName(pht('New Pull Request'))
- ->setIcon('create')
- ->setDisabled(!$branch->isActive()));
+ if ($branch) {
+ $pull_uri = $this->getApplicationURI('branch/pull/'.$branch->getID().'/');
+ $crumbs->addAction(
+ id(new PHUIListItemView())
+ ->setHref($pull_uri)
+ ->setName(pht('New Pull Request'))
+ ->setIcon('create')
+ ->setDisabled(!$branch->isActive()));
+ }
return $crumbs;
}
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
@@ -53,19 +53,6 @@
return $this;
}
- public function willSaveObject() {
- // Do this first, to generate the PHID
- parent::willSaveObject();
-
- $banned_names = $this->getBannedNames();
- if (in_array($this->name, $banned_names)) {
- throw new Exception(sprintf(
- "The name '%s' is in the list of banned project names!",
- $this->name,
- implode(', ', $banned_names)));
- }
- }
-
public function loadArcanistProject() {
return $this->loadOneRelative(
new PhabricatorRepositoryArcanistProject(),
@@ -116,12 +103,6 @@
return new ReleephDefaultFieldSelector();
}
- private function getBannedNames() {
- return array(
- 'branch', // no one's tried this... yet!
- );
- }
-
public function isTestFile($filename) {
$test_paths = $this->getDetail('testPaths', array());

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 19, 7:15 AM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7221638
Default Alt Text
D8767.id.diff (3 KB)

Event Timeline