Skip to content

The Unified and Autonomous Development Platform

Enhance BlobSearcher to be able to send results to web layer via web socket.

robin shineaee07ce4b9cb
diff --git a/commons.wicket/src/main/java/com/pmease/commons/wicket/websocket/WebSocketRenderBehavior.java b/commons.wicket/src/main/java/com/pmease/commons/wicket/websocket/WebSocketRenderBehavior.java
index 53fdab6f63..c165764167 100644
--- a/commons.wicket/src/main/java/com/pmease/commons/wicket/websocket/WebSocketRenderBehavior.java
+++ b/commons.wicket/src/main/java/com/pmease/commons/wicket/websocket/WebSocketRenderBehavior.java
@@ -14,6 +14,7 @@ import java.util.concurrent.ExecutorService;
import javax.annotation.Nullable;
import org.apache.wicket.Component;
+import org.apache.wicket.Page;
import org.apache.wicket.protocol.ws.api.IWebSocketConnection;
import org.apache.wicket.protocol.ws.api.WebSocketBehavior;
import org.apache.wicket.protocol.ws.api.WebSocketRequestHandler;
@@ -142,6 +143,14 @@ public abstract class WebSocketRenderBehavior extends WebSocketBehavior {
});
}
+ /**
+ * Return trait object of this behavior. When method {@link #requestToRender(Object, PageId)} gets
+ * called, its first parameter will be compared with this trait via <tt>equals</tt> method, and if
+ * equals, method {@link #onRender(WebSocketRequestHandler)} will be called to render this behavior.
+ *
+ * @return
+ * trait of this behavior
+ */
protected abstract Object getTrait();
protected void onRender(WebSocketRequestHandler handler) {
@@ -176,13 +185,17 @@ public abstract class WebSocketRenderBehavior extends WebSocketBehavior {
}
}
+ public static void requestToRender(Object trait, Page page) {
+ requestToRender(trait, PageId.fromObj(page.getId()));
+ }
+
public static void requestToRender(Object trait, @Nullable PageId pageId) {
String message = asMessage(trait);
for (Iterator<Map.Entry<IWebSocketConnection, ConnectionData>> it = connections.entrySet().iterator(); it.hasNext();) {
Map.Entry<IWebSocketConnection, ConnectionData> entry = it.next();
IWebSocketConnection connection = entry.getKey();
- if (connection != null && connection.isOpen()) {
+ if (connection != null && connection.isOpen()) synchronized (connection) {
ConnectionData data = entry.getValue();
if ((pageId == null || !pageId.equals(data.getPageId())) && data.getTraits().contains(trait)) {
try {
diff --git a/gitplex.search/src/main/java/com/pmease/gitplex/search/DefaultIndexManager.java b/gitplex.search/src/main/java/com/pmease/gitplex/search/DefaultIndexManager.java
index 87b7c44812..aad1e68b5e 100644
--- a/gitplex.search/src/main/java/com/pmease/gitplex/search/DefaultIndexManager.java
+++ b/gitplex.search/src/main/java/com/pmease/gitplex/search/DefaultIndexManager.java
@@ -1,6 +1,6 @@
package com.pmease.gitplex.search;
-import static com.pmease.gitplex.search.FieldConstants.BLOB_CONTENT;
+import static com.pmease.gitplex.search.FieldConstants.BLOB_TEXT;
import static com.pmease.gitplex.search.FieldConstants.BLOB_HASH;
import static com.pmease.gitplex.search.FieldConstants.BLOB_INDEX_VERSION;
import static com.pmease.gitplex.search.FieldConstants.BLOB_PATH;
@@ -257,9 +257,9 @@ public class DefaultIndexManager implements IndexManager {
if (charset != null) {
String content = new String(bytes, charset);
TokenStream tokens = new NGramTokenizer(new StringReader(content),
- IndexConstants.CONTENT_GRAM_SIZE, IndexConstants.CONTENT_GRAM_SIZE);
+ IndexConstants.TEXT_GRAM_SIZE, IndexConstants.TEXT_GRAM_SIZE);
tokens = new LowerCaseFilter(tokens);
- document.add(new Field(BLOB_CONTENT.name(), tokens, TextField.TYPE_NOT_STORED));
+ document.add(new Field(BLOB_TEXT.name(), tokens, TextField.TYPE_NOT_STORED));
if (extractor != null) {
try {
diff --git a/gitplex.search/src/main/java/com/pmease/gitplex/search/DefaultSearchManager.java b/gitplex.search/src/main/java/com/pmease/gitplex/search/DefaultSearchManager.java
index 9d38d4a19b..85d528a503 100644
--- a/gitplex.search/src/main/java/com/pmease/gitplex/search/DefaultSearchManager.java
+++ b/gitplex.search/src/main/java/com/pmease/gitplex/search/DefaultSearchManager.java
@@ -1,6 +1,7 @@
package com.pmease.gitplex.search;
import java.io.IOException;
+import java.nio.channels.ClosedByInterruptException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -52,7 +53,7 @@ public class DefaultSearchManager implements SearchManager, IndexListener {
}
@Nullable
- private SearcherManager getSearcherManager(Repository repository) {
+ private SearcherManager getSearcherManager(Repository repository) throws InterruptedException {
try {
SearcherManager searcherManager = searcherManagers.get(repository.getId());
if (searcherManager == null) synchronized (searcherManagers) {
@@ -66,6 +67,13 @@ public class DefaultSearchManager implements SearchManager, IndexListener {
}
}
return searcherManager;
+ } catch (ClosedByInterruptException e) {
+ // catch this exception and convert to normal InterruptedException as
+ // we do not want to throw the original exception to surprise the user
+ // when they searches by typing fast (and subsequent typing will cancel
+ // search of previous typing by interrupting previous search thread
+ // which may creating the searcher manager if it does not exist yet
+ throw new InterruptedException();
} catch (IOException e) {
throw Throwables.propagate(e);
}
@@ -91,7 +99,9 @@ public class DefaultSearchManager implements SearchManager, IndexListener {
Preconditions.checkArgument(GitUtils.isHash(commitHash));
final List<QueryHit> hits = new ArrayList<>();
- SearcherManager searcherManager = getSearcherManager(repository);
+
+ SearcherManager searcherManager;
+ searcherManager = getSearcherManager(repository);
if (searcherManager != null) {
try {
final IndexSearcher searcher = searcherManager.acquire();
@@ -157,7 +167,7 @@ public class DefaultSearchManager implements SearchManager, IndexListener {
public void commitIndexed(Repository repository, String commitHash) {
try {
getSearcherManager(repository).maybeRefresh();
- } catch (IOException e) {
+ } catch (InterruptedException | IOException e) {
Throwables.propagate(e);
}
}
diff --git a/gitplex.search/src/main/java/com/pmease/gitplex/search/FieldConstants.java b/gitplex.search/src/main/java/com/pmease/gitplex/search/FieldConstants.java
index f1b24ae427..70a439102c 100644
--- a/gitplex.search/src/main/java/com/pmease/gitplex/search/FieldConstants.java
+++ b/gitplex.search/src/main/java/com/pmease/gitplex/search/FieldConstants.java
@@ -1,11 +1,10 @@
package com.pmease.gitplex.search;
import org.apache.lucene.index.Term;
-import org.apache.lucene.search.NGramPhraseQuery;
import org.apache.lucene.search.TermQuery;
public enum FieldConstants {
- BLOB_INDEX_VERSION, BLOB_HASH, BLOB_PATH, BLOB_SYMBOLS, BLOB_CONTENT,
+ BLOB_INDEX_VERSION, BLOB_HASH, BLOB_PATH, BLOB_SYMBOLS, BLOB_TEXT,
COMMIT_INDEX_VERSION, COMMIT_HASH,
META, LAST_COMMIT, LAST_COMMIT_HASH, LAST_COMMIT_INDEX_VERSION;
@@ -17,7 +16,4 @@ public enum FieldConstants {
return new Term(name(), value);
}
- public NGramPhraseQuery ngramQuery(String value) {
- return null;
- }
}
diff --git a/gitplex.search/src/main/java/com/pmease/gitplex/search/IndexConstants.java b/gitplex.search/src/main/java/com/pmease/gitplex/search/IndexConstants.java
index 16ebdbb3fb..3e29891178 100644
--- a/gitplex.search/src/main/java/com/pmease/gitplex/search/IndexConstants.java
+++ b/gitplex.search/src/main/java/com/pmease/gitplex/search/IndexConstants.java
@@ -4,7 +4,7 @@ public interface IndexConstants {
int MAX_INDEXABLE_SIZE = 1024*1024;
- int CONTENT_GRAM_SIZE = 2;
+ int TEXT_GRAM_SIZE = 2;
int SYMBOL_GRAM_SIZE = 2;
diff --git a/gitplex.search/src/main/java/com/pmease/gitplex/search/hit/ContentHit.java b/gitplex.search/src/main/java/com/pmease/gitplex/search/hit/TextHit.java
similarity index 92%
rename from gitplex.search/src/main/java/com/pmease/gitplex/search/hit/ContentHit.java
rename to gitplex.search/src/main/java/com/pmease/gitplex/search/hit/TextHit.java
index cbcad7c29e..5a22c020ac 100644
--- a/gitplex.search/src/main/java/com/pmease/gitplex/search/hit/ContentHit.java
+++ b/gitplex.search/src/main/java/com/pmease/gitplex/search/hit/TextHit.java
@@ -7,7 +7,7 @@ import org.apache.wicket.markup.html.basic.Label;
import com.google.common.base.Preconditions;
-public class ContentHit extends QueryHit {
+public class TextHit extends QueryHit {
private final int lineNo;
@@ -15,7 +15,7 @@ public class ContentHit extends QueryHit {
private final List<Match> matches;
- public ContentHit(String blobPath, String line, int lineNo, List<Match> matches) {
+ public TextHit(String blobPath, String line, int lineNo, List<Match> matches) {
super(blobPath);
Preconditions.checkArgument(!matches.isEmpty(), "Matches should not be empty");
diff --git a/gitplex.search/src/main/java/com/pmease/gitplex/search/query/SymbolQuery.java b/gitplex.search/src/main/java/com/pmease/gitplex/search/query/SymbolQuery.java
index 10ff39706e..806bc34b14 100644
--- a/gitplex.search/src/main/java/com/pmease/gitplex/search/query/SymbolQuery.java
+++ b/gitplex.search/src/main/java/com/pmease/gitplex/search/query/SymbolQuery.java
@@ -11,6 +11,7 @@ import com.pmease.commons.lang.Extractor;
import com.pmease.commons.lang.Extractors;
import com.pmease.commons.lang.Symbol;
import com.pmease.commons.util.Charsets;
+import com.pmease.commons.util.StringUtils;
import com.pmease.gitplex.core.GitPlex;
import com.pmease.gitplex.search.FieldConstants;
import com.pmease.gitplex.search.IndexConstants;
@@ -53,12 +54,18 @@ public class SymbolQuery extends BlobQuery {
}
}
+ String blobName;
+ int index = blobPath.indexOf('/');
+ if (index != -1)
+ blobName = StringUtils.substringAfterLast(blobPath, "/");
+ else
+ blobName = blobPath;
if (!isCaseSensitive()) {
- blobPath = blobPath.toLowerCase();
+ blobName = blobName.toLowerCase();
searchFor = searchFor.toLowerCase();
}
- if (blobPath.startsWith(searchFor))
- hits.add(new FileHit(treeWalk.getPathString()));
+ if (blobName.startsWith(searchFor))
+ hits.add(new FileHit(blobPath));
}
}
diff --git a/gitplex.search/src/main/java/com/pmease/gitplex/search/query/ContentQuery.java b/gitplex.search/src/main/java/com/pmease/gitplex/search/query/TextQuery.java
similarity index 77%
rename from gitplex.search/src/main/java/com/pmease/gitplex/search/query/ContentQuery.java
rename to gitplex.search/src/main/java/com/pmease/gitplex/search/query/TextQuery.java
index 68cdd0e696..8b0903b77a 100644
--- a/gitplex.search/src/main/java/com/pmease/gitplex/search/query/ContentQuery.java
+++ b/gitplex.search/src/main/java/com/pmease/gitplex/search/query/TextQuery.java
@@ -12,14 +12,14 @@ import com.google.common.base.Splitter;
import com.pmease.commons.util.Charsets;
import com.pmease.gitplex.search.FieldConstants;
import com.pmease.gitplex.search.IndexConstants;
-import com.pmease.gitplex.search.hit.ContentHit;
+import com.pmease.gitplex.search.hit.TextHit;
import com.pmease.gitplex.search.hit.QueryHit;
-public class ContentQuery extends BlobQuery {
+public class TextQuery extends BlobQuery {
- public ContentQuery(String searchFor, boolean caseSensitive, int count) {
- super(FieldConstants.BLOB_CONTENT.name(), searchFor, false,
- caseSensitive, count, IndexConstants.CONTENT_GRAM_SIZE);
+ public TextQuery(String searchFor, boolean caseSensitive, int count) {
+ super(FieldConstants.BLOB_TEXT.name(), searchFor, false,
+ caseSensitive, count, IndexConstants.TEXT_GRAM_SIZE);
}
@Override
@@ -39,18 +39,18 @@ public class ContentQuery extends BlobQuery {
int lineNo = 0;
for (String line: Splitter.on("\n").split(content)) {
- List<ContentHit.Match> matches = new ArrayList<>();
+ List<TextHit.Match> matches = new ArrayList<>();
String normalizedLine = line;
if (!isCaseSensitive())
normalizedLine = line.toLowerCase();
int start = normalizedLine.indexOf(searchFor, 0);
while (start != -1) {
int end = start + searchFor.length();
- matches.add(new ContentHit.Match(start, end));
+ matches.add(new TextHit.Match(start, end));
start = normalizedLine.indexOf(searchFor, end);
}
if (!matches.isEmpty()) {
- ContentHit hit = new ContentHit(blobPath, line, lineNo, matches);
+ TextHit hit = new TextHit(blobPath, line, lineNo, matches);
hits.add(hit);
if (hits.size() >= getCount())
break;
diff --git a/gitplex.search/src/test/java/com/pmease/gitplex/search/IndexAndSearchTest.java b/gitplex.search/src/test/java/com/pmease/gitplex/search/IndexAndSearchTest.java
index f861fdc468..473f54b4b9 100644
--- a/gitplex.search/src/test/java/com/pmease/gitplex/search/IndexAndSearchTest.java
+++ b/gitplex.search/src/test/java/com/pmease/gitplex/search/IndexAndSearchTest.java
@@ -29,7 +29,7 @@ import com.pmease.gitplex.core.manager.IndexResult;
import com.pmease.gitplex.core.manager.StorageManager;
import com.pmease.gitplex.core.model.Repository;
import com.pmease.gitplex.search.hit.QueryHit;
-import com.pmease.gitplex.search.query.ContentQuery;
+import com.pmease.gitplex.search.query.TextQuery;
import com.pmease.gitplex.search.query.SymbolQuery;
public class IndexAndSearchTest extends AbstractGitTest {
@@ -89,7 +89,7 @@ public class IndexAndSearchTest extends AbstractGitTest {
String commitHash = git.parseRevision("master", true);
assertEquals(2, indexManager.index(repository, commitHash).getIndexed());
- ContentQuery contentQuery = new ContentQuery("public", false, Integer.MAX_VALUE);
+ TextQuery contentQuery = new TextQuery("public", false, Integer.MAX_VALUE);
List<QueryHit> hits = searchManager.search(repository, commitHash, contentQuery);
assertEquals(4, hits.size());
@@ -111,7 +111,7 @@ public class IndexAndSearchTest extends AbstractGitTest {
commitHash = git.parseRevision("master", true);
assertEquals(1, indexManager.index(repository, commitHash).getIndexed());
- contentQuery = new ContentQuery("strin", false, Integer.MAX_VALUE);
+ contentQuery = new TextQuery("strin", false, Integer.MAX_VALUE);
hits = searchManager.search(repository, commitHash, contentQuery);
assertEquals(2, hits.size());
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/search/BlobSearcher.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/search/BlobSearcher.html
index aa68b24a2b..1466089269 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/search/BlobSearcher.html
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/search/BlobSearcher.html
@@ -1,6 +1,10 @@
<wicket:panel>
<input wicket:id="input"></input>
- <ul wicket:id="matchesContainer">
- <li wicket:id="matches"><span wicket:id="match"></span></li>
- </ul>
+
+ <ul wicket:id="symbols"></ul>
+ <ul wicket:id="texts"></ul>
+
+ <wicket:fragment wicket:id="hitsFrag">
+ <li wicket:id="hits"><span wicket:id="hit"></span></li>
+ </wicket:fragment>
</wicket:panel>
\ No newline at end of file
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/search/BlobSearcher.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/search/BlobSearcher.java
index 6ba5572a43..d44184da73 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/search/BlobSearcher.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/search/BlobSearcher.java
@@ -2,92 +2,185 @@ package com.pmease.gitplex.web.component.search;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import org.apache.wicket.Page;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.OnChangeAjaxBehavior;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import com.pmease.commons.util.StringUtils;
+import com.google.common.collect.MapMaker;
+import com.pmease.commons.wicket.websocket.WebSocketRenderBehavior;
import com.pmease.gitplex.core.GitPlex;
import com.pmease.gitplex.core.model.Repository;
import com.pmease.gitplex.search.SearchManager;
import com.pmease.gitplex.search.hit.QueryHit;
-import com.pmease.gitplex.search.query.ContentQuery;
+import com.pmease.gitplex.search.query.BlobQuery;
+import com.pmease.gitplex.search.query.SymbolQuery;
+import com.pmease.gitplex.search.query.TextQuery;
@SuppressWarnings("serial")
public class BlobSearcher extends Panel {
+ private static final Logger logger = LoggerFactory.getLogger(BlobSearcher.class);
+
+ private static final int MAX_QUERY_ENTRIES = 20;
+
private final IModel<Repository> repoModel;
- private final IModel<String> commitHashModel;
+ private final String commitHash;
+
+ private final boolean caseSensitive;
private TextField<String> input;
- public BlobSearcher(String id, IModel<Repository> repoModel, IModel<String> commitHashModel) {
+ private WebMarkupContainer symbolContainer;
+
+ private WebMarkupContainer textContainer;
+
+ private final static Map<BlobSearcher, Thread> symbolSearchThreads =
+ new MapMaker().concurrencyLevel(16).weakKeys().makeMap();
+
+ private final static Map<BlobSearcher, List<QueryHit>> symbolSearchResults =
+ new MapMaker().concurrencyLevel(16).weakKeys().makeMap();
+
+ private final static Map<BlobSearcher, Thread> textSearchThreads =
+ new MapMaker().concurrencyLevel(16).weakKeys().makeMap();
+
+ private final static Map<BlobSearcher, List<QueryHit>> textSearchResults =
+ new MapMaker().concurrencyLevel(16).weakKeys().makeMap();
+
+ public BlobSearcher(String id, IModel<Repository> repoModel, String commitHash, boolean caseSensitive) {
super(id);
this.repoModel = repoModel;
- this.commitHashModel = commitHashModel;
+ this.commitHash = commitHash;
+ this.caseSensitive = caseSensitive;
}
- @Override
- protected void onInitialize() {
- super.onInitialize();
-
- final WebMarkupContainer matchesContainer = new WebMarkupContainer("matchesContainer");
- matchesContainer.setOutputMarkupId(true);
- matchesContainer.add(new ListView<QueryHit>("matches", new LoadableDetachableModel<List<QueryHit>>() {
+ private WebMarkupContainer newHitsContainer(String componentId, final boolean forSymbols) {
+ final Fragment fragment = new Fragment(componentId, "hitsFrag", this);
+ fragment.setOutputMarkupId(true);
+ fragment.add(new ListView<QueryHit>("hits", new LoadableDetachableModel<List<QueryHit>>() {
@Override
protected List<QueryHit> load() {
- String symbol = input.getInput();
-
- if (StringUtils.isNotBlank(symbol)) {
- SearchManager searchManager = GitPlex.getInstance(SearchManager.class);
- ContentQuery query = new ContentQuery(symbol, true, 100);
- try {
- return searchManager.search(repoModel.getObject(), commitHashModel.getObject(), query);
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- } else {
- return new ArrayList<>();
- }
+ List<QueryHit> hits;
+ if (forSymbols)
+ hits = symbolSearchResults.remove(BlobSearcher.this);
+ else
+ hits = textSearchResults.remove(BlobSearcher.this);
+
+ if (hits == null)
+ hits = new ArrayList<>();
+ return hits;
}
}) {
@Override
protected void populateItem(ListItem<QueryHit> item) {
- item.add(item.getModelObject().render("match"));
+ item.add(item.getModelObject().render("hit"));
}
});
- add(matchesContainer);
+ fragment.add(new WebSocketRenderBehavior() {
+
+ @Override
+ protected Object getTrait() {
+ return fragment.getPath();
+ }
+
+ });
+ return fragment;
+ }
+
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
+
+ add(symbolContainer = newHitsContainer("symbols", true));
+ add(textContainer = newHitsContainer("texts", false));
input = new TextField<>("input", Model.of(""));
input.add(new OnChangeAjaxBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
- target.add(matchesContainer);
- }
-
+ search(true);
+ search(false);
+ }
});
add(input);
}
+
+ private void search(boolean forSymbol) {
+ final BlobQuery query;
+ final WebMarkupContainer hitsContainer;
+ final Map<BlobSearcher, Thread> searchThreads;
+ final Map<BlobSearcher, List<QueryHit>> searchResults;
+ if (forSymbol) {
+ query = new SymbolQuery(input.getInput(), false, caseSensitive, MAX_QUERY_ENTRIES);
+ hitsContainer = symbolContainer;
+ searchThreads = symbolSearchThreads;
+ searchResults = symbolSearchResults;
+ } else {
+ query = new TextQuery(input.getInput(), caseSensitive, MAX_QUERY_ENTRIES);
+ hitsContainer = textContainer;
+ searchThreads = textSearchThreads;
+ searchResults = textSearchResults;
+ }
+
+ ExecutorService executorService = GitPlex.getInstance(ExecutorService.class);
+ final Page page = getPage();
+ executorService.execute(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ Thread thread = Thread.currentThread();
+ try {
+ Thread prevThread = searchThreads.get(BlobSearcher.this);
+ if (prevThread != null) synchronized (prevThread) {
+ prevThread = searchThreads.get(BlobSearcher.this);
+ if (prevThread != null)
+ prevThread.interrupt();
+ }
+ searchThreads.put(BlobSearcher.this, thread);
+
+ SearchManager searchManager = GitPlex.getInstance(SearchManager.class);
+ searchResults.put(BlobSearcher.this, searchManager.search(repoModel.getObject(), commitHash, query));
+ } finally {
+ synchronized (thread) {
+ Thread.interrupted();
+ searchThreads.remove(BlobSearcher.this);
+ }
+ }
+ WebSocketRenderBehavior.requestToRender(hitsContainer.getPath(), page);
+ } catch (Exception e) {
+ if (!(e instanceof InterruptedException))
+ logger.error("Error searching blob.", e);
+ }
+ }
+
+ });
+ }
+
@Override
protected void onDetach() {
repoModel.detach();
- commitHashModel.detach();
super.onDetach();
}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/TestPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/TestPage.java
index e5f28b8389..201c12da02 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/TestPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/TestPage.java
@@ -48,7 +48,8 @@ public class TestPage extends CommonPage {
});
Repository repo = GitPlex.getInstance(Dao.class).load(Repository.class, 1L);
- add(new BlobSearcher("searcher", Model.of(repo), Model.of(repo.git().parseRevision("master", true))));
+ String commitHash = repo.git().parseRevision("master", true);
+ add(new BlobSearcher("searcher", Model.of(repo), commitHash, false));
}
@Override