use of com.google.gerrit.client.info.ChangeInfo in project gerrit by GerritCodeReview.
the class RevertAction method call.
static void call(final Button b, final Change.Id id, final String revision, final String commitSubject) {
// TODO Replace ActionDialog with a nicer looking display.
b.setEnabled(false);
new TextAreaActionDialog(Util.C.revertChangeTitle(), Util.C.headingRevertMessage()) {
{
sendButton.setText(Util.C.buttonRevertChangeSend());
message.setText(Util.M.revertChangeDefaultMessage(commitSubject, revision));
}
@Override
public void onSend() {
ChangeApi.revert(id.get(), getMessageText(), new GerritCallback<ChangeInfo>() {
@Override
public void onSuccess(ChangeInfo result) {
sent = true;
hide();
Gerrit.display(PageLinks.toChange(result.legacyId()));
}
@Override
public void onFailure(Throwable caught) {
enableButtons(true);
super.onFailure(caught);
}
});
}
@Override
public void onClose(CloseEvent<PopupPanel> event) {
super.onClose(event);
b.setEnabled(true);
}
}.center();
}
use of com.google.gerrit.client.info.ChangeInfo in project gerrit by GerritCodeReview.
the class PatchSetsBox method onLoad.
@Override
protected void onLoad() {
if (!loaded) {
RestApi call = ChangeApi.detail(changeId.get());
ChangeList.addOptions(call, EnumSet.of(ListChangesOption.ALL_COMMITS, ListChangesOption.ALL_REVISIONS));
call.get(new AsyncCallback<ChangeInfo>() {
@Override
public void onSuccess(ChangeInfo result) {
if (edit != null) {
edit.setName(edit.commit().commit());
result.revisions().put(edit.name(), RevisionInfo.fromEdit(edit));
}
render(result.revisions());
loaded = true;
}
@Override
public void onFailure(Throwable caught) {
}
});
}
}
use of com.google.gerrit.client.info.ChangeInfo in project gerrit by GerritCodeReview.
the class RebaseAction method call.
static void call(final Button b, final String project, final String branch, final Change.Id id, final String revision, final boolean enabled) {
b.setEnabled(false);
new RebaseDialog(project, branch, id, enabled) {
@Override
public void onSend() {
ChangeApi.rebase(id.get(), revision, getBase(), new GerritCallback<ChangeInfo>() {
@Override
public void onSuccess(ChangeInfo result) {
sent = true;
hide();
Gerrit.display(PageLinks.toChange(id));
}
@Override
public void onFailure(Throwable caught) {
enableButtons(true);
super.onFailure(caught);
}
});
}
@Override
public void onClose(CloseEvent<PopupPanel> event) {
super.onClose(event);
b.setEnabled(true);
}
}.center();
}
use of com.google.gerrit.client.info.ChangeInfo in project gerrit by GerritCodeReview.
the class ChangeTable method onOpenRow.
@Override
protected void onOpenRow(final int row) {
final ChangeInfo c = getRowItem(row);
final Change.Id id = c.legacyId();
Gerrit.display(PageLinks.toChange(id));
}
use of com.google.gerrit.client.info.ChangeInfo in project gerrit by GerritCodeReview.
the class CherryPickAction method call.
static void call(final Button b, final ChangeInfo info, final String revision, String project, final String commitMessage) {
// TODO Replace CherryPickDialog with a nicer looking display.
b.setEnabled(false);
new CherryPickDialog(new Project.NameKey(project)) {
{
sendButton.setText(Util.C.buttonCherryPickChangeSend());
if (info.status() == Change.Status.MERGED) {
message.setText(Util.M.cherryPickedChangeDefaultMessage(commitMessage.trim(), revision));
} else {
message.setText(commitMessage.trim());
}
}
@Override
public void onSend() {
ChangeApi.cherrypick(info.legacyId().get(), revision, getDestinationBranch(), getMessageText(), new GerritCallback<ChangeInfo>() {
@Override
public void onSuccess(ChangeInfo result) {
sent = true;
hide();
Gerrit.display(PageLinks.toChange(result.legacyId()));
}
@Override
public void onFailure(Throwable caught) {
enableButtons(true);
super.onFailure(caught);
}
});
}
@Override
public void onClose(CloseEvent<PopupPanel> event) {
super.onClose(event);
b.setEnabled(true);
}
}.center();
}
Aggregations