Dustin J. Mitchell
6e9ad1048d
move use of contextTask out of columns, into commands
2021-12-30 15:03:37 -05:00
Dustin J. Mitchell
e98b61f2b5
test for dashes in proj without incidentally testing DOM references in 'task add'
2021-12-30 15:03:37 -05:00
Dustin J. Mitchell
1bc7b5f019
Merge pull request #316 from djmitche/issue90
...
Define UDAs
2021-12-27 17:06:47 -05:00
Dustin J. Mitchell
bc8bb52551
do not use str.split_once, as it is not in MSRV
2021-12-27 00:14:40 +00:00
Dustin J. Mitchell
e94c29ae2f
use better trait bounds
2021-12-27 00:09:02 +00:00
Dustin J. Mitchell
829f67ee02
Merge branch 'main' into issue90
2021-12-26 19:04:10 -05:00
Dustin J. Mitchell
b255ad2a7d
use namespace.key for UDAs in the API, with legacy support
2021-12-27 00:01:14 +00:00
Dustin J. Mitchell
d5f087bf9a
Merge pull request #324 from djmitche/issue322
...
Update clippy toolchain to 1.57
2021-12-23 09:08:49 -05:00
Dustin J. Mitchell
cb1395ea32
Merge pull request #323 from taskchampion/issue92
...
Support 'undo'
2021-12-23 09:08:01 -05:00
Dustin J. Mitchell
8195b187c4
fix docs typo
2021-12-23 09:06:19 -05:00
Dustin J. Mitchell
691a3e49e8
Update clippy toolchain to 1.57
2021-12-22 00:43:15 +00:00
Dustin J. Mitchell
36c51d2d93
fix clippy
2021-12-22 00:31:46 +00:00
Dustin J. Mitchell
5fb3f700c0
add some logging for undo
2021-12-21 01:12:30 +00:00
Dustin J. Mitchell
e328b86d97
add user docs for 'ta undo'
2021-12-21 01:10:08 +00:00
Dustin J. Mitchell
caa62ba9a0
add a 'ta undo' subcommand
2021-12-21 01:05:52 +00:00
Dustin J. Mitchell
9d93928996
support undo operations
2021-12-21 00:43:26 +00:00
Dustin J. Mitchell
9e20935f04
Merge pull request #319 from djmitche/issue317
...
Fix application of modifications during 'ta add'
2021-12-20 19:28:32 -05:00
Dustin J. Mitchell
2b63a227d2
Merge pull request #321 from djmitche/clippy-1-57-fixes
...
fix a few lints in clippy 1.57
2021-12-20 18:29:14 -05:00
Dustin J. Mitchell
4fa1f9c6bc
fix a few lints in clippy 1.57
2021-12-20 16:35:55 +00:00
Dustin J. Mitchell
2456012ed6
Fix application of modifications during 'ta add'
2021-12-20 16:16:25 +00:00
Dustin J. Mitchell
1647ba9144
insert UndoPoint appropriately into the replica operations
2021-12-20 00:33:32 +00:00
Dustin J. Mitchell
103bbcdf8f
Store data necessary to undo ReplicaOps
2021-12-19 23:58:57 +00:00
Dustin J. Mitchell
1789344cd0
refactor sync to use SyncOps
2021-12-19 23:44:45 +00:00
Dustin J. Mitchell
cefdd83d94
Use the latest taskmap when modifying a task
...
The previous logic duplicated the action of applying an operation to the
TaskDb with a "manual" application to the Task's local TaskMap. This
now uses the updated TaskMap fetched from the DB, which will help to
incorporate any other concurrent DB updates.
2021-12-19 23:29:16 +00:00
Dustin J. Mitchell
fee25fa742
Apply SyncOps, but keep a list of ReplicaOps
...
This changes a lot of function signatures, but basically:
* TaskDB::apply now takes a SyncOp, not a ReplicaOp
* Replica::update_task returns a TaskMap
2021-12-19 23:29:15 +00:00
Dustin J. Mitchell
0b29efab31
rename Operation to ReplicaOp for clarity
2021-12-19 22:55:24 +00:00
Dustin J. Mitchell
6f7794c7de
introduce a new taskchampion::server::SyncOp type
2021-12-19 22:55:24 +00:00
Dustin J. Mitchell
ff9ad8185b
undo docs
2021-12-19 22:55:24 +00:00
Dustin J. Mitchell
ef12e1a2f8
Define UDAs
2021-12-18 23:39:56 +00:00
Dustin J. Mitchell
4fa1c0bcfb
remove temporary function
2021-12-16 23:03:44 -05:00
Dustin J. Mitchell
e3dd91d45e
use the existing (but misnamed) orphans method
2021-12-16 23:03:44 -05:00
Dustin J. Mitchell
e768e2c100
compare Tasks directly, not their properties
2021-12-16 23:03:44 -05:00
Dustin J. Mitchell
ac24ec1387
fixup and fix spelling for denotate
2021-12-16 23:03:44 -05:00
Dustin J. Mitchell
3a61289f6c
replace a use of Task::data in tests
2021-12-16 23:03:44 -05:00
Dustin J. Mitchell
9f149a7f35
use Task::getAnnotations to get annotatoins
2021-12-16 23:03:44 -05:00
Dustin J. Mitchell
70f83b34ef
Move diff formatting into Task (simple refactor)
...
The Task class already included two forms of diff. This adds another
two.
2021-12-16 23:03:44 -05:00
Dustin J. Mitchell
8d3953183a
Only set contextTask if not adding a new task
...
When adding a new task, the current task is empty, so there is no
context in which to evaluate DOM references. #2683 will address this in
a more robust fashion.
2021-12-16 23:03:44 -05:00
Dustin J. Mitchell
2812a8c77a
Refactor getDOM to use a pointer for the optional context
...
It's possible to call getDOM without a contextual task. Previously,
this was done by referencing a "dummy" task which necessitated a way to
distinguish such dummy tasks. This switches to using a pointer and
treating the NULL value as meaning there is no context.
Note that this cannot use `std::optional<&Task>`, as optional does not
support reference types.
2021-12-16 23:03:44 -05:00
Dustin J. Mitchell
3af5ceadc1
Return early from getDOM if there is no contextual task (refactor)
...
Before this change, all conditionals checked `have_ref`; returning early
is clearer.
2021-12-16 23:03:44 -05:00
Dustin J. Mitchell
0d9e402d3e
Add Task.is_empty, needed to identify "dummy" tasks (simple refactor)
...
getDOM takes an &Task that may be a reference to a dummy, or may be a
real task. The is_empty method replaces `task.data.size() == 0` as a
way to distinguish the two.
2021-12-16 23:03:44 -05:00
Dustin J. Mitchell
dede40bc4e
Replace direct Task.data access with a temp getter (syntactic refactor)
...
Now this getter, `data_removeme`, can easily be grepped out and
replaced, one usage at a time in small PRs.
2021-12-16 23:03:44 -05:00
Tomas Babej
3a00956144
ColDepends: Allow specifying short(er) UUIDs
2021-12-03 03:57:37 -05:00
Siôn le Roux
01add8a34a
docs: Fix typo in XDG news
...
This had XFG written in it, it's surely a typo of XDG since on the next
line it's written correctly.
2021-11-23 21:05:01 +01:00
Tomas Babej
a09712d5d2
docs: Document #2655
2021-11-22 15:51:27 +01:00
Tomas Babej
8074e509ba
tests: Add bulk removal test for tags attribute
2021-11-22 15:51:27 +01:00
Tomas Babej
af10774aec
tests: Add bulk removal test for depends attribute
2021-11-22 15:51:27 +01:00
Tomas Babej
d54c7e090e
Task: Correctly handle bulk removal of virtual tags/depends attributes
...
This edge case would happen if a user issued a following command
$ task 1 mod depends:
or
$ task 1 mod tags:
which would not perform as expected for tasks with non-empty depends /
tags attributes.
The problem under the hood is the fact that current synchronization
between 'tags" attribute and its constituent decomposed `tag_X`
attributes is performed in a way where the set of tags obtained from
`tag_X` attributes is taken as the source of truth.
If the legacy 'tags:' attribute was set to empty, the fixTags() method
would then restore its previous value from the `tag_X` attributes,
effectively leading to a no-op.
The same happens with dependencies. The fix here is to detect removal of
depends and tags attributes, and instead of setting the legacy
attributes to empty values, we iteratively remove all tags/dependencies.
Closes #2655 .
2021-11-22 15:51:27 +01:00
Dustin J. Mitchell
3937f1efb0
Don't look for a specific sha when testing task version
...
This allows tests to pass even with a dirty working copy or when running
tests via `git rebase`.
2021-11-21 23:34:46 +01:00
Tomas Babej
3e8190831c
docs: Document #502
2021-11-20 15:19:34 -05:00
Tomas Babej
3c2b74a36f
tests: Remove expected failure for ID-range based dependencies
2021-11-20 15:19:34 -05:00