Move "projects" table into Git

Project settings are now saved in the project.config file of the
refs/meta/config branch within each Git repository.  This offers
us free version control over the lifespan of the project, and will
help reduce schema version issues as the configuration file is
more free-form.

Project owners can edit the configuration of their project by
hand and push the results back up, possibly even going through
code review, if the proper access rules are assigned in the
project's access panel.  Project users can inspect the history of
the configuration by reading the history of the refs/meta/config
branch with their favorite history browser.

Change-Id: Id63414d86dbfb9033021f76e1d5e782373525a77
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2011-01-10 11:11:55 -08:00
parent 3b0ecf4984
commit a56d834d2b
35 changed files with 1218 additions and 271 deletions

View File

@@ -32,7 +32,6 @@ import com.google.gerrit.reviewdb.ReviewDb;
import com.google.gerrit.server.config.SitePath;
import com.google.gerrit.server.config.SitePaths;
import com.google.gerrit.server.git.GitRepositoryManager;
import com.google.gerrit.server.git.LocalDiskRepositoryManager;
import com.google.gerrit.server.schema.SchemaUpdater;
import com.google.gerrit.server.schema.UpdateUI;
import com.google.gerrit.server.util.HostPlatform;
@@ -292,8 +291,6 @@ public class Init extends SiteProgram {
protected void configure() {
bind(ConsoleUI.class).toInstance(init.ui);
bind(InitFlags.class).toInstance(init.flags);
bind(GitRepositoryManager.class).to(LocalDiskRepositoryManager.class);
}
});
return createDbInjector(SINGLE_USER).createChildInjector(modules);

View File

@@ -56,7 +56,6 @@ public class ScanTrackingIds extends SiteProgram {
private List<Change> todo;
private Injector dbInjector;
private Injector gitInjector;
@Inject
private TrackingFooters footers;
@@ -74,17 +73,9 @@ public class ScanTrackingIds extends SiteProgram {
}
dbInjector = createDbInjector(MULTI_USER);
gitInjector = dbInjector.createChildInjector(new LifecycleModule() {
@Override
protected void configure() {
bind(GitRepositoryManager.class).to(LocalDiskRepositoryManager.class);
listener().to(LocalDiskRepositoryManager.Lifecycle.class);
}
});
manager.add(dbInjector, gitInjector);
manager.add(dbInjector);
manager.start();
gitInjector.injectMembers(this);
dbInjector.injectMembers(this);
final ReviewDb db = database.open();
try {

View File

@@ -22,6 +22,7 @@ import com.google.gerrit.server.config.GerritServerConfigModule;
import com.google.gerrit.server.config.SitePath;
import com.google.gerrit.server.schema.DataSourceProvider;
import com.google.gerrit.server.schema.DatabaseModule;
import com.google.gerrit.server.schema.SchemaModule;
import com.google.gwtorm.client.OrmException;
import com.google.inject.AbstractModule;
import com.google.inject.CreationException;
@@ -162,6 +163,7 @@ public abstract class SiteProgram extends AbstractProgram {
});
modules.add(new GerritServerConfigModule());
modules.add(new DatabaseModule());
modules.add(new SchemaModule());
try {
return Guice.createInjector(PRODUCTION, modules);