mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
Hint 'arc' commands in Differential UI
Summary: Point users toward 'arc amend', 'arc commit', 'arc patch' and 'arc export' since no one is going to read 'arc help'. There's kind of a tradeoff here where we're wasting a fair amount of UI space for expert users with the patch/export hints but I think it's probably okay since there's really no other way to figure out that these features exist. Note that the "export" command given isn't complete (it needs --git or --unified), but it will give you a useful error message when you run it, telling you to specify --git or --unified. If it turns out users get confused by this, let me know. Test Plan: Loaded a revision and looked at it. Faked it into 'accepted' status. Reviewed By: tuomaspelkonen Reviewers: tuomaspelkonen, aran, jungejason CC: aran, tuomaspelkonen, epriestley Differential Revision: 242
This commit is contained in:
parent
7ebd0d1efe
commit
dd8232b766
2 changed files with 23 additions and 1 deletions
|
@ -267,8 +267,24 @@ class DifferentialRevisionViewController extends DifferentialController {
|
||||||
$properties = array();
|
$properties = array();
|
||||||
|
|
||||||
$status = $revision->getStatus();
|
$status = $revision->getStatus();
|
||||||
|
$next_step = null;
|
||||||
|
if ($status == DifferentialRevisionStatus::ACCEPTED) {
|
||||||
|
switch ($diff->getSourceControlSystem()) {
|
||||||
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
||||||
|
$next_step = 'arc amend --revision '.$revision->getID();
|
||||||
|
break;
|
||||||
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
||||||
|
$next_step = 'arc commit --revision '.$revision->getID();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ($next_step) {
|
||||||
|
$next_step =
|
||||||
|
' · '.
|
||||||
|
'Next step: <tt>'.phutil_escape_html($next_step).'</tt>';
|
||||||
|
}
|
||||||
|
}
|
||||||
$status = DifferentialRevisionStatus::getNameForRevisionStatus($status);
|
$status = DifferentialRevisionStatus::getNameForRevisionStatus($status);
|
||||||
$properties['Revision Status'] = '<strong>'.$status.'</strong>';
|
$properties['Revision Status'] = '<strong>'.$status.'</strong>'.$next_step;
|
||||||
|
|
||||||
$author = $handles[$revision->getAuthorPHID()];
|
$author = $handles[$revision->getAuthorPHID()];
|
||||||
$properties['Author'] = $author->renderLink();
|
$properties['Author'] = $author->renderLink();
|
||||||
|
@ -399,6 +415,11 @@ class DifferentialRevisionViewController extends DifferentialController {
|
||||||
$properties['Commits'] = implode('<br />', $links);
|
$properties['Commits'] = implode('<br />', $links);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$properties['Apply Patch'] =
|
||||||
|
'<tt>arc patch D'.$revision->getID().'</tt>';
|
||||||
|
$properties['Export Patch'] =
|
||||||
|
'<tt>arc export --revision '.$revision->getID().'</tt>';
|
||||||
|
|
||||||
return $properties;
|
return $properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ phutil_require_module('phabricator', 'applications/differential/view/revisionupd
|
||||||
phutil_require_module('phabricator', 'applications/draft/storage/draft');
|
phutil_require_module('phabricator', 'applications/draft/storage/draft');
|
||||||
phutil_require_module('phabricator', 'applications/phid/constants');
|
phutil_require_module('phabricator', 'applications/phid/constants');
|
||||||
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
||||||
|
phutil_require_module('phabricator', 'applications/repository/constants/repositorytype');
|
||||||
phutil_require_module('phabricator', 'infrastructure/celerity/api');
|
phutil_require_module('phabricator', 'infrastructure/celerity/api');
|
||||||
phutil_require_module('phabricator', 'infrastructure/env');
|
phutil_require_module('phabricator', 'infrastructure/env');
|
||||||
phutil_require_module('phabricator', 'view/form/error');
|
phutil_require_module('phabricator', 'view/form/error');
|
||||||
|
|
Loading…
Reference in a new issue