mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
fix mercurial version informations
This commit is contained in:
@@ -127,7 +127,8 @@ public class HgRepositoryHandler
|
||||
try
|
||||
{
|
||||
this.jaxbContext = JAXBContext.newInstance(BrowserResult.class,
|
||||
BlameResult.class, Changeset.class, ChangesetPagingResult.class);
|
||||
BlameResult.class, Changeset.class, ChangesetPagingResult.class,
|
||||
HgVersion.class);
|
||||
}
|
||||
catch (JAXBException ex)
|
||||
{
|
||||
@@ -362,15 +363,23 @@ public class HgRepositoryHandler
|
||||
|
||||
try
|
||||
{
|
||||
JAXBContext context = JAXBContext.newInstance(HgVersion.class);
|
||||
HgVersion hgVersion = new HgVersionHandler(this, hgContextProvider.get(),
|
||||
baseDirectory).getVersion();
|
||||
|
||||
if (hgVersion != null)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("mercurial/python informations: {}", hgVersion);
|
||||
}
|
||||
|
||||
version = MessageFormat.format(version, hgVersion.getPython(),
|
||||
hgVersion.getMercurial());
|
||||
}
|
||||
else if (logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn("could not retrieve version informations");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
|
||||
package sonia.scm.repository;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
@@ -46,6 +50,64 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
public class HgVersion
|
||||
{
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param obj
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final HgVersion other = (HgVersion) obj;
|
||||
|
||||
return Objects.equal(mercurial, other.mercurial)
|
||||
&& Objects.equal(python, other.python);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hashCode(mercurial, python);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
//J-
|
||||
return Objects.toStringHelper(this)
|
||||
.add("mercurial", mercurial)
|
||||
.add("python", python)
|
||||
.toString();
|
||||
//J+
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
@@ -36,8 +36,6 @@ package sonia.scm.repository;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
@@ -54,8 +52,8 @@ public class HgVersionHandler extends AbstractHgHandler
|
||||
* @param context
|
||||
* @param directory
|
||||
*/
|
||||
public HgVersionHandler(HgRepositoryHandler handler,
|
||||
HgContext context, File directory)
|
||||
public HgVersionHandler(HgRepositoryHandler handler, HgContext context,
|
||||
File directory)
|
||||
{
|
||||
super(handler, context, null, directory);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user