Fix default revision for hg and fix encoded slashes in URLs

This commit is contained in:
René Pfeuffer
2018-08-23 15:52:02 +02:00
parent 7177cbd3fe
commit ca563dd874
6 changed files with 66 additions and 24 deletions

View File

@@ -36,16 +36,14 @@ package sonia.scm.repository.spi;
//~--- non-JDK imports --------------------------------------------------------
import com.google.common.base.Strings;
import sonia.scm.repository.BrowserResult;
import sonia.scm.repository.Repository;
import sonia.scm.repository.RepositoryException;
import sonia.scm.repository.spi.javahg.HgFileviewCommand;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
//~--- JDK imports ------------------------------------------------------------
/**
*
* @author Sebastian Sdorra
@@ -76,12 +74,9 @@ public class HgBrowseCommand extends AbstractCommand implements BrowseCommand
* @return
*
* @throws IOException
* @throws RepositoryException
*/
@Override
public BrowserResult getBrowserResult(BrowseCommandRequest request)
throws IOException, RepositoryException
{
public BrowserResult getBrowserResult(BrowseCommandRequest request) throws IOException {
HgFileviewCommand cmd = HgFileviewCommand.on(open());
if (!Strings.isNullOrEmpty(request.getRevision()))
@@ -113,6 +108,12 @@ public class HgBrowseCommand extends AbstractCommand implements BrowseCommand
result.setFiles(cmd.execute());
if (!Strings.isNullOrEmpty(request.getRevision())) {
result.setRevision(request.getRevision());
} else {
result.setRevision("tip");
}
return result;
}
}