Allow file annotations (blame) in side-by-side diff

Using CodeMirror's lint addon on the UI to display the blame
annotations. It works on both sides of the side-by-side
diff and also supports the auto-merge commit. It requires manual
step to enable the annotations to avoid any unnecessary git
processing and network traffic between the server and client.

Introduces a new dependency on blame-cache in gerrit-server
to reuse BlameCache.

In a following change, the gutter showing the blame info will be
made clickable. Clicking on the gutter will open a new tab that
takes the user to the corresponding change in Gerrit.

The commit SHA-1 hashes are currently not selectable. Making it
so might require an upstream change in CodeMirror's lint addon.

Bug: Issue 1642
Change-Id: I6267d30cbee448f8137e11c7120959dc424eaeeb
This commit is contained in:
Gabor Somossy
2015-10-20 23:40:07 +01:00
committed by Michael Zhou
parent b3ba766ffa
commit b72d4c6d8f
27 changed files with 655 additions and 0 deletions

View File

@@ -42,6 +42,9 @@ public interface Resources extends ClientBundle {
@Source("resultset_up_gray.png")
ImageResource arrowUp();
@Source("lightbulb.png")
ImageResource blame();
@Source("page_white_put.png")
ImageResource downloadIcon();

View File

@@ -56,6 +56,7 @@ public class ServerInfo extends JavaScriptObject {
public static class ChangeConfigInfo extends JavaScriptObject {
public final native boolean allowDrafts() /*-{ return this.allow_drafts || false; }-*/;
public final native boolean allowBlame() /*-{ return this.allow_blame || false; }-*/;
public final native int largeChange() /*-{ return this.large_change || 0; }-*/;
public final native String replyLabel() /*-{ return this.reply_label; }-*/;
public final native String replyTooltip() /*-{ return this.reply_tooltip; }-*/;