There are several instances where the "total" reported in the interval
summary is confusing because the summarize function would walk backward
and add all intervals with the same set of tags.
Closes#248 and #308
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
- It seems that recent changes made the `stop` command faster such that these tests aborted with "The end of a date range must be after the start."
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
- Compute the set difference between the latest interval's tag set and the given tag set
- If no tags given, the difference is set to `{}`
- In case of an empty difference, close the current open interval, apply exclusions and update the database
- In case of a non-empty difference, just add a new open interval and let the overlap resolution do the job...
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
- The given set of tags must be a subset of the latest interval's tag set (this includes the empty case)
- If not a subset, throw an error and show the first non-matching tag
- This also prevents the stop command from doing any work on the database
- Closes#280
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
- Use default range starting at `now`
- Add check for no datetime given (rare case of e.g. `timew stop :all`)
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
I had a broken symbolic link in my extensions directory. When I ran
`timew diag` it would simply print on the screen:
```
stat error 2: No such file or directory
```
After this change, there is more context information about the source of
the error:
```
timew 1.3.0
Platform: Linux
Compiler:
Version: 7.5.0
Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
Compliance: C++11
Build Features
Built: Aug 14 2020 05:57:06
Commit: 6fe15d26
CMake: 3.10.2
Build type: Debug
Configuration
TIMEWARRIORDB: -
Cfg: /home/sruffell/.timewarrior/timewarrior.cfg (-rw- 0 bytes)
Database: /home/sruffell/.timewarrior (drwx 4096 bytes)
$EDITOR: vim
Color theme: Built-in default
00 01 02 03 04 05 06 07 08 09 10 11 12
Extensions
Location: /home/sruffell/.timewarrior/extensions (drwx 4096 bytes)
/home/sruffell/.timewarrior/extensions/tsheet (stat error 2: No such file or directory)
```
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
This is particularly bad when called from the Database::modifyInterval
call, since the delete may fail, but then the addInterval will proceed.
Closes#319
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
I would like to use TempDir for the Datafile test in order to cleanup
any datafiles created as part of the test.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
If calling undo on an operation the removes many entries from the
datafiles, there would be many 0 length size files remaining in the data
directory. Now they will be removed if they are empty so they will not
longer need to be checked when parsing the database.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
Allows the user to specify a maximum number of entries to store in the
undo file. By default the behavior is unchanged, and the file will grow
unbounded without user intervention.
journal.size = 0 will disable storing any entries, journal.size < 0
indicates that the size of the journal should be unlimited (the
default), otherwise it indicates the number of entries to store.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
- This also handles the case when it is called with the `:all` hint
- When called with a range, the `track` command is recommended
- There is no forwarding to `track`
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Move the adjustment of a new open interval that is enclosed by the
current open interval into the validation processing, where the other
overlap resolution takes place.
This will allow the start command to honor the :adjust flag when
starting a new interval that predates the current open interval.
Closes#326
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
It was possible previously to start an interval with a filter earlier
than the current filter, and if the tags matched, the command would
report success without actually moving the start time.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
Since the Intervals are all in order, we can use getTracked directly to
get overlapping intervals without the need to copy the Intervals into
another vector.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>