Compare commits

..

55 Commits

Author SHA1 Message Date
Federico Hernandez
df49aaba12 Version number and release date for 2.4.4 2015-05-10 22:57:16 +02:00
Paul Beckingham
0d45bb75e8 Merge branch '2.4.4' of ssh://git.tasktools.org/tm/task into 2.4.4 2015-05-10 13:19:12 -04:00
Paul Beckingham
5d5e824453 Docs: Filled in balnks in NEWS file. 2015-05-10 13:18:54 -04:00
Wilhelm Schuermann
92b5dfd83d Add-ons: Fix UTF8 problems with export-sql.py 2015-05-10 17:58:20 +02:00
Paul Beckingham
7293de75b0 TW-1608: The recur/recurring report shows tasks without a recur interval
- Lexer needed additional lookbehind criteria for ::isTag (thanks to Brad
  Collette).
2015-05-09 21:27:48 -04:00
Paul Beckingham
f30f4d45c6 TW-1285: I'd like to use relative dates combined with times
- With the new parser and datemath in place, this can now be done (thanks to
  Adam Gibbins).
2015-05-09 11:22:05 -04:00
Paul Beckingham
32ef3fdb3d TW-69: wait dates relative to due date
- Possible now with DOM access:  task add ... due:eom wait:due-1wk
  (thanks to John Florian).
2015-05-09 11:15:35 -04:00
Wilhelm Schuermann
65b6a35ef5 Tests: Make self.t('add proj:"with space" foo') work 2015-05-08 18:19:37 +02:00
Roman Inflianskas
e16bd6ee83 Fish: Use variables for completion options 2015-05-07 20:21:32 -04:00
Wilhelm Schuermann
69698454c3 Tests: Speed up filter.t
- None of the tests in filter.t write data.  Make use of that by
  setting up task data once for all included tests.
2015-05-07 17:23:14 +02:00
Wilhelm Schuermann
3a7af017f8 Tests: Make "run_all --fast" even faster
- Run isolated tests in the background, bringing the time for running
  "run_all" down to the time it takes to run the old tests.
2015-05-07 11:41:05 +02:00
Wilhelm Schuermann
accd51bc35 Tests: Fix problems with "run_all --fast" on OpenBSD 2015-05-06 22:06:11 +02:00
Wilhelm Schuermann
5fee3ef27c Tests: Clean up after "run_all --fast" 2015-05-06 20:56:35 +02:00
Paul Beckingham
0850e26a3e Tests: Removed annoying comment. 2015-05-06 14:44:35 -04:00
Wilhelm Schuermann
4deb17696e Tests: Parallelize Python tests
- "./run_all --fast" parallelizes all Python tests.  Perl and C++ tests
  are not guaranteed to run in an isolated environment, so run them
  serially instead.
- Adjust some tests in order to recognize them as Python.
2015-05-06 19:17:33 +02:00
Wilhelm Schuermann
7d859d6b6d Tests: Beautify gc.t, add one more GC test 2015-05-05 21:00:39 +02:00
Wilhelm Schuermann
f6e04585ae Tests: Add simpler self.t("add foo +bar") syntax 2015-05-05 20:28:10 +02:00
Renato Alves
1e31df3c7a Tests: bug.368.t > feature.recurrence.t as python 2015-05-05 15:13:01 +01:00
Renato Alves
db04f1b583 Tests: bug.327.t > feature.recurrence.t in python 2015-05-05 15:05:42 +01:00
Wilhelm Schuermann
1c9edcc2ec TW-1610: Add tests
- More GC tests needed, this is just a basic "starter pack" to
  reproduce the problem reported in TW-1610.
2015-05-05 10:10:29 +02:00
Wilhelm Schuermann
710372b8db TW-1610: Disabling GC can lead to editing the wrong task
- 9e6c6ecb93 introduced a change that
  can lead to the wrong task being edited when GC is manually turned
  off.  Fix this by taking the user's GC setting into account.
2015-05-04 09:01:01 +02:00
Paul Beckingham
c8756f0201 TW-1474: Documentation is confusing with respect to user/uuid on the server
- Man page clarified, mention of 'password' removed (thanks to Tomas Babej).
2015-05-03 11:21:01 -04:00
Paul Beckingham
b6b49ca7e4 Docs: Added comment to prevent changes 2015-05-03 10:54:52 -04:00
Renato Alves
ec9b8c5aa9 Tests: Force protocol to IPv4 on localhost 2015-05-03 15:52:12 +01:00
Wilhelm Schuermann
023a17e6be (t|T)ask(w|W)arrior ---> Taskwarrior
- Standardize spelling of "Taskwarrior" across most files.
- Fix other minor typos in help text and docs.
2015-05-02 18:12:21 +02:00
Paul Beckingham
c346cf9395 Portability: Use fcntl instead of flock
- POSIX file locking mechanism, eliminating platform-specific code.
2015-05-02 11:47:39 -04:00
Paul Beckingham
71fef9f22f Docs: Updated INSTALL 2015-05-02 09:47:06 -04:00
Paul Beckingham
36e31811b0 TW-1606: scheduled.any filter
- The Lexer::dom type worked embedded, but not isolated (thanks to Peter Rochen).
2015-04-29 18:53:13 -04:00
Paul Beckingham
71753ef666 TW-1605: Japanese translation for Taskwarrior
- Initial Japanese translation (thanks to Oota Toshiya).
2015-04-28 20:11:11 -04:00
Paul Beckingham
7a9e099568 TW-1603: Priority color precedence changed since it is a UDA, should be lowered again
- The 'uda.' element is moved to the end, where 'pri.' used to be (thanks to
  Jens Erat).
2015-04-27 17:21:01 -04:00
Renato Alves
fcfc95df86 Tests: Fix framework log collection error 2015-04-27 11:39:34 +01:00
Paul Beckingham
5f9a543b1b TLS: Diagnostics
- When a certificate fails validation, display the full set of reasons, in
  debug mode.
2015-04-26 20:52:34 -04:00
Paul Beckingham
75775786e6 TLS: Fixed version conditional
- The call to gnutls_certificate_verification_status_print was protected by an
  #ifdef which had the wrong GnuTLS version number.
2015-04-26 20:51:46 -04:00
Paul Beckingham
caa8c8e884 TLS: Fixed cert verification bug
- When a cert was unreadable, instead of exiting verification with a value of
  GNUTLS_E_CERTIFICATE_ERROR, the value was assigned to 'status', which has
  different semantics.
2015-04-26 20:51:08 -04:00
Paul Beckingham
93470bb8d8 Merge branch '2.4.4' of ssh://git.tasktools.org/tm/task into 2.4.4 2015-04-26 13:29:13 -04:00
Paul Beckingham
8e01976abb Sync: Made more explicit exit codes for various errors 2015-04-26 13:28:53 -04:00
Renato Alves
e60ea2e07a Revert "Tests: Use IP address instead of hostname with taskd"
Going back to using "localhost". Using the IP address causes GNUTLS
handshake errors in GnuTLS <= 3.2.18

This reverts commit 233d97fbff.
2015-04-26 18:13:20 +01:00
Renato Alves
931afb0674 Tests: Documentation on TASK/TASKD_USE_PATH 2015-04-26 17:46:44 +01:00
Paul Beckingham
1b63a2dde5 Documentation: Added the 'rc.obfuscate' setting.
- The 'obfuscate' setting, if set to '1' will replace all text with 'xxx'.
2015-04-26 11:14:05 -04:00
Paul Beckingham
c62ba68f10 Merge branch '2.4.4' of ssh://git.tasktools.org/tm/task into 2.4.4 2015-04-26 10:34:40 -04:00
Paul Beckingham
5d60f426a8 Obfuscation: rc.obfuscate=1 hides private details 2015-04-26 10:31:32 -04:00
Renato Alves
7fcb26f363 Tests: Increase timeout to 5 seconds 2015-04-26 15:28:51 +01:00
Paul Beckingham
c34b2b8cfb Color: Removed "pri." from the color rule precedence
- This is an obsolete entry (thanks To Jens Erat).
2015-04-26 09:36:08 -04:00
Paul Beckingham
b9a8d62324 Diagnostics: Removed 'Build caps' line 2015-04-26 09:30:44 -04:00
Paul Beckingham
c8c7123eb9 Merge branch '2.4.4' of ssh://git.tasktools.org/tm/task into 2.4.4 2015-04-26 09:23:08 -04:00
Paul Beckingham
dc8e874f19 Diagnostics: Removed obsolete items
- Removed '+pthreads' caps indicator.
- Removed HAVE_LIB defines for pthreads and readline.
- Removed CMake module for finding readline.
2015-04-26 09:17:31 -04:00
Renato Alves
233d97fbff Tests: Use IP address instead of hostname with taskd 2015-04-26 00:24:59 +01:00
Renato Alves
64be230639 Tests: Include taskd in USE_PATH warning 2015-04-25 23:59:49 +01:00
Renato Alves
a52bba46f1 Output taskd.log to stdout on taskd failures (not test errors) 2015-04-25 23:51:01 +01:00
Paul Beckingham
b91a4b4982 Tests: Code formatting 2015-04-25 11:55:19 -04:00
Paul Beckingham
f9e3f865b1 TW-1596: TW-1596 taskwarrior can't compile FreeBSD 9.3 32bit environment
- On 32-bit systems, 'int' and 'time_t' are ambiguous overrides, and must be
  disambiguated with other signature changes (thanks to ribbon).
2015-04-21 11:24:44 +01:00
Paul Beckingham
67a008e7bf Docs: Updated compiler requirements 2015-04-21 10:55:51 +01:00
Federico Hernandez
5c70619d68 Bumped version number in ref page 2015-04-20 00:22:15 +02:00
Federico Hernandez
6cf3345595 Bumped version number to 2.4.4 2015-04-20 00:07:53 +02:00
Federico Hernandez
9959d8eac8 Added SHA1 of tagged release commit 2015-04-20 00:04:19 +02:00
68 changed files with 1646 additions and 484 deletions

