Merge "Always show "submitted together" for topicless changes"

This commit is contained in:
Shawn Pearce 2015-07-17 19:52:42 +00:00 committed by Gerrit Code Review
commit dc8f340ba0

View File

@ -215,12 +215,8 @@ public class RelatedChanges extends TabPanel {
EnumSet.of(ListChangesOption.CURRENT_REVISION, ListChangesOption.CURRENT_COMMIT), EnumSet.of(ListChangesOption.CURRENT_REVISION, ListChangesOption.CURRENT_COMMIT),
new TabChangeListCallback(Tab.CHERRY_PICKS, info.project(), revision)); new TabChangeListCallback(Tab.CHERRY_PICKS, info.project(), revision));
if (Gerrit.info().change().isSubmitWholeTopicEnabled()) { if (!Gerrit.info().change().isSubmitWholeTopicEnabled()
// TODO(sbeller): show only on latest revision && info.topic() != null && !"".equals(info.topic())) {
ChangeApi.change(info.legacyId().get()).view("submitted_together")
.get(new TabChangeListCallback(Tab.SUBMITTED_TOGETHER,
info.project(), revision));
} else if (info.topic() != null && !"".equals(info.topic())) {
StringBuilder topicQuery = new StringBuilder(); StringBuilder topicQuery = new StringBuilder();
topicQuery.append("status:open"); topicQuery.append("status:open");
topicQuery.append(" ").append(op("topic", info.topic())); topicQuery.append(" ").append(op("topic", info.topic()));
@ -230,6 +226,11 @@ public class RelatedChanges extends TabPanel {
ListChangesOption.DETAILED_LABELS, ListChangesOption.DETAILED_LABELS,
ListChangesOption.LABELS), ListChangesOption.LABELS),
new TabChangeListCallback(Tab.SAME_TOPIC, info.project(), revision)); new TabChangeListCallback(Tab.SAME_TOPIC, info.project(), revision));
} else {
// TODO(sbeller): show only on latest revision
ChangeApi.change(info.legacyId().get()).view("submitted_together")
.get(new TabChangeListCallback(Tab.SUBMITTED_TOGETHER,
info.project(), revision));
} }
} }