1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 23:02:41 +01:00

Minor, fix arc land for the case of no dependencies.

Auditors: Afaque_Hussain
This commit is contained in:
epriestley 2013-03-07 17:21:37 -08:00
parent 91154c9cdf
commit 42235d9f1f

View file

@ -365,36 +365,37 @@ EOTEXT
if ($rev_auxiliary) { if ($rev_auxiliary) {
$phids = idx($rev_auxiliary, 'phabricator:depends-on', array()); $phids = idx($rev_auxiliary, 'phabricator:depends-on', array());
if ($phids) {
$dep_on_revs = $this->getConduit()->callMethodSynchronous(
'differential.query',
array(
'phids' => $phids,
'status' => 'status-open',
));
$dep_on_revs = $this->getConduit()->callMethodSynchronous( $open_dep_revs = array();
'differential.query', foreach ($dep_on_revs as $dep_on_rev) {
array( $dep_on_rev_id = $dep_on_rev['id'];
'phids' => $phids, $dep_on_rev_title = $dep_on_rev['title'];
'status' => 'status-open', $dep_on_rev_status = $dep_on_rev['status'];
)); $open_dep_revs[$dep_on_rev_id] = $dep_on_rev_title;
$open_dep_revs = array();
foreach ($dep_on_revs as $dep_on_rev) {
$dep_on_rev_id = $dep_on_rev['id'];
$dep_on_rev_title = $dep_on_rev['title'];
$dep_on_rev_status = $dep_on_rev['status'];
$open_dep_revs[$dep_on_rev_id] = $dep_on_rev_title;
}
if (!empty($open_dep_revs)) {
$open_revs = array();
foreach ($open_dep_revs as $id => $title) {
$open_revs[] = " - D".$id.": ".$title;
} }
$open_revs = implode("\n", $open_revs);
echo "Revision 'D{$rev_id}: {$rev_title}' depends ". if (!empty($open_dep_revs)) {
"on open revisions:\n\n"; $open_revs = array();
echo $open_revs; foreach ($open_dep_revs as $id => $title) {
$open_revs[] = " - D".$id.": ".$title;
}
$open_revs = implode("\n", $open_revs);
$ok = phutil_console_confirm("Continue anyway?"); echo "Revision 'D{$rev_id}: {$rev_title}' depends ".
if (!$ok) { "on open revisions:\n\n";
throw new ArcanistUserAbortException(); echo $open_revs;
$ok = phutil_console_confirm("Continue anyway?");
if (!$ok) {
throw new ArcanistUserAbortException();
}
} }
} }
} }