fixes python module path detection

This commit is contained in:
Sebastian Sdorra
2020-07-01 15:28:37 +02:00
parent 17d31b80e0
commit 2bb865bf5c
3 changed files with 15 additions and 3 deletions

View File

@@ -123,7 +123,9 @@ public class UnixAutoConfigurator implements AutoConfigurator {
int end = line.indexOf(")");
Path modulePath = Paths.get(line.substring(start + 1, end));
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 {
LOG.warn("could not find module path at {}", modulePath);
}

View File

@@ -143,7 +143,14 @@ public class HgRepositoryHandler
if (autoConfigurator.isPresent()) {
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());
}
}
}