View File

@@ -1,4 +1,4 @@
The development of taskwarrior was made possible by the significant
The development of Taskwarrior was made possible by the significant
contributions of the following people:
Paul Beckingham (Principal Author)
@@ -116,6 +116,7 @@ The following submitted code, packages or analysis, and deserve special thanks:
V.Krishn
Jens Erat
Peter Rochen
Oota Toshiya
Thanks to the following, who submitted detailed bug reports and excellent
suggestions:

View File

@@ -10,7 +10,7 @@ include (CheckStructHasMember)
set (HAVE_CMAKE true)
project (task)
set (PROJECT_VERSION "2.4.3")
set (PROJECT_VERSION "2.4.4")
OPTION(USE_GNUTLS "Build gnutls support." ON)
@@ -163,6 +163,7 @@ set (LANGUAGE_ITA_ITA 5)
set (LANGUAGE_POR_PRT 6)
set (LANGUAGE_EPO_RUS 7)
set (LANGUAGE_POL_POL 8)
set (LANGUAGE_JPN_JPN 9)
message ("-- Configuring cmake.h")
configure_file (

View File

@@ -1,4 +1,4 @@
taskwarrior - a command line task list manager.
Taskwarrior - a command line task list manager.
Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.

View File

@@ -1,4 +1,25 @@
2.4.3 (2015-04-19) -
2.4.4 (2015-05-10) -
- TW-69 wait dates relative to due date (thanks to John Florian).
- TW-1285 I'd like to use relative dates combined with times (thanks to Adam
Gibbins).
- TW-1474 Documentation is confusing with respect to user/uuid on the server
(thanks to Tomas Babej).
- TW-1596 taskwarrior can't compile FreeBSD 9.3 32bit environment (thanks to
ribbon)
- TW-1603 Priority color precedence changed since it is a UDA, should be lowered
again (thanks to Jens Erat).
- TW-1605 Japanese translation for Taskwarrior (thanks to Oota Toshiya).
- TW-1606 scheduled.any filter (thanks to Peter Rochen).
- TW-1608 The recur/recurring report shows tasks without a recur interval
(thanks to Brad Collette).
- TW-1610 Disabling GC can lead to editing the wrong task (thanks to Scott M).
- The 'obfuscate' setting, if set to '1' will replace all text with 'xxx'.
- POSIX file locking mechanism, eliminating platform-specific code.
------ current release ---------------------------
2.4.3 (2015-04-19) 499044b9b6bdbc95338ea585204e949d80b24a09
- TW-57 user defined attribute sort order (thanks to Max Muller).
- TW-70 urgency.user.keyword.<keyword>.coefficient=...
@@ -38,8 +59,6 @@
+ Stops after measuring a fixed-width column format.
+ Reduced number of std::string copies.
------ current release ---------------------------
2.4.2 (2015-03-15) b9dc0813d9a8922b4cef9595033f133f9fbabf44
- TW-41 Tasks in subprojects are not counted in project completion (thanks

View File

@@ -1,16 +1,15 @@
How to Build Taskwarrior
Satisfy the Requirements:
- gcc 4.4 or later, clang 2.9 or later or equivalent. This is because 2.4.1
marks the first step towards using modern C++11. Initially this involves
only feature N1984.
- gcc 4.7 or later, clang 3.3 or later or equivalent. This is because 2.4.4
will be utilizing C++11.
- libuuid
- gnutls (optional)
Obtain and build code:
$ git clone https://git.tasktools.org/scm/tm/task.git task.git
$ cd task.git
$ git checkout 2.4.3 # Latest dev branch
$ git checkout 2.4.4 # Latest dev branch
$ cmake -DCMAKE_BUILD_TYPE=debug . # debug or release. Default: neither.
$ make VERBOSE=1 # Shows details
@@ -189,11 +188,11 @@ Work in Progress
Current Codebase Condition
'master' branch:
- 2.4.2 Current release, locked.
- 2.4.3 Current release, locked.
'2.4.3' branch:
'2.4.4' branch:
- Current development branch no plans yet.
---
2015-03-15 Updated for 2.4.3
2015-04-21 Updated for 2.4.4

48
INSTALL
View File

@@ -1,23 +1,25 @@
Installation Instructions
-------------------------
Please follow the instructions below to build task with cmake.
Please follow the instructions below to build and install Taskwarrior from
source.
Pre-requisites
--------------
You will need the CMake build system installed in order to build taskwarrior
You will need the CMake build system installed in order to build Taskwarrior
from source. More information on cmake can be obtained at http://cmake.org
You will need a C++ compiler that supports C++11 N1984, which includes:
You will also need:
- make
- gcc 4.4 (released 2009-04-21)
- clang 2.9 (released 2011-04-06)
You will need a C++ compiler that supports full C++11, which includes:
- gcc 4.7 (released 2012-03-23)
- clang 3.3 (released 2013-01-07)
In addition:
- uuid lib
You will need the following libraries:
- libuuid
- gnutls (optional - for syncing)
It is HIGHLY RECOMMENDED that you build with a library that provides uuid_*
@@ -27,14 +29,14 @@ functions, such as libuuid.
Basic Installation
------------------
Briefly, these shell commands will unpack, build and install taskwarrior:
Briefly, these shell commands will unpack, build and install Taskwarrior:
$ tar xzf task-X.Y.Z.tar.gz [1]
$ cd task-X.Y.Z [2]
$ cmake . [3]
$ make [4]
$ sudo make install [5]
$ cd .. ; rm -r task-X.Y.Z [6]
$ tar xzf task-X.Y.Z.tar.gz [1]
$ cd task-X.Y.Z [2]
$ cmake . [3]
$ make [4]
$ sudo make install [5]
$ cd .. ; rm -r task-X.Y.Z [6]
These commands are explained below:
@@ -46,7 +48,7 @@ These commands are explained below:
3. Invokes CMake to scan for dependencies and machine-specific details, then
generate the makefiles. This may take a minute.
4. Builds taskwarrior. This may take a minute.
4. Builds Taskwarrior. This may take a minute.
5. Installs the program, documentation and other data files.
@@ -107,24 +109,24 @@ Currently the defined languages are:
epo_RUS 7
pol_POL 8
Uninstallation
--------------
To uninstall taskwarrior, you need the Makefiles, so if you deleted them in
step 7 above, they must first be regenerated by following steps [1], [2] and
[3]. Then simply run:
There is no uninstall option in CMake makefiles. This is a manual process.
$ sudo make uninstall TODO TODO TODO -- cmake doesn't include uninstall
To uninstall Taskwarrior, remove the files listed in the install_manifest.txt
file that was generated when you built Taskwarrior.
Taskwarrior Build Notes
-----------------------
Taskwarrior has dependencies that are detected by cmake in almost all cases, but
Taskwarrior has dependencies that are detected by CMake in almost all cases, but
there are situations and operating systems that mean you will need to offer a
little help.
If taskwarrior will not build on your system, first take a look at the Operating
If Taskwarrior will not build on your system, first take a look at the Operating
System notes below. If this doesn't help, then go to the Troubleshooting
section, which includes instructions on how to contact us for help.
@@ -180,7 +182,7 @@ If a build does not succeed, please send the contents of the 'CMakeCache.txt'
and 'CMakeFiles/CMakeOutput.log' files to support@taskwarrior.org, or post a
message in the support forums at taskwarrior.org along with the information.
If CMake runs but taskwarrior does not build, please send the contents of the
If CMake runs but Taskwarrior does not build, please send the contents of the
above files as well as a transcript from the build, which is not written to a
file and must be captured from the terminal.

View File

@@ -1,4 +1,4 @@
taskwarrior - a command line task list manager.
Taskwarrior - a command line task list manager.
Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.

31
NEWS
View File

@@ -1,31 +1,26 @@
New Features in taskwarrior 2.4.3
New Features in Taskwarrior 2.4.4
- UDA string attributes with allowable values can now define their sort order.
- The 'priority' attribute is now a UDA, configured by default.
- Taskwarrior now requires GCC 4.7+ / Clang 3.3+, for full C++11 support.
- Taskwarrior now builds properly on 32-bit platforms.
- The beginnings of a Japaneѕe translation.
New commands in taskwarrior 2.4.3
New commands in Taskwarrior 2.4.4
-
- None
New configuration options in taskwarrior 2.4.3
New configuration options in Taskwarrior 2.4.4
- Setting 'bulk' to zero is interpreted as infinity, which means there is no
amount of changes that is considered dangerous.
- The 'urgency.user.keyword.<keyword>.coefficient' setting allows tasks with
specific words in the description to have adjusted urgency.
- The 'summary.all.projects' setting shows all projects in the 'summary'
reportş instead of just those with pending tasks.
- The 'obfuscate' setting, if set to '1' will replace all text with 'xxx'.
This is useful when sharing data for bug reporting purposes.
Newly deprecated features in taskwarrior 2.4.3
Newly deprecated features in Taskwarrior 2.4.4
-
- None
Removed features in 2.4.3
Removed features in 2.4.4
- The 'priority.long' and 'priority.short' column formats are no longer
supported.
- The 'default.priority' setting is now 'uda.priority.default'.
- None
Known Issues

View File

@@ -39,7 +39,7 @@ Please send your code patches to:
support@taskwarrior.org
Consider joining bug.tasktools.org, answers.tasktools.org and participating in
the future of taskwarrior.
the future of Taskwarrior.
---

View File

@@ -27,6 +27,7 @@
#define LANGUAGE_POR_PRT ${LANGUAGE_POR_PRT}
#define LANGUAGE_EPO_RUS ${LANGUAGE_EPO_RUS}
#define LANGUAGE_POL_POL ${LANGUAGE_POL_POL}
#define LANGUAGE_JPN_JPN ${LANGUAGE_JPN_JPN}
/* git information */
#cmakedefine HAVE_COMMIT
@@ -51,12 +52,6 @@
/* Found the GnuTLS library */
#cmakedefine HAVE_LIBGNUTLS
/* Found the Readline library */
#cmakedefine HAVE_READLINE
/* Found the pthread library */
#cmakedefine HAVE_LIBPTHREAD
/* Found tm_gmtoff */
#cmakedefine HAVE_TM_GMTOFF

View File

@@ -1,81 +0,0 @@
# - Find the readline library
# This module defines
# READLINE_INCLUDE_DIR, path to readline/readline.h, etc.
# READLINE_LIBRARIES, the libraries required to use READLINE.
# READLINE_FOUND, If false, do not try to use READLINE.
# also defined, but not for general use are
# READLINE_readline_LIBRARY, where to find the READLINE library.
# READLINE_ncurses_LIBRARY, where to find the ncurses library [might not be defined]
# Apple readline does not support readline hooks
# So we look for another one by default
IF (APPLE OR FREEBSD)
FIND_PATH (READLINE_INCLUDE_DIR NAMES readline/readline.h PATHS
/usr/include/
/sw/include
/opt/local/include
/opt/include
/usr/local/include
NO_DEFAULT_PATH
)
ENDIF (APPLE OR FREEBSD)
FIND_PATH (READLINE_INCLUDE_DIR NAMES readline/readline.h)
# Apple readline does not support readline hooks
# So we look for another one by default
IF (APPLE OR FREEBSD)
FIND_LIBRARY (READLINE_readline_LIBRARY NAMES readline PATHS
/usr/lib
/sw/lib
/opt/local/lib
/opt/lib
/usr/local/lib
NO_DEFAULT_PATH
)
ENDIF (APPLE OR FREEBSD)
FIND_LIBRARY (READLINE_readline_LIBRARY NAMES readline)
# Sometimes readline really needs ncurses
IF (APPLE OR FREEBSD)
FIND_LIBRARY (READLINE_ncurses_LIBRARY NAMES ncurses PATHS
/usr/lib
/sw/lib
/opt/local/lib
/opt/lib
/usr/local/lib
/usr/lib
NO_DEFAULT_PATH
)
ENDIF (APPLE OR FREEBSD)
FIND_LIBRARY (READLINE_ncurses_LIBRARY NAMES ncurses)
MARK_AS_ADVANCED (
READLINE_INCLUDE_DIR
READLINE_readline_LIBRARY
READLINE_ncurses_LIBRARY
)
SET (READLINE_FOUND "NO" )
IF (READLINE_INCLUDE_DIR)
IF (READLINE_readline_LIBRARY)
SET (READLINE_FOUND "YES" )
SET (READLINE_LIBRARIES
${READLINE_readline_LIBRARY}
)
# some readline libraries depend on ncurses
IF (READLINE_ncurses_LIBRARY)
SET (READLINE_LIBRARIES ${READLINE_LIBRARIES} ${READLINE_ncurses_LIBRARY})
ENDIF (READLINE_ncurses_LIBRARY)
ENDIF (READLINE_readline_LIBRARY)
ENDIF (READLINE_INCLUDE_DIR)
IF (READLINE_FOUND)
MESSAGE (STATUS "Found readline library")
ELSE (READLINE_FOUND)
IF (READLINE_FIND_REQUIRED)
MESSAGE (FATAL_ERROR "Could not find readline -- please give some paths to CMake")
ENDIF (READLINE_FIND_REQUIRED)
ENDIF (READLINE_FOUND)

View File

@@ -1,7 +1,7 @@
.TH task-color 5 2015-04-19 "${PACKAGE_STRING}" "User Manuals"
.TH task-color 5 2015-05-10 "${PACKAGE_STRING}" "User Manuals"
.SH NAME
task-color \- A color tutorial for the taskwarrior command line todo manager.
task-color \- A color tutorial for the Taskwarrior command line todo manager.
.SH SETUP
The first thing you need is a terminal program that supports color. All
@@ -18,8 +18,8 @@ which shell you use). If this is a new setting, you will need to either run
that profile script, or close and reopen the terminal window (which does the
same thing).
Now tell taskwarrior that you want to use color. This is the default for
taskwarrior, so the following step may be unnecessary.
Now tell Taskwarrior that you want to use color. This is the default for
Taskwarrior, so the following step may be unnecessary.
$ task config color on
@@ -28,11 +28,11 @@ like:
color=on
Now taskwarrior is ready.
Now Taskwarrior is ready.
.SH AUTOMATIC MONOCHROME
It should be mentioned that taskwarrior is aware of whether its output is going
to a terminal, or to a file or through a pipe. When taskwarrior output goes to
It should be mentioned that Taskwarrior is aware of whether its output is going
to a terminal, or to a file or through a pipe. When Taskwarrior output goes to
a terminal, color is desirable, but consider the following command:
$ task list > file.txt
@@ -268,7 +268,7 @@ from the example):
include ${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}/dark-256.theme
.RE
You can use any of the standard taskwarrior themes:
You can use any of the standard Taskwarrior themes:
.RS
dark-16.theme
@@ -323,7 +323,7 @@ http://www.opensource.org/licenses/mit-license.php for more information.
.BR taskrc(5),
.BR task-sync(5)
For more information regarding taskwarrior, the following may be referenced:
For more information regarding Taskwarrior, the following may be referenced:
.TP
The official site at
@@ -339,5 +339,5 @@ You can contact the project by writing an email to
.SH REPORTING BUGS
.TP
Bugs in taskwarrior may be reported to the issue-tracker at
Bugs in Taskwarrior may be reported to the issue-tracker at
<http://taskwarrior.org>

