aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/query2/output/QueryOutputUtils.java
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2015-08-25 22:02:38 +0000
committerGravatar Lukacs Berki <lberki@google.com>2015-08-26 07:41:08 +0000
commit706bc72fa9dfe8b1a02558f6f177e547b98155b5 (patch)
treec9392de8295111510bf1bfd0cfe700ed3ef39ed0 /src/main/java/com/google/devtools/build/lib/query2/output/QueryOutputUtils.java
parentf882c54cb7390ad76f48c25edebcb67e737903c4 (diff)
Replace query option --order_results with --order_output, which can take three values for a given output formatter: 'no', 'deps', or 'full'. A fourth value, 'auto', means either 'deps' or 'full' depending on the formatter.
The option 'no' is equivalent to --noorder_results. 'full' means that output will be deterministically ordered, using alphabetization if necessary. 'deps' means that graph order will be preserved (where applicable), but further efforts to order the output may not be undertaken. 'auto' is equivalent to 'full' for all output formatters except for proto, minrank, maxrank, and graph, for which it is equivalent to 'deps'. The purpose of this cl is to enable genquery to force completely deterministic output, which requires that it be able to specify a total ordering on the graph that is consistent across runs. Which ordering doesn't matter very much, so depending on the output formatter, or even within the same one, there may be some groups of nodes that are ordered alphabetically, and some reverse alphabetically. -- MOS_MIGRATED_REVID=101512292
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/query2/output/QueryOutputUtils.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/query2/output/QueryOutputUtils.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/query2/output/QueryOutputUtils.java b/src/main/java/com/google/devtools/build/lib/query2/output/QueryOutputUtils.java
index 078b937a55..b85cf66694 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/output/QueryOutputUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/output/QueryOutputUtils.java
@@ -17,6 +17,7 @@ import com.google.devtools.build.lib.packages.Target;
import com.google.devtools.build.lib.query2.engine.BlazeQueryEvalResult;
import com.google.devtools.build.lib.query2.engine.QueryEvalResult;
import com.google.devtools.build.lib.query2.output.OutputFormatter.UnorderedFormatter;
+import com.google.devtools.build.lib.query2.output.QueryOptions.OrderOutput;
import java.io.IOException;
import java.io.PrintStream;
@@ -27,7 +28,7 @@ public class QueryOutputUtils {
private QueryOutputUtils() {}
public static boolean orderResults(QueryOptions queryOptions, OutputFormatter formatter) {
- return queryOptions.orderResults || !(formatter instanceof UnorderedFormatter);
+ return queryOptions.orderOutput != OrderOutput.NO || !(formatter instanceof UnorderedFormatter);
}
public static void output(QueryOptions queryOptions, QueryEvalResult<Target> result,