mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
fix hg.py instead of hg.bat
This commit is contained in:
@@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
|
||||
import sonia.scm.SCMContext;
|
||||
import sonia.scm.io.ZipUnArchiver;
|
||||
import sonia.scm.net.HttpClient;
|
||||
import sonia.scm.repository.HgBatFix;
|
||||
import sonia.scm.repository.HgPyFix;
|
||||
import sonia.scm.repository.HgConfig;
|
||||
import sonia.scm.repository.HgRepositoryHandler;
|
||||
import sonia.scm.util.IOUtil;
|
||||
@@ -231,7 +231,7 @@ public class HgPackageInstaller implements Runnable
|
||||
config.setUseOptimizedBytecode(template.isUseOptimizedBytecode());
|
||||
|
||||
// fix wrong hg.bat
|
||||
HgBatFix.fixHgBat(SCMContext.getContext(), config);
|
||||
HgPyFix.fixHgPy(SCMContext.getContext(), config);
|
||||
|
||||
handler.storeConfig();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ import java.io.IOException;
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public class HgBatFix
|
||||
public class HgPyFix
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
@@ -63,6 +63,9 @@ public class HgBatFix
|
||||
/** Field description */
|
||||
private static final String HG_BAT = "hg.bat";
|
||||
|
||||
/** Field description */
|
||||
private static final String HG_PY = "hg.py";
|
||||
|
||||
/**
|
||||
* the logger for HgUtil
|
||||
*/
|
||||
@@ -77,7 +80,7 @@ public class HgBatFix
|
||||
* @param context
|
||||
* @param config
|
||||
*/
|
||||
public static void fixHgBat(SCMContextProvider context, HgConfig config)
|
||||
public static void fixHgPy(SCMContextProvider context, HgConfig config)
|
||||
{
|
||||
String basePath = context.getBaseDirectory().getAbsolutePath();
|
||||
|
||||
@@ -85,8 +88,10 @@ public class HgBatFix
|
||||
|
||||
if (hg.startsWith(basePath) && hg.endsWith(HG_BAT))
|
||||
{
|
||||
File file = new File(hg);
|
||||
|
||||
fixHgBat(hg);
|
||||
file = new File(file.getParentFile(), HG_PY);
|
||||
fixHgPy(file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,10 +100,11 @@ public class HgBatFix
|
||||
*
|
||||
*
|
||||
* @param hg
|
||||
*
|
||||
* @param hgBat
|
||||
*/
|
||||
static void fixHgBat(String hg)
|
||||
static void fixHgPy(File hgBat)
|
||||
{
|
||||
File hgBat = new File(hg);
|
||||
|
||||
if (hgBat.exists())
|
||||
{
|
||||
@@ -110,7 +116,7 @@ public class HgBatFix
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("check hg.bat for setbinary at {}", hg);
|
||||
logger.debug("check hg.bat for setbinary at {}", hgBat);
|
||||
}
|
||||
|
||||
if (!isSetBinaryAvailable(hgBat))
|
||||
@@ -130,7 +136,7 @@ public class HgBatFix
|
||||
}
|
||||
else if (logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn("could not find hg.bat at {}", hg);
|
||||
logger.warn("could not find hg.bat at {}", hgBat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ public class HgRepositoryHandler
|
||||
// fix wrong hg.bat from package installation
|
||||
if (SystemUtil.isWindows())
|
||||
{
|
||||
HgBatFix.fixHgBat(context, getConfig());
|
||||
HgPyFix.fixHgPy(context, getConfig());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ import java.net.URL;
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public class HgBatFixTest
|
||||
public class HgPyFixTest
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -136,10 +136,10 @@ public class HgBatFixTest
|
||||
*/
|
||||
private File testModify(File file)
|
||||
{
|
||||
HgBatFix.fixHgBat(file.getAbsolutePath());
|
||||
assertTrue(HgBatFix.isSetBinaryAvailable(file));
|
||||
HgPyFix.fixHgPy(file);
|
||||
assertTrue(HgPyFix.isSetBinaryAvailable(file));
|
||||
|
||||
File mod = new File(file.getParentFile(), HgBatFix.MODIFY_MARK);
|
||||
File mod = new File(file.getParentFile(), HgPyFix.MODIFY_MARK);
|
||||
|
||||
assertTrue(mod.exists());
|
||||
|
||||
Reference in New Issue
Block a user