Merge lp:~zorba-coders/zorba/1025564 into lp:zorba
- 1025564
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Chris Hillery | ||||
Approved revision: | 11339 | ||||
Merged at revision: | 11421 | ||||
Proposed branch: | lp:~zorba-coders/zorba/1025564 | ||||
Merge into: | lp:zorba | ||||
Diff against target: |
194 lines (+50/-17) 5 files modified
ChangeLog (+2/-0) bin/CMakeLists.txt (+14/-1) bin/test/shebang.xq.in (+2/-0) bin/zorbacmdproperties.cpp (+10/-11) bin/zorbacmdproperties_base.h (+22/-5) |
||||
To merge this branch: | bzr merge lp:~zorba-coders/zorba/1025564 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthias Brantner | Approve | ||
Chris Hillery | Approve | ||
Review via email: mp+125256@code.launchpad.net |
This proposal supersedes a proposal from 2012-08-16.
Commit message
Added changes for deprecating -f option.
Description of the change
Matthias Brantner (matthias-brantner) wrote : | # |
Chris Hillery (ceejatec) wrote : | # |
Agree about the --help doc; if I get a little time later I might put in a suggested change myself.
Also agree about not leaving commented-out code.
To be fair to Luis, the coding guidelines do not mention anything about brace positioning or spaces after "if", etc.
Chris Hillery (ceejatec) wrote : | # |
Also, add a mention to the option changes to the ChangeLog.
Luis Rodriguez Gonzalez (kuraru) wrote : | # |
Comments fixed, please re-review.
Chris Hillery (ceejatec) wrote : | # |
I'm not sure why Launchpad is showing hundreds of changes on this branch; something odd when merging from the trunk, I assume. But the diff looks good, so if it merges OK, I'm happy.
Sorin Marian Nasoi (sorin.marian.nasoi) wrote : | # |
> I'm not sure why Launchpad is showing hundreds of changes on this branch;
> something odd when merging from the trunk, I assume. But the diff looks good,
> so if it merges OK, I'm happy.
Since most of the changes are in bin folder, that has not been changed in a while now, just to be 100% sure that everything is OK one could:
- create a new branch of lp:zorba locally
- merge the proposed changes in this branch and propose it for merging (be sure to give it a unique name when pushing the changes to LP)
- delete this merge proposal and related branch
Matthias Brantner (matthias-brantner) wrote : | # |
What happened to "Fixed bug #866958 (Parsing error not explicit enough)" in the ChangeLog?
Chris Hillery (ceejatec) wrote : | # |
That bug was never part of this proposal. I think it's showing up in the did here due to my merge from the trunk. The Changelog had a number of things get rearranged which made conflict resolution hard. That bug is in fact fixed so I assume it should be in the Changelog.
Matthias Brantner (matthias-brantner) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~zorba-coders/zorba/1025564 into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job 1025564-
final status was:
1 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job 1025564-
All tests succeeded!
Preview Diff
1 | === modified file 'ChangeLog' | |||
2 | --- ChangeLog 2013-04-30 23:54:17 +0000 | |||
3 | +++ ChangeLog 2013-05-01 03:16:28 +0000 | |||
4 | @@ -94,6 +94,7 @@ | |||
5 | 94 | * Fixed bug in computing the static type of a self-axis path step. | 94 | * Fixed bug in computing the static type of a self-axis path step. |
6 | 95 | * Fixed bug #867068: (Incorrect usage of XQDY0027) | 95 | * Fixed bug #867068: (Incorrect usage of XQDY0027) |
7 | 96 | * Fixed bug: jsoniq constructor should not be const-folded | 96 | * Fixed bug: jsoniq constructor should not be const-folded |
8 | 97 | * Fixed bug #866958 (Parsing error not explicit enough) | ||
9 | 97 | * Fixed bug #1152834 (bug in computing the scripting kind of array and object | 98 | * Fixed bug #1152834 (bug in computing the scripting kind of array and object |
10 | 98 | constructor exprs) | 99 | constructor exprs) |
11 | 99 | * Fixed bug #1125444 (input group-by exprs were not treated by index-flwor_vars() | 100 | * Fixed bug #1125444 (input group-by exprs were not treated by index-flwor_vars() |
12 | @@ -101,6 +102,7 @@ | |||
13 | 101 | * Raise XQST0046, if needed, from namespace declaration attribute inside | 102 | * Raise XQST0046, if needed, from namespace declaration attribute inside |
14 | 102 | direct element constructor. | 103 | direct element constructor. |
15 | 103 | * Fixed bug #1023362 (xsi:type attribute ignored during validation) | 104 | * Fixed bug #1023362 (xsi:type attribute ignored during validation) |
16 | 105 | * Fixed bug #1025564 (Deprecate -f argument to zorbacmd) | ||
17 | 104 | * Fixed bug #1082740 (support for INF and -INF values in fn:subsequence function). | 106 | * Fixed bug #1082740 (support for INF and -INF values in fn:subsequence function). |
18 | 105 | 107 | ||
19 | 106 | 108 | ||
20 | 107 | 109 | ||
21 | === modified file 'bin/CMakeLists.txt' | |||
22 | --- bin/CMakeLists.txt 2013-02-07 17:24:36 +0000 | |||
23 | +++ bin/CMakeLists.txt 2013-05-01 03:16:28 +0000 | |||
24 | @@ -58,6 +58,12 @@ | |||
25 | 58 | ENDIF(UNIX) | 58 | ENDIF(UNIX) |
26 | 59 | 59 | ||
27 | 60 | # test the basic features of the command line tool | 60 | # test the basic features of the command line tool |
28 | 61 | ZORBA_ADD_TEST(bin/zorba_f1 zorbacmd blub.xq) | ||
29 | 62 | ZORBA_SET_TEST_PROPERTY(bin/zorba_f1 PASS_REGULAR_EXPRESSION ".*file {blub.xq} not found or not readable.*") | ||
30 | 63 | |||
31 | 64 | ZORBA_ADD_TEST(bin/zorba_f2 zorbacmd "${CMAKE_CURRENT_SOURCE_DIR}/test/option.xq" --option "{http://www.zorba-xquery.com}option=highly_unique") | ||
32 | 65 | ZORBA_SET_TEST_PROPERTY(bin/zorba_f2 PASS_REGULAR_EXPRESSION "highly_unique") | ||
33 | 66 | |||
34 | 61 | ZORBA_ADD_TEST(bin/zorba1 zorbacmd --omit-xml-declaration -q "1+1") | 67 | ZORBA_ADD_TEST(bin/zorba1 zorbacmd --omit-xml-declaration -q "1+1") |
35 | 62 | ZORBA_SET_TEST_PROPERTY(bin/zorba1 PASS_REGULAR_EXPRESSION "2") | 68 | ZORBA_SET_TEST_PROPERTY(bin/zorba1 PASS_REGULAR_EXPRESSION "2") |
36 | 63 | 69 | ||
37 | @@ -71,7 +77,14 @@ | |||
38 | 71 | ZORBA_SET_TEST_PROPERTY(bin/zorba4 PASS_REGULAR_EXPRESSION "(.*<child>child1</child>)*") | 77 | ZORBA_SET_TEST_PROPERTY(bin/zorba4 PASS_REGULAR_EXPRESSION "(.*<child>child1</child>)*") |
39 | 72 | 78 | ||
40 | 73 | ZORBA_ADD_TEST(bin/zorba5 zorbacmd -q -f blub.xq) | 79 | ZORBA_ADD_TEST(bin/zorba5 zorbacmd -q -f blub.xq) |
42 | 74 | ZORBA_SET_TEST_PROPERTY(bin/zorba5 PASS_REGULAR_EXPRESSION ".*Extra arguments found on command line.*") | 80 | ZORBA_SET_TEST_PROPERTY(bin/zorba5 PASS_REGULAR_EXPRESSION ".*No queries submitted.*") |
43 | 81 | |||
44 | 82 | IF (UNIX) | ||
45 | 83 | CONFIGURE_FILE ("${CMAKE_CURRENT_SOURCE_DIR}/test/shebang.xq.in" | ||
46 | 84 | "${CMAKE_CURRENT_BINARY_DIR}/shebang.xq" @ONLY) | ||
47 | 85 | ADD_TEST (bin/shebang "${CMAKE_CURRENT_BINARY_DIR}/shebang.xq") | ||
48 | 86 | SET_TESTS_PROPERTIES (bin/shebang PROPERTIES PASS_REGULAR_EXPRESSION "shebang success") | ||
49 | 87 | ENDIF (UNIX) | ||
50 | 75 | 88 | ||
51 | 76 | # test the compile-only option of the command line tool which is used for semantic checking in eclipse | 89 | # test the compile-only option of the command line tool which is used for semantic checking in eclipse |
52 | 77 | ZORBA_ADD_TEST(bin/zorba_compilechk1 zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/test/mymod.xq" -f -l) | 90 | ZORBA_ADD_TEST(bin/zorba_compilechk1 zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/test/mymod.xq" -f -l) |
53 | 78 | 91 | ||
54 | === added file 'bin/test/shebang.xq.in' | |||
55 | --- bin/test/shebang.xq.in 1970-01-01 00:00:00 +0000 | |||
56 | +++ bin/test/shebang.xq.in 2013-05-01 03:16:28 +0000 | |||
57 | @@ -0,0 +1,2 @@ | |||
58 | 1 | #!@ZORBA_EXE@ | ||
59 | 2 | "shebang success" | ||
60 | 0 | 3 | ||
61 | === modified file 'bin/zorbacmdproperties.cpp' | |||
62 | --- bin/zorbacmdproperties.cpp 2013-02-07 17:24:36 +0000 | |||
63 | +++ bin/zorbacmdproperties.cpp 2013-05-01 03:16:28 +0000 | |||
64 | @@ -23,22 +23,21 @@ | |||
65 | 23 | 23 | ||
66 | 24 | std::string ZorbaCMDProperties::check_args () { | 24 | std::string ZorbaCMDProperties::check_args () { |
67 | 25 | 25 | ||
70 | 26 | if(queriesOrFilesBegin() == queriesOrFilesEnd()) { | 26 | if(queriesOrFilesBegin() == queriesOrFilesEnd()) |
71 | 27 | return "No queries submitted \nUsage: zorba -q '1 + 1' execute an inline query \n zorba -f -q file.xq execute a query from a file \n Use -h for help."; | 27 | { |
72 | 28 | return "No queries submitted \nUsage: zorba -q '1 + 1' execute an inline query \n zorba file.xq execute a query from a file \n Use -h for help."; | ||
73 | 28 | } | 29 | } |
74 | 29 | 30 | ||
84 | 30 | if (getPositionalArgs ().size () != 0) { | 31 | if(unknownOption()) |
85 | 31 | QueriesOrFiles_t::const_iterator lIter; | 32 | { |
77 | 32 | for (lIter = queriesOrFilesBegin(); lIter != queriesOrFilesEnd(); | ||
78 | 33 | ++lIter) | ||
79 | 34 | { | ||
80 | 35 | if (*lIter == "-f") | ||
81 | 36 | return "Extra arguments found on command line. Possible reason: misplaced -f option (try '-f -q filename' instead of '-q -f filename'). Use -h for help."; | ||
82 | 37 | } | ||
83 | 38 | |||
86 | 39 | return "Extra arguments found on command line. Use -h for help."; | 33 | return "Extra arguments found on command line. Use -h for help."; |
87 | 40 | } | 34 | } |
88 | 41 | 35 | ||
89 | 36 | if(queriesOrFilesBegin() == queriesOrFilesEnd()) | ||
90 | 37 | { | ||
91 | 38 | return "No queries submitted \nUsage: zorba -q '1 + 1' execute an inline query \n zorba file.xq execute a query from a file \n Use -h for help."; | ||
92 | 39 | } | ||
93 | 40 | |||
94 | 42 | if ( theBoundarySpace.size() != 0 ) | 41 | if ( theBoundarySpace.size() != 0 ) |
95 | 43 | { | 42 | { |
96 | 44 | if ( ! (theBoundarySpace.compare("strip") == 0 || theBoundarySpace.compare("preserve") == 0 )) | 43 | if ( ! (theBoundarySpace.compare("strip") == 0 || theBoundarySpace.compare("preserve") == 0 )) |
97 | 45 | 44 | ||
98 | === modified file 'bin/zorbacmdproperties_base.h' | |||
99 | --- bin/zorbacmdproperties_base.h 2013-02-07 17:24:36 +0000 | |||
100 | +++ bin/zorbacmdproperties_base.h 2013-05-01 03:16:28 +0000 | |||
101 | @@ -94,6 +94,9 @@ | |||
102 | 94 | bool theSerializePlan; | 94 | bool theSerializePlan; |
103 | 95 | bool theSavePlan; | 95 | bool theSavePlan; |
104 | 96 | bool theLoadPlan; | 96 | bool theLoadPlan; |
105 | 97 | bool theFparm; | ||
106 | 98 | bool theQBeforeF; | ||
107 | 99 | bool theUnknownOption; | ||
108 | 97 | 100 | ||
109 | 98 | void initialize () | 101 | void initialize () |
110 | 99 | { | 102 | { |
111 | @@ -106,7 +109,7 @@ | |||
112 | 106 | theByteOrderMark = false; | 109 | theByteOrderMark = false; |
113 | 107 | theOmitXmlDeclaration = false; | 110 | theOmitXmlDeclaration = false; |
114 | 108 | theMultiple = 1; | 111 | theMultiple = 1; |
116 | 109 | theAsFiles = false; | 112 | theAsFiles = true; |
117 | 110 | theOptimizationLevel = "O1"; | 113 | theOptimizationLevel = "O1"; |
118 | 111 | theLibModule = false; | 114 | theLibModule = false; |
119 | 112 | theParseOnly = false; | 115 | theParseOnly = false; |
120 | @@ -121,6 +124,9 @@ | |||
121 | 121 | theSerializePlan = false; | 124 | theSerializePlan = false; |
122 | 122 | theSavePlan = false; | 125 | theSavePlan = false; |
123 | 123 | theLoadPlan = false; | 126 | theLoadPlan = false; |
124 | 127 | theFparm = false; | ||
125 | 128 | theQBeforeF = false; | ||
126 | 129 | theUnknownOption = false; | ||
127 | 124 | } | 130 | } |
128 | 125 | 131 | ||
129 | 126 | public: | 132 | public: |
130 | @@ -167,6 +173,8 @@ | |||
131 | 167 | const bool& serializePlan () const { return theSerializePlan; } | 173 | const bool& serializePlan () const { return theSerializePlan; } |
132 | 168 | const bool& loadPlan () const { return theLoadPlan; } | 174 | const bool& loadPlan () const { return theLoadPlan; } |
133 | 169 | const bool& savePlan () const { return theSavePlan; } | 175 | const bool& savePlan () const { return theSavePlan; } |
134 | 176 | const bool& qBeforeF () const { return theQBeforeF; } | ||
135 | 177 | const bool& unknownOption() const { return theUnknownOption; } | ||
136 | 170 | 178 | ||
137 | 171 | std::string load_argv (int argc, const char **argv) | 179 | std::string load_argv (int argc, const char **argv) |
138 | 172 | { | 180 | { |
139 | @@ -279,6 +287,13 @@ | |||
140 | 279 | else if (strcmp (*argv, "--query") == 0 || strncmp (*argv, "-q", 2) == 0) | 287 | else if (strcmp (*argv, "--query") == 0 || strncmp (*argv, "-q", 2) == 0) |
141 | 280 | { | 288 | { |
142 | 281 | int d = 2; | 289 | int d = 2; |
143 | 290 | if(theFparm == false) | ||
144 | 291 | theAsFiles = false; | ||
145 | 292 | if(!strncmp(*(argv+1), "-f", 2)) | ||
146 | 293 | { | ||
147 | 294 | theQBeforeF = true; // is it "-q -f <filename>" perhaps? | ||
148 | 295 | break; // stop functionality here | ||
149 | 296 | } | ||
150 | 282 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } | 297 | if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; } |
151 | 283 | if (*argv == NULL) | 298 | if (*argv == NULL) |
152 | 284 | { | 299 | { |
153 | @@ -288,6 +303,7 @@ | |||
154 | 288 | } | 303 | } |
155 | 289 | else if (strcmp (*argv, "--as-files") == 0 || strncmp (*argv, "-f", 2) == 0) | 304 | else if (strcmp (*argv, "--as-files") == 0 || strncmp (*argv, "-f", 2) == 0) |
156 | 290 | { | 305 | { |
157 | 306 | theFparm = true; | ||
158 | 291 | theAsFiles = true; | 307 | theAsFiles = true; |
159 | 292 | } | 308 | } |
160 | 293 | else if (strcmp (*argv, "--external-variable") == 0 || strncmp (*argv, "-e", 2) == 0) | 309 | else if (strcmp (*argv, "--external-variable") == 0 || strncmp (*argv, "-e", 2) == 0) |
161 | @@ -449,12 +465,13 @@ | |||
162 | 449 | } | 465 | } |
163 | 450 | else if ((*argv) [0] == '-') | 466 | else if ((*argv) [0] == '-') |
164 | 451 | { | 467 | { |
166 | 452 | result = "unknown command line option "; result += *argv; break; | 468 | result = "unknown command line option "; result += *argv; |
167 | 469 | theUnknownOption = true; break; | ||
168 | 453 | } | 470 | } |
169 | 454 | else | 471 | else |
170 | 455 | { | 472 | { |
171 | 473 | init_val(*argv, theQueriesOrFiles, 0); | ||
172 | 456 | copy_args (argv); | 474 | copy_args (argv); |
173 | 457 | break; | ||
174 | 458 | } | 475 | } |
175 | 459 | } | 476 | } |
176 | 460 | 477 | ||
177 | @@ -481,7 +498,7 @@ | |||
178 | 481 | "--ordering-mode\nSet the ordering mode ('ordered' or 'unordered') in the static context.\n\n" | 498 | "--ordering-mode\nSet the ordering mode ('ordered' or 'unordered') in the static context.\n\n" |
179 | 482 | "--multiple, -m\nExecute the given queries multiple times.\n\n" | 499 | "--multiple, -m\nExecute the given queries multiple times.\n\n" |
180 | 483 | "--query, -q\nQuery test or file URI (file://...)\n\n" | 500 | "--query, -q\nQuery test or file URI (file://...)\n\n" |
182 | 484 | "--as-files, -f\nTreat all -q arguments as file paths instead of URIs or inline queries.\n\n" | 501 | "--as-files, -f\nTreat all -q arguments as file paths instead of URIs or inline queries. This option is deprecated and will be defaulted to true in the future, so any entry in the command line is going to be treated as files.\n\n" |
183 | 485 | "--external-variable, -e\nProvide the value for a variable given a file (name=file) or a value (name:=value)\n\n" | 502 | "--external-variable, -e\nProvide the value for a variable given a file (name=file) or a value (name:=value)\n\n" |
184 | 486 | "--context-item\nSet the context item to the XML document in a given file.\n\n" | 503 | "--context-item\nSet the context item to the XML document in a given file.\n\n" |
185 | 487 | "--optimization-level\nOptimization level for the query compiler (O0, O1 or O2 - default: O1)\n\n" | 504 | "--optimization-level\nOptimization level for the query compiler (O0, O1 or O2 - default: O1)\n\n" |
186 | @@ -504,7 +521,7 @@ | |||
187 | 504 | "--thesaurus\nMapping specifying a thesaurus URI to another.\n\n" | 521 | "--thesaurus\nMapping specifying a thesaurus URI to another.\n\n" |
188 | 505 | "--serialize-plan, -s\nSerialize and then load the query execution plan.\n\n" | 522 | "--serialize-plan, -s\nSerialize and then load the query execution plan.\n\n" |
189 | 506 | "--compile-plan,\nDo not execute the query; just compile it and save the execution plan in the file specified with the -o option.\n\n" | 523 | "--compile-plan,\nDo not execute the query; just compile it and save the execution plan in the file specified with the -o option.\n\n" |
191 | 507 | "--execute-plan\nDo not compile the query; instead load the execution plan from the file specified by the -f -q options, and execute the loaded plan.\n\n" | 524 | "--execute-plan\nDo not compile the query; instead load the execution plan from the file specified by the -f -q options (or by any file specified without any other argument), and execute the loaded plan.\n\n" |
192 | 508 | "--disable-http-resolution\nDo not use HTTP to resolve URIs\n\n" | 525 | "--disable-http-resolution\nDo not use HTTP to resolve URIs\n\n" |
193 | 509 | ; | 526 | ; |
194 | 510 | } | 527 | } |
Works great. Some minor issues:
- the --help documentation should mention that the argument is deprecated
- also, the --help documentation should mention the syntax to pass the file
- please respect coding guidelines. For example,
if(qBeforeF()){ => if (qBeforeF())
{
- remove commented out code