@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.

Remove horrible old repository edit controller

Summary:
Ref T2231. I didn't port these options over, so they're still supported but have no edit UI:

- Pull Frequency (confusing/not useful, I think?)
- Default Owners Path (probably used only by Facebook and only in the E repository)
- Show user in public repository URL (probably mostly obsolete with hosting?)

We can add those back if users notice, but they seem like the three least useful options so I'm going to see if we can get away with removing them.

Test Plan: Clicked "Edit" from Repositories, got kicked into the nice new Diffusion edit UI instead of the old one.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2231

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

+1 -699
-2
src/applications/repository/application/PhabricatorApplicationRepositories.php
··· 30 30 '/repository/' => array( 31 31 '' => 'PhabricatorRepositoryListController', 32 32 'create/' => 'PhabricatorRepositoryCreateController', 33 - 'edit/(?P<id>[1-9]\d*)/(?:(?P<view>\w+)/)?' => 34 - 'PhabricatorRepositoryEditController', 35 33 'delete/(?P<id>[1-9]\d*)/' => 'PhabricatorRepositoryDeleteController', 36 34 'project/edit/(?P<id>[1-9]\d*)/' => 37 35 'PhabricatorRepositoryArcanistProjectEditController',
-696
src/applications/repository/controller/PhabricatorRepositoryEditController.php
··· 1 - <?php 2 - 3 - final class PhabricatorRepositoryEditController 4 - extends PhabricatorRepositoryController { 5 - 6 - private $id; 7 - private $view; 8 - private $repository; 9 - private $sideNav; 10 - 11 - public function willProcessRequest(array $data) { 12 - $this->id = $data['id']; 13 - $this->view = idx($data, 'view'); 14 - } 15 - 16 - public function processRequest() { 17 - 18 - $request = $this->getRequest(); 19 - $viewer = $request->getUser(); 20 - 21 - $repository = id(new PhabricatorRepositoryQuery()) 22 - ->setViewer($viewer) 23 - ->withIDs(array($this->id)) 24 - ->executeOne(); 25 - if (!$repository) { 26 - return new Aphront404Response(); 27 - } 28 - 29 - $views = array( 30 - 'basic' => 'Basics', 31 - 'tracking' => 'Tracking', 32 - ); 33 - 34 - $this->repository = $repository; 35 - 36 - if (!isset($views[$this->view])) { 37 - $this->view = head_key($views); 38 - } 39 - 40 - $nav = new AphrontSideNavFilterView(); 41 - $base_uri = new PhutilURI('/repository/edit/'.$repository->getID().'/'); 42 - $nav->setBaseURI($base_uri); 43 - foreach ($views as $view => $name) { 44 - $nav->addFilter($view, $name); 45 - } 46 - $nav->selectFilter($this->view, null); 47 - 48 - $nav->appendChild($this->renderDaemonNotice()); 49 - 50 - $this->sideNav = $nav; 51 - 52 - switch ($this->view) { 53 - case 'basic': 54 - return $this->processBasicRequest(); 55 - case 'tracking': 56 - return $this->processTrackingRequest(); 57 - default: 58 - throw new Exception("Unknown view."); 59 - } 60 - } 61 - 62 - protected function processBasicRequest() { 63 - $request = $this->getRequest(); 64 - $user = $request->getUser(); 65 - $repository = $this->repository; 66 - $repository_id = $repository->getID(); 67 - 68 - $errors = array(); 69 - 70 - $e_name = true; 71 - 72 - if ($request->isFormPost()) { 73 - $repository->setName($request->getStr('name')); 74 - 75 - if (!strlen($repository->getName())) { 76 - $e_name = 'Required'; 77 - $errors[] = 'Repository name is required.'; 78 - } else { 79 - $e_name = null; 80 - } 81 - 82 - $repository->setDetail('description', $request->getStr('description')); 83 - $repository->setDetail('encoding', $request->getStr('encoding')); 84 - 85 - if (!$errors) { 86 - $repository->save(); 87 - return id(new AphrontRedirectResponse()) 88 - ->setURI('/repository/edit/'.$repository_id.'/basic/?saved=true'); 89 - } 90 - } 91 - 92 - $error_view = null; 93 - if ($errors) { 94 - $error_view = new AphrontErrorView(); 95 - $error_view->setErrors($errors); 96 - $error_view->setTitle('Form Errors'); 97 - } else if ($request->getStr('saved')) { 98 - $error_view = new AphrontErrorView(); 99 - $error_view->setSeverity(AphrontErrorView::SEVERITY_NOTICE); 100 - $error_view->setTitle('Changes Saved'); 101 - $error_view->appendChild('Repository changes were saved.'); 102 - } 103 - 104 - $encoding_doc_link = PhabricatorEnv::getDoclink( 105 - 'article/User_Guide_UTF-8_and_Character_Encoding.html'); 106 - 107 - $form = new AphrontFormView(); 108 - $form 109 - ->setUser($user) 110 - ->setAction('/repository/edit/'.$repository->getID().'/') 111 - ->appendChild( 112 - id(new AphrontFormTextControl()) 113 - ->setLabel('Name') 114 - ->setName('name') 115 - ->setValue($repository->getName()) 116 - ->setError($e_name) 117 - ->setCaption('Human-readable repository name.')) 118 - ->appendChild( 119 - id(new AphrontFormTextAreaControl()) 120 - ->setLabel('Description') 121 - ->setName('description') 122 - ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_SHORT) 123 - ->setValue($repository->getDetail('description'))) 124 - ->appendChild( 125 - id(new AphrontFormStaticControl()) 126 - ->setLabel('Callsign') 127 - ->setName('callsign') 128 - ->setValue($repository->getCallsign())) 129 - ->appendChild(hsprintf(' 130 - <p class="aphront-form-instructions">'. 131 - 'If source code in this repository uses a character '. 132 - 'encoding other than UTF-8 (for example, ISO-8859-1), '. 133 - 'specify it here. You can usually leave this field blank. '. 134 - 'See User Guide: '. 135 - '<a href="%s">UTF-8 and Character Encoding</a> for more information.'. 136 - '</p>', 137 - $encoding_doc_link)) 138 - ->appendChild( 139 - id(new AphrontFormTextControl()) 140 - ->setLabel('Encoding') 141 - ->setName('encoding') 142 - ->setValue($repository->getDetail('encoding'))) 143 - ->appendChild( 144 - id(new AphrontFormStaticControl()) 145 - ->setLabel('Type') 146 - ->setName('type') 147 - ->setValue($repository->getVersionControlSystem())) 148 - ->appendChild( 149 - id(new AphrontFormStaticControl()) 150 - ->setLabel('ID') 151 - ->setValue($repository->getID())) 152 - ->appendChild( 153 - id(new AphrontFormStaticControl()) 154 - ->setLabel('PHID') 155 - ->setValue($repository->getPHID())) 156 - ->appendChild( 157 - id(new AphrontFormSubmitControl()) 158 - ->setValue('Save')); 159 - 160 - $nav = $this->sideNav; 161 - 162 - $form_box = id(new PHUIObjectBoxView()) 163 - ->setHeaderText(pht('Edit Repository')) 164 - ->setFormError($error_view) 165 - ->setForm($form); 166 - 167 - $nav->appendChild($form_box); 168 - 169 - return $this->buildApplicationPage( 170 - $nav, 171 - array( 172 - 'title' => pht('Edit Repository'), 173 - 'device' => true, 174 - )); 175 - } 176 - 177 - private function processTrackingRequest() { 178 - $request = $this->getRequest(); 179 - $user = $request->getUser(); 180 - $repository = $this->repository; 181 - $repository_id = $repository->getID(); 182 - 183 - $errors = array(); 184 - 185 - $e_uri = null; 186 - $e_path = null; 187 - 188 - $is_git = false; 189 - $is_svn = false; 190 - $is_mercurial = false; 191 - 192 - $e_ssh_key = null; 193 - $e_ssh_keyfile = null; 194 - $e_branch = null; 195 - 196 - switch ($repository->getVersionControlSystem()) { 197 - case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 198 - $is_git = true; 199 - break; 200 - case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 201 - $is_svn = true; 202 - break; 203 - case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: 204 - $is_mercurial = true; 205 - break; 206 - default: 207 - throw new Exception("Unsupported VCS!"); 208 - } 209 - 210 - $has_branches = ($is_git || $is_mercurial); 211 - $has_local = ($is_git || $is_mercurial); 212 - $has_branch_filter = ($is_git); 213 - $has_auth_support = $is_svn; 214 - 215 - if ($request->isFormPost()) { 216 - $tracking = ($request->getStr('tracking') == 'enabled' ? true : false); 217 - $repository->setDetail('tracking-enabled', $tracking); 218 - $repository->setDetail('remote-uri', $request->getStr('uri')); 219 - if ($has_local) { 220 - $repository->setDetail('local-path', $request->getStr('path')); 221 - } 222 - 223 - if ($has_branch_filter) { 224 - $branch_filter = $request->getStrList('branch-filter'); 225 - $branch_filter = array_fill_keys($branch_filter, true); 226 - 227 - $repository->setDetail('branch-filter', $branch_filter); 228 - 229 - $close_commits_filter = $request->getStrList('close-commits-filter'); 230 - $close_commits_filter = array_fill_keys($close_commits_filter, true); 231 - 232 - $repository->setDetail('close-commits-filter', $close_commits_filter); 233 - } 234 - 235 - $repository->setDetail( 236 - 'disable-autoclose', 237 - $request->getStr('autoclose') == 'disabled' ? true : false); 238 - 239 - $repository->setDetail( 240 - 'pull-frequency', 241 - max(1, $request->getInt('frequency'))); 242 - 243 - if ($has_branches) { 244 - $repository->setDetail( 245 - 'default-branch', 246 - $request->getStr('default-branch')); 247 - if ($is_git) { 248 - $branch_name = $repository->getDetail('default-branch'); 249 - if (strpos($branch_name, '/') !== false) { 250 - $e_branch = 'Invalid'; 251 - $errors[] = "Your branch name should not specify an explicit ". 252 - "remote. For instance, use 'master', not ". 253 - "'origin/master'."; 254 - } 255 - } 256 - } 257 - 258 - $repository->setDetail( 259 - 'default-owners-path', 260 - $request->getStr( 261 - 'default-owners-path', 262 - '/')); 263 - 264 - $repository->setDetail('ssh-login', $request->getStr('ssh-login')); 265 - $repository->setDetail('ssh-key', $request->getStr('ssh-key')); 266 - $repository->setDetail('ssh-keyfile', $request->getStr('ssh-keyfile')); 267 - 268 - $repository->setDetail('http-login', $request->getStr('http-login')); 269 - $repository->setDetail('http-pass', $request->getStr('http-pass')); 270 - 271 - $repository->setDetail('show-user', $request->getInt('show-user')); 272 - 273 - if ($repository->getDetail('ssh-key') && 274 - $repository->getDetail('ssh-keyfile')) { 275 - $errors[] = 276 - "Specify only one of 'SSH Private Key' and 'SSH Private Key File', ". 277 - "not both."; 278 - $e_ssh_key = 'Choose Only One'; 279 - $e_ssh_keyfile = 'Choose Only One'; 280 - } 281 - 282 - $repository->setDetail( 283 - 'herald-disabled', 284 - $request->getInt('herald-disabled', 0)); 285 - 286 - if ($is_svn) { 287 - $repository->setUUID($request->getStr('uuid')); 288 - $subpath = ltrim($request->getStr('svn-subpath'), '/'); 289 - if ($subpath) { 290 - $subpath = rtrim($subpath, '/').'/'; 291 - } 292 - $repository->setDetail('svn-subpath', $subpath); 293 - } 294 - 295 - if ($tracking) { 296 - if (!$repository->getDetail('remote-uri')) { 297 - $e_uri = 'Required'; 298 - $errors[] = "Repository URI is required."; 299 - } else if ($is_svn && 300 - !preg_match('@/$@', $repository->getDetail('remote-uri'))) { 301 - 302 - $e_uri = 'Invalid'; 303 - $errors[] = 'Subversion Repository Root must end in a slash ("/").'; 304 - } else { 305 - $e_uri = null; 306 - } 307 - 308 - if ($has_local) { 309 - if (!$repository->getDetail('local-path')) { 310 - $e_path = 'Required'; 311 - $errors[] = "Local path is required."; 312 - } else { 313 - $e_path = null; 314 - } 315 - } 316 - } 317 - 318 - if (!$errors) { 319 - $repository->save(); 320 - return id(new AphrontRedirectResponse()) 321 - ->setURI('/repository/edit/'.$repository_id.'/tracking/?saved=true'); 322 - } 323 - } 324 - 325 - $error_view = null; 326 - if ($errors) { 327 - $error_view = new AphrontErrorView(); 328 - $error_view->setErrors($errors); 329 - $error_view->setTitle('Form Errors'); 330 - } else if ($request->getStr('saved')) { 331 - $error_view = new AphrontErrorView(); 332 - $error_view->setSeverity(AphrontErrorView::SEVERITY_NOTICE); 333 - $error_view->setTitle('Changes Saved'); 334 - $error_view->appendChild('Tracking changes were saved.'); 335 - } else if (!$repository->isTracked()) { 336 - $error_view = new AphrontErrorView(); 337 - $error_view->setSeverity(AphrontErrorView::SEVERITY_WARNING); 338 - $error_view->setTitle('Repository Not Tracked'); 339 - $error_view->appendChild( 340 - 'Tracking is currently "Disabled" for this repository, so it will '. 341 - 'not be imported into Phabricator. You can enable it below.'); 342 - } 343 - 344 - switch ($repository->getVersionControlSystem()) { 345 - case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 346 - $is_git = true; 347 - break; 348 - case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 349 - $is_svn = true; 350 - break; 351 - } 352 - 353 - $doc_href = PhabricatorEnv::getDoclink('article/Diffusion_User_Guide.html'); 354 - $user_guide_link = phutil_tag( 355 - 'a', 356 - array( 357 - 'href' => $doc_href, 358 - ), 359 - 'Diffusion User Guide'); 360 - 361 - $form = new AphrontFormView(); 362 - $form 363 - ->setUser($user) 364 - ->setAction('/repository/edit/'.$repository->getID().'/tracking/') 365 - ->appendChild(hsprintf( 366 - '<p class="aphront-form-instructions">Phabricator can track '. 367 - 'repositories, importing commits as they happen and notifying '. 368 - 'Differential, Diffusion, Herald, and other services. To enable '. 369 - 'tracking for a repository, configure it here and then start (or '. 370 - 'restart) the daemons. More information is available in the '. 371 - '<strong>%s</strong>.</p>', 372 - $user_guide_link)); 373 - 374 - $form 375 - ->appendChild( 376 - id(new AphrontFormInsetView()) 377 - ->setTitle('Basics') 378 - ->appendChild(id(new AphrontFormStaticControl()) 379 - ->setLabel('Repository Name') 380 - ->setValue($repository->getName())) 381 - ->appendChild(id(new AphrontFormSelectControl()) 382 - ->setName('tracking') 383 - ->setLabel('Tracking') 384 - ->setOptions(array( 385 - 'disabled' => 'Disabled', 386 - 'enabled' => 'Enabled', 387 - )) 388 - ->setValue( 389 - $repository->isTracked() 390 - ? 'enabled' 391 - : 'disabled'))); 392 - 393 - $inset = new AphrontFormInsetView(); 394 - $inset->setTitle('Remote URI'); 395 - 396 - $clone_command = null; 397 - $fetch_command = null; 398 - if ($is_git) { 399 - $clone_command = 'git clone'; 400 - $fetch_command = 'git fetch'; 401 - } else if ($is_mercurial) { 402 - $clone_command = 'hg clone'; 403 - $fetch_command = 'hg pull'; 404 - } 405 - 406 - $uri_label = 'Repository URI'; 407 - if ($has_local) { 408 - if ($is_git) { 409 - $instructions = hsprintf( 410 - 'Enter the URI to clone this repository from. It should look like '. 411 - '<tt>git@github.com:example/example.git</tt>, '. 412 - '<tt>ssh://user@host.com/git/example.git</tt>, or '. 413 - '<tt>file:///local/path/to/repo</tt>'); 414 - } else if ($is_mercurial) { 415 - $instructions = hsprintf( 416 - 'Enter the URI to clone this repository from. It should look '. 417 - 'something like <tt>ssh://user@host.com/hg/example</tt>'); 418 - } 419 - $inset->appendChild(hsprintf( 420 - '<p class="aphront-form-instructions">%s</p>', 421 - $instructions)); 422 - } else if ($is_svn) { 423 - $instructions = hsprintf( 424 - 'Enter the <strong>Repository Root</strong> for this SVN repository. '. 425 - 'You can figure this out by running <tt>svn info</tt> and looking at '. 426 - 'the value in the <tt>Repository Root</tt> field. It should be a URI '. 427 - 'and look like <tt>http://svn.example.org/svn/</tt>, '. 428 - '<tt>svn+ssh://svn.example.com/svnroot/</tt>, or '. 429 - '<tt>svn://svn.example.net/svn/</tt>'); 430 - $inset->appendChild(hsprintf( 431 - '<p class="aphront-form-instructions">%s</p>', 432 - $instructions)); 433 - $uri_label = 'Repository Root'; 434 - } 435 - 436 - $inset 437 - ->appendChild( 438 - id(new AphrontFormTextControl()) 439 - ->setName('uri') 440 - ->setLabel($uri_label) 441 - ->setID('remote-uri') 442 - ->setValue($repository->getDetail('remote-uri')) 443 - ->setError($e_uri)); 444 - 445 - $inset->appendChild( 446 - id(new AphrontFormCheckboxControl()) 447 - ->addCheckbox( 448 - 'show-user', 449 - 1, 450 - pht('Permit users to view the username of this connection.'), 451 - $repository->getDetail('show-user') == 1)); 452 - 453 - $inset->appendChild(hsprintf( 454 - '<div class="aphront-form-instructions">'. 455 - 'If you want to connect to this repository over SSH, enter the '. 456 - 'username and private key to use. You can leave these fields blank if '. 457 - 'the repository does not use SSH.'. 458 - '</div>')); 459 - 460 - $inset 461 - ->appendChild( 462 - id(new AphrontFormTextControl()) 463 - ->setName('ssh-login') 464 - ->setLabel('SSH User') 465 - ->setValue($repository->getDetail('ssh-login'))) 466 - ->appendChild( 467 - id(new AphrontFormTextAreaControl()) 468 - ->setName('ssh-key') 469 - ->setLabel('SSH Private Key') 470 - ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_SHORT) 471 - ->setValue($repository->getDetail('ssh-key')) 472 - ->setError($e_ssh_key) 473 - ->setCaption( 474 - hsprintf('Specify the entire private key, <em>or</em>...'))) 475 - ->appendChild( 476 - id(new AphrontFormTextControl()) 477 - ->setName('ssh-keyfile') 478 - ->setLabel('SSH Private Key File') 479 - ->setValue($repository->getDetail('ssh-keyfile')) 480 - ->setError($e_ssh_keyfile) 481 - ->setCaption( 482 - '...specify a path on disk where the daemon should '. 483 - 'look for a private key.')); 484 - 485 - if ($has_auth_support) { 486 - $inset 487 - ->appendChild(hsprintf( 488 - '<div class="aphront-form-instructions">'. 489 - 'If you want to connect to this repository with a username and '. 490 - 'password, such as over HTTP Basic Auth or SVN with SASL, '. 491 - 'enter the username and password to use. You can leave these '. 492 - 'fields blank if the repository does not use a username and '. 493 - 'password for authentication.'. 494 - '</div>')) 495 - ->appendChild( 496 - id(new AphrontFormTextControl()) 497 - ->setName('http-login') 498 - ->setLabel('Username') 499 - ->setValue($repository->getDetail('http-login'))) 500 - ->appendChild( 501 - id(new AphrontFormPasswordControl()) 502 - ->setName('http-pass') 503 - ->setLabel('Password') 504 - ->setValue($repository->getDetail('http-pass'))); 505 - } 506 - 507 - $inset 508 - ->appendChild(hsprintf( 509 - '<div class="aphront-form-important">'. 510 - 'To test your authentication configuration, <strong>save this '. 511 - 'form</strong> and then run this script:'. 512 - '<code>'. 513 - 'phabricator/ $ ./scripts/repository/test_connection.php %s'. 514 - '</code>'. 515 - 'This will verify that your configuration is correct and the '. 516 - 'daemons can connect to the remote repository and pull changes '. 517 - 'from it.'. 518 - '</div>', 519 - $repository->getCallsign())); 520 - 521 - $form->appendChild($inset); 522 - 523 - $inset = new AphrontFormInsetView(); 524 - $inset->setTitle('Repository Information'); 525 - 526 - if ($has_local) { 527 - $default_local_path = ''; 528 - $default = 529 - PhabricatorEnv::getEnvConfig('repository.default-local-path'); 530 - if (!$repository->getDetail('remote-uri') && $default) { 531 - $default_local_path = $default.strtolower($repository->getCallsign()); 532 - } 533 - $inset->appendChild(hsprintf( 534 - '<p class="aphront-form-instructions">Select a path on local disk '. 535 - 'which the daemons should <tt>%s</tt> the repository into. This must '. 536 - 'be readable and writable by the daemons, and readable by the '. 537 - 'webserver. The daemons will <tt>%s</tt> and keep this repository up '. 538 - 'to date.</p>', 539 - $clone_command, 540 - $fetch_command)); 541 - $inset->appendChild( 542 - id(new AphrontFormTextControl()) 543 - ->setName('path') 544 - ->setLabel('Local Path') 545 - ->setValue($repository->getDetail('local-path', $default_local_path)) 546 - ->setError($e_path)); 547 - } else if ($is_svn) { 548 - $inset->appendChild(hsprintf( 549 - '<p class="aphront-form-instructions">If you only want to parse one '. 550 - 'subpath of the repository, specify it here, relative to the '. 551 - 'repository root (e.g., <tt>trunk/</tt> or <tt>projects/wheel/</tt>). '. 552 - 'If you want to parse multiple subdirectories, create a separate '. 553 - 'Phabricator repository for each one.</p>')); 554 - $inset->appendChild( 555 - id(new AphrontFormTextControl()) 556 - ->setName('svn-subpath') 557 - ->setLabel('Subpath') 558 - ->setValue($repository->getDetail('svn-subpath')) 559 - ->setError($e_path)); 560 - } 561 - 562 - if ($has_branch_filter) { 563 - $branch_filter_str = implode( 564 - ', ', 565 - array_keys($repository->getDetail('branch-filter', array()))); 566 - $inset 567 - ->appendChild( 568 - id(new AphrontFormTextControl()) 569 - ->setName('branch-filter') 570 - ->setLabel('Track Only') 571 - ->setValue($branch_filter_str) 572 - ->setCaption(hsprintf( 573 - 'Optional list of branches to track. Other branches will be '. 574 - 'completely ignored. If left empty, all branches are tracked. '. 575 - 'Example: <tt>master, release</tt>'))); 576 - } 577 - 578 - $inset 579 - ->appendChild( 580 - id(new AphrontFormTextControl()) 581 - ->setName('frequency') 582 - ->setLabel('Pull Frequency') 583 - ->setValue($repository->getDetail('pull-frequency', 15)) 584 - ->setCaption( 585 - 'Number of seconds daemon should sleep between requests. Larger '. 586 - 'numbers reduce load but also decrease responsiveness.')); 587 - 588 - $form->appendChild($inset); 589 - 590 - $inset = new AphrontFormInsetView(); 591 - $inset->setTitle('Application Configuration'); 592 - 593 - if ($has_branches) { 594 - $inset 595 - ->appendChild( 596 - id(new AphrontFormTextControl()) 597 - ->setName('default-branch') 598 - ->setLabel('Default Branch') 599 - ->setValue($repository->getDefaultBranch()) 600 - ->setError($e_branch) 601 - ->setCaption( 602 - 'Default branch to show in Diffusion.')); 603 - } 604 - 605 - $inset 606 - ->appendChild(id(new AphrontFormSelectControl()) 607 - ->setName('autoclose') 608 - ->setLabel('Autoclose') 609 - ->setOptions(array( 610 - 'enabled' => 'Enabled: Automatically Close Pushed Revisions', 611 - 'disabled' => 'Disabled: Ignore Pushed Revisions', 612 - )) 613 - ->setCaption( 614 - "Automatically close Differential revisions when associated commits ". 615 - "are pushed to this repository.") 616 - ->setValue( 617 - $repository->getDetail('disable-autoclose', false) 618 - ? 'disabled' 619 - : 'enabled')); 620 - 621 - if ($has_branch_filter) { 622 - $close_commits_filter_str = implode( 623 - ', ', 624 - array_keys($repository->getDetail('close-commits-filter', array()))); 625 - $inset 626 - ->appendChild( 627 - id(new AphrontFormTextControl()) 628 - ->setName('close-commits-filter') 629 - ->setLabel('Autoclose Branches') 630 - ->setValue($close_commits_filter_str) 631 - ->setCaption( 632 - 'Optional list of branches which can trigger autoclose. '. 633 - 'If left empty, all branches trigger autoclose.')); 634 - } 635 - 636 - $inset 637 - ->appendChild( 638 - id(new AphrontFormTextControl()) 639 - ->setName('default-owners-path') 640 - ->setLabel('Default Owners Path') 641 - ->setValue( 642 - $repository->getDetail( 643 - 'default-owners-path', 644 - '/')) 645 - ->setCaption('Default path in Owners tool.')); 646 - 647 - $inset 648 - ->appendChild( 649 - id(new AphrontFormSelectControl()) 650 - ->setName('herald-disabled') 651 - ->setLabel('Herald/Feed Enabled') 652 - ->setValue($repository->getDetail('herald-disabled', 0)) 653 - ->setOptions( 654 - array( 655 - 0 => 'Enabled - Send Email and Publish Stories', 656 - 1 => 'Disabled - Do Not Send Email or Publish Stories', 657 - )) 658 - ->setCaption( 659 - 'You can disable Herald commit notifications and feed stories '. 660 - 'for this repository. This can be useful when initially importing '. 661 - 'a repository. Feed stories are never published about commits '. 662 - 'that are more than 24 hours old.')); 663 - 664 - if ($is_svn) { 665 - $inset 666 - ->appendChild( 667 - id(new AphrontFormTextControl()) 668 - ->setName('uuid') 669 - ->setLabel('UUID') 670 - ->setValue($repository->getUUID()) 671 - ->setCaption(hsprintf('Repository UUID from <tt>svn info</tt>.'))); 672 - } 673 - 674 - $form->appendChild($inset); 675 - 676 - $form 677 - ->appendChild( 678 - id(new AphrontFormSubmitControl()) 679 - ->setValue('Save Configuration')); 680 - 681 - $form_box = id(new PHUIObjectBoxView()) 682 - ->setHeaderText(pht('Edit Repository Tracking')) 683 - ->setFormError($error_view) 684 - ->setForm($form); 685 - 686 - $nav = $this->sideNav; 687 - $nav->appendChild($form_box); 688 - 689 - return $this->buildApplicationPage( 690 - $nav, 691 - array( 692 - 'title' => pht('Edit Repository Tracking'), 693 - )); 694 - } 695 - 696 - }
+1 -1
src/applications/repository/controller/PhabricatorRepositoryListController.php
··· 38 38 'a', 39 39 array( 40 40 'class' => 'button small grey', 41 - 'href' => '/repository/edit/'.$repo->getID().'/', 41 + 'href' => '/diffusion/'.$repo->getCallsign().'/edit/', 42 42 ), 43 43 'Edit'), 44 44 );