Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/intellij15' into intellij2016.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle.properties
  • Loading branch information
uwolfer committed Jan 28, 2020
2 parents daed8a0 + f01d677 commit f6fb171
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 34 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ Diff viewing is based on Git operations (i.e. it fetches the commit from the Ger
takes a lot of time, you can run a local "[git gc](https://www.kernel.org/pub/software/scm/git/docs/git-gc.html)"
and ask your Gerrit administrator to do run a "[gerrit gc](https://gerrit-review.googlesource.com/Documentation/cmd-gc.html)".

### Authenticate against *-review.googlesource.com
It's a bit of manual work to do:
<kbd>Settings</kbd> -> <kbd>HTTP Credentials</kbd> -> <kbd>Obtain password</kbd>

Then search for the line in the text area starting with `*-review.googlesource.com` (e.g. `gerrit-review.googlesource.com`) and extract username and password:

gerrit-review.googlesource.com,FALSE,/,TRUE,12345678,o,**git-username.gmail.com**=**password-until-end-of-line**

Architecture
------------
### IntelliJ Integration
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

plugins {
id 'org.jetbrains.intellij' version '0.4.10'
id 'org.jetbrains.intellij' version '0.4.15'
}

apply plugin: 'java'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ideaVersion=IC-2016.2.5
ijPluginRepoChannel=
downloadIdeaSources=false
version=1.2.0-146
version=1.2.1-146
javaVersion=1.8
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.urswolfer.intellij.plugin.gerrit.errorreport;

import com.google.common.base.Strings;
import com.google.common.base.Throwables;
import com.google.gson.Gson;
import com.intellij.openapi.application.ex.ApplicationInfoEx;
import com.intellij.openapi.diagnostic.ErrorReportSubmitter;
Expand Down Expand Up @@ -97,7 +96,7 @@ private void postError(String json) {
httpClient.close();
}
} catch (IOException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static git4idea.commands.GitSimpleEventDetector.Event.LOCAL_CHANGES_OVERWRITTEN_BY_CHERRY_PICK;

import com.google.common.base.Optional;
import com.google.common.base.Throwables;
import com.google.gerrit.extensions.common.ChangeInfo;
import com.google.gerrit.extensions.common.FetchInfo;
import com.google.inject.Inject;
Expand Down Expand Up @@ -154,7 +153,7 @@ public void onSuccess() {
successCallable.call();
}
} catch (Exception e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import com.google.common.base.Supplier;
import com.google.common.base.Throwables;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
Expand Down Expand Up @@ -129,7 +128,7 @@ public void run(@NotNull ProgressIndicator indicator) {
if (exception.get() == null) {
return result.get();
}
throw Throwables.propagate(exception.get());
throw new RuntimeException(exception.get());
}

public void postReview(final String changeId,
Expand All @@ -144,7 +143,7 @@ public Void get() {
gerritClient.changes().id(changeId).revision(revision).review(reviewInput);
return null;
} catch (RestApiException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
};
Expand All @@ -162,7 +161,7 @@ public Void get() {
gerritClient.changes().id(changeId).current().submit(submitInput);
return null;
} catch (RestApiException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
};
Expand All @@ -179,7 +178,7 @@ public Void get() {
gerritClient.changes().id(changeId).publish();
return null;
} catch (RestApiException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
};
Expand All @@ -196,7 +195,7 @@ public Void get() {
gerritClient.changes().id(changeId).delete();
return null;
} catch (RestApiException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
};
Expand All @@ -214,7 +213,7 @@ public Void get() {
gerritClient.changes().id(changeId).abandon(abandonInput);
return null;
} catch (RestApiException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
};
Expand All @@ -232,7 +231,7 @@ public Void get() {
gerritClient.changes().id(changeId).addReviewer(reviewerName);
return null;
} catch (RestApiException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
};
Expand All @@ -257,7 +256,7 @@ public Void get() {
}
return null;
} catch (RestApiException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
};
Expand All @@ -280,7 +279,7 @@ public Void get() {
gerritClient.changes().id(changeNr).revision(revision).setReviewed(filePath, true);
return null;
} catch (RestApiException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
};
Expand Down Expand Up @@ -548,7 +547,7 @@ public CommentInfo get() {
}
return commentInfo;
} catch (RestApiException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
};
Expand All @@ -567,7 +566,7 @@ public Void get() {
gerritClient.changes().id(changeNr).revision(revision).draft(draftCommentId).delete();
return null;
} catch (RestApiException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void setCommit(final ChangeInfo changeInfo) {
}

private void addMetaData(ChangeInfo changeInfo, StringBuilder sb) {
final String comment = IssueLinkHtmlRenderer.formatTextWithLinks(project, changeInfo.subject);
String comment = changeInfo.subject != null ? IssueLinkHtmlRenderer.formatTextWithLinks(project, changeInfo.subject) : "-";
sb.append("<html><head>").append(UIUtil.getCssFontDeclaration(UIUtil.getLabelFont()))
.append("</head><body><table>")
.append("<tr valign=\"top\"><td><i>Change-Id:</i></td><td><b>").append(changeInfo.changeId).append("</b></td></tr>")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public class AbandonAction extends AbstractLoggedInChangeAction {

public AbandonAction() {
super("Abandon", "Abandon Change", AllIcons.Actions.Delete);
super("Abandon", "Abandon Change", AllIcons.Actions.Cancel);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.google.common.base.Optional;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.base.Throwables;
import com.google.gerrit.extensions.api.GerritApi;
import com.google.gerrit.extensions.common.AccountInfo;
import com.google.gerrit.extensions.common.ChangeInfo;
Expand All @@ -42,14 +41,14 @@
import com.intellij.ui.EditorTextFieldProvider;
import com.intellij.ui.SoftWrapsEditorCustomization;
import com.intellij.util.TextFieldCompletionProviderDumbAware;
import com.intellij.util.containers.ContainerUtil;
import com.urswolfer.gerrit.client.rest.GerritRestApi;
import com.urswolfer.intellij.plugin.gerrit.GerritModule;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

Expand Down Expand Up @@ -98,7 +97,7 @@ protected AddReviewersDialog(Project project,
setOKButtonText("Add Reviewers");

EditorTextFieldProvider service = ServiceManager.getService(project, EditorTextFieldProvider.class);
Set<EditorCustomization> editorFeatures = ContainerUtil.newHashSet();
Set<EditorCustomization> editorFeatures = new HashSet<EditorCustomization>();
editorFeatures.add(SoftWrapsEditorCustomization.ENABLED);
editorFeatures.add(SpellCheckingEditorCustomizationProvider.getInstance().getDisabledCustomization());
reviewTextField = service.getEditorField(FileTypes.PLAIN_TEXT.getLanguage(), project, editorFeatures);
Expand Down Expand Up @@ -138,7 +137,7 @@ protected void addCompletionVariants(@NotNull final String text,
}
}
} catch (RestApiException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ private String buildBranchName(ChangeInfo changeDetails) {
if (topic == null) {
topic = Integer.toString(changeDetails._number);
}
String branchName = "review/" + changeDetails.owner.name.toLowerCase().replace(" ", "_").replace("?", "_") + '/' + topic;
String branchName = "review/" + changeDetails.owner.name.toLowerCase() + '/' + topic;
if (revisionInfo._number != changeDetails.revisions.size()) {
branchName += "-patch" + revisionInfo._number;
}
return branchName;
return branchName.replace(" ", "_").replace("?", "_");
}

public static class Proxy extends CheckoutAction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class CompareBranchAction extends AbstractChangeAction {
private NotificationService notificationService;

public CompareBranchAction() {
super("Compare with Branch", "Compare change with current branch", AllIcons.Actions.DiffWithCurrent);
super("Compare with Branch", "Compare change with current branch", AllIcons.Actions.Diff);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class DeleteAction extends AbstractLoggedInChangeAction {

public DeleteAction() {
super("Delete Draft", "Delete Draft Change", AllIcons.Actions.Delete);
super("Delete Draft", "Delete Draft Change", AllIcons.Actions.Cancel);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public class PublishAction extends AbstractLoggedInChangeAction {

public PublishAction() {
super("Publish Draft", "Publish Draft Change", AllIcons.Actions.Nextfile);
super("Publish Draft", "Publish Draft Change", AllIcons.Actions.Forward);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class SubmitAction extends AbstractLoggedInChangeAction {
private NotificationService notificationService;

public SubmitAction() {
super("Submit", "Submit Change", AllIcons.Actions.Export);
super("Submit", "Submit Change", AllIcons.ToolbarDecorator.Export);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.urswolfer.intellij.plugin.gerrit.ui.diff;

import com.google.common.base.Throwables;
import com.google.gerrit.extensions.client.Comment;
import com.intellij.util.text.CharSequenceReader;

Expand Down Expand Up @@ -58,7 +57,7 @@ public static Comment.Range textOffsetToRange(CharSequence charsSequence, int st
}
}
} catch (IOException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
} finally {
charSequenceReader.close();
}
Expand Down Expand Up @@ -93,7 +92,7 @@ public static Offset rangeToTextOffset(CharSequence charsSequence, Comment.Range
textLineCount++;
}
} catch (IOException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
} finally {
charSequenceReader.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public RemoveCommentAction(CommentsDiffTool commentsDiffTool,
String revisionId,
RangeHighlighter lineHighlighter,
RangeHighlighter rangeHighlighter) {
super("Remove", "Remove selected comment", AllIcons.Actions.Delete);
super("Remove", "Remove selected comment", AllIcons.Actions.Cancel);

this.commentsDiffTool = commentsDiffTool;
this.comment = comment;
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@
href="https://github.com/uwolfer/gerrit-intellij-plugin#pre-releases">
https://github.com/uwolfer/gerrit-intellij-plugin#pre-releases</a>.</li>
<li>1.2.1</li>
<ul>
<li>fix compatibility with new IntelliJ APIs</li>
<li>minor fixes and improvements</li>
</ul>
<li>1.2.0</li>
<ul>
<li>add review filter for assignee</li>
Expand Down

0 comments on commit f6fb171

Please sign in to comment.