From c3fb8c04cae5093735458a1df160f6b8c6cf6b48 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Wed, 13 Jun 2012 16:31:38 +0200 Subject: [PATCH] added option to disable pre processor execution --- .../repository/api/BrowseCommandBuilder.java | 23 +++++++++++++++-- .../scm/repository/api/LogCommandBuilder.java | 25 ++++++++++++++++--- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/scm-core/src/main/java/sonia/scm/repository/api/BrowseCommandBuilder.java b/scm-core/src/main/java/sonia/scm/repository/api/BrowseCommandBuilder.java index 1d056c20c0..6ec29a7264 100644 --- a/scm-core/src/main/java/sonia/scm/repository/api/BrowseCommandBuilder.java +++ b/scm-core/src/main/java/sonia/scm/repository/api/BrowseCommandBuilder.java @@ -133,7 +133,7 @@ public final class BrowseCommandBuilder } } - if (result != null) + if (! disablePreProcessors && result != null) { preProcessorUtil.prepareForReturn(repository, result); } @@ -160,6 +160,22 @@ public final class BrowseCommandBuilder return this; } + /** + * Disable the execution of pre processors. + * + * + * @param disablePreProcessors true to disable the pre processors execution + * + * @return {@code this} + */ + public BrowseCommandBuilder setDisablePreProcessors( + boolean disablePreProcessors) + { + this.disablePreProcessors = disablePreProcessors; + + return this; + } + /** * Retrieve only files which are children of the given path. * This path have to be a directory. @@ -274,7 +290,10 @@ public final class BrowseCommandBuilder private Cache cache; /** disables the cache */ - private boolean disableCache; + private boolean disableCache = false; + + /** disables the execution of pre processors */ + private boolean disablePreProcessors = false; /** Field description */ private PreProcessorUtil preProcessorUtil; diff --git a/scm-core/src/main/java/sonia/scm/repository/api/LogCommandBuilder.java b/scm-core/src/main/java/sonia/scm/repository/api/LogCommandBuilder.java index 605804fd22..cd9976de9a 100644 --- a/scm-core/src/main/java/sonia/scm/repository/api/LogCommandBuilder.java +++ b/scm-core/src/main/java/sonia/scm/repository/api/LogCommandBuilder.java @@ -199,7 +199,7 @@ public final class LogCommandBuilder } } - if (changeset != null) + if (! disablePreProcessors && changeset != null) { preProcessorUtil.prepareForReturn(repository, changeset); } @@ -242,7 +242,7 @@ public final class LogCommandBuilder } } - if (cpr != null) + if (! disablePreProcessors && cpr != null) { preProcessorUtil.prepareForReturn(repository, cpr); } @@ -284,6 +284,22 @@ public final class LogCommandBuilder return this; } + /** + * Disable the execution of pre processors. + * + * + * @param disablePreProcessors true to disable the pre processors execution + * + * @return {@code this} + */ + public LogCommandBuilder setDisablePreProcessors( + boolean disablePreProcessors) + { + this.disablePreProcessors = disablePreProcessors; + + return this; + } + /** * Retrieve changesets until the given the {@link Changeset} * with the given id. @@ -461,7 +477,10 @@ public final class LogCommandBuilder private Cache cache; /** disable cache */ - private boolean disableCache; + private boolean disableCache = false; + + /** disable the execution of pre processors */ + private boolean disablePreProcessors = false; /** Implementation of the log command */ private LogCommand logCommand;