Skip to content

Commit 09dedf6

Browse files
committed
log a warning if repository command does not work
1 parent e9c36d5 commit 09dedf6

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/MercurialRepository.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,10 @@ boolean isNestable() {
539539

540540
private static boolean isHgWorking() {
541541
String repoCommand = getCommand(MercurialRepository.class, CMD_PROPERTY_KEY, CMD_FALLBACK);
542-
return checkCmd(repoCommand);
542+
boolean works = checkCmd(repoCommand);
543+
LOGGER.log(Level.WARNING, "Command ''{0}'' does not work. " +
544+
"Some operations with Mercurial repositories will fail as a result.", repoCommand);
545+
return works;
543546
}
544547

545548
@Override

opengrok-indexer/src/main/java/org/opengrok/indexer/history/SubversionRepository.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,12 @@ boolean isRepositoryFor(File file, CommandTimeoutType cmdType) {
364364

365365
private static boolean isSvnWorking() {
366366
String repoCommand = getCommand(SubversionRepository.class, CMD_PROPERTY_KEY, CMD_FALLBACK);
367-
return checkCmd(repoCommand, "--help");
367+
boolean works = checkCmd(repoCommand, "--help");
368+
if (!works) {
369+
LOGGER.log(Level.WARNING, "Command ''{0}'' does not work. " +
370+
"Some operations with Subversion repositories will fail as a result.", repoCommand);
371+
}
372+
return works;
368373
}
369374

370375
@Override

0 commit comments

Comments
 (0)