mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-21 22:32:41 +01:00
Add more "RepositoryRef" legacy status mappings
Summary: Ref T13546. The old "differential.query" call is still used to fill refs when all we have locally is hashes. Add some mappings to improve the resulting refs. Test Plan: Viewed "arc branches", saw statuses colored more consistently. Reviewers: ptarjan Reviewed By: ptarjan Maniphest Tasks: T13546 Differential Revision: https://secure.phabricator.com/D21355
This commit is contained in:
parent
b0a9ef8351
commit
f52222ad19
1 changed files with 23 additions and 0 deletions
|
@ -49,6 +49,27 @@ final class ArcanistRevisionRef
|
|||
break;
|
||||
}
|
||||
|
||||
$value_map = array(
|
||||
'0' => 'needs-review',
|
||||
'1' => 'needs-revision',
|
||||
'2' => 'accepted',
|
||||
'3' => 'published',
|
||||
'4' => 'abandoned',
|
||||
'5' => 'changes-planned',
|
||||
);
|
||||
|
||||
$color_map = array(
|
||||
'needs-review' => 'magenta',
|
||||
'needs-revision' => 'red',
|
||||
'accepted' => 'green',
|
||||
'published' => 'cyan',
|
||||
'abandoned' => null,
|
||||
'changes-planned' => 'red',
|
||||
);
|
||||
|
||||
$status_value = idx($value_map, idx($dict, 'status'));
|
||||
$ansi_color = idx($color_map, $status_value);
|
||||
|
||||
$dict['fields'] = array(
|
||||
'uri' => idx($dict, 'uri'),
|
||||
'title' => idx($dict, 'title'),
|
||||
|
@ -56,6 +77,8 @@ final class ArcanistRevisionRef
|
|||
'status' => array(
|
||||
'name' => $status_name,
|
||||
'closed' => $is_closed,
|
||||
'value' => $status_value,
|
||||
'color.ansi' => $ansi_color,
|
||||
),
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue