mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
Fix default revision for hg and fix encoded slashes in URLs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user