mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-10-26 08:06:09 +01:00
Fixed unexpected mercurial server pool stop
This commit is contained in:
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Fixed
|
||||
- Language detection of files with interpreter parameters e.g.: `#!/usr/bin/make -f` ([#1450](https://github.com/scm-manager/scm-manager/issues/1450))
|
||||
- Unexpected mercurial server pool stop ([#1446](https://github.com/scm-manager/scm-manager/issues/1446) and [#1457](https://github.com/scm-manager/scm-manager/issues/1457))
|
||||
|
||||
## [2.10.1] - 2020-11-24
|
||||
### Fixed
|
||||
|
||||
@@ -29,15 +29,12 @@ import de.otto.edison.hal.Links;
|
||||
import org.mapstruct.Context;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ObjectFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import sonia.scm.repository.Branch;
|
||||
import sonia.scm.repository.Changeset;
|
||||
import sonia.scm.repository.Contributor;
|
||||
import sonia.scm.repository.Person;
|
||||
import sonia.scm.repository.Repository;
|
||||
import sonia.scm.repository.Signature;
|
||||
import sonia.scm.repository.Tags;
|
||||
import sonia.scm.repository.api.Command;
|
||||
import sonia.scm.repository.api.RepositoryService;
|
||||
import sonia.scm.repository.api.RepositoryServiceFactory;
|
||||
@@ -47,7 +44,6 @@ import sonia.scm.security.gpg.RawGpgKey;
|
||||
import sonia.scm.web.EdisonHalAppender;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
@@ -60,8 +56,6 @@ import static de.otto.edison.hal.Links.linkingTo;
|
||||
@Mapper
|
||||
public abstract class DefaultChangesetToChangesetDtoMapper extends HalAppenderMapper implements InstantAttributeMapper, ChangesetToChangesetDtoMapper {
|
||||
|
||||
private static Logger LOG = LoggerFactory.getLogger(DefaultChangesetToChangesetDtoMapper.class);
|
||||
|
||||
@Inject
|
||||
private RepositoryServiceFactory serviceFactory;
|
||||
|
||||
@@ -120,22 +114,12 @@ public abstract class DefaultChangesetToChangesetDtoMapper extends HalAppenderMa
|
||||
|
||||
try (RepositoryService repositoryService = serviceFactory.create(repository)) {
|
||||
if (repositoryService.isSupported(Command.TAGS)) {
|
||||
Tags tags = null;
|
||||
try {
|
||||
tags = repositoryService.getTagsCommand().getTags();
|
||||
} catch (IOException e) {
|
||||
LOG.error("Error while retrieving tags from repository", e);
|
||||
}
|
||||
if (tags != null) {
|
||||
embeddedBuilder.with("tags", tagCollectionToDtoMapper.getTagDtoList(namespace, name,
|
||||
getListOfObjects(source.getTags(), tags::getTagByName)));
|
||||
}
|
||||
embeddedBuilder.with("tags", tagCollectionToDtoMapper.getEmbeddedTagDtoList(namespace, name, source.getTags()));
|
||||
}
|
||||
if (repositoryService.isSupported(Command.BRANCHES)) {
|
||||
embeddedBuilder.with("branches", branchCollectionToDtoMapper.getBranchDtoList(repository,
|
||||
getListOfObjects(source.getBranches(), branchName -> Branch.normalBranch(branchName, source.getId()))));
|
||||
}
|
||||
|
||||
if (repositoryService.isSupported(Command.DIFF_RESULT)) {
|
||||
linksBuilder.single(link("diffParsed", resourceLinks.diff().parsed(namespace, name, source.getId())));
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
@@ -58,6 +58,17 @@ public class TagCollectionToDtoMapper {
|
||||
return tags.stream().map(tag -> tagToTagDtoMapper.map(tag, new NamespaceAndName(namespace, name))).collect(toList());
|
||||
}
|
||||
|
||||
public List<TagDto> getEmbeddedTagDtoList(String namespace, String name, Collection<String> tags) {
|
||||
return tags.stream()
|
||||
.map(tag -> {
|
||||
Links links = linkingTo().self(resourceLinks.tag().self(namespace, name, tag)).build();
|
||||
TagDto dto = new TagDto(links);
|
||||
dto.setName(tag);
|
||||
return dto;
|
||||
})
|
||||
.collect(toList());
|
||||
}
|
||||
|
||||
private Links createLinks(String namespace, String name) {
|
||||
return
|
||||
linkingTo()
|
||||
|
||||
@@ -46,6 +46,10 @@ public class TagDto extends HalRepresentation {
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Instant date;
|
||||
|
||||
TagDto(Links links) {
|
||||
super(links);
|
||||
}
|
||||
|
||||
TagDto(Links links, Embedded embedded) {
|
||||
super(links, embedded);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import de.otto.edison.hal.Embedded;
|
||||
|
||||
Reference in New Issue
Block a user