View File

@@ -1,4 +1,4 @@
.TH task-sync 5 2015-04-19 "${PACKAGE_STRING}" "User Manuals"
.TH task-sync 5 2015-05-10 "${PACKAGE_STRING}" "User Manuals"
.SH NAME
task-sync \- A discussion and tutorial for the various task(1) data
@@ -80,24 +80,25 @@ The Taskserver was designed for this purpose to be secure, fast and conflict
free, allowing data interchange between assorted Taskwarrior clients, and
tolerant of network connectivity problems.
There is a 'sync' command built in to Taskwarrior, and with a server account
and client configuration, syncing is done on demand.
There is a 'sync' command built in to Taskwarrior (provided the GnuTLS library
is installed), and with a server account and client configuration, syncing is
done on demand.
Setup is a matter of creating an account on a Taskserver (see your Taskserver
provider or operate your own - see
http://taskwarrior.org/docs/server_setup.html)
Once you have an account, you'll receive a certificate, key and a password.
Once you have an account, you'll receive a certificate, key, and credentials.
You'll need to put the certificate and key somewhere like this:
$ cp <name>.cert.pem ~/.task
$ cp <name>.key.pem ~/.task
Then you configure Taskwarrior, using the account details:
Then you configure Taskwarrior, using the provided details:
$ task config taskd.certificate ~/.task/<name>.cert.pem
$ task config taskd.key ~/.task/<name>.key.pem
$ task config taskd.credentials <organization>/<name>/<password>
$ task config taskd.credentials <organization>/<name>/<UUID>
$ task config taskd.server <server domain>:<port>
If you are using a private server, you are likely also using a self-signed
@@ -108,7 +109,7 @@ certificate, which means you will need one of the following additional entries:
The CA (Certificate Authority) will be used to verify the server certificate.
Alternatively, you can override the cert verification process using:
$ task config taskd.trust yes
$ task config taskd.trust 'allow all'
This is an insecure option that should be used with caution, because it directs
Taskwarrior to trust any certificate.

View File

@@ -1,4 +1,4 @@
.TH task 1 2015-04-19 "${PACKAGE_STRING}" "User Manuals"
.TH task 1 2015-05-10 "${PACKAGE_STRING}" "User Manuals"
.SH NAME
task \- A command line todo manager.
@@ -14,7 +14,7 @@ that you want to do, allowing you to add/remove, and otherwise manipulate them.
Taskwarrior has a rich set of subcommands that allow you to do various things
with it.
At the core, taskwarrior is a list processing program. You add text and
At the core, Taskwarrior is a list processing program. You add text and
additional related parameters and redisplay the information in a nice way. It
turns into a todo list program when you add due dates and recurrence. It turns
into an organized todo list program when you add priorities, tags (one word
@@ -98,7 +98,7 @@ generated, as with verbose=nothing).
.SH READ SUBCOMMANDS
Reports are read subcommands. There are several reports currently predefined in
taskwarrior. The output and sort behavior of these reports can be configured in
Taskwarrior. The output and sort behavior of these reports can be configured in
the configuration file. See also the man page taskrc(5). There are also other
read subcommands that are not reports.
@@ -381,7 +381,7 @@ non-standard arguments.
.TP
.B task calc <expression>
Evaluates an algebraic expression. Can be used to test how TaskWarrior
Evaluates an algebraic expression. Can be used to test how Taskwarrior
parses and evaluates the expression given on the command line.
Examples:
@@ -397,7 +397,7 @@ Examples:
.TP
.B task config [name [value | '']]
Add, modify and remove settings directly in the taskwarrior configuration.
Add, modify and remove settings directly in the Taskwarrior configuration.
This command either modifies the 'name' setting with a new value of 'value',
or adds a new entry that is equivalent to 'name=value':
@@ -414,7 +414,7 @@ Finally, this command removes any 'name=...' entry from the .taskrc file:
.TP
.B task context <name>
Sets the currectly active context. See the CONTEXT section.
Sets the currently active context. See the CONTEXT section.
Example:
@@ -510,7 +510,7 @@ Reverts the most recent action. Obeys the confirmation setting.
.TP
.B task version
Shows the taskwarrior version number.
Shows the Taskwarrior version number.
.SH HELPER SUBCOMMANDS
@@ -566,7 +566,7 @@ Displays the urgency measure of a task.
.TP
.B task _version
Shows only the taskwarrior version number.
Shows only the Taskwarrior version number.
.TP
.B task _zshcommands
@@ -870,7 +870,7 @@ The original example therefore must be entered as:
task '( project:Home or project:Garden )' list
This includes quotes to escape the parentheses, so that the shell doesn't
interpret them and hide them from taskwarrior.
interpret them and hide them from Taskwarrior.
There is redundancy between operators, attribute modifiers and other syntactic
sugar. For example, the following are all equivalent:
@@ -1083,7 +1083,7 @@ Contexts are permanent, and the currently set context name is stored in the
"context.<name>" configuration variable.
.SH COMMAND ABBREVIATION
All taskwarrior commands may be abbreviated as long as a unique prefix is used,
All Taskwarrior commands may be abbreviated as long as a unique prefix is used,
for example:
.RS
@@ -1122,7 +1122,7 @@ $ task add "quoted ' quote"
$ task add escaped \\' quote
.RE
The argument \-\- (a double dash) tells taskwarrior to treat all other args
The argument \-\- (a double dash) tells Taskwarrior to treat all other args
as description:
.RS
@@ -1219,7 +1219,7 @@ http://www.opensource.org/licenses/mit-license.php for more information.
.BR task-color(5),
.BR task-sync(5)
For more information regarding taskwarrior, see the following:
For more information regarding Taskwarrior, see the following:
.TP
The official site at
@@ -1235,6 +1235,6 @@ You can contact the project by emailing
.SH REPORTING BUGS
.TP
Bugs in taskwarrior may be reported to the issue-tracker at
Bugs in Taskwarrior may be reported to the issue-tracker at
<http://taskwarrior.org>

View File

@@ -1,4 +1,4 @@
.TH taskrc 5 2015-04-19 "${PACKAGE_STRING}" "User Manuals"
.TH taskrc 5 2015-05-10 "${PACKAGE_STRING}" "User Manuals"
.SH NAME
taskrc \- Configuration details for the task(1) command
@@ -49,7 +49,7 @@ $ task rc.<name>=<value> ...
.RE
If
.B taskwarrior
.B Taskwarrior
is run without an existing configuration file it will ask if it should create a
default, sample
.I .taskrc
@@ -67,7 +67,7 @@ Whitespace is not permitted in comma-separated lists.
The entry must be on a single line, no continuations.
Values support UTF8 as well as JSON encoding, such as \\uNNNN.
Note that taskwarrior is flexible about the values used to represent Boolean
Note that Taskwarrior is flexible about the values used to represent Boolean
items. You can use "on", "yes", "y", "1" and "true".
Anything else means "off".
@@ -149,7 +149,7 @@ include ${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}/holidays.en-US.rc
include ${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}/dark-16.theme
.RE
This includes two standard files that are distributed with taskwarrior, which
This includes two standard files that are distributed with Taskwarrior, which
define a set of US holidays, and set up a 16-color theme to use, to color the
reports and calendar.
@@ -158,7 +158,7 @@ These environment variables override defaults and command line arguments.
.TP
.B TASKDATA=~/.task
This overrides the default path for the taskwarrior data files.
This overrides the default path for the Taskwarrior data files.
.TP
.B TASKRC=~/.taskrc
@@ -171,7 +171,7 @@ Valid variable names and their default values are:
.TP
.B data.location=$HOME/.task
This is a path to the directory containing all the taskwarrior files. By
This is a path to the directory containing all the Taskwarrior files. By
default, it is set up to be ~/.task, for example: /home/paul/.task
Note that you can use the
@@ -294,7 +294,7 @@ and project. The others are sent to standard output.
.TP
.B confirmation=yes
May be "yes" or "no", and determines whether taskwarrior will ask for
May be "yes" or "no", and determines whether Taskwarrior will ask for
confirmation before deleting a task or performing the undo command. The default
value is "yes". Consider leaving this setting as "yes", for safety.
@@ -388,7 +388,7 @@ Defaults to infix.
.TP
.B dom=on
Enables or disables access to taskwarrior internals and task metadata on the
Enables or disables access to Taskwarrior internals and task metadata on the
command line. Defaults to on.
.TP
@@ -454,7 +454,7 @@ and one for a week from tomorrow.
.TP
.B undo.style=side
When the 'undo' command is run, taskwarrior presents a before and after
When the 'undo' command is run, Taskwarrior presents a before and after
comparison of the data. This can be in either the 'side' style, which compares
values side-by-side in a table, or 'diff' style, which uses a format similar to
the 'diff' command.
@@ -502,6 +502,12 @@ shows parse trees from every phase of the parse.
Controls the GnuTLS diagnostic level. For 'sync' debugging. Level 0 means no
diagnostics. Level 9 is the highest. Level 2 is a good setting for debugging.
.TP
.B obfuscate=1
When set to '1', will replace all report text with 'xxx'.
This is useful for sharing report output in bug reports.
Default value is '0'.
.TP
.B alias.rm=delete
Taskwarrior supports command aliases. This alias provides an alternate name
@@ -525,7 +531,7 @@ the 'history' report, for example, or 'export'.
.B dateformat.annotation=
.TP
.B report.X.dateformat=Y-M-D
This is a string of characters that defines how taskwarrior formats date values.
This is a string of characters that defines how Taskwarrior formats date values.
The precedence order for the configuration variable is report.X.dateformat then
dateformat.report then dateformat for formating the due dates in reports.
If both report.X.dateformat and dateformat.report are not set then dateformat
@@ -755,7 +761,7 @@ holiday.eastersunday.date=easter
.RE
.RE
Note that the taskwarrior distribution contains example holiday files that can
Note that the Taskwarrior distribution contains example holiday files that can
be included like this:
.RS
@@ -769,7 +775,7 @@ include ${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}/holidays.en-US.rc
.B monthsperline=3
Determines how many months the "task calendar" command renders across the
screen. Defaults to however many will fit. If more months than will fit are
specified, taskwarrior will only show as many that will fit.
specified, Taskwarrior will only show as many that will fit.
.SS DEPENDENCIES
@@ -785,7 +791,7 @@ Determines whether dependency chain repair requires confirmation.
.TP
.B color=on
May be "on" or "off". Determines whether taskwarrior uses color. When "off",
May be "on" or "off". Determines whether Taskwarrior uses color. When "off",
will use dashes (-----) to underline column headings.
.TP
@@ -1148,7 +1154,7 @@ command, if you don't specify values. The default is blank.
.TP
.B
default.command=next
Provides a default command that is run every time taskwarrior is invoked with no
Provides a default command that is run every time Taskwarrior is invoked with no
arguments. For example, if set to:
.RS
@@ -1158,7 +1164,7 @@ default.command=project:foo list
.RE
.RS
then taskwarrior will run the "project:foo list" command if no command is
then Taskwarrior will run the "project:foo list" command if no command is
specified. This means that by merely typing
.RE
@@ -1457,7 +1463,7 @@ http://www.opensource.org/licenses/mit-license.php for more information.
.BR task-color(5),
.BR task-sync(5)
For more information regarding taskwarrior, see the following:
For more information regarding Taskwarrior, see the following:
.TP
The official site at
@@ -1473,6 +1479,6 @@ You can contact the project by emailing
.SH REPORTING BUGS
.TP
Bugs in taskwarrior may be reported to the issue-tracker at
Bugs in Taskwarrior may be reported to the issue-tracker at
<http://taskwarrior.org>

View File

@@ -24,7 +24,7 @@
#
###############################################################################
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

View File

@@ -24,7 +24,7 @@
#
###############################################################################
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

View File

@@ -24,7 +24,7 @@
#
###############################################################################
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

View File

@@ -24,7 +24,7 @@
#
###############################################################################
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

View File

@@ -24,7 +24,7 @@
#
###############################################################################
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

View File

@@ -24,7 +24,7 @@
#
###############################################################################
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

View File

@@ -24,7 +24,7 @@
#
###############################################################################
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

View File

@@ -24,7 +24,7 @@
#
###############################################################################
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

View File

@@ -24,7 +24,7 @@
#
###############################################################################
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

View File

@@ -24,7 +24,7 @@
#
###############################################################################
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

View File

@@ -24,7 +24,7 @@
#
###############################################################################
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

View File

@@ -24,7 +24,7 @@
#
###############################################################################
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# This is a theme that disables all default colors
# It can be used as template for other themes

View File

@@ -41,7 +41,7 @@
#
# Taskwarrior solarized-dark-256 theme created by Stefan A. Keel.
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

View File

@@ -41,7 +41,7 @@
#
# Taskwarrior solarized-dark-256 theme created by Stefan A. Keel.
rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.
rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.
# General decoration
color.label=

Binary file not shown.

Binary file not shown.

View File

@@ -29,7 +29,7 @@ export-sql.py -- Export the taskwarrior database as a series of SQL commands.
Example usage::
$ ./export-sql.py | sqlite3 mytasks.db
$ PYTHONIOENCODING=UTF-8 ./export-sql.py | sqlite3 mytasks.db
$ /usr/bin/sqlite3 mytasks.db "select * from annotations;"
This script has only been tested with sqlite3, but in theory, it could be
@@ -120,8 +120,8 @@ def to_sql(task):
values = template.format(**annot)
return "INSERT INTO \"annotations\" VALUES(%s)" % values
template = "{uuid}, {description}, {entry}, {end}, " + \
"{priority}, {project}, {status}"
template = u"{uuid}, {description}, {entry}, {end}, " + \
u"{priority}, {project}, {status}"
nullables = ['end', 'priority', 'project', 'status']
defaults = dict([(key, None) for key in nullables])
@@ -162,7 +162,7 @@ if __name__ == '__main__':
sql = table_definitions + ";\n".join(lines) + ';'
# Print them out, decorated with sqlite3 trappings
print """
print u"""
BEGIN TRANSACTION;
{sql}
COMMIT;""".format(sql=sql)

View File

@@ -15,6 +15,24 @@
# * Tags
# * Attribute names and modifiers
#
#
# You can override some default options in your config.fish:
#
# # Tab-completion of task descriptions.
# # Warning: This often creates a list of suggestions which spans several pages,
# # and it usually pushes some of the commands and attributes to the end of the
# # list.
# set -g task_complete_task yes
#
# # Tab-completion of task IDs outside of the "depends" attribute.
# # Warning: This often creates a list of suggestions which spans several pages,
# # and it pushes all commands and attributes to the end of the list.
# set -g task_complete_id yes
#
# # Attribute modifiers (DEPRECATED since 2.4.0)
# set -g task_complete_attribute_modifiers yes
#
#
# Copyright 2014 - 2015, Roman Inflianskas <infroma@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -150,8 +168,7 @@ function __fish.task.list.attr_value_by_name
__fish.task.combos_simple $attr (__fish.task.list $attr)
# case 'description' 'due' 'entry' 'end' 'start' 'project' 'recur' 'until' 'wait'
case '*'
# BUG: remove in 2.4.0
if echo (commandline -ct) | grep -q '\.'
if [ "$task_complete_attribute_modifiers" = 'yes' ]; and echo (commandline -ct) | grep -q '\.'
__fish.task.combos_with_mods $attr (__fish.task.list $attr)
else
__fish.task.combos_simple $attr (__fish.task.list $attr)
@@ -195,7 +212,7 @@ function __fish.task.list.id
end
end
# BUG: remove in 2.4.0
# Attribure modifiers (DEPRECATED since 2.4.0)
function __fish.task.list.mod
for mod in 'before' 'after' 'over' 'under' 'none' 'is' 'isnt' 'has' 'hasnt' 'startswith' 'endswith' 'word' 'noword'
echo $mod
@@ -266,7 +283,7 @@ function __fish.task.combos_simple
end
end
# BUG: remove in 2.4.0
# Attribure modifiers (DEPRECATED since 2.4.0)
function __fish.task.combos_with_mods
__fish.task.combos_simple $argv
for mod in (__fish.task.list.mod)
@@ -290,16 +307,10 @@ __fish.task.complete attr_value
__fish.task.complete attr_name
__fish.task.complete config
# Uncomment the following line if you want tab-completion of task descriptions.
# Warning: This often creates a list of suggestions which spans several pages,
# and it usually pushes some of the commands and attributes to the end of the
# list.
if [ "$task_complete_task" = 'yes' ]
__fish.task.complete task
end
#__fish.task.complete task
# Uncomment the following line if you want tab-completion of task IDs outside
# of the "depends" attribute. Warning: This often creates a list of
# suggestions which spans several pages, and it pushes all commands and
# attributes to the end of the list.
#__fish.task.complete id with_description
if [ "$task_complete_id" = 'yes' ]
__fish.task.complete id with_description
end

View File

@@ -166,7 +166,7 @@ std::string Config::_defaults =
"color=on # Enable color\n"
#if defined(LINUX) || defined(DARWIN)
"\n"
"rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.\n"
"rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.\n"
"\n"
"# General decoration\n"
"color.label=\n"
@@ -240,7 +240,7 @@ std::string Config::_defaults =
"\n"
#else
"\n"
"rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.\n"
"rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.\n"
"\n"
"# General decoration\n"
"color.label=\n"
@@ -329,7 +329,7 @@ std::string Config::_defaults =
"# Here is the rule precedence order, highest to lowest.\n"
"# Note that these are just the color rule names, without the leading 'color.'\n"
"# and any trailing '.value'.\n"
"rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.\n"
"rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.\n"
"\n"
"#default.project=foo # Default project for 'add' command\n"
"#default.due=eom # Default due date for 'add' command\n"
@@ -342,6 +342,7 @@ std::string Config::_defaults =
"list.all.tags=no # Include old tag names in 'tags' command\n"
"print.empty.columns=no # Print columns which have no data for any task\n"
"debug=no # Display diagnostics\n"
"obfuscate=no # Obfuscate data for error reporting\n"
"fontunderline=yes # Uses underlines rather than -------\n"
"shell.prompt=task> # Prompt used by the shell command\n"
"\n"

View File

@@ -453,7 +453,7 @@ int Context::dispatch (std::string &out)
// possible.
if (c->displays_id () && !tdb2.read_only ())
{
run_gc = true;
run_gc = config.getBoolean ("gc");
tdb2.gc ();
}
else

View File

@@ -28,14 +28,10 @@
#include <fstream>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef SOLARIS
#include <fcntl.h> // for flock() replacement
#include <string.h> // for memset()
#else
#include <sys/file.h>
#endif
#include <pwd.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <pwd.h>
#include <File.h>
#include <text.h>
#include <util.h>
@@ -151,6 +147,9 @@ void File::close ()
{
if (_fh)
{
if (_locked)
unlock ();
fclose (_fh);
_fh = NULL;
_h = -1;
@@ -161,38 +160,31 @@ void File::close ()
////////////////////////////////////////////////////////////////////////////////
bool File::lock ()
{
_locked = false;
if (_fh && _h != -1)
{
// Try three times before failing.
int retry = 0;
while (flock (_h, LOCK_NB | LOCK_EX) && ++retry <= 3)
;
if (retry <= 3)
{
// l_type l_whence l_start l_len l_pid
struct flock fl = {F_WRLCK, SEEK_SET, 0, 0, 0 };
fl.l_pid = getpid ();
if (fcntl (_h, F_SETLKW, &fl) == 0)
_locked = true;
return true;
}
}
_locked = false;
return false;
return _locked;
}
////////////////////////////////////////////////////////////////////////////////
bool File::waitForLock ()
void File::unlock ()
{
if (_locked)
return true;
{
// l_type l_whence l_start l_len l_pid
struct flock fl = {F_UNLCK, SEEK_SET, 0, 0, 0 };
fl.l_pid = getpid ();
if (_fh && _h != -1)
if (flock (_h, LOCK_EX) == 0)
{
_locked = true;
return true;
}
return false;
fcntl (_h, F_SETLK, &fl);
_locked = false;
}
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -52,7 +52,7 @@ public:
void close ();
bool lock ();
bool waitForLock ();
void unlock ();
void read (std::string&);
void read (std::vector <std::string>&);

View File

@@ -754,14 +754,16 @@ bool Lexer::isPair (std::string& token, Lexer::Type& type)
}
}
if (_eos - _cursor > 1 &&
if (_eos - _cursor >= 1 &&
_text[_cursor] == ':')
{
_cursor++;
if (isString (ignoredToken, ignoredType, '\'') ||
isString (ignoredToken, ignoredType, '"') ||
isWord (ignoredToken, ignoredType))
isWord (ignoredToken, ignoredType) ||
_eos == _cursor ||
_text[_cursor] == ' ')
{
token = _text.substr (marker, _cursor - marker);
type = Lexer::Type::pair;
@@ -776,14 +778,17 @@ bool Lexer::isPair (std::string& token, Lexer::Type& type)
////////////////////////////////////////////////////////////////////////////////
// Lexer::Type::tag
// ^ | <isWhiteSpace> [ +|- ] <isIdentifierStart> [ <isIdentifierNext> ]*
// ^ | '(' | ')' | <isWhiteSpace>
// [ +|- ] <isIdentifierStart> [ <isIdentifierNext> ]*
bool Lexer::isTag (std::string& token, Lexer::Type& type)
{
std::size_t marker = _cursor;
// Lookbehind: ^ | <isWhiteSpace>
if (marker > 0 &&
! isWhitespace (_text[marker - 1]))
// Lookbehind: ^ | '(' | ')' | <isWhiteSpace>
if (marker > 0 &&
! isWhitespace (_text[marker - 1]) &&
_text[marker - 1] != '(' &&
_text[marker - 1] != ')')
return false;
if (_text[marker] == '+' ||

View File

@@ -226,7 +226,7 @@ void TF2::commit ()
if (_file.open ())
{
if (context.config.getBoolean ("locking"))
_file.waitForLock ();
_file.lock ();
// Write out all the added tasks.
std::vector <Task>::iterator task;
@@ -258,7 +258,7 @@ void TF2::commit ()
if (_file.open ())
{
if (context.config.getBoolean ("locking"))
_file.waitForLock ();
_file.lock ();
// Truncate the file and rewrite.
_file.truncate ();
@@ -358,7 +358,7 @@ void TF2::load_lines ()
if (_file.open ())
{
if (context.config.getBoolean ("locking"))
_file.waitForLock ();
_file.lock ();
_file.read (_lines);
_file.close ();

View File

@@ -298,7 +298,6 @@ int TLSClient::verify_certificate () const
// This verification function uses the trusted CAs in the credentials
// structure. So you must have installed one or more CA certificates.
unsigned int status = 0;
const char* hostname = _host.c_str();
#if GNUTLS_VERSION_NUMBER >= 0x030104
if (_trust == TLSClient::ignore_hostname)
@@ -350,7 +349,7 @@ int TLSClient::verify_certificate () const
if (_debug)
std::cout << "c: ERROR x509 cert import. " << gnutls_strerror (ret) << "\n";
gnutls_x509_crt_deinit(cert);
status = GNUTLS_E_CERTIFICATE_ERROR;
return GNUTLS_E_CERTIFICATE_ERROR;
}
if (gnutls_x509_crt_check_hostname (cert, hostname) == 0)
@@ -366,7 +365,7 @@ int TLSClient::verify_certificate () const
}
#endif
#if GNUTLS_VERSION_NUMBER >= 0x030105
#if GNUTLS_VERSION_NUMBER >= 0x030104
gnutls_certificate_type_t type = gnutls_certificate_type_get (_session);
gnutls_datum_t out;
ret = gnutls_certificate_verification_status_print (status, type, &out, 0);
@@ -377,6 +376,8 @@ int TLSClient::verify_certificate () const
return GNUTLS_E_CERTIFICATE_ERROR;
}
if (_debug)
std::cout << "c: INFO " << out.data << "\n";
gnutls_free (out.data);
#endif

View File

@@ -114,6 +114,7 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
{
context.timer_render.start ();
bool const obfuscate = context.config.getBoolean ("obfuscate");
bool const print_empty_columns = context.config.getBoolean ("print.empty.columns");
std::vector <Column*> nonempty_columns;
std::vector <bool> nonempty_sort;
@@ -321,6 +322,11 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
if (cells[c].size () > max_lines)
max_lines = cells[c].size ();
if (obfuscate)
if (_columns[c]->type () == "string")
for (unsigned int line = 0; line < cells[c].size (); ++line)
cells[c][line] = obfuscateText (cells[c][line]);
}
// Listing breaks are simply blank lines inserted when a column value

View File

@@ -114,6 +114,8 @@ void ViewText::set (int row, int col, Color color)
////////////////////////////////////////////////////////////////////////////////
std::string ViewText::render ()
{
bool const obfuscate = context.config.getBoolean ("obfuscate");
// Determine minimal, ideal column widths.
std::vector <int> minimal;
std::vector <int> ideal;
@@ -265,6 +267,11 @@ std::string ViewText::render ()
if (cells[col].size () > max_lines)
max_lines = cells[col].size ();
if (obfuscate)
if (_columns[col]->type () == "string")
for (unsigned int line = 0; line < cells[col].size (); ++line)
cells[col][line] = obfuscateText (cells[col][line]);
}
for (unsigned int i = 0; i < max_lines; ++i)

View File

@@ -160,20 +160,7 @@ int CmdDiagnostics::execute (std::string& output)
#ifdef HAVE_COMMIT
<< " " << STRING_CMD_DIAG_COMMIT << ": " << COMMIT << "\n"
#endif
<< " CMake: " << CMAKE_VERSION << "\n"
<< " " << STRING_CMD_DIAG_CAPS << ":"
#ifdef HAVE_LIBPTHREAD
<< " +pthreads"
#else
<< " -pthreads"
#endif
#ifdef HAVE_LIBGNUTLS
<< " +tls"
#else
<< " -tls"
#endif
<< "\n";
<< " CMake: " << CMAKE_VERSION << "\n";
out << " libuuid: "
#ifdef HAVE_UUID_UNPARSE_LOWER

View File

@@ -167,6 +167,7 @@ int CmdShow::execute (std::string& output)
" locking"
" monthsperline"
" nag"
" obfuscate"
" print.empty.columns"
" recurrence"
" recurrence.confirmation"

View File

@@ -255,10 +255,13 @@ int CmdSync::execute (std::string& output)
else if (upload_count > 0 && download_count > 0)
context.footnote (format (STRING_CMD_SYNC_SUCCESS3, upload_count, download_count));
}
status = 0;
}
else if (code == "201")
{
context.footnote (STRING_CMD_SYNC_SUCCESS_NOP);
status = 0;
}
else if (code == "301")
{
@@ -266,6 +269,7 @@ int CmdSync::execute (std::string& output)
context.config.set ("taskd.server", new_server);
context.error (STRING_CMD_SYNC_RELOCATE0);
context.error (" " + format (STRING_CMD_SYNC_RELOCATE1, new_server));
status = 2;
}
else if (code == "430")
{
@@ -335,6 +339,8 @@ bool CmdSync::send (
const Msg& request,
Msg& response)
{
// It is important that the ':' be the *last* colon, in order to support
// IPv6 addresses.
std::string::size_type colon = to.rfind (':');
if (colon == std::string::npos)
throw format (STRING_CMD_SYNC_BAD_SERVER, to);

View File

@@ -58,6 +58,8 @@
#include <l10n/epo-RUS.h>
#elif PACKAGE_LANGUAGE == LANGUAGE_POL_POL
#include <l10n/pol-POL.h>
#elif PACKAGE_LANGUAGE == LANGUAGE_JPN_JPN
#include <l10n/jpn-JPN.h>
#endif
#endif

View File

@@ -254,10 +254,10 @@
// commands/Cmd*
// USAGE strings are visible in 'task help'
#define STRING_CMD_CONFLICT "Custom report '{1}' conflicts with built-in task command."
#define STRING_CMD_VERSION_USAGE "Shows the taskwarrior version number"
#define STRING_CMD_VERSION_USAGE2 "Shows only the taskwarrior version number"
#define STRING_CMD_VERSION_MIT "Taskwarrior may be copied only under the terms of the MIT license, which may be found in the taskwarrior source kit."
#define STRING_CMD_VERSION_DOCS "Documentation for taskwarrior can be found using 'man task', 'man taskrc', 'man task-color', 'man task-sync' or at http://taskwarrior.org"
#define STRING_CMD_VERSION_USAGE "Shows the Taskwarrior version number"
#define STRING_CMD_VERSION_USAGE2 "Shows only the Taskwarrior version number"
#define STRING_CMD_VERSION_MIT "Taskwarrior may be copied only under the terms of the MIT license, which may be found in the Taskwarrior source kit."
#define STRING_CMD_VERSION_DOCS "Documentation for Taskwarrior can be found using 'man task', 'man taskrc', 'man task-color', 'man task-sync' or at http://taskwarrior.org"
#define STRING_CMD_VERSION_BUILT "{1} {2} built for "
#define STRING_CMD_VERSION_UNKNOWN "unknown"
#define STRING_CMD_VERSION_COPY "Copyright (C) 2006 - 2015 P. Beckingham, F. Hernandez."
@@ -557,7 +557,7 @@
#define STRING_CMD_CONTEXT_DEF_SUCC "Context '{1}' defined."
#define STRING_CMD_CONTEXT_DEF_FAIL "Context '{1}' not defined."
#define STRING_CMD_CONTEXT_DEF_USAG "Both context name and its definition must be provided."
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definition aborted."
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
@@ -615,7 +615,7 @@
#define STRING_CONFIG_DEPRECATED_VAR "Your .taskrc file contains variables that are deprecated:"
// Context
#define STRING_CONTEXT_CREATE_RC "A configuration file could not be found in {1}\n\nWould you like a sample {2} created, so taskwarrior can proceed?"
#define STRING_CONTEXT_CREATE_RC "A configuration file could not be found in {1}\n\nWould you like a sample {2} created, so Taskwarrior can proceed?"
#define STRING_CONTEXT_NEED_RC "Cannot proceed without rc file."
#define STRING_CONTEXT_RC_OVERRIDE "TASKRC override: {1}"
#define STRING_CONTEXT_DATA_OVERRIDE "TASKDATA override: {1}"
@@ -730,12 +730,12 @@
#define STRING_EDIT_HEADER_1 "The 'task <id> edit' command allows you to modify all aspects of a task"
#define STRING_EDIT_HEADER_2 "using a text editor. Below is a representation of all the task details."
#define STRING_EDIT_HEADER_3 "Modify what you wish, and when you save and quit your editor,"
#define STRING_EDIT_HEADER_4 "taskwarrior will read this file, determine what changed, and apply"
#define STRING_EDIT_HEADER_4 "Taskwarrior will read this file, determine what changed, and apply"
#define STRING_EDIT_HEADER_5 "those changes. If you exit your editor without saving or making"
#define STRING_EDIT_HEADER_6 "modifications, taskwarrior will do nothing."
#define STRING_EDIT_HEADER_6 "modifications, Taskwarrior will do nothing."
#define STRING_EDIT_HEADER_7 "Lines that begin with # represent data you cannot change, like ID."
#define STRING_EDIT_HEADER_8 "If you get too creative with your editing, taskwarrior will send you"
#define STRING_EDIT_HEADER_8 "If you get too creative with your editing, Taskwarrior will send you"
#define STRING_EDIT_HEADER_9 "back to the editor to try again."
#define STRING_EDIT_HEADER_10 "Should you find yourself in an endless loop, re-editing the same file,"
@@ -852,7 +852,7 @@
#define STRING_TASK_NO_FF1 "Taskwarrior no longer supports file format 1, originally used between 27 November 2006 and 31 December 2007."
#define STRING_TASK_NO_FF2 "Taskwarrior no longer supports file format 2, originally used between 1 January 2008 and 12 April 2009."
#define STRING_TASK_NO_FF3 "Taskwarrior no longer supports file format 3, originally used between 23 March 2009 and 16 May 2009."
#define STRING_TASK_PARSE_UNREC_FF "Unrecognized taskwarrior file format."
#define STRING_TASK_PARSE_UNREC_FF "Unrecognized Taskwarrior file format."
#define STRING_TASK_DEPEND_ITSELF "A task cannot be dependent on itself."
#define STRING_TASK_DEPEND_MISS_CREA "Could not create a dependency on task {1} - not found."
#define STRING_TASK_DEPEND_MISS_DEL "Could not delete a dependency on task {1} - not found."
@@ -985,7 +985,7 @@
" task add \"quoted ' quote\"\n" \
" task add escaped \\' quote\n" \
"\n" \
"The argument -- tells taskwarrior to treat all other args as description, even " \
"The argument -- tells Taskwarrior to treat all other args as description, even " \
"if they would otherwise be attributes or tags:\n" \
" task add -- project:Home needs scheduling\n" \
"\n" \
@@ -994,7 +994,7 @@
"\n"
/*
To be included later, before the 'precendence' line.
To be included later, before the 'precedence' line.
" + - Addition, subtraction\n" \
" ! Inversion\n" \

1020
src/l10n/jpn-JPN.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -624,6 +624,38 @@ int strippedLength (const std::string& input)
return count;
}
////////////////////////////////////////////////////////////////////////////////
const std::string obfuscateText (const std::string& input)
{
std::stringstream output;
std::string::size_type i = 0;
int character;
bool inside = false;
while ((character = utf8_next_char (input, i)))
{
if (inside)
{
output << (char) character;
if (character == 'm')
inside = false;
}
else
{
if (character == 033)
inside = true;
if (inside || character == ' ')
output << (char) character;
else
output << 'x';
}
}
return output.str ();
}
////////////////////////////////////////////////////////////////////////////////
const std::string format (char value)
{

View File

@@ -55,6 +55,7 @@ bool closeEnough (const std::string&, const std::string&, unsigned int minLength
std::string::size_type find (const std::string&, const std::string&, bool sensitive = true);
std::string::size_type find (const std::string&, const std::string&, std::string::size_type, bool sensitive = true);
int strippedLength (const std::string&);
const std::string obfuscateText (const std::string&);
const std::string format (char);
const std::string format (int);
const std::string formatHex (int);

View File

@@ -42,7 +42,6 @@
#include <sys/types.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
@@ -228,40 +227,6 @@ const std::string uuid ()
}
#endif
////////////////////////////////////////////////////////////////////////////////
// On Solaris no flock function exists.
#ifdef SOLARIS
int flock (int fd, int operation)
{
struct flock fl;
switch (operation & ~LOCK_NB)
{
case LOCK_SH:
fl.l_type = F_RDLCK;
break;
case LOCK_EX:
fl.l_type = F_WRLCK;
break;
case LOCK_UN:
fl.l_type = F_UNLCK;
break;
default:
errno = EINVAL;
return -1;
}
fl.l_whence = 0;
fl.l_start = 0;
fl.l_len = 0;
return fcntl (fd, (operation & LOCK_NB) ? F_SETLK : F_SETLKW, &fl);
}
#endif
////////////////////////////////////////////////////////////////////////////////
// Run a binary with args, capturing output.
int execute (

View File

@@ -52,15 +52,6 @@ const std::string uuid ();
int execute (const std::string&, const std::vector <std::string>&, const std::string&, std::string&);
#ifdef SOLARIS
#define LOCK_SH 1
#define LOCK_EX 2
#define LOCK_NB 4
#define LOCK_UN 8
int flock (int, int);
#endif
const std::string indentProject (
const std::string&,
const std::string& whitespace = " ",

4
test/.gitignore vendored
View File

@@ -2,6 +2,10 @@
*.pyc
*.data
*.log
*.runlog
_run_all_parallel.txt
_run_all_serial.txt
_run_all_parallel_rc1
autocomplete.t
color.t
config.t

View File

@@ -2,4 +2,5 @@ Shell environment variables that affect how and what tests are executed:
TASKW_SKIP -> Causes any test that needs Taskwarrior (task binary) to be skipped
TASKD_SKIP -> Causes any test that needs Task Server (taskd binary) to be skipped
USE_PATH -> Causes tests to look for "task" and "taskd" in PATH instead of the default location
TASK_USE_PATH -> Causes tests to look for "task" in PATH instead of the default location
TASKD_USE_PATH -> Causes tests to look for "taskd" in PATH instead of the default location

View File

@@ -147,7 +147,7 @@ class Task(object):
return f.readlines()
def runSuccess(self, args=(), input=None, merge_streams=False,
timeout=1):
timeout=5):
"""Invoke task with given arguments and fail if exit code != 0
Use runError if you want exit_code to be tested automatically and
@@ -167,6 +167,19 @@ class Task(object):
"""
# Create a copy of the command
command = self._command[:]
# Enable nicer-looking calls by allowing plain strings
try:
# Python 2.x
if isinstance(args, basestring):
import shlex
args = shlex.split(args)
except NameError:
# Python 3.x
if isinstance(args, str):
import shlex
args = shlex.split(args)
command.extend(args)
output = run_cmd_wait_nofail(command, input,
@@ -179,7 +192,7 @@ class Task(object):
return output
def runError(self, args=(), input=None, merge_streams=False, timeout=1):
def runError(self, args=(), input=None, merge_streams=False, timeout=5):
"""Invoke task with given arguments and fail if exit code == 0
Use runSuccess if you want exit_code to be tested automatically and

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import division, print_function
import os
import tempfile
import shutil
@@ -81,6 +81,7 @@ class Taskd(object):
run_cmd_wait(cmd, env=self.env)
self.config("server", "{0}:{1}".format(self.address, self.port))
self.config("family", "IPv4")
self.config("log", self.tasklog)
self.config("pid.file", self.taskpid)
self.config("root", self.datadir)
@@ -207,6 +208,8 @@ class Taskd(object):
self.proc = Popen(cmd, stdout=PIPE, stderr=PIPE, stdin=DEVNULL,
env=self.env)
else:
self.show_log_contents()
raise OSError("Taskd server is still running or crashed")
# Wait for server to listen by checking connectivity in the port
@@ -218,6 +221,8 @@ class Taskd(object):
return
elif status == self.TASKD_NEVER_STARTED:
self.show_log_contents()
raise OSError("Task server was never started. "
"This shouldn't happen!!")
@@ -225,6 +230,8 @@ class Taskd(object):
# Collect output logs
out, err = self.proc.communicate()
self.show_log_contents()
raise OSError(
"Task server launched with '{0}' crashed or exited "
"prematurely. Exit code: {1}. "
@@ -242,14 +249,18 @@ class Taskd(object):
sleep(1 / tries_per_minute)
else:
self.show_log_contents()
raise OSError("Unknown running status for taskd '{0}'".format(
status))
# Force stop so we can collect output
self.stop()
proc = self.stop()
# Collect output logs
out, err = self.proc.communicate()
out, err = proc.communicate()
self.show_log_contents()
raise OSError("Task server didn't start and listen on port {0} after "
"{1} minutes. Stdout: {2!r}. Stderr: {3!r}.".format(
@@ -259,6 +270,8 @@ class Taskd(object):
"""Stop the server by sending a SIGTERM and SIGKILL if fails to
terminate.
If it's already stopped OSError will be raised
Returns: a reference to the old process object
"""
if self.proc is None:
raise OSError("Taskd server is not running")
@@ -272,9 +285,14 @@ class Taskd(object):
# Wait for process to end to avoid zombies
self.proc.wait()
# Keep a reference to the old process
proc = self.proc
# Unset the process to inform that no process is running
self.proc = None
return proc
def _check_pid(self):
"Check if self.proc is still running and a PID still exists"
# Wait ~1 sec for taskd to finish
@@ -339,4 +357,14 @@ class Taskd(object):
return parse_datafile(file)
def show_log_contents(self):
"""Print to to STDOUT the contents of taskd.log
"""
if os.path.isfile(self.tasklog):
with open(self.tasklog) as fh:
print("#### Start taskd.log ####")
for line in fh:
print(line, end='')
print("#### End taskd.log ####")
# vim: ai sts=4 et sw=4

View File

@@ -129,9 +129,9 @@ def _queue_output(arguments, pidq, outputq):
outputq.put((
"",
("Unexpected exception caught during execution of taskw: '{0}' . "
"If you are running out-of-tree tests set USE_PATH=1 in shell "
"env before execution and add the location of the task binary to "
"the PATH".format(e)),
"If you are running out-of-tree tests set TASK_USE_PATH=1 or "
"TASKD_USE_PATH=1 in shell env before execution and add the "
"location of the task(d) binary to the PATH".format(e)),
255)) # false exitcode
return

View File

@@ -1,62 +0,0 @@
#! /usr/bin/env perl
################################################################################
##
## Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
## copies of the Software, and to permit persons to whom the Software is
## furnished to do so, subject to the following conditions:
##
## The above copyright notice and this permission notice shall be included
## in all copies or substantial portions of the Software.
##
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
## SOFTWARE.
##
## http://www.opensource.org/licenses/mit-license.php
##
################################################################################
use strict;
use warnings;
use Test::More tests => 2;
# Ensure environment has no influence.
delete $ENV{'TASKDATA'};
delete $ENV{'TASKRC'};
use File::Basename;
my $ut = basename ($0);
my $rc = $ut . '.rc';
# Create the rc file.
if (open my $fh, '>', $rc)
{
print $fh "data.location=.\n",
"confirmation=no\n";
close $fh;
}
# Setup: Add a recurring task then remove the due date.
qx{../src/task rc:$rc add foo recur:yearly due:eoy 2>&1};
qx{../src/task rc:$rc list 2>&1};
qx{../src/task rc:$rc 2 modify due: 2>&1};
# Result: Somehow the due date is incremented and wraps around to 12/31/1969,
# then keeps going back to today.
my $output = qx{../src/task rc:$rc list 2>&1};
like ($output, qr/^1 task$/ms, "$ut: task foo shown");
unlike ($output, qr/1969/ms, "$ut: Should not display 12/31/1969");
# Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data), $rc;
exit 0;

View File

@@ -1,60 +0,0 @@
#! /usr/bin/env perl
################################################################################
##
## Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
## copies of the Software, and to permit persons to whom the Software is
## furnished to do so, subject to the following conditions:
##
## The above copyright notice and this permission notice shall be included
## in all copies or substantial portions of the Software.
##
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
## SOFTWARE.
##
## http://www.opensource.org/licenses/mit-license.php
##
################################################################################
use strict;
use warnings;
use Test::More tests => 2;
# Ensure environment has no influence.
delete $ENV{'TASKDATA'};
delete $ENV{'TASKRC'};
use File::Basename;
my $ut = basename ($0);
my $rc = $ut . '.rc';
# Create the rc file.
if (open my $fh, '>', $rc)
{
print $fh "data.location=.\n",
"dateformat.info=m/d/Y\n",
"confirmation=no\n";
close $fh;
}
# Setup: Add a recurring task, generate an instance, then add a project.
qx{../src/task rc:$rc add foo due:today recur:daily until:eom 2>&1};
my $output = qx{../src/task rc:$rc info 1 2>&1};
# Result: Make sure the 'until' date is rendered as a date, not an epoch.
unlike ($output, qr/Until\s+\d{10}/, "$ut: until is not shown as an epoch");
like ($output, qr/Until\s+\d+\/\d+\/\d{4}/, "$ut: until is shown as a date");
# Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data), $rc;
exit 0;

View File

@@ -1,4 +1,4 @@
#! /usr/bin/env python2.7
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
###############################################################################
#

View File

@@ -1,4 +1,4 @@
#! /usr/bin/env python2.7
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
###############################################################################
#

View File

@@ -129,7 +129,7 @@ int main (int argc, char** argv)
t.notok (d9.up (), "parent / --> false");
// Test permissions.
umask(0022);
umask (0022);
Directory d10 ("tmp/dir.perm");
d10.create (0750);
t.ok (d10.exists (), "Directory::create perm file exists");

73
test/feature.recurrence.t Executable file
View File

@@ -0,0 +1,73 @@
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# http://www.opensource.org/licenses/mit-license.php
#
###############################################################################
import sys
import os
import unittest
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from basetest import Task, TestCase
class TestRecurrenceProblems(TestCase):
def setUp(self):
self.t = Task()
def test_recurring_due_removal(self):
"""Removing due from a recurring task causes date wrapping"""
# Originally bug.327.t
self.t(("add", "foo", "recur:yearly", "due:eoy"))
self.t(("list",)) # Trigger garbage collection
code, out, err = self.t.runError(("2", "modify", "due:"))
self.assertIn("cannot remove the due date from a recurring task", err)
code, out, err = self.t(("list",))
self.assertIn("\n1 task", out)
self.assertNotIn("1969", out)
def test_recurring_not_as_epoch(self):
"""Ensure 'until' is rendered as date, not epoch"""
# Originally bug.368.t
self.t.config("dateformat.info", "m/d/Y")
self.t(("add", "foo", "due:today", "recur:yearly", "until:eom"))
code, out, err = self.t(("info", "1"))
self.assertNotRegexpMatches(out, "Until\s+\d{10}")
self.assertRegexpMatches(out, "Until\s+\d+\/\d+\/\d{4}")
if __name__ == "__main__":
from simpletap import TAPTestRunner
unittest.main(testRunner=TAPTestRunner())
# vim: ai sts=4 et sw=4

View File

@@ -36,16 +36,17 @@ from basetest import Task, TestCase
class TestFilter(TestCase):
def setUp(self):
self.t = Task()
@classmethod
def setUpClass(cls):
cls.t = Task()
self.t(("add", "project:A", "prio:H", "+tag", "one", "foo"))
self.t(("add", "project:A", "prio:H", "two"))
self.t(("add", "project:A", "three"))
self.t(("add", "prio:H", "four"))
self.t(("add", "+tag", "five"))
self.t(("add", "six", "foo"))
self.t(("add", "prio:L", "seven", "bar", "foo"))
cls.t(("add", "project:A", "prio:H", "+tag", "one", "foo"))
cls.t(("add", "project:A", "prio:H", "two"))
cls.t(("add", "project:A", "three"))
cls.t(("add", "prio:H", "four"))
cls.t(("add", "+tag", "five"))
cls.t(("add", "six", "foo"))
cls.t(("add", "prio:L", "seven", "bar", "foo"))
def test_list(self):
"""filter - list"""

78
test/gc.t Executable file
View File

@@ -0,0 +1,78 @@
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# http://www.opensource.org/licenses/mit-license.php
#
###############################################################################
import sys
import os
import unittest
# Ensure python finds the local simpletap module
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from basetest import Task, TestCase
class TestGC(TestCase):
def setUp(self):
self.t = Task()
self.t.config("report.gctest.description", "gctest")
self.t.config("report.gctest.columns", "id,description,tags")
self.t.config("report.gctest.sort", "id+")
self.t("add one")
self.t("add two")
self.t("add three")
def test_gc_off_id(self):
"""ID retained when GC off"""
self.t.config("gc", "off")
self.t("1 done")
code, out, err = self.t("gctest")
self.assertRegexpMatches(out, "1\s+one", "should still have ID")
def test_gc_off_mod(self):
"""mod by ID after done with gc off"""
self.t.config("gc", "off")
self.t("1 done")
self.t("gctest")
self.t("2 mod +TWO")
code, out, err = self.t("gctest")
self.assertRegexpMatches(out, "2\s+two\s+TWO", "modified 'two'")
def test_gc_on_id(self):
"""IDs reshuffle after report when GC on"""
self.t.config("gc", "on")
self.t("1 done")
self.t("2 mod +TWO")
code, out, err = self.t("gctest")
self.assertRegexpMatches(out, "1\s+two\s+TWO")
self.assertRegexpMatches(out, "2\s+three")
if __name__ == "__main__":
from simpletap import TAPTestRunner
unittest.main(testRunner=TAPTestRunner())
# vim: ai sts=4 et sw=4

View File

@@ -36,7 +36,7 @@ Context context;
////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv)
{
UnitTest t (765);
UnitTest t (789);
std::vector <std::pair <std::string, Lexer::Type>> tokens;
std::string token;
@@ -278,6 +278,7 @@ int main (int argc, char** argv)
// Pair
{ "name:value", { { "name:value", Lexer::Type::pair }, NO, NO, NO, NO }, },
{ "desc.cont:pattern", { { "desc.cont:pattern", Lexer::Type::pair }, NO, NO, NO, NO }, },
{ "desc.any:", { { "desc.any:", Lexer::Type::pair }, NO, NO, NO, NO }, },
{ "pro:'P 1'", { { "pro:'P 1'", Lexer::Type::pair }, NO, NO, NO, NO }, },
{ "pro:PROJECT", { { "pro:PROJECT", Lexer::Type::pair }, NO, NO, NO, NO }, },
{ "due:'eow - 2d'", { { "due:'eow - 2d'", Lexer::Type::pair }, NO, NO, NO, NO }, },
@@ -373,6 +374,9 @@ int main (int argc, char** argv)
{ "desc~pattern", { { "desc", Lexer::Type::dom },
{ "~", Lexer::Type::op },
{ "pattern", Lexer::Type::dom }, NO, NO }, },
{ "(+tag)", { { "(", Lexer::Type::op },
{ "+tag", Lexer::Type::tag },
{ ")", Lexer::Type::op }, NO, NO }, },
};
#define NUM_TESTS (sizeof (lexerTests) / sizeof (lexerTests[0]))

View File

@@ -3,6 +3,59 @@
# Look for taskd in $PATH instead of task/src/
export TASKD_USE_PATH=1
runlog_cleanup() {
if [ -f "_run_all_parallel.txt" ]; then
rm _run_all_parallel.txt
fi
if [ -f "_run_all_serial.txt" ]; then
rm _run_all_serial.txt
fi
if [ -f "_run_all_parallel_rc1" ]; then
rm _run_all_parallel_rc1
fi
for i in *.runlog; do
# Ugly hack. :)
if [ -f "$i" ]; then
rm *.runlog
fi
break
done
}
get_numprocs() {
numprocs=""
# Most Linux systems and OSX have getconf and _NPROCESSORS_ONLN.
if command -v getconf >/dev/null 2>&1; then
numprocs=$(getconf _NPROCESSORS_ONLN 2>/dev/null)
fi
# OpenBSD doesn't know _NPROCESSORS_ONLN, but it does have hw.ncpu
if [ "$numprocs" = "" ] && command -v sysctl >/dev/null 2>&1; then
numprocs=$(sysctl -n hw.ncpu 2>/dev/null)
fi
# If we still haven't found the number of CPU cores available, give up.
if [ "$numprocs" = "" ] || [ "$numprocs" -lt 1 ]; then
echo "Couldn't find number of CPU cores for parallelization. Assuming 2." 1>&2
numprocs=2
else
numprocs=$((numprocs+1))
fi
echo $numprocs
}
run_all_parallel() {
numprocs=$(get_numprocs)
cat _run_all_parallel.txt | xargs -n 1 -P $numprocs sh -c 'echo "#" $0 > $0.runlog; $0 >> $0.runlog 2>&1'
if [ $? -ne 0 ]; then
touch _run_all_parallel_rc1
fi
rm _run_all_parallel.txt
}
rc=0
if [ x"$1" = x"--verbose" ];
then
@@ -24,6 +77,69 @@ then
fi
done
exit $rc
elif [ "$1" = "--fast" ]; then
# Useful for faster local testing, might not be portable. Use at own risk.
# Results in (almost) the exact same "all.log" as a normal run.
# Ordering is off, but could easily be adjusted to be the same.
date > all.log
# Perl is used here to get the time in seconds
# because 'date +%s' isn't supported on Solaris.
STARTEPOCH=`perl -e 'print time'`
# Clean up after aborted runs
runlog_cleanup
for i in ${TESTBLOB}; do
if [ -x "$i" ]; then
# Only Python tests are guaranteed to run isolated.
if head -n 1 "$i" | grep -q '/usr/bin/env python'; then
echo $i >> _run_all_parallel.txt
else
echo $i >> _run_all_serial.txt
fi
else
echo "# Skipping $(basename $i) execute bit not set" >> all.log 2>&1
fi
done
run_all_parallel&
while read i; do
echo '#' $i >>all.log
$i >> all.log 2>&1
if [ $? -ne 0 ]; then
rc=1
fi
done < _run_all_serial.txt
while [ -f "_run_all_parallel.txt" ]; do
# Wait for the parallelized tests to finish running.
sleep 1 # sleep 0.1 is not portable.
done
if [ -f "_run_all_parallel_rc1" ]; then
rc=1
fi
cat *.runlog >> all.log
runlog_cleanup
date >> all.log
ENDEPOCH=`perl -e 'print time'`
RUNTIME=`expr $ENDEPOCH - $STARTEPOCH`
printf "Pass: %5d\n" `grep -c '^ok' all.log`
printf "Fail: %5d\n" `grep -c '^not' all.log`
printf "Skipped: %5d\n" `grep -c '^skip' all.log`
printf "Runtime: %5d seconds\n" $RUNTIME
exit $rc
else
date > all.log

View File

@@ -1,4 +1,4 @@
#! /usr/bin/env python2.7
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
###############################################################################
#