Commit graph

3168 commits

Author SHA1 Message Date
Paul Beckingham
7a45db4d0f Feature #891
- Added feature #891, which allows for leftmost partial matches of UUID values.
  Makes direct comparisons for full-length values, and regular expressions for
  partial values.  Note that there is a minimum length of 8 hex digits.
- Added safety parsing mechanism that fails a partial UUID if immediately
  followed by a hex digit.  This allows for numbers longer than 8 digits to not
  be misinterpreted as a UUID.
- Implemented Nibbler::getPartialUUID.
- Implemented unit tests.
@@ -1145,12 +1145,23 @@ const A3 A3::sequence (const A3& input) const

   for (unsigned int i = 0; i < uuids.size (); ++i)
   {
-    if (ids.size ())
+    if (ids.size () + i > 0)
       sequenced.push_back (Arg ("or", Arg::cat_op));

-    sequenced.push_back (Arg ("uuid",        Arg::type_string, Arg::cat_dom));
-    sequenced.push_back (Arg ("=",                             Arg::cat_op));
-    sequenced.push_back (Arg (uuids[i],      Arg::type_string, Arg::cat_literal));
+    // A full-length UUID requires a string comparison.
+    if (uuids[i].length () == 36)
+    {
+      sequenced.push_back (Arg ("uuid",         Arg::type_string, Arg::cat_dom));
+      sequenced.push_back (Arg ("=",                              Arg::cat_op));
+      sequenced.push_back (Arg (uuids[i],       Arg::type_string, Arg::cat_literal));
+    }
+    // A UUID fragment is a leftmost comparison.
+    else
+    {
+      sequenced.push_back (Arg ("uuid",         Arg::type_string, Arg::cat_dom));
+      sequenced.push_back (Arg ("~",                              Arg::cat_op));
+      sequenced.push_back (Arg ("^" + uuids[i], Arg::type_string, Arg::cat_rx));
+    }
   }

   sequenced.push_back (Arg (")", Arg::cat_op));
@@ -1674,11 +1685,11 @@ bool A3::is_uuid (Nibbler& n, std::string& result)
   n.save ();
   result = "";
   std::string uuid;
-  if (n.getUUID (uuid))
+  if (n.getPartialUUID (uuid))
   {
     result += uuid;
     while (n.skip (',') &&
-           n.getUUID (uuid))
+           n.getPartialUUID (uuid))
     {
       result += ',' + uuid;
     }
