Merge with develop

This commit is contained in:
Sebastian Sdorra
2020-10-29 15:05:23 +01:00
5 changed files with 38 additions and 8 deletions

View File

@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Automatic user converter for external users ([#1380](https://github.com/scm-manager/scm-manager/pull/1380))
### Fixed
- Do not expose subversion commit with id 0 ([#1395](https://github.com/scm-manager/scm-manager/pull/1395))
## [2.8.0] - 2020-10-27
### Added
- Generation of email addresses for users, where none is configured ([#1370](https://github.com/scm-manager/scm-manager/pull/1370))

View File

@@ -71,11 +71,11 @@
<goal>wget</goal>
</goals>
<configuration>
<url>https://github.com/winsw/winsw/releases/download/v2.9.0/WinSW.NETCore31.x64.exe</url>
<url>https://github.com/winsw/winsw/releases/download/v2.10.3/WinSW.NETCore31.x86.exe</url>
<unpack>false</unpack>
<outputFileName>scm-server.exe</outputFileName>
<outputDirectory>${project.build.directory}/windows</outputDirectory>
<sha256>59d29a41652cfc9a564c9c05d77976391833a6fb686bce941ad89f8f8dff120b</sha256>
<sha256>d6ad842e104bfb200bca06d6724e3e1fb19d013fa62fa49a21298d2ee9b044b7</sha256>
</configuration>
</execution>
</executions>

View File

@@ -198,7 +198,7 @@ public final class SvnUtil
Person.toPerson(entry.getAuthor()),
entry.getMessage());
if (revision > 0)
if (revision > 1)
{
changeset.getParents().add(String.valueOf(revision - 1));
}
@@ -232,6 +232,7 @@ public final class SvnUtil
*
* @return
*/
@SuppressWarnings("java:S1149") // we can not use StringBuild SVNXMLUtil requires StringBuffer
public static String createErrorBody(SVNErrorCode errorCode)
{
StringBuffer xmlBuffer = new StringBuffer();

View File

@@ -26,6 +26,7 @@ package sonia.scm.repository.spi;
//~--- non-JDK imports --------------------------------------------------------
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import org.slf4j.Logger;
@@ -76,6 +77,7 @@ public class SvnLogCommand extends AbstractSvnCommand implements LogCommand
try
{
long revisioNumber = parseRevision(revision, repository);
Preconditions.checkArgument(revisioNumber > 0, "revision must be greater than zero: %d", revisioNumber);
SVNRepository repo = open();
Collection<SVNLogEntry> entries = repo.log(null, null, revisioNumber,
revisioNumber, true, true);

View File

@@ -32,10 +32,9 @@ import sonia.scm.repository.Changeset;
import sonia.scm.repository.ChangesetPagingResult;
import sonia.scm.repository.Modifications;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.stream.StreamSupport;
import static org.junit.Assert.*;
//~--- JDK imports ------------------------------------------------------------
@@ -56,11 +55,36 @@ public class SvnLogCommandTest extends AbstractSvnCommandTestBase
assertEquals(5, result.getChangesets().size());
}
@Test
public void shouldNotReturnChangesetWithIdZero() {
ChangesetPagingResult result = createCommand().getChangesets(new LogCommandRequest());
boolean found = StreamSupport.stream(result.spliterator(), false).anyMatch(c -> "0".equals(c.getId()));
assertFalse(found);
}
@Test(expected = IllegalArgumentException.class)
public void shouldThrowIllegalArgumentExceptionForChangesetZero() {
createCommand().getChangeset("0", new LogCommandRequest());
}
@Test
public void shouldNotReturnChangesetZeroAsParent() {
Changeset changeset = createCommand().getChangeset("1", new LogCommandRequest());
assertTrue(changeset.getParents().isEmpty());
}
@Test
public void shouldAppendParentChangeset() {
Changeset changeset = createCommand().getChangeset("2", new LogCommandRequest());
assertEquals(1, changeset.getParents().size());
assertEquals("1", changeset.getParents().get(0));
}
@Test
public void testShouldStartWithRevisionOne() {
ChangesetPagingResult result = createCommand().getChangesets(new LogCommandRequest());
Changeset first = Iterables.getLast(result);
assertEquals(first.getId(), "1");
assertEquals("1", first.getId());
}
@Test