Remove PatchSetAccess#byRevision(Range)

These cannot be implemented efficiently in notedb, and we can get what
we need from the secondary index in most cases, or else (in the case
of ConsistencyChecker) directly from the repo.

This change intends to provide the same behavior, and does not correct
for some sketchy usages of patch sets, like failing to check
visibility.

Change-Id: I2d961f8d2436b44308116c19597f0ed74b9d1337
This commit is contained in:
Dave Borowitz
2016-01-14 15:29:56 -05:00
parent f85bd49cfc
commit 21fa49d50f
13 changed files with 164 additions and 134 deletions

View File

@@ -69,4 +69,8 @@ public final class RevId {
public String toString() {
return getClass().getSimpleName() + "{" + id + "}";
}
public boolean matches(String str) {
return id.startsWith(str.toLowerCase());
}
}

View File

@@ -16,7 +16,6 @@ package com.google.gerrit.reviewdb.server;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.reviewdb.client.RevId;
import com.google.gwtorm.server.Access;
import com.google.gwtorm.server.OrmException;
import com.google.gwtorm.server.PrimaryKey;
@@ -30,11 +29,4 @@ public interface PatchSetAccess extends Access<PatchSet, PatchSet.Id> {
@Query("WHERE id.changeId = ? ORDER BY id.patchSetId")
ResultSet<PatchSet> byChange(Change.Id id) throws OrmException;
@Query("WHERE revision = ?")
ResultSet<PatchSet> byRevision(RevId rev) throws OrmException;
@Query("WHERE revision >= ? AND revision <= ?")
ResultSet<PatchSet> byRevisionRange(RevId reva, RevId revb)
throws OrmException;
}