mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
Merge with 2.0.0-m3
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import sonia.scm.config.ConfigurationPermissions;
|
||||
import sonia.scm.plugin.Extension;
|
||||
import sonia.scm.web.JsonEnricherBase;
|
||||
import sonia.scm.web.JsonEnricherContext;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Provider;
|
||||
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static sonia.scm.web.VndMediaType.INDEX;
|
||||
|
||||
@Extension
|
||||
public class HgConfigInIndexResource extends JsonEnricherBase {
|
||||
|
||||
private final Provider<ScmPathInfoStore> scmPathInfoStore;
|
||||
|
||||
@Inject
|
||||
public HgConfigInIndexResource(Provider<ScmPathInfoStore> scmPathInfoStore, ObjectMapper objectMapper) {
|
||||
super(objectMapper);
|
||||
this.scmPathInfoStore = scmPathInfoStore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enrich(JsonEnricherContext context) {
|
||||
if (resultHasMediaType(INDEX, context) && ConfigurationPermissions.list().isPermitted()) {
|
||||
String hgConfigUrl = new LinkBuilder(scmPathInfoStore.get().get(), HgConfigResource.class)
|
||||
.method("get")
|
||||
.parameters()
|
||||
.href();
|
||||
|
||||
JsonNode hgConfigRefNode = createObject(singletonMap("href", value(hgConfigUrl)));
|
||||
|
||||
addPropertyNode(context.getResponseEntity().get("_links"), "hgConfig", hgConfigRefNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,11 @@ public class HgLogCommand extends AbstractCommand implements LogCommand
|
||||
List<Changeset> changesets = on(repository).rev(start + ":"
|
||||
+ end).execute();
|
||||
|
||||
result = new ChangesetPagingResult(total, changesets);
|
||||
if (request.getBranch() == null) {
|
||||
result = new ChangesetPagingResult(total, changesets);
|
||||
} else {
|
||||
result = new ChangesetPagingResult(total, changesets, request.getBranch());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -216,10 +216,7 @@ public abstract class AbstractChangesetCommand extends AbstractCommand
|
||||
|
||||
String branch = in.textUpTo('\n');
|
||||
|
||||
if (!BRANCH_DEFAULT.equals(branch))
|
||||
{
|
||||
changeset.getBranches().add(branch);
|
||||
}
|
||||
changeset.getBranches().add(branch);
|
||||
|
||||
String p1 = readId(in, changeset, PROPERTY_PARENT1_REVISION);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user