@Override public String getValue(Revision revision) { return revision.getId().substring(0, 8) + "..."; } };
@Override public String getValue(Revision revision) { return revision.getId().substring(0, 8); } };
@Override public String getValue(Revision revision) { return revision.getId().substring(0, 8) + "..."; } };
writer.write(revision.getBranch()); writer.write(' '); writer.write(revision.getId()); writer.write(']'); writer.write(' ');
/** @see InfoPage#writeTo(java.io.OutputStream) */ @Override public void writeTo(OutputStream out) throws IOException { PrintWriter writer = new PrintWriter(out); DateFormat df = (DateFormat) dateFormat.clone(); for (Revision commit : commits) { writer.format("commit %s\n", commit.getId()); GitUser commiter = commit.getCommitter(); if (commiter != null) { writer.format("Author: %1$s <%2$s>\n", commiter.getName(), commiter.getEmail()); } long commitTime = commit.getCommitTime(); if (commitTime > 0) { writer.format("Date: %s\n", df.format(new Date(commitTime))); } writer.println(); // Message with indent. String[] lines = commit.getMessage().split("\n"); for (String line : lines) { writer.format(" %s\n", line); } writer.println(); } writer.flush(); }
String revisionFileName = docId+"_"+revision.getId()+"_"+revision.getModifiedDate(); FileOutputStream outputstream = new FileOutputStream(new java.io.File(revisionFileDir, revisionFileName)); IOUtils.copy(resp.getContent(), outputstream,true);
this.committer = committerIn == null ? null : new GitUserImpl(committerIn); this.message = origin.getMessage(); this.id = origin.getId(); this.fake = origin.isFake(); this.branch = origin.getBranch();
private void onCommitSuccess(@NotNull final Revision revision) { String date = dateTimeFormatter.getFormattedDate(revision.getCommitTime()); String message = locale.commitMessage(revision.getId(), date); if ((revision.getCommitter() != null && revision.getCommitter().getName() != null && !revision.getCommitter().getName().isEmpty())) { message += " " + locale.commitUser(revision.getCommitter().getName()); } GitOutputConsole console = gitOutputConsoleFactory.create(COMMIT_COMMAND_NAME); console.print(message); consolesPanelPresenter.addCommandOutput(console); notificationManager.notify(message); view.setMessage(""); }
private void revert() { final GitOutputConsole console = gitOutputConsoleFactory.create(constant.consoleRevertCommandName()); service .revert(project.getLocation(), selectedRevision.getId()) .then( result -> { console.print(formRevertMessage(result)); String conflictsMessage = formConflictsMessage(result.getConflicts()); if (!conflictsMessage.isEmpty()) { console.printError(conflictsMessage); } consolesPanelPresenter.addCommandOutput(console); notificationManager.notify(constant.revertCommitSuccessfully()); }) .catchError( error -> { String errorMessage = (error.getMessage() != null) ? error.getMessage() : constant.revertCommitFailed(); console.printError(errorMessage); consolesPanelPresenter.addCommandOutput(console); notificationManager.notify(constant.revertCommitFailed(), FAIL, FLOAT_MODE); }); }
/** Reset current HEAD to the specified state and refresh project in the success case. */ private void reset() { ResetRequest.ResetType type = view.isMixMode() ? ResetRequest.ResetType.MIXED : null; type = (type == null && view.isSoftMode()) ? ResetRequest.ResetType.SOFT : type; type = (type == null && view.isHardMode()) ? ResetRequest.ResetType.HARD : type; final GitOutputConsole console = gitOutputConsoleFactory.create(RESET_COMMAND_NAME); service .reset(project.getLocation(), selectedRevision.getId(), type, null) .then( ignored -> { console.print(constant.resetSuccessfully()); consolesPanelPresenter.addCommandOutput(console); notificationManager.notify(constant.resetSuccessfully()); }) .catchError( error -> { String errorMessage = (error.getMessage() != null) ? error.getMessage() : constant.resetFail(); console.printError(errorMessage); consolesPanelPresenter.addCommandOutput(console); notificationManager.notify(constant.resetFail(), FAIL, FLOAT_MODE); }); } }