diff --git a/README.md b/README.md index 3bd6d617..4627be23 100644 --- a/README.md +++ b/README.md @@ -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: +Settings -> HTTP Credentials -> Obtain password + +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 diff --git a/build.gradle b/build.gradle index 29746970..323749af 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ */ plugins { - id 'org.jetbrains.intellij' version '0.4.10' + id 'org.jetbrains.intellij' version '0.4.15' } apply plugin: 'java' diff --git a/gradle.properties b/gradle.properties index e0c3ed31..388ec5a5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/errorreport/PluginErrorReportSubmitter.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/errorreport/PluginErrorReportSubmitter.java index 6060251e..f11e2a24 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/errorreport/PluginErrorReportSubmitter.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/errorreport/PluginErrorReportSubmitter.java @@ -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; @@ -97,7 +96,7 @@ private void postError(String json) { httpClient.close(); } } catch (IOException e) { - throw Throwables.propagate(e); + throw new RuntimeException(e); } } } diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/git/GerritGitUtil.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/git/GerritGitUtil.java index 84cec886..2afd3dce 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/git/GerritGitUtil.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/git/GerritGitUtil.java @@ -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; @@ -154,7 +153,7 @@ public void onSuccess() { successCallable.call(); } } catch (Exception e) { - throw Throwables.propagate(e); + throw new RuntimeException(e); } } diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/rest/GerritUtil.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/rest/GerritUtil.java index 49144c01..968796bd 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/rest/GerritUtil.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/rest/GerritUtil.java @@ -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; @@ -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, @@ -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); } } }; @@ -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); } } }; @@ -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); } } }; @@ -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); } } }; @@ -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); } } }; @@ -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); } } }; @@ -257,7 +256,7 @@ public Void get() { } return null; } catch (RestApiException e) { - throw Throwables.propagate(e); + throw new RuntimeException(e); } } }; @@ -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); } } }; @@ -548,7 +547,7 @@ public CommentInfo get() { } return commentInfo; } catch (RestApiException e) { - throw Throwables.propagate(e); + throw new RuntimeException(e); } } }; @@ -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); } } }; diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/GerritChangeDetailsPanel.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/GerritChangeDetailsPanel.java index 972448ad..f339f66a 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/GerritChangeDetailsPanel.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/GerritChangeDetailsPanel.java @@ -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("").append(UIUtil.getCssFontDeclaration(UIUtil.getLabelFont())) .append("") .append("") diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/AbandonAction.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/AbandonAction.java index 82060f0e..208dfef2 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/AbandonAction.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/AbandonAction.java @@ -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 diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/AddReviewersAction.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/AddReviewersAction.java index 4f1de680..c8de9af3 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/AddReviewersAction.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/AddReviewersAction.java @@ -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; @@ -42,7 +41,6 @@ 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; @@ -50,6 +48,7 @@ import javax.swing.*; import java.awt.*; +import java.util.HashSet; import java.util.List; import java.util.Set; @@ -98,7 +97,7 @@ protected AddReviewersDialog(Project project, setOKButtonText("Add Reviewers"); EditorTextFieldProvider service = ServiceManager.getService(project, EditorTextFieldProvider.class); - Set editorFeatures = ContainerUtil.newHashSet(); + Set editorFeatures = new HashSet(); editorFeatures.add(SoftWrapsEditorCustomization.ENABLED); editorFeatures.add(SpellCheckingEditorCustomizationProvider.getInstance().getDisabledCustomization()); reviewTextField = service.getEditorField(FileTypes.PLAIN_TEXT.getLanguage(), project, editorFeatures); @@ -138,7 +137,7 @@ protected void addCompletionVariants(@NotNull final String text, } } } catch (RestApiException e) { - throw Throwables.propagate(e); + throw new RuntimeException(e); } } }; diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/CheckoutAction.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/CheckoutAction.java index 112127fb..21120b64 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/CheckoutAction.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/CheckoutAction.java @@ -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 { diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/CompareBranchAction.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/CompareBranchAction.java index e17a144f..0c98f196 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/CompareBranchAction.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/CompareBranchAction.java @@ -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 diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/DeleteAction.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/DeleteAction.java index 00a82d06..b44b282a 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/DeleteAction.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/DeleteAction.java @@ -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 diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/PublishAction.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/PublishAction.java index 2ed1928c..f7829852 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/PublishAction.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/PublishAction.java @@ -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 diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/SubmitAction.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/SubmitAction.java index f7d5a573..4f98834b 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/SubmitAction.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/action/SubmitAction.java @@ -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 diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/diff/RangeUtils.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/diff/RangeUtils.java index 10f4a72c..2087c5bc 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/diff/RangeUtils.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/diff/RangeUtils.java @@ -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; @@ -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(); } @@ -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(); } diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/diff/RemoveCommentAction.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/diff/RemoveCommentAction.java index 6700d041..090a008e 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/diff/RemoveCommentAction.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/diff/RemoveCommentAction.java @@ -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; diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 1e5699bc..f5dce2ba 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -89,6 +89,11 @@ href="https://github.com/uwolfer/gerrit-intellij-plugin#pre-releases"> https://github.com/uwolfer/gerrit-intellij-plugin#pre-releases. +
  • 1.2.1
  • +
      +
    • fix compatibility with new IntelliJ APIs
    • +
    • minor fixes and improvements
    • +
  • 1.2.0
    • add review filter for assignee
    Change-Id:").append(changeInfo.changeId).append("