diff --git a/plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgChangesetViewer.java b/plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgChangesetViewer.java
index a9254e1f2d..cd9e14b1a8 100644
--- a/plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgChangesetViewer.java
+++ b/plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgChangesetViewer.java
@@ -79,7 +79,7 @@ public class HgChangesetViewer implements ChangesetViewer
+ "{file_adds}"
+ "{file_mods}"
+ "{file_dels}"
- + "\n";
+ + "";
//J+
/** Field description */
@@ -150,6 +150,14 @@ public class HgChangesetViewer implements ChangesetViewer
new StringReader(sb.toString())));
changesets = new ChangesetPagingResult(total, changesetList);
+ }
+ else if ( logger.isErrorEnabled() )
+ {
+ logger.error(
+ "command for fetching changesets failed with exit code {} and output {}",
+ result.getReturnCode(),
+ result.getOutput()
+ );
}
}
catch (ParserConfigurationException ex)
@@ -197,7 +205,7 @@ public class HgChangesetViewer implements ChangesetViewer
*/
private int getTotalChangesets(String repositoryPath) throws IOException
{
- int total = 0;
+ int total = -1;
Command command = new SimpleCommand(handler.getConfig().getHgBinary(),
"-R", repositoryPath, "tip", "--template",
TEMPLATE_TOTAL);
@@ -207,6 +215,14 @@ public class HgChangesetViewer implements ChangesetViewer
{
total = Integer.parseInt(result.getOutput().trim());
}
+ else if ( logger.isErrorEnabled() )
+ {
+ logger.error(
+ "could not read tip revision, command returned with exit code {} and content {}",
+ result.getReturnCode(),
+ result.getOutput()
+ );
+ }
return total;
}
diff --git a/scm-core/src/main/java/sonia/scm/io/SimpleCommand.java b/scm-core/src/main/java/sonia/scm/io/SimpleCommand.java
index f85717f0df..e816b452df 100644
--- a/scm-core/src/main/java/sonia/scm/io/SimpleCommand.java
+++ b/scm-core/src/main/java/sonia/scm/io/SimpleCommand.java
@@ -176,6 +176,15 @@ public class SimpleCommand implements Command
}
int returnCode = process.waitFor();
+
+ if ( logger.isDebugEnabled() )
+ {
+ logger.debug( "command returned with exitcode {}", returnCode );
+ if ( logger.isTraceEnabled() )
+ {
+ logger.trace("command content: {}{}", s, content.toString() );
+ }
+ }
result = new SimpleCommandResult(content.toString(), returnCode);
}