Adapt to latest master

- Rename reviewdb package to entities
- Adapt to static factory method for Branch.NameKey
- Adapt to changed permission backend interface

Change-Id: Ie9f9ae3f443e6c69eda868cf052577475f5b48f4
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/GitGraphServlet.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/GitGraphServlet.java
index e96678b..83f6acb 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/GitGraphServlet.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/GitGraphServlet.java
@@ -14,9 +14,9 @@
 package com.googlesource.gerrit.plugins.branchnetwork.canvas;
 
 import com.google.gerrit.common.data.GitwebType;
+import com.google.gerrit.entities.Project;
 import com.google.gerrit.extensions.annotations.PluginCanonicalWebUrl;
 import com.google.gerrit.extensions.restapi.AuthException;
-import com.google.gerrit.reviewdb.client.Project;
 import com.google.gerrit.server.CurrentUser;
 import com.google.gerrit.server.config.GitwebConfig;
 import com.google.gerrit.server.git.GitRepositoryManager;
@@ -87,9 +87,9 @@
         repoName = repoName.substring(0, repoName.length() - 4);
       }
 
-      final Project.NameKey nameKey = new Project.NameKey(repoName);
+      final Project.NameKey nameKey = Project.nameKey(repoName);
       try {
-        permissionBackend.user(user).project(nameKey).check(ProjectPermission.ACCESS);
+        permissionBackend.user(user.get()).project(nameKey).check(ProjectPermission.ACCESS);
       } catch (AuthException | PermissionBackendException e) {
         resp.sendError(HttpServletResponse.SC_NOT_FOUND);
         return;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java
index 70d1091..49455b3 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java
@@ -13,7 +13,7 @@
 // limitations under the License.
 package com.googlesource.gerrit.plugins.branchnetwork.data;
 
-import com.google.gerrit.reviewdb.client.Project.NameKey;
+import com.google.gerrit.entities.Project.NameKey;
 import com.google.gerrit.server.git.GitRepositoryManager;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;