Continue reducing callers to getCallsign()
Summary: Ref T4245. More of the same, just narrowing down the easy cases. Test Plan: - Called `diffusion.querycommit`. - Browsed branches. - Browsed repository. - Browsed directory. - Searched for stuff. - Viewed a commit. - Viewed a file diff. - Edited a commit. - Viewed history. - Viewed tags. - Viewed push log. Reviewers: chad Reviewed By: chad Maniphest Tasks: T4245 Differential Revision: https://secure.phabricator.com/D14929
This commit is contained in:
@@ -70,16 +70,14 @@ final class DiffusionQueryCommitsConduitAPIMethod
|
|||||||
foreach ($commits as $commit) {
|
foreach ($commits as $commit) {
|
||||||
$commit_data = $commit->getCommitData();
|
$commit_data = $commit->getCommitData();
|
||||||
|
|
||||||
$callsign = $commit->getRepository()->getCallsign();
|
$uri = $commit->getURI();
|
||||||
$identifier = $commit->getCommitIdentifier();
|
|
||||||
$uri = '/r'.$callsign.$identifier;
|
|
||||||
$uri = PhabricatorEnv::getProductionURI($uri);
|
$uri = PhabricatorEnv::getProductionURI($uri);
|
||||||
|
|
||||||
$dict = array(
|
$dict = array(
|
||||||
'id' => $commit->getID(),
|
'id' => $commit->getID(),
|
||||||
'phid' => $commit->getPHID(),
|
'phid' => $commit->getPHID(),
|
||||||
'repositoryPHID' => $commit->getRepository()->getPHID(),
|
'repositoryPHID' => $commit->getRepository()->getPHID(),
|
||||||
'identifier' => $identifier,
|
'identifier' => $commit->getCommitIdentifier(),
|
||||||
'epoch' => $commit->getEpoch(),
|
'epoch' => $commit->getEpoch(),
|
||||||
'uri' => $uri,
|
'uri' => $uri,
|
||||||
'isImporting' => !$commit->isImported(),
|
'isImporting' => !$commit->isImported(),
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ final class DiffusionBranchTableController extends DiffusionController {
|
|||||||
array(
|
array(
|
||||||
'title' => array(
|
'title' => array(
|
||||||
pht('Branches'),
|
pht('Branches'),
|
||||||
'r'.$repository->getCallsign(),
|
$repository->getDisplayName(),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,6 @@ abstract class DiffusionBrowseController extends DiffusionController {
|
|||||||
->setActionList($actions);
|
->setActionList($actions);
|
||||||
|
|
||||||
$stable_commit = $drequest->getStableCommit();
|
$stable_commit = $drequest->getStableCommit();
|
||||||
$callsign = $drequest->getRepository()->getCallsign();
|
|
||||||
|
|
||||||
$view->addProperty(
|
$view->addProperty(
|
||||||
pht('Commit'),
|
pht('Commit'),
|
||||||
|
|||||||
@@ -98,9 +98,7 @@ final class DiffusionBrowseDirectoryController
|
|||||||
array(
|
array(
|
||||||
'title' => array(
|
'title' => array(
|
||||||
nonempty(basename($drequest->getPath()), '/'),
|
nonempty(basename($drequest->getPath()), '/'),
|
||||||
pht(
|
$drequest->getRepository()->getDisplayName(),
|
||||||
'%s Repository',
|
|
||||||
$drequest->getRepository()->getCallsign()),
|
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ final class DiffusionBrowseSearchController extends DiffusionBrowseController {
|
|||||||
array(
|
array(
|
||||||
'title' => array(
|
'title' => array(
|
||||||
nonempty(basename($drequest->getPath()), '/'),
|
nonempty(basename($drequest->getPath()), '/'),
|
||||||
pht(
|
$drequest->getRepository()->getDisplayName(),
|
||||||
'%s Repository',
|
|
||||||
$drequest->getRepository()->getCallsign()),
|
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ final class DiffusionChangeController extends DiffusionController {
|
|||||||
->setActionList($actions);
|
->setActionList($actions);
|
||||||
|
|
||||||
$stable_commit = $drequest->getStableCommit();
|
$stable_commit = $drequest->getStableCommit();
|
||||||
$callsign = $drequest->getRepository()->getCallsign();
|
|
||||||
|
|
||||||
$view->addProperty(
|
$view->addProperty(
|
||||||
pht('Commit'),
|
pht('Commit'),
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ final class DiffusionCommitController extends DiffusionController {
|
|||||||
id(new PhabricatorRepository())->establishConnection('r'),
|
id(new PhabricatorRepository())->establishConnection('r'),
|
||||||
'SELECT * FROM %T WHERE fullCommitName = %s',
|
'SELECT * FROM %T WHERE fullCommitName = %s',
|
||||||
PhabricatorRepository::TABLE_BADCOMMIT,
|
PhabricatorRepository::TABLE_BADCOMMIT,
|
||||||
'r'.$callsign.$commit->getCommitIdentifier());
|
$commit->getMonogram());
|
||||||
}
|
}
|
||||||
|
|
||||||
$show_changesets = false;
|
$show_changesets = false;
|
||||||
@@ -314,9 +314,8 @@ final class DiffusionCommitController extends DiffusionController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$change_list_title = DiffusionView::nameCommit(
|
$change_list_title = $commit->getDisplayName();
|
||||||
$repository,
|
|
||||||
$commit->getCommitIdentifier());
|
|
||||||
$change_list = new DifferentialChangesetListView();
|
$change_list = new DifferentialChangesetListView();
|
||||||
$change_list->setTitle($change_list_title);
|
$change_list->setTitle($change_list_title);
|
||||||
$change_list->setChangesets($changesets);
|
$change_list->setChangesets($changesets);
|
||||||
@@ -344,11 +343,6 @@ final class DiffusionCommitController extends DiffusionController {
|
|||||||
|
|
||||||
$content[] = $this->renderAddCommentPanel($commit, $audit_requests);
|
$content[] = $this->renderAddCommentPanel($commit, $audit_requests);
|
||||||
|
|
||||||
$commit_id = 'r'.$callsign.$commit->getCommitIdentifier();
|
|
||||||
$short_name = DiffusionView::nameCommit(
|
|
||||||
$repository,
|
|
||||||
$commit->getCommitIdentifier());
|
|
||||||
|
|
||||||
$prefs = $user->loadPreferences();
|
$prefs = $user->loadPreferences();
|
||||||
$pref_filetree = PhabricatorUserPreferences::PREFERENCE_DIFF_FILETREE;
|
$pref_filetree = PhabricatorUserPreferences::PREFERENCE_DIFF_FILETREE;
|
||||||
$pref_collapse = PhabricatorUserPreferences::PREFERENCE_NAV_COLLAPSED;
|
$pref_collapse = PhabricatorUserPreferences::PREFERENCE_NAV_COLLAPSED;
|
||||||
@@ -357,8 +351,8 @@ final class DiffusionCommitController extends DiffusionController {
|
|||||||
|
|
||||||
if ($show_changesets && $show_filetree) {
|
if ($show_changesets && $show_filetree) {
|
||||||
$nav = id(new DifferentialChangesetFileTreeSideNavBuilder())
|
$nav = id(new DifferentialChangesetFileTreeSideNavBuilder())
|
||||||
->setTitle($short_name)
|
->setTitle($commit->getDisplayName())
|
||||||
->setBaseURI(new PhutilURI('/'.$commit_id))
|
->setBaseURI(new PhutilURI($commit->getURI()))
|
||||||
->build($changesets)
|
->build($changesets)
|
||||||
->setCrumbs($crumbs)
|
->setCrumbs($crumbs)
|
||||||
->setCollapsed((bool)$collapsed)
|
->setCollapsed((bool)$collapsed)
|
||||||
@@ -371,7 +365,7 @@ final class DiffusionCommitController extends DiffusionController {
|
|||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
$content,
|
$content,
|
||||||
array(
|
array(
|
||||||
'title' => $commit_id,
|
'title' => $commit->getDisplayName(),
|
||||||
'pageObjects' => array($commit->getPHID()),
|
'pageObjects' => array($commit->getPHID()),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ final class DiffusionCommitEditController extends DiffusionController {
|
|||||||
protected function processDiffusionRequest(AphrontRequest $request) {
|
protected function processDiffusionRequest(AphrontRequest $request) {
|
||||||
$user = $request->getUser();
|
$user = $request->getUser();
|
||||||
$drequest = $this->getDiffusionRequest();
|
$drequest = $this->getDiffusionRequest();
|
||||||
$callsign = $drequest->getRepository()->getCallsign();
|
|
||||||
$repository = $drequest->getRepository();
|
$repository = $drequest->getRepository();
|
||||||
$commit = $drequest->loadCommit();
|
$commit = $drequest->loadCommit();
|
||||||
$data = $commit->loadCommitData();
|
$data = $commit->loadCommitData();
|
||||||
@@ -34,7 +33,7 @@ final class DiffusionCommitEditController extends DiffusionController {
|
|||||||
->setContentSourceFromRequest($request);
|
->setContentSourceFromRequest($request);
|
||||||
$xactions = $editor->applyTransactions($commit, $xactions);
|
$xactions = $editor->applyTransactions($commit, $xactions);
|
||||||
return id(new AphrontRedirectResponse())
|
return id(new AphrontRedirectResponse())
|
||||||
->setURI('/r'.$callsign.$commit->getCommitIdentifier());
|
->setURI($commit->getURI());
|
||||||
}
|
}
|
||||||
|
|
||||||
$tokenizer_id = celerity_generate_unique_node_id();
|
$tokenizer_id = celerity_generate_unique_node_id();
|
||||||
@@ -95,8 +94,8 @@ final class DiffusionCommitEditController extends DiffusionController {
|
|||||||
|
|
||||||
$submit = id(new AphrontFormSubmitControl())
|
$submit = id(new AphrontFormSubmitControl())
|
||||||
->setValue(pht('Save'))
|
->setValue(pht('Save'))
|
||||||
->addCancelButton('/r'.$callsign.$commit->getCommitIdentifier());
|
->addCancelButton($commit->getURI());
|
||||||
$form->appendChild($submit);
|
$form->appendChild($submit);
|
||||||
|
|
||||||
$crumbs = $this->buildCrumbs(array(
|
$crumbs = $this->buildCrumbs(array(
|
||||||
'commit' => true,
|
'commit' => true,
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ abstract class DiffusionController extends PhabricatorController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$links[] = 'r'.$drequest->getRepository()->getCallsign();
|
$links[] = $drequest->getRepository()->getDisplayName();
|
||||||
$links[] = $divider;
|
$links[] = $divider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ final class DiffusionExternalController extends DiffusionController {
|
|||||||
array(
|
array(
|
||||||
'href' => $href,
|
'href' => $href,
|
||||||
),
|
),
|
||||||
'r'.$repo->getCallsign().$commit->getCommitIdentifier()),
|
$commit->getMonogram()),
|
||||||
$commit->loadCommitData()->getSummary(),
|
$commit->loadCommitData()->getSummary(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ final class DiffusionHistoryController extends DiffusionController {
|
|||||||
array(
|
array(
|
||||||
'title' => array(
|
'title' => array(
|
||||||
pht('History'),
|
pht('History'),
|
||||||
pht('%s Repository', $drequest->getRepository()->getCallsign()),
|
$drequest->getRepository()->getDisplayName(),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -151,7 +151,6 @@ final class DiffusionHistoryController extends DiffusionController {
|
|||||||
->setActionList($actions);
|
->setActionList($actions);
|
||||||
|
|
||||||
$stable_commit = $drequest->getStableCommit();
|
$stable_commit = $drequest->getStableCommit();
|
||||||
$callsign = $drequest->getRepository()->getCallsign();
|
|
||||||
|
|
||||||
$view->addProperty(
|
$view->addProperty(
|
||||||
pht('Commit'),
|
pht('Commit'),
|
||||||
|
|||||||
@@ -80,7 +80,12 @@ final class DiffusionLintController extends DiffusionController {
|
|||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
phutil_tag('a', array('href' => $href_lint), $code['n']),
|
phutil_tag('a', array('href' => $href_lint), $code['n']),
|
||||||
phutil_tag('a', array('href' => $href_browse), $code['files']),
|
phutil_tag('a', array('href' => $href_browse), $code['files']),
|
||||||
phutil_tag('a', array('href' => $href_repo), $drequest->getCallsign()),
|
phutil_tag(
|
||||||
|
'a',
|
||||||
|
array(
|
||||||
|
'href' => $href_repo,
|
||||||
|
),
|
||||||
|
$drequest->getRepository()->getDisplayName()),
|
||||||
ArcanistLintSeverity::getStringForSeverity($code['maxSeverity']),
|
ArcanistLintSeverity::getStringForSeverity($code['maxSeverity']),
|
||||||
$code['code'],
|
$code['code'],
|
||||||
$code['maxName'],
|
$code['maxName'],
|
||||||
@@ -133,7 +138,7 @@ final class DiffusionLintController extends DiffusionController {
|
|||||||
));
|
));
|
||||||
|
|
||||||
if ($this->diffusionRequest) {
|
if ($this->diffusionRequest) {
|
||||||
$title[] = $drequest->getCallsign();
|
$title[] = $drequest->getRepository()->getDisplayName();
|
||||||
} else {
|
} else {
|
||||||
$crumbs->addTextCrumb(pht('All Lint'));
|
$crumbs->addTextCrumb(pht('All Lint'));
|
||||||
}
|
}
|
||||||
@@ -314,7 +319,6 @@ final class DiffusionLintController extends DiffusionController {
|
|||||||
->setUser($viewer)
|
->setUser($viewer)
|
||||||
->setActionList($actions);
|
->setActionList($actions);
|
||||||
|
|
||||||
$callsign = $drequest->getRepository()->getCallsign();
|
|
||||||
$lint_commit = $branch->getLintCommit();
|
$lint_commit = $branch->getLintCommit();
|
||||||
|
|
||||||
$view->addProperty(
|
$view->addProperty(
|
||||||
|
|||||||
@@ -90,11 +90,10 @@ final class DiffusionLintDetailsController extends DiffusionController {
|
|||||||
$pager,
|
$pager,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'title' =>
|
'title' => array(
|
||||||
array(
|
pht('Lint'),
|
||||||
pht('Lint'),
|
$drequest->getRepository()->getDisplayName(),
|
||||||
$drequest->getRepository()->getCallsign(),
|
),
|
||||||
),
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ final class DiffusionPushEventViewController
|
|||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(
|
$crumbs->addTextCrumb(
|
||||||
$repository->getName(),
|
$repository->getName(),
|
||||||
$this->getApplicationURI($repository->getCallsign().'/'));
|
$repository->getURI());
|
||||||
|
|
||||||
$crumbs->addTextCrumb(
|
$crumbs->addTextCrumb(
|
||||||
pht('Push Logs'),
|
pht('Push Logs'),
|
||||||
$this->getApplicationURI(
|
$this->getApplicationURI(
|
||||||
|
|||||||
@@ -500,9 +500,8 @@ final class DiffusionRepositoryController extends DiffusionController {
|
|||||||
->setDisabled(!$can_edit));
|
->setDisabled(!$can_edit));
|
||||||
|
|
||||||
if ($repository->isHosted()) {
|
if ($repository->isHosted()) {
|
||||||
$callsign = $repository->getCallsign();
|
|
||||||
$push_uri = $this->getApplicationURI(
|
$push_uri = $this->getApplicationURI(
|
||||||
'pushlog/?repositories=r'.$callsign);
|
'pushlog/?repositories='.$repository->getMonogram());
|
||||||
|
|
||||||
$view->addAction(
|
$view->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
@@ -551,7 +550,6 @@ final class DiffusionRepositoryController extends DiffusionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$history_table->setIsHead(true);
|
$history_table->setIsHead(true);
|
||||||
$callsign = $drequest->getRepository()->getCallsign();
|
|
||||||
|
|
||||||
$icon = id(new PHUIIconView())
|
$icon = id(new PHUIIconView())
|
||||||
->setIconFont('fa-list-alt');
|
->setIconFont('fa-list-alt');
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ abstract class DiffusionRepositoryEditController
|
|||||||
|
|
||||||
if ($this->diffusionRequest) {
|
if ($this->diffusionRequest) {
|
||||||
$repository = $this->getDiffusionRequest()->getRepository();
|
$repository = $this->getDiffusionRequest()->getRepository();
|
||||||
$repo_uri = $this->getRepositoryControllerURI($repository, '');
|
$repo_uri = $repository->getURI();
|
||||||
$edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
|
$edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
|
||||||
|
|
||||||
$crumbs->addTextCrumb('r'.$repository->getCallsign(), $repo_uri);
|
$crumbs->addTextCrumb($repository->getDisplayname(), $repo_uri);
|
||||||
|
|
||||||
if ($is_main) {
|
if ($is_main) {
|
||||||
$crumbs->addTextCrumb(pht('Edit Repository'));
|
$crumbs->addTextCrumb(pht('Edit Repository'));
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ final class DiffusionRepositoryEditStorageController
|
|||||||
"web interface. To edit it, run this command:\n\n %s",
|
"web interface. To edit it, run this command:\n\n %s",
|
||||||
sprintf(
|
sprintf(
|
||||||
'phabricator/ $ ./bin/repository edit %s --as %s --local-path ...',
|
'phabricator/ $ ./bin/repository edit %s --as %s --local-path ...',
|
||||||
$repository->getCallsign(),
|
$repository->getMonogram(),
|
||||||
$user->getUsername())))
|
$user->getUsername())))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormSubmitControl())
|
id(new AphrontFormSubmitControl())
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ final class DiffusionTagListController extends DiffusionController {
|
|||||||
array(
|
array(
|
||||||
'title' => array(
|
'title' => array(
|
||||||
pht('Tags'),
|
pht('Tags'),
|
||||||
pht('%s Repository', $repository->getCallsign()),
|
$repository->getDisplayName(),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ final class DiffusionRepositoryDatasource
|
|||||||
foreach ($repos as $repo) {
|
foreach ($repos as $repo) {
|
||||||
$results[] = id(new PhabricatorTypeaheadResult())
|
$results[] = id(new PhabricatorTypeaheadResult())
|
||||||
->setName($repo->getMonogram().' '.$repo->getName())
|
->setName($repo->getMonogram().' '.$repo->getName())
|
||||||
->setURI('/diffusion/'.$repo->getCallsign().'/')
|
->setURI($repo->getURI())
|
||||||
->setPHID($repo->getPHID())
|
->setPHID($repo->getPHID())
|
||||||
->setPriorityString($repo->getMonogram());
|
->setPriorityString($repo->getMonogram());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ final class DiffusionPushLogListView extends AphrontView {
|
|||||||
|
|
||||||
$rows = array();
|
$rows = array();
|
||||||
foreach ($logs as $log) {
|
foreach ($logs as $log) {
|
||||||
|
$repository = $log->getRepository();
|
||||||
|
|
||||||
// Reveal this if it's valid and the user can edit the repository.
|
// Reveal this if it's valid and the user can edit the repository.
|
||||||
$remote_addr = '-';
|
$remote_addr = '-';
|
||||||
@@ -51,16 +52,16 @@ final class DiffusionPushLogListView extends AphrontView {
|
|||||||
|
|
||||||
$event_id = $log->getPushEvent()->getID();
|
$event_id = $log->getPushEvent()->getID();
|
||||||
|
|
||||||
$callsign = $log->getRepository()->getCallsign();
|
|
||||||
$old_ref_link = null;
|
$old_ref_link = null;
|
||||||
if ($log->getRefOld() != DiffusionCommitHookEngine::EMPTY_HASH) {
|
if ($log->getRefOld() != DiffusionCommitHookEngine::EMPTY_HASH) {
|
||||||
$old_ref_link = phutil_tag(
|
$old_ref_link = phutil_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
'href' => '/r'.$callsign.$log->getRefOld(),
|
'href' => $repository->getCommitURI($log->getRefOld()),
|
||||||
),
|
),
|
||||||
$log->getRefOldShort());
|
$log->getRefOldShort());
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
phutil_tag(
|
phutil_tag(
|
||||||
'a',
|
'a',
|
||||||
@@ -71,9 +72,9 @@ final class DiffusionPushLogListView extends AphrontView {
|
|||||||
phutil_tag(
|
phutil_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
'href' => '/diffusion/'.$callsign.'/',
|
'href' => $repository->getURI(),
|
||||||
),
|
),
|
||||||
$callsign),
|
$repository->getDisplayName()),
|
||||||
$handles[$log->getPusherPHID()]->renderLink(),
|
$handles[$log->getPusherPHID()]->renderLink(),
|
||||||
$remote_addr,
|
$remote_addr,
|
||||||
$log->getPushEvent()->getRemoteProtocol(),
|
$log->getPushEvent()->getRemoteProtocol(),
|
||||||
@@ -83,7 +84,7 @@ final class DiffusionPushLogListView extends AphrontView {
|
|||||||
phutil_tag(
|
phutil_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
'href' => '/r'.$callsign.$log->getRefNew(),
|
'href' => $repository->getCommitURI($log->getRefNew()),
|
||||||
),
|
),
|
||||||
$log->getRefNewShort()),
|
$log->getRefNewShort()),
|
||||||
|
|
||||||
|
|||||||
@@ -123,30 +123,12 @@ abstract class DiffusionView extends AphrontView {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
final public static function nameCommit(
|
|
||||||
PhabricatorRepository $repository,
|
|
||||||
$commit) {
|
|
||||||
|
|
||||||
switch ($repository->getVersionControlSystem()) {
|
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
|
||||||
$commit_name = substr($commit, 0, 12);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$commit_name = $commit;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$callsign = $repository->getCallsign();
|
|
||||||
return "r{$callsign}{$commit_name}";
|
|
||||||
}
|
|
||||||
|
|
||||||
final public static function linkCommit(
|
final public static function linkCommit(
|
||||||
PhabricatorRepository $repository,
|
PhabricatorRepository $repository,
|
||||||
$commit,
|
$commit,
|
||||||
$summary = '') {
|
$summary = '') {
|
||||||
|
|
||||||
$commit_name = self::nameCommit($repository, $commit);
|
$commit_name = $repository->formatCommitName($commit);
|
||||||
$callsign = $repository->getCallsign();
|
$callsign = $repository->getCallsign();
|
||||||
|
|
||||||
if (strlen($summary)) {
|
if (strlen($summary)) {
|
||||||
|
|||||||
@@ -601,6 +601,11 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
|
|||||||
return '/diffusion/'.$this->getCallsign().'/';
|
return '/diffusion/'.$this->getCallsign().'/';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCommitURI($identifier) {
|
||||||
|
$callsign = $this->getCallsign();
|
||||||
|
return "/r{$callsign}{$identifier}";
|
||||||
|
}
|
||||||
|
|
||||||
public function getNormalizedPath() {
|
public function getNormalizedPath() {
|
||||||
$uri = (string)$this->getCloneURIObject();
|
$uri = (string)$this->getCloneURIObject();
|
||||||
|
|
||||||
|
|||||||
@@ -256,6 +256,12 @@ final class PhabricatorRepositoryCommit
|
|||||||
return "r{$callsign}{$identifier}";
|
return "r{$callsign}{$identifier}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDisplayName() {
|
||||||
|
$repository = $this->getRepository();
|
||||||
|
$identifier = $this->getCommitIdentifier();
|
||||||
|
return $repository->formatCommitName($identifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -( PhabricatorPolicyInterface )----------------------------------------- */
|
/* -( PhabricatorPolicyInterface )----------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user