Fix changes not found

I7530cd604 tried to re-introduce the possibility of accepting a commit
as as argument to the SetReviewersCommand. The problem is, the regex
can match also a legacy-id greater than 1000, breaking the finder.

Accept a minimum of 7 characters for the sha-1 as the possibility of
having a sha-1 starting with seven consecutive digits is pretty low
(about 3%).

Change-Id: If1390ed73e095f739386d022439ed3b1f98931b2
diff --git a/Documentation/cmd-set-reviewers.txt b/Documentation/cmd-set-reviewers.txt
index f8a272d..eb4335b 100644
--- a/Documentation/cmd-set-reviewers.txt
+++ b/Documentation/cmd-set-reviewers.txt
@@ -20,7 +20,7 @@
 
 Changes can be specified in the
 link:rest-api-changes.html#change-id[same format] supported by the REST
-API, as well as with the commit SHA-1.
+API, as well as with the commit SHA-1 (at least the 7 first characters).
 
 == OPTIONS
 
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/ChangeFinder.java b/gerrit-server/src/main/java/com/google/gerrit/server/ChangeFinder.java
index fa68473..b6222a4 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/ChangeFinder.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/ChangeFinder.java
@@ -55,7 +55,7 @@
     InternalChangeQuery query = queryProvider.get().noFields();
 
     //Try commit hash
-    if (id.matches("^([0-9a-fA-F]{4," + RevId.LEN + "})$")) {
+    if (id.matches("^([0-9a-fA-F]{" + RevId.ABBREV_LEN + "," + RevId.LEN + "})$")) {
       return asChangeControls(query.byCommit(id), user);
     }