Move "refs/..." constants to a RefNames class

This class lives in gerrit-reviewdb because "refs/changes/" needs to be
referenced from PatchSet in reviewdb/client (and other UI classes).

Rename constants to all use REFS_* instead of being inconsistent.

Change-Id: I76e6ee7e63a4549b51a43698fb50b54a19dabfc6
This commit is contained in:
Dave Borowitz
2013-12-11 08:55:24 -08:00
parent 2f7cb5997f
commit 31b599b40f
40 changed files with 150 additions and 105 deletions

View File

@@ -23,6 +23,7 @@ import com.google.gerrit.common.data.AccessSection;
import com.google.gerrit.common.data.ProjectAccess;
import com.google.gerrit.reviewdb.client.Branch;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.client.RefNames;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Style.Display;
@@ -125,7 +126,7 @@ public class ProjectAccessEditor extends Composite implements
history.getStyle().setDisplay(Display.BLOCK);
gitweb.setText(c.getLinkName());
gitweb.setHref(c.toFileHistory(new Branch.NameKey(value.getProjectName(),
"refs/meta/config"), "project.config"));
RefNames.REFS_CONFIG), "project.config"));
} else {
history.getStyle().setDisplay(Display.NONE);
}

View File

@@ -34,6 +34,7 @@ import com.google.gerrit.client.ui.OnEditEnabler;
import com.google.gerrit.common.PageLinks;
import com.google.gerrit.reviewdb.client.Branch;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.client.RefNames;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
@@ -394,7 +395,7 @@ public class ProjectBranchesScreen extends ProjectScreen {
final FlexCellFormatter fmt = table.getFlexCellFormatter();
String iconCellStyle = Gerrit.RESOURCES.css().iconCell();
String dataCellStyle = Gerrit.RESOURCES.css().dataCell();
if ("refs/meta/config".equals(k.getShortName())
if (RefNames.REFS_CONFIG.equals(k.getShortName())
|| "HEAD".equals(k.getShortName())) {
iconCellStyle = Gerrit.RESOURCES.css().specialBranchIconCell();
dataCellStyle = Gerrit.RESOURCES.css().specialBranchDataCell();