Merge lp:~zorba-coders/zorba/1025564 into lp:zorba

Proposed by Chris Hillery
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
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.

To post a comment you must log in.
Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

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

review: Needs Fixing
Revision history for this message
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.

Revision history for this message
Chris Hillery (ceejatec) wrote :

Also, add a mention to the option changes to the ChangeLog.

review: Needs Fixing
Revision history for this message
Luis Rodriguez Gonzalez (kuraru) wrote :

Comments fixed, please re-review.

Revision history for this message
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.

review: Approve
Revision history for this message
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

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

What happened to "Fixed bug #866958 (Parsing error not explicit enough)" in the ChangeLog?

review: Needs Information
Revision history for this message
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.

Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
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/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job 1025564-2013-04-30T22-40-03.37Z is finished. The
  final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
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.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job 1025564-2013-05-01T03-32-07.037Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2013-04-30 23:54:17 +0000
+++ ChangeLog 2013-05-01 03:16:28 +0000
@@ -94,6 +94,7 @@
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.
95 * Fixed bug #867068: (Incorrect usage of XQDY0027)95 * Fixed bug #867068: (Incorrect usage of XQDY0027)
96 * Fixed bug: jsoniq constructor should not be const-folded96 * Fixed bug: jsoniq constructor should not be const-folded
97 * Fixed bug #866958 (Parsing error not explicit enough)
97 * Fixed bug #1152834 (bug in computing the scripting kind of array and object98 * Fixed bug #1152834 (bug in computing the scripting kind of array and object
98 constructor exprs)99 constructor exprs)
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()
@@ -101,6 +102,7 @@
101 * Raise XQST0046, if needed, from namespace declaration attribute inside102 * Raise XQST0046, if needed, from namespace declaration attribute inside
102 direct element constructor.103 direct element constructor.
103 * Fixed bug #1023362 (xsi:type attribute ignored during validation)104 * Fixed bug #1023362 (xsi:type attribute ignored during validation)
105 * Fixed bug #1025564 (Deprecate -f argument to zorbacmd)
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).
105107
106108
107109
=== modified file 'bin/CMakeLists.txt'
--- bin/CMakeLists.txt 2013-02-07 17:24:36 +0000
+++ bin/CMakeLists.txt 2013-05-01 03:16:28 +0000
@@ -58,6 +58,12 @@
58ENDIF(UNIX)58ENDIF(UNIX)
5959
60# test the basic features of the command line tool60# test the basic features of the command line tool
61ZORBA_ADD_TEST(bin/zorba_f1 zorbacmd blub.xq)
62ZORBA_SET_TEST_PROPERTY(bin/zorba_f1 PASS_REGULAR_EXPRESSION ".*file {blub.xq} not found or not readable.*")
63
64ZORBA_ADD_TEST(bin/zorba_f2 zorbacmd "${CMAKE_CURRENT_SOURCE_DIR}/test/option.xq" --option "{http://www.zorba-xquery.com}option=highly_unique")
65ZORBA_SET_TEST_PROPERTY(bin/zorba_f2 PASS_REGULAR_EXPRESSION "highly_unique")
66
61ZORBA_ADD_TEST(bin/zorba1 zorbacmd --omit-xml-declaration -q "1+1")67ZORBA_ADD_TEST(bin/zorba1 zorbacmd --omit-xml-declaration -q "1+1")
62ZORBA_SET_TEST_PROPERTY(bin/zorba1 PASS_REGULAR_EXPRESSION "2")68ZORBA_SET_TEST_PROPERTY(bin/zorba1 PASS_REGULAR_EXPRESSION "2")
6369
@@ -71,7 +77,14 @@
71ZORBA_SET_TEST_PROPERTY(bin/zorba4 PASS_REGULAR_EXPRESSION "(.*<child>child1</child>)*")77ZORBA_SET_TEST_PROPERTY(bin/zorba4 PASS_REGULAR_EXPRESSION "(.*<child>child1</child>)*")
7278
73ZORBA_ADD_TEST(bin/zorba5 zorbacmd -q -f blub.xq)79ZORBA_ADD_TEST(bin/zorba5 zorbacmd -q -f blub.xq)
74ZORBA_SET_TEST_PROPERTY(bin/zorba5 PASS_REGULAR_EXPRESSION ".*Extra arguments found on command line.*")80ZORBA_SET_TEST_PROPERTY(bin/zorba5 PASS_REGULAR_EXPRESSION ".*No queries submitted.*")
81
82IF (UNIX)
83 CONFIGURE_FILE ("${CMAKE_CURRENT_SOURCE_DIR}/test/shebang.xq.in"
84 "${CMAKE_CURRENT_BINARY_DIR}/shebang.xq" @ONLY)
85 ADD_TEST (bin/shebang "${CMAKE_CURRENT_BINARY_DIR}/shebang.xq")
86 SET_TESTS_PROPERTIES (bin/shebang PROPERTIES PASS_REGULAR_EXPRESSION "shebang success")
87ENDIF (UNIX)
7588
76# test the compile-only option of the command line tool which is used for semantic checking in eclipse89# test the compile-only option of the command line tool which is used for semantic checking in eclipse
77ZORBA_ADD_TEST(bin/zorba_compilechk1 zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/test/mymod.xq" -f -l)90ZORBA_ADD_TEST(bin/zorba_compilechk1 zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/test/mymod.xq" -f -l)
7891
=== added file 'bin/test/shebang.xq.in'
--- bin/test/shebang.xq.in 1970-01-01 00:00:00 +0000
+++ bin/test/shebang.xq.in 2013-05-01 03:16:28 +0000
@@ -0,0 +1,2 @@
1#!@ZORBA_EXE@
2"shebang success"
03
=== modified file 'bin/zorbacmdproperties.cpp'
--- bin/zorbacmdproperties.cpp 2013-02-07 17:24:36 +0000
+++ bin/zorbacmdproperties.cpp 2013-05-01 03:16:28 +0000
@@ -23,22 +23,21 @@
2323
24std::string ZorbaCMDProperties::check_args () {24std::string ZorbaCMDProperties::check_args () {
2525
26 if(queriesOrFilesBegin() == queriesOrFilesEnd()) {26 if(queriesOrFilesBegin() == queriesOrFilesEnd())
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 {
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.";
28 }29 }
2930
30 if (getPositionalArgs ().size () != 0) {31 if(unknownOption())
31 QueriesOrFiles_t::const_iterator lIter;32 {
32 for (lIter = queriesOrFilesBegin(); lIter != queriesOrFilesEnd();
33 ++lIter)
34 {
35 if (*lIter == "-f")
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.";
37 }
38
39 return "Extra arguments found on command line. Use -h for help.";33 return "Extra arguments found on command line. Use -h for help.";
40 }34 }
4135
36 if(queriesOrFilesBegin() == queriesOrFilesEnd())
37 {
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.";
39 }
40
42 if ( theBoundarySpace.size() != 0 )41 if ( theBoundarySpace.size() != 0 )
43 {42 {
44 if ( ! (theBoundarySpace.compare("strip") == 0 || theBoundarySpace.compare("preserve") == 0 ))43 if ( ! (theBoundarySpace.compare("strip") == 0 || theBoundarySpace.compare("preserve") == 0 ))
4544
=== modified file 'bin/zorbacmdproperties_base.h'
--- bin/zorbacmdproperties_base.h 2013-02-07 17:24:36 +0000
+++ bin/zorbacmdproperties_base.h 2013-05-01 03:16:28 +0000
@@ -94,6 +94,9 @@
94 bool theSerializePlan;94 bool theSerializePlan;
95 bool theSavePlan;95 bool theSavePlan;
96 bool theLoadPlan;96 bool theLoadPlan;
97 bool theFparm;
98 bool theQBeforeF;
99 bool theUnknownOption;
97100
98 void initialize () 101 void initialize ()
99 {102 {
@@ -106,7 +109,7 @@
106 theByteOrderMark = false;109 theByteOrderMark = false;
107 theOmitXmlDeclaration = false;110 theOmitXmlDeclaration = false;
108 theMultiple = 1;111 theMultiple = 1;
109 theAsFiles = false;112 theAsFiles = true;
110 theOptimizationLevel = "O1";113 theOptimizationLevel = "O1";
111 theLibModule = false;114 theLibModule = false;
112 theParseOnly = false;115 theParseOnly = false;
@@ -121,6 +124,9 @@
121 theSerializePlan = false;124 theSerializePlan = false;
122 theSavePlan = false;125 theSavePlan = false;
123 theLoadPlan = false;126 theLoadPlan = false;
127 theFparm = false;
128 theQBeforeF = false;
129 theUnknownOption = false;
124 }130 }
125131
126public:132public:
@@ -167,6 +173,8 @@
167 const bool& serializePlan () const { return theSerializePlan; }173 const bool& serializePlan () const { return theSerializePlan; }
168 const bool& loadPlan () const { return theLoadPlan; }174 const bool& loadPlan () const { return theLoadPlan; }
169 const bool& savePlan () const { return theSavePlan; }175 const bool& savePlan () const { return theSavePlan; }
176 const bool& qBeforeF () const { return theQBeforeF; }
177 const bool& unknownOption() const { return theUnknownOption; }
170178
171 std::string load_argv (int argc, const char **argv) 179 std::string load_argv (int argc, const char **argv)
172 {180 {
@@ -279,6 +287,13 @@
279 else if (strcmp (*argv, "--query") == 0 || strncmp (*argv, "-q", 2) == 0) 287 else if (strcmp (*argv, "--query") == 0 || strncmp (*argv, "-q", 2) == 0)
280 {288 {
281 int d = 2;289 int d = 2;
290 if(theFparm == false)
291 theAsFiles = false;
292 if(!strncmp(*(argv+1), "-f", 2))
293 {
294 theQBeforeF = true; // is it "-q -f <filename>" perhaps?
295 break; // stop functionality here
296 }
282 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }297 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
283 if (*argv == NULL)298 if (*argv == NULL)
284 {299 {
@@ -288,6 +303,7 @@
288 }303 }
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)
290 {305 {
306 theFparm = true;
291 theAsFiles = true;307 theAsFiles = true;
292 }308 }
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)
@@ -449,12 +465,13 @@
449 }465 }
450 else if ((*argv) [0] == '-')466 else if ((*argv) [0] == '-')
451 {467 {
452 result = "unknown command line option "; result += *argv; break; 468 result = "unknown command line option "; result += *argv;
469 theUnknownOption = true; break;
453 }470 }
454 else471 else
455 {472 {
473 init_val(*argv, theQueriesOrFiles, 0);
456 copy_args (argv);474 copy_args (argv);
457 break;
458 }475 }
459 }476 }
460477
@@ -481,7 +498,7 @@
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"
482 "--multiple, -m\nExecute the given queries multiple times.\n\n"499 "--multiple, -m\nExecute the given queries multiple times.\n\n"
483 "--query, -q\nQuery test or file URI (file://...)\n\n"500 "--query, -q\nQuery test or file URI (file://...)\n\n"
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"
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"
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"
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"
@@ -504,7 +521,7 @@
504 "--thesaurus\nMapping specifying a thesaurus URI to another.\n\n"521 "--thesaurus\nMapping specifying a thesaurus URI to another.\n\n"
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"
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"
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"
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"
509 ;526 ;
510 }527 }

Subscribers

People subscribed via source and target branches