copy templates folder into lib/hg folder

This commit is contained in:
Sebastian Sdorra
2010-12-25 19:23:04 +01:00
parent cf62ffae35
commit d544722a65
2 changed files with 48 additions and 20 deletions

View File

@@ -64,7 +64,7 @@ public class WindowsHgInstaller extends AbstractHgInstaller
{
// TortoiseHg
"TortoiseHg\\hg.exe"
"TortoiseHg"
};
/** Field description */
@@ -80,7 +80,7 @@ public class WindowsHgInstaller extends AbstractHgInstaller
{
// TortoiseHg
"TortoiseHg\\template"
"TortoiseHg\\templates"
};
/** Field description */
@@ -91,6 +91,8 @@ public class WindowsHgInstaller extends AbstractHgInstaller
private static final Logger logger =
LoggerFactory.getLogger(WindowsHgInstaller.class);
public static String BINARY_MERCURIAL = "hg";
//~--- constructors ---------------------------------------------------------
/**
@@ -120,38 +122,29 @@ public class WindowsHgInstaller extends AbstractHgInstaller
super.install(config);
String progDir = getProgrammDirectory();
String path = null;
File libraryZip = find(progDir, PATH_LIBRARY_ZIP);
File libDir = null;
if (libraryZip != null)
{
File libDir = new File(baseDirectory, "lib\\hg");
libDir = new File(baseDirectory, "lib\\hg");
IOUtil.extract(libraryZip, libDir);
path = libDir.getAbsolutePath();
config.setPythonPath(libDir.getAbsolutePath());
}
File templateDir = find(progDir, PATH_TEMPLATE);
if (templateDir != null)
if ( libDir != null )
{
if (path != null)
File templateDir = find(progDir, PATH_TEMPLATE);
if (templateDir != null)
{
path = path.concat(";").concat(templateDir.getAbsolutePath());
}
else
{
path = templateDir.getAbsolutePath();
IOUtil.copy(templateDir, new File(libDir, "templates"));
}
}
if (path != null)
{
config.setPythonPath(path);
}
checkForOptimizedByteCode(config);
config.setPythonBinary(getPythonBinary());
config.setHgBinary( search(PATH_HG, BINARY_MERCURIAL) );
}
/**