@@ -1997,13 +2008,13 @@ bool A3::extract_uuid (
   Nibbler n (input);

   std::string uuid;
-  if (n.getUUID (uuid))
+  if (n.getPartialUUID (uuid))
   {
     sequence.push_back (uuid);

     while (n.skip (','))
     {
-      if (!n.getUUID (uuid))
+      if (!n.getPartialUUID (uuid))
         throw std::string (STRING_A3_UUID_AFTER_COMMA);

       sequence.push_back (uuid);
2012-02-19 22:27:40 -05:00
Paul Beckingham
c785836083 Feature #632
- Added feature #632, which allows environment variables TASKRC and TASKDATA
  to override .taskrc and .task directory locations (thanks to Steve Rader).
- Added unit tests.
+
2012-02-19 18:59:28 -05:00
Paul Beckingham
09431caf1c Bug
- Tag matching was being performed using the regex \b<tag>\b, which makes
  taskwarrior dependent on regex lib bugs for basic functionality.  This is
  now modified to use pseudo-operators _hastag_ and _notag_.
2012-02-19 17:20:11 -05:00
Michal Vyskocil
78e5891cd3 Portability
- lua_open has been declared as deprecated in lua 5.1 and removed from
  5.2. Usage of luaL_newstate is thus recommended in both series.

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-02-15 19:26:26 -05:00
Paul Beckingham
26cc4e11f5 Unit Tests
- Improved verbosity unit tests.
2012-02-13 06:16:18 -05:00
Uli Martens
7fe5fc80e9 Bug #636
- Fixed bug #636, which causes the burndown reports to not honor the
  _forcecolor=off setting (thanks to Steve Rader, Uli Martens).

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-02-13 06:15:27 -05:00
Paul Beckingham
28a4947234 Bug #818
- Fixed bug #818, which caused partial tag matching (thanks to Joe Holloway).
- Note that the regex word boundary anchors are different for Solaris
  and Linux, and largely broken on OSX.
- Added unit tests.
2012-02-12 10:42:24 -05:00
Paul Beckingham
efb2476c15 Unit Tests
- Added bug.924.t unit tests.  I cannot replicate the bug, but a
  regerssion test should prevent any recurrence.
2012-02-12 08:41:08 -05:00
Uli Martens
0f60e8c758 Bug #929
- Fixed bug #929, which corrected argument handling for aliases.

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-02-12 08:15:45 -05:00
Ralph Bean
53ac325705 Patch to fix broken build.
Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-02-05 22:47:36 -05:00
Paul Beckingham
96fe3f42ba Minor Refactoring
- Added support for more type-specific checks of attribute values.
- Added support for more type-specific attribute rendering.
- Improved generalized methods for checking columns in a report.
- Added unit tests.
- Minor code cleanup.
- Added secret hidden feature for internal testing.
2012-02-05 20:56:46 -05:00
Paul Beckingham
cffc42484e Code Cleanup
- Removed non-STL Nibbler method, which makes way for a future optimization
  in the form of a non-copying Nibbler.
2012-02-05 15:28:09 -05:00
Paul Beckingham
c0f8ab3249 Configuration Cleanup
- Fixed typos in default config file.
- Removed default values for edit.verbose and echo.command, both of
  which are deprecated.
2012-02-05 14:37:22 -05:00
Paul Beckingham
412396d35b Code Cleanup
- Removed restriction on waiting recurring tasks.
- Removed unused L10N string.
- Removed unnecessary include.
2012-02-05 10:08:10 -05:00
Paul Beckingham
86f113a24c Feature #609
- Added feature #609, which allows suppression of output labels and verbose
  text.
2012-02-03 00:05:46 -05:00
Paul Beckingham
8abc541777 Bug #906
- Fixed bug #906, which caused problems with inverted project matching (thanks
  to Uli Martens).
2012-02-02 23:51:31 -05:00
Paul Beckingham
565d14962d Bug #910
- Fixed bug #910, which caused unexpected behavior when duplicating a recurring
  task (thanks to Jennifer Cormier).
- Fixed typo in duplicate command that failed to remove the 'mask' attribute.
2012-02-02 23:31:22 -05:00
Paul Beckingham
2ce9322a28 Bug #917
- Fixed bug #917, which mis-encoded quotes (thanks to Uli Martens).
- Added unit tests.
- Minor unrelated edits.
2012-02-02 22:58:36 -05:00
Paul Beckingham
89b5c91a35 Unit Tests
- Corrected method name.
2012-01-30 20:27:50 -05:00
Paul Beckingham
1619441f87 Theme Sample generation
- Generating snapshots of themes now automated.
2012-01-30 20:27:17 -05:00
Paul Beckingham
bff868145d Bug #901
- Fixed bug #901, which was preventing multiple IDs and UUIDs from being used
  as a filter (thanks to Bryce Harrington).
2012-01-30 01:00:45 -05:00
Paul Beckingham
36e5e650d4 Feedback
- Converted std::cout to context.footnote, for custom reports and burndown.
  Not sure why they were wrong.
2012-01-30 00:42:15 -05:00
Paul Beckingham
5e4f7feff8 Performance
- Added a shortcut test that speeds up the decode process for most cases.
2012-01-30 00:18:53 -05:00
Paul Beckingham
5609711d47 Feature #571 - Special tag feedback
- The verbosity token 'special' now controls whether the feedback is provided
  when special tags are added to a task.
- Added new 'special' verbosity token documentation to man page.
- Added missing 'next' special tag to man page.
- Added new localized strings for describing special tags.
2012-01-29 18:28:07 -05:00
Paul Beckingham
bf9e14f581 Bug 899
- Fixed bug #899, which displayed incorrect project completion numbers (thanks
  to Paul-Gheorghe Barbu).
- Added unit tests.
2012-01-29 17:44:43 -05:00
Paul Beckingham
c092b027a6 Code Cleanup
- Removed 'synch_key' tests and file I/O.  Soon, soon...
2012-01-29 17:42:52 -05:00
Paul Beckingham
ec96d929a0 Bug 879 - Description/Annotation ending with Slash Causes Problems
- Backslashes actually.  The escaping mechanism in the low-level parser
  was eating leading \ characters when it should not.  Very hard bug to
  find, trivial to fix.
- Added unit tests to several components while narrowing this down.
2012-01-29 15:36:05 -05:00
Paul Beckingham
7a2bf28005 ChangeLog
- Updated ChangeLog to reflect several bugs that have been fixed, but
  were not reported.
2012-01-28 17:18:34 -05:00
Paul Beckingham
e05b3633f2 Bug - Summary report broken linefeeds
- Applied same #907 patch for CmdHistory.cpp to CmdSummary.cpp.
2012-01-28 10:43:11 -05:00
Paul Beckingham
6cf9790fac Code Cleanup
- Removed code that creates the ~/.task/extensions directory, which will not be
  needed until 2.1.  Until then, it is clutter.
2012-01-28 10:37:14 -05:00
Uli Martens
529161b711 Bug #905
- The problem was that the routine dependencyIsCircular() changed its behaviour
  in git revision 726fc33fe4, and the new version
  only checked tasks by id - but all completed/deleted tasks have the id0, which
  led to the problem.  The fix is extremelly simple, just get the dependencies
  by uuid instead of by id.

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-01-23 06:24:51 -05:00
Paul Beckingham
6145f2d4a8 Typo
- Fixed typo in L10N name month names.
2012-01-22 14:41:00 -05:00
Uli Martens
851347fccc Bug #907
- The bug first occured in commit 36ed70ad93 and
  seems to be caused by the rewritten break point detection. This adds linefeeds
  into the table output, where they're not wanted.  This can be fixed by marking
  the respective tables as nonbreakable, as done in the attached patch.

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-01-18 07:29:08 -05:00
Ralph Bean
184ba60df4 Portability
- Fixed GCC 4.3 compilation error.

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-01-17 18:12:27 -05:00
Paul Beckingham
fe467640ca Bug #902 - 'task version' requires a .taskrc
- Added special case support for '--version' which bypasses all
  configuration.  Not documented.  For extension prgorams like
  'taskhelm', that need to determine whether taskwarrior is
  sufficiently current.
2012-01-16 22:44:59 -05:00
Paul Beckingham
15d25d4fdf Lua
- Tweaks to the Lua and extension API.  Note that this is a documentation-only
  change, meaning the design is being honed.  No support exists yet.
2012-01-15 11:39:53 -05:00
Paul Beckingham
15030599fd Unit Tests
- Added more verbosity token tests, which show up some unimplemented
  loose ends.
2012-01-12 16:49:54 -05:00
Paul Beckingham
35fdb4058d Doucmentation
- Updated PUNCHLIST doc, which at this point isn't very useful.
2012-01-12 16:48:38 -05:00
Paul Beckingham
7cc3544f74 Bug #897
- Fixed bug #897, which omitted the UUID field from the 'completed'
  report, which is essential if you need to modify a completed task
  (thanks to Eli Lev).
2012-01-12 16:47:08 -05:00
Paul Beckingham
205d4fe29f Cleanup
- Removed git conflict marker (thanks to Uli Martens).
2012-01-12 01:06:26 -05:00
Paul Beckingham
71a15f9d44 Documentation
- Corrected some example command lines (thanks to Eric Fluger).
2012-01-10 23:21:21 -05:00
Paul Beckingham
9853bfee46 Unit Tests
- Restored a 'skip' unit test, because it works most of the time, and
  only fails during the one end of daylight savings day.  Along with
  several others.
2012-01-10 23:19:54 -05:00
Paul Beckingham
0c93d22720 Merge branch '2.0.0' of tasktools.org:task into 2.0.0
Conflicts:
	DEVELOPER
2012-01-10 18:00:08 -05:00
Ralph Bean
36ed70ad93 Exports
- Provided sample sqlite3 export script in Python, to serve as a
  starting point for anyone wanting to migrate taskwarrior data into
  a SQL database.  Illustrates JSON parsing and separation of the
  relational data.

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-01-10 17:58:34 -05:00
Ralph Bean
76e87173e1 Exports
- Provided sample sqlite3 export script in Python, to serve as a
  starting point for anyone wanting to migrate taskwarrior data into
  a SQL database.  Illustrates JSON parsing and separation of the
  relational data.

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-01-07 12:31:08 -05:00
Paul Beckingham
0215e708ad Unit Tests
- Fixed bug in TAP 'diag' output generation, which was missing a newline.
2012-01-05 23:29:33 -05:00
Paul Beckingham
938a33f236 Unit Tests
- Typo in #ifdef caused incorrect number of reported tests.
2012-01-05 20:17:03 -05:00
Owen Clarke
7c90d1e8cc Bug - Default TZ not always UTC.
From Owen:

I tried mktime on Darwin an Linux; looks like they both default to UTC if the TZ
environment variable is unset but on Solaris it defaults to the local timezone.
I compiled and ran the tests and checked the behaviour by running:

date
TZ="" date
TZ="UTC" date

On Solaris the first two are in local time and the third is in UTC.
On Darwin and Linux the first one is in local time and the other two are in UTC.

Found this as a reference, too, which mentions the suggested implementation in
'man 3 timegm':

http://stackoverflow.com/questions/6467844/is-c-mktime-different-on-windows-and-gnu-linux

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-01-05 18:08:24 -05:00
Owen Clarke
afcd362f67 + Fixed problem with duplicate 'project changed' messages.
Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-01-05 17:43:29 -05:00
Paul Beckingham
fb38dca1db Parsing
- Integrated modified Nibbler and test code from kronisk.  These
  changes make both test and Nibbler standalone objects, with configurable
  features.
2012-01-05 17:37:50 -05:00