diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 546a173607..9849ae8470 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -228,7 +228,7 @@ final class DifferentialRevisionViewController extends DifferentialController { $revision_detail = new DifferentialRevisionDetailView(); $revision_detail->setRevision($revision); - $revision_detail->setDiff(reset($diffs)); + $revision_detail->setDiff(end($diffs)); $revision_detail->setAuxiliaryFields($aux_fields); $actions = $this->getRevisionActions($revision); diff --git a/src/applications/differential/view/DifferentialRevisionDetailView.php b/src/applications/differential/view/DifferentialRevisionDetailView.php index 7abb848714..78cb39b634 100644 --- a/src/applications/differential/view/DifferentialRevisionDetailView.php +++ b/src/applications/differential/view/DifferentialRevisionDetailView.php @@ -69,13 +69,24 @@ final class DifferentialRevisionDetailView extends AphrontView { if ($status == ArcanistDifferentialRevisionStatus::ACCEPTED) { switch ($local_vcs) { case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: - case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: - $next_step = phutil_tag('tt', array(), 'arc land'); + $bookmark = $this->getDiff()->getBookmark(); + $command = ($bookmark != '' + ? csprintf('arc land %s', $bookmark) + : 'arc land'); break; + + case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: + $branch = $this->getDiff()->getBranch(); + $command = ($branch != '' + ? csprintf('arc land %s', $branch) + : 'arc land'); + break; + case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: - $next_step = phutil_tag('tt', array(), 'arc commit'); + $command = 'arc commit'; break; } + $next_step = phutil_tag('tt', array(), $command); } if ($next_step) { $properties->addProperty(pht('Next Step'), $next_step);