Merge branch 'stable-2.9'
* stable-2.9: Only permit current patch set to edit the commit message Use Provider for IdentifiedUser in CreateBranch constructor Split PGPEncryptedDataGenerator creation out into a utility method ChangeScreen2: Only reset the commit message text on cancel Fix log spew caused by DeleteBranch constructor Add Documentation menu entry for Project Owner Guide Mention project-specific themes in the project owner guide Added global request handlers to SshDaemon
This commit is contained in:
@@ -547,6 +547,18 @@ Project-specific download commands that are defined on a parent project
|
||||
are inherited by the child projects. A child project can overwrite an
|
||||
inherited download command, or remove it by assigning no value to it.
|
||||
|
||||
[[theme]]
|
||||
== Theme
|
||||
|
||||
Gerrit supports project-specific themes for customizing the appearance
|
||||
of the change screen and the diff screens. It is possible to define an
|
||||
HTML header and footer and to adapt Gerrit's CSS. Details about themes
|
||||
are explained in the link:config-themes.html[Themes] section.
|
||||
|
||||
Project-specific themes can only be installed by Gerrit administrators
|
||||
since the theme files must be copied into the Gerrit installation
|
||||
folder.
|
||||
|
||||
[[tool-integration]]
|
||||
== Integration with other tools
|
||||
|
||||
|
@@ -689,6 +689,7 @@ public class Gerrit implements EntryPoint {
|
||||
addDocLink(m, C.menuDocumentationUpload(), "user-upload.html");
|
||||
addDocLink(m, C.menuDocumentationAccess(), "access-control.html");
|
||||
addDocLink(m, C.menuDocumentationAPI(), "rest-api.html");
|
||||
addDocLink(m, C.menuDocumentationProjectOwnerGuide(), "intro-project-owner.html");
|
||||
menuLeft.add(m, C.menuDocumentation());
|
||||
}
|
||||
|
||||
|
@@ -91,6 +91,7 @@ public interface GerritConstants extends Constants {
|
||||
String menuDocumentationUpload();
|
||||
String menuDocumentationAccess();
|
||||
String menuDocumentationAPI();
|
||||
String menuDocumentationProjectOwnerGuide();
|
||||
|
||||
String searchHint();
|
||||
String searchButton();
|
||||
|
@@ -74,6 +74,7 @@ menuDocumentationSearch = Searching
|
||||
menuDocumentationUpload = Uploading
|
||||
menuDocumentationAccess = Access Controls
|
||||
menuDocumentationAPI = REST API
|
||||
menuDocumentationProjectOwnerGuide = Project Owner Guide
|
||||
|
||||
searchHint = Search term
|
||||
searchButton = Search
|
||||
|
@@ -65,6 +65,11 @@ class EditMessage implements RestModifyView<RevisionResource, Input>,
|
||||
ResourceNotFoundException, EmailException, OrmException, IOException {
|
||||
if (Strings.isNullOrEmpty(input.message)) {
|
||||
throw new BadRequestException("message must be non-empty");
|
||||
} else if (!rsrc.getPatchSet().getId()
|
||||
.equals(rsrc.getChange().currentPatchSetId())) {
|
||||
throw new ResourceConflictException(String.format(
|
||||
"revision %s is not current revision",
|
||||
rsrc.getPatchSet().getRevision().get()));
|
||||
}
|
||||
try {
|
||||
return json.format(changeUtil.editCommitMessage(
|
||||
|
@@ -32,6 +32,7 @@ import com.google.gerrit.server.project.CreateBranch.Input;
|
||||
import com.google.gerrit.server.project.ListBranches.BranchInfo;
|
||||
import com.google.gerrit.server.util.MagicBranch;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.assistedinject.Assisted;
|
||||
|
||||
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
|
||||
@@ -64,14 +65,15 @@ public class CreateBranch implements RestModifyView<ProjectResource, Input> {
|
||||
CreateBranch create(String ref);
|
||||
}
|
||||
|
||||
private final IdentifiedUser identifiedUser;
|
||||
private final Provider<IdentifiedUser> identifiedUser;
|
||||
private final GitRepositoryManager repoManager;
|
||||
private final GitReferenceUpdated referenceUpdated;
|
||||
private final ChangeHooks hooks;
|
||||
private String ref;
|
||||
|
||||
@Inject
|
||||
CreateBranch(IdentifiedUser identifiedUser, GitRepositoryManager repoManager,
|
||||
CreateBranch(Provider<IdentifiedUser> identifiedUser,
|
||||
GitRepositoryManager repoManager,
|
||||
GitReferenceUpdated referenceUpdated, ChangeHooks hooks,
|
||||
@Assisted String ref) {
|
||||
this.identifiedUser = identifiedUser;
|
||||
@@ -135,7 +137,7 @@ public class CreateBranch implements RestModifyView<ProjectResource, Input> {
|
||||
final RefUpdate u = repo.updateRef(ref);
|
||||
u.setExpectedOldObjectId(ObjectId.zeroId());
|
||||
u.setNewObjectId(object.copy());
|
||||
u.setRefLogIdent(identifiedUser.newRefLogIdent());
|
||||
u.setRefLogIdent(identifiedUser.get().newRefLogIdent());
|
||||
u.setRefLogMessage("created via REST from " + input.revision, false);
|
||||
final RefUpdate.Result result = u.update(rw);
|
||||
switch (result) {
|
||||
@@ -143,7 +145,7 @@ public class CreateBranch implements RestModifyView<ProjectResource, Input> {
|
||||
case NEW:
|
||||
case NO_CHANGE:
|
||||
referenceUpdated.fire(name.getParentKey(), u);
|
||||
hooks.doRefUpdatedHook(name, u, identifiedUser.getAccount());
|
||||
hooks.doRefUpdatedHook(name, u, identifiedUser.get().getAccount());
|
||||
break;
|
||||
case LOCK_FAILURE:
|
||||
if (repo.getRef(ref) != null) {
|
||||
|
@@ -45,6 +45,7 @@ import org.apache.sshd.common.ForwardingFilter;
|
||||
import org.apache.sshd.common.KeyExchange;
|
||||
import org.apache.sshd.common.KeyPairProvider;
|
||||
import org.apache.sshd.common.NamedFactory;
|
||||
import org.apache.sshd.common.RequestHandler;
|
||||
import org.apache.sshd.common.Session;
|
||||
import org.apache.sshd.common.Signature;
|
||||
import org.apache.sshd.common.SshdSocketAddress;
|
||||
@@ -80,6 +81,7 @@ import org.apache.sshd.common.random.BouncyCastleRandom;
|
||||
import org.apache.sshd.common.random.JceRandom;
|
||||
import org.apache.sshd.common.random.SingletonRandomFactory;
|
||||
import org.apache.sshd.common.session.AbstractSession;
|
||||
import org.apache.sshd.common.session.ConnectionService;
|
||||
import org.apache.sshd.common.signature.SignatureDSA;
|
||||
import org.apache.sshd.common.signature.SignatureRSA;
|
||||
import org.apache.sshd.common.util.Buffer;
|
||||
@@ -92,6 +94,10 @@ import org.apache.sshd.server.auth.UserAuthPublicKey;
|
||||
import org.apache.sshd.server.auth.gss.GSSAuthenticator;
|
||||
import org.apache.sshd.server.auth.gss.UserAuthGSS;
|
||||
import org.apache.sshd.server.channel.ChannelSession;
|
||||
import org.apache.sshd.server.global.CancelTcpipForwardHandler;
|
||||
import org.apache.sshd.server.global.KeepAliveHandler;
|
||||
import org.apache.sshd.server.global.NoMoreSessionsHandler;
|
||||
import org.apache.sshd.server.global.TcpipForwardHandler;
|
||||
import org.apache.sshd.server.kex.DHG1;
|
||||
import org.apache.sshd.server.kex.DHG14;
|
||||
import org.apache.sshd.server.session.SessionFactory;
|
||||
@@ -149,6 +155,7 @@ public class SshDaemon extends SshServer implements SshInfo, LifecycleListener {
|
||||
private volatile IoAcceptor acceptor;
|
||||
private final Config cfg;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Inject
|
||||
SshDaemon(final CommandFactory commandFactory, final NoShell noShell,
|
||||
final PublickeyAuthenticator userAuth,
|
||||
@@ -257,6 +264,12 @@ public class SshDaemon extends SshServer implements SshInfo, LifecycleListener {
|
||||
return new GerritServerSession(server, ioSession);
|
||||
}
|
||||
});
|
||||
setGlobalRequestHandlers(Arrays.<RequestHandler<ConnectionService>> asList(
|
||||
new KeepAliveHandler(),
|
||||
new NoMoreSessionsHandler(),
|
||||
new TcpipForwardHandler(),
|
||||
new CancelTcpipForwardHandler()
|
||||
));
|
||||
|
||||
hostKeys = computeHostKeys();
|
||||
}
|
||||
|
Reference in New Issue
Block a user