Improve clarity of commit and symbol handling in DiffusionRequest
Summary: Ref T2683. Currently, DiffusionRequest has four different "commitey" things: - `commit` - `rawCommit` - `symbolicCommit` - `stableCommit` Of these, only two are actually distinct, useful values: `symbolicCommit` (which holds the value the request originally contained, if one existed) and `stableCommit` (which resolves that value, or the value implied by its omission, into a stable, permanent commit identifier). - `rawCommit` is equivalent to `symbolicCommit` and can be simply removed. - `commit` has some sketchy magic around it that needs to be pulled out before it can be jettisoned. Test Plan: Viewed SVN, Git, and Mercurial repositories. Viewed brwose/history/change/tag/branch/etc views. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T2683 Differential Revision: https://secure.phabricator.com/D9098
This commit is contained in:
@@ -98,17 +98,17 @@ abstract class DiffusionController extends PhabricatorController {
|
||||
)));
|
||||
$crumb_list[] = $crumb;
|
||||
|
||||
$raw_commit = $drequest->getRawCommit();
|
||||
$stable_commit = $drequest->getStableCommit();
|
||||
|
||||
if ($spec['tags']) {
|
||||
$crumb = new PhabricatorCrumbView();
|
||||
if ($spec['commit']) {
|
||||
$crumb->setName(
|
||||
pht("Tags for %s", 'r'.$callsign.$raw_commit));
|
||||
pht("Tags for %s", 'r'.$callsign.$stable_commit));
|
||||
$crumb->setHref($drequest->generateURI(
|
||||
array(
|
||||
'action' => 'commit',
|
||||
'commit' => $raw_commit,
|
||||
'commit' => $drequest->getStableCommit(),
|
||||
)));
|
||||
} else {
|
||||
$crumb->setName(pht('Tags'));
|
||||
@@ -126,8 +126,8 @@ abstract class DiffusionController extends PhabricatorController {
|
||||
|
||||
if ($spec['commit']) {
|
||||
$crumb = id(new PhabricatorCrumbView())
|
||||
->setName("r{$callsign}{$raw_commit}")
|
||||
->setHref("r{$callsign}{$raw_commit}");
|
||||
->setName("r{$callsign}{$stable_commit}")
|
||||
->setHref("r{$callsign}{$stable_commit}");
|
||||
$crumb_list[] = $crumb;
|
||||
return $crumb_list;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user