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

Merge branch 'master' of github.com:facebook/phabricator

+179 -130
+2
src/__phutil_library_map__.php
··· 81 81 'AphrontRequestTestCase' => 'aphront/__tests__/AphrontRequestTestCase.php', 82 82 'AphrontResponse' => 'aphront/response/AphrontResponse.php', 83 83 'AphrontSideNavFilterView' => 'view/layout/AphrontSideNavFilterView.php', 84 + 'AphrontStackTraceView' => 'view/widget/AphrontStackTraceView.php', 84 85 'AphrontTableView' => 'view/control/AphrontTableView.php', 85 86 'AphrontTagView' => 'view/AphrontTagView.php', 86 87 'AphrontTokenizerTemplateView' => 'view/control/AphrontTokenizerTemplateView.php', ··· 2401 2402 'AphrontRequestFailureView' => 'AphrontView', 2402 2403 'AphrontRequestTestCase' => 'PhabricatorTestCase', 2403 2404 'AphrontSideNavFilterView' => 'AphrontView', 2405 + 'AphrontStackTraceView' => 'AphrontView', 2404 2406 'AphrontTableView' => 'AphrontView', 2405 2407 'AphrontTagView' => 'AphrontView', 2406 2408 'AphrontTokenizerTemplateView' => 'AphrontView',
+3 -107
src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
··· 243 243 } 244 244 245 245 if (PhabricatorEnv::getEnvConfig('phabricator.developer-mode')) { 246 - $trace = $this->renderStackTrace($ex->getTrace(), $user); 246 + $trace = id(new AphrontStackTraceView()) 247 + ->setUser($user) 248 + ->setTrace($ex->getTrace()); 247 249 } else { 248 250 $trace = null; 249 251 } ··· 287 289 new PhabricatorRedirectController($this->getRequest()), 288 290 array( 289 291 'uri' => $uri, 290 - )); 291 - } 292 - 293 - private function renderStackTrace($trace, PhabricatorUser $user) { 294 - 295 - $libraries = PhutilBootloader::getInstance()->getAllLibraries(); 296 - 297 - // TODO: Make this configurable? 298 - $path = 'https://secure.phabricator.com/diffusion/%s/browse/master/src/'; 299 - 300 - $callsigns = array( 301 - 'arcanist' => 'ARC', 302 - 'phutil' => 'PHU', 303 - 'phabricator' => 'P', 304 - ); 305 - 306 - $rows = array(); 307 - $depth = count($trace); 308 - foreach ($trace as $part) { 309 - $lib = null; 310 - $file = idx($part, 'file'); 311 - $relative = $file; 312 - foreach ($libraries as $library) { 313 - $root = phutil_get_library_root($library); 314 - if (Filesystem::isDescendant($file, $root)) { 315 - $lib = $library; 316 - $relative = Filesystem::readablePath($file, $root); 317 - break; 318 - } 319 - } 320 - 321 - $where = ''; 322 - if (isset($part['class'])) { 323 - $where .= $part['class'].'::'; 324 - } 325 - if (isset($part['function'])) { 326 - $where .= $part['function'].'()'; 327 - } 328 - 329 - if ($file) { 330 - if (isset($callsigns[$lib])) { 331 - $attrs = array('title' => $file); 332 - try { 333 - $attrs['href'] = $user->loadEditorLink( 334 - '/src/'.$relative, 335 - $part['line'], 336 - $callsigns[$lib]); 337 - } catch (Exception $ex) { 338 - // The database can be inaccessible. 339 - } 340 - if (empty($attrs['href'])) { 341 - $attrs['href'] = sprintf($path, $callsigns[$lib]). 342 - str_replace(DIRECTORY_SEPARATOR, '/', $relative). 343 - '$'.$part['line']; 344 - $attrs['target'] = '_blank'; 345 - } 346 - $file_name = phutil_tag( 347 - 'a', 348 - $attrs, 349 - $relative); 350 - } else { 351 - $file_name = phutil_tag( 352 - 'span', 353 - array( 354 - 'title' => $file, 355 - ), 356 - $relative); 357 - } 358 - $file_name = hsprintf('%s : %d', $file_name, $part['line']); 359 - } else { 360 - $file_name = phutil_tag('em', array(), '(Internal)'); 361 - } 362 - 363 - 364 - $rows[] = array( 365 - $depth--, 366 - $lib, 367 - $file_name, 368 - $where, 369 - ); 370 - } 371 - $table = new AphrontTableView($rows); 372 - $table->setHeaders( 373 - array( 374 - 'Depth', 375 - 'Library', 376 - 'File', 377 - 'Where', 378 - )); 379 - $table->setColumnClasses( 380 - array( 381 - 'n', 382 - '', 383 - '', 384 - 'wide', 385 - )); 386 - 387 - return phutil_tag( 388 - 'div', 389 - array('class' => 'exception-trace'), 390 - array( 391 - phutil_tag( 392 - 'div', 393 - array('class' => 'exception-trace-header'), 394 - pht('Stack Trace')), 395 - $table->render(), 396 292 )); 397 293 } 398 294
+37 -16
src/aphront/response/AphrontRedirectResponse.php
··· 8 8 class AphrontRedirectResponse extends AphrontResponse { 9 9 10 10 private $uri; 11 + private $stackWhenCreated; 12 + 13 + public function __construct() { 14 + if ($this->shouldStopForDebugging()) { 15 + // If we're going to stop, capture the stack so we can print it out. 16 + $this->stackWhenCreated = id(new Exception())->getTrace(); 17 + } 18 + } 11 19 12 20 public function setURI($uri) { 13 21 $this->uri = $uri; ··· 33 41 34 42 public function buildResponseString() { 35 43 if ($this->shouldStopForDebugging()) { 44 + $user = new PhabricatorUser(); 45 + 36 46 $view = new PhabricatorStandardPageView(); 37 47 $view->setRequest($this->getRequest()); 38 48 $view->setApplicationName('Debug'); 39 49 $view->setTitle('Stopped on Redirect'); 40 50 41 - $error = new AphrontErrorView(); 42 - $error->setSeverity(AphrontErrorView::SEVERITY_NOTICE); 43 - $error->setTitle('Stopped on Redirect'); 51 + $dialog = new AphrontDialogView(); 52 + $dialog->setUser($user); 53 + $dialog->setTitle('Stopped on Redirect'); 54 + 55 + $dialog->appendParagraph( 56 + pht( 57 + 'You were stopped here because %s is set in your configuration.', 58 + phutil_tag('tt', array(), 'debug.stop-on-redirect'))); 59 + 60 + $dialog->appendParagraph( 61 + pht( 62 + 'You are being redirected to: %s', 63 + phutil_tag('tt', array(), $this->getURI()))); 64 + 65 + $dialog->addCancelButton($this->getURI(), pht('Continue')); 66 + 67 + $dialog->appendChild(phutil_tag('br')); 44 68 45 - $error->appendChild(phutil_tag('p', array(), pht( 46 - 'You were stopped here because %s is set in your configuration.', 47 - phutil_tag('tt', array(), 'debug.stop-on-redirect')))); 69 + $dialog->appendChild( 70 + id(new AphrontStackTraceView()) 71 + ->setUser($user) 72 + ->setTrace($this->stackWhenCreated)); 48 73 49 - $link = phutil_tag( 50 - 'a', 51 - array( 52 - 'href' => $this->getURI(), 53 - ), 54 - $this->getURI()); 74 + $dialog->setIsStandalone(true); 75 + $dialog->setWidth(AphrontDialogView::WIDTH_FULL); 55 76 56 - $error->appendChild(phutil_tag('p', array(), pht( 57 - 'Continue to: %s', 58 - $link))); 77 + $box = id(new PHUIBoxView()) 78 + ->addMargin(PHUI::MARGIN_LARGE) 79 + ->appendChild($dialog); 59 80 60 - $view->appendChild($error); 81 + $view->appendChild($box); 61 82 62 83 return $view->render(); 63 84 }
+1 -1
src/applications/auth/controller/PhabricatorEmailVerificationController.php
··· 44 44 'user. Make sure you followed the link in the email correctly and are '. 45 45 'logged in with the user account associated with the email address.'); 46 46 $continue = pht('Rats!'); 47 - } else if ($email->getIsVerified()) { 47 + } else if ($email->getIsVerified() && $user->getIsEmailVerified()) { 48 48 $title = pht('Address Already Verified'); 49 49 $content = pht( 50 50 'This email address has already been verified.');
+1 -1
src/applications/auth/controller/PhabricatorMustVerifyEmailController.php
··· 19 19 20 20 $email = $user->loadPrimaryEmail(); 21 21 22 - if ($email->getIsVerified()) { 22 + if ($user->getIsEmailVerified()) { 23 23 return id(new AphrontRedirectResponse())->setURI('/'); 24 24 } 25 25
+2 -3
src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php
··· 88 88 89 89 try { 90 90 list($xml, $stderr) = $repository->execxRemoteCommand( 91 - 'log --xml --quiet --limit %d %s@%s', 91 + 'log --xml --quiet --limit %d %s', 92 92 $limit, 93 - $repository->getSubversionBaseURI(), 94 - $at_rev); 93 + $repository->getSubversionBaseURI($at_rev)); 95 94 } catch (CommandException $ex) { 96 95 $stderr = $ex->getStdErr(); 97 96 if (preg_match('/(path|File) not found/', $stderr)) {
+2 -2
src/applications/repository/storage/PhabricatorRepository.php
··· 155 155 return $this->getDetail('local-path'); 156 156 } 157 157 158 - public function getSubversionBaseURI() { 158 + public function getSubversionBaseURI($commit = null) { 159 159 $subpath = $this->getDetail('svn-subpath'); 160 160 if (!strlen($subpath)) { 161 161 $subpath = null; 162 162 } 163 - return $this->getSubversionPathURI($subpath); 163 + return $this->getSubversionPathURI($subpath, $commit); 164 164 } 165 165 166 166 public function getSubversionPathURI($path = null, $commit = null) {
+11
src/applications/repository/storage/__tests__/PhabricatorRepositoryTestCase.php
··· 94 94 $this->assertEqual( 95 95 'file:///var/repo/SVN/%3F@22', 96 96 $repo->getSubversionPathURI('?', 22)); 97 + 98 + $repo->setDetail('svn-subpath', 'quack/trunk/'); 99 + 100 + $this->assertEqual( 101 + 'file:///var/repo/SVN/quack/trunk/@', 102 + $repo->getSubversionBaseURI()); 103 + 104 + $this->assertEqual( 105 + 'file:///var/repo/SVN/quack/trunk/@HEAD', 106 + $repo->getSubversionBaseURI('HEAD')); 107 + 97 108 } 98 109 99 110
+120
src/view/widget/AphrontStackTraceView.php
··· 1 + <?php 2 + 3 + final class AphrontStackTraceView extends AphrontView { 4 + 5 + private $trace; 6 + 7 + public function setTrace($trace) { 8 + $this->trace = $trace; 9 + return $this; 10 + } 11 + 12 + public function render() { 13 + $user = $this->getUser(); 14 + $trace = $this->trace; 15 + 16 + $libraries = PhutilBootloader::getInstance()->getAllLibraries(); 17 + 18 + // TODO: Make this configurable? 19 + $path = 'https://secure.phabricator.com/diffusion/%s/browse/master/src/'; 20 + 21 + $callsigns = array( 22 + 'arcanist' => 'ARC', 23 + 'phutil' => 'PHU', 24 + 'phabricator' => 'P', 25 + ); 26 + 27 + $rows = array(); 28 + $depth = count($trace); 29 + foreach ($trace as $part) { 30 + $lib = null; 31 + $file = idx($part, 'file'); 32 + $relative = $file; 33 + foreach ($libraries as $library) { 34 + $root = phutil_get_library_root($library); 35 + if (Filesystem::isDescendant($file, $root)) { 36 + $lib = $library; 37 + $relative = Filesystem::readablePath($file, $root); 38 + break; 39 + } 40 + } 41 + 42 + $where = ''; 43 + if (isset($part['class'])) { 44 + $where .= $part['class'].'::'; 45 + } 46 + if (isset($part['function'])) { 47 + $where .= $part['function'].'()'; 48 + } 49 + 50 + if ($file) { 51 + if (isset($callsigns[$lib])) { 52 + $attrs = array('title' => $file); 53 + try { 54 + $attrs['href'] = $user->loadEditorLink( 55 + '/src/'.$relative, 56 + $part['line'], 57 + $callsigns[$lib]); 58 + } catch (Exception $ex) { 59 + // The database can be inaccessible. 60 + } 61 + if (empty($attrs['href'])) { 62 + $attrs['href'] = sprintf($path, $callsigns[$lib]). 63 + str_replace(DIRECTORY_SEPARATOR, '/', $relative). 64 + '$'.$part['line']; 65 + $attrs['target'] = '_blank'; 66 + } 67 + $file_name = phutil_tag( 68 + 'a', 69 + $attrs, 70 + $relative); 71 + } else { 72 + $file_name = phutil_tag( 73 + 'span', 74 + array( 75 + 'title' => $file, 76 + ), 77 + $relative); 78 + } 79 + $file_name = hsprintf('%s : %d', $file_name, $part['line']); 80 + } else { 81 + $file_name = phutil_tag('em', array(), '(Internal)'); 82 + } 83 + 84 + 85 + $rows[] = array( 86 + $depth--, 87 + $lib, 88 + $file_name, 89 + $where, 90 + ); 91 + } 92 + $table = new AphrontTableView($rows); 93 + $table->setHeaders( 94 + array( 95 + 'Depth', 96 + 'Library', 97 + 'File', 98 + 'Where', 99 + )); 100 + $table->setColumnClasses( 101 + array( 102 + 'n', 103 + '', 104 + '', 105 + 'wide', 106 + )); 107 + 108 + return phutil_tag( 109 + 'div', 110 + array('class' => 'exception-trace'), 111 + array( 112 + phutil_tag( 113 + 'div', 114 + array('class' => 'exception-trace-header'), 115 + pht('Stack Trace')), 116 + $table->render(), 117 + )); 118 + } 119 + 120 + }