mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 02:06:18 +01:00
fixes python module path detection
This commit is contained in:
@@ -123,7 +123,9 @@ public class UnixAutoConfigurator implements AutoConfigurator {
|
|||||||
int end = line.indexOf(")");
|
int end = line.indexOf(")");
|
||||||
Path modulePath = Paths.get(line.substring(start + 1, end));
|
Path modulePath = Paths.get(line.substring(start + 1, end));
|
||||||
if (Files.exists(modulePath)) {
|
if (Files.exists(modulePath)) {
|
||||||
return Optional.of(modulePath);
|
// installed modules contains the path to the mercurial module,
|
||||||
|
// but we need the parent for the python path
|
||||||
|
return Optional.of(modulePath.getParent());
|
||||||
} else {
|
} else {
|
||||||
LOG.warn("could not find module path at {}", modulePath);
|
LOG.warn("could not find module path at {}", modulePath);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,7 +143,14 @@ public class HgRepositoryHandler
|
|||||||
if (autoConfigurator.isPresent()) {
|
if (autoConfigurator.isPresent()) {
|
||||||
config = autoConfigurator.get().configure();
|
config = autoConfigurator.get().configure();
|
||||||
}
|
}
|
||||||
doAutoConfiguration(config != null ? config : new HgConfig());
|
|
||||||
|
if (config != null && config.isValid()) {
|
||||||
|
this.config = config;
|
||||||
|
storeConfig();
|
||||||
|
} else {
|
||||||
|
// do the old configuration
|
||||||
|
doAutoConfiguration(config != null ? config : new HgConfig());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,12 +144,15 @@ class UnixAutoConfiguratorTest {
|
|||||||
Path modules = directory.resolve("modules");
|
Path modules = directory.resolve("modules");
|
||||||
Files.createDirectories(modules);
|
Files.createDirectories(modules);
|
||||||
|
|
||||||
|
Path mercurialModule = modules.resolve("mercurial");
|
||||||
|
Files.createDirectories(mercurialModule);
|
||||||
|
|
||||||
UnixAutoConfigurator configurator = create(directory);
|
UnixAutoConfigurator configurator = create(directory);
|
||||||
configurator.setExecutor((Path binary, String... args) -> {
|
configurator.setExecutor((Path binary, String... args) -> {
|
||||||
String content = String.join("\n",
|
String content = String.join("\n",
|
||||||
"checking Python executable (/python3.8)",
|
"checking Python executable (/python3.8)",
|
||||||
"checking Python lib (/python3.8)...",
|
"checking Python lib (/python3.8)...",
|
||||||
"checking installed modules (" + modules.toString() + ")...",
|
"checking installed modules (" + mercurialModule.toString() + ")...",
|
||||||
"checking templates (/mercurial/templates)...",
|
"checking templates (/mercurial/templates)...",
|
||||||
"checking default template (/mercurial/templates/map-cmdline.default))"
|
"checking default template (/mercurial/templates/map-cmdline.default))"
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user