-
-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow combinations of --change-time
, --delete
, and --edit
while correctly counting the number of entries affected
#1669
Conversation
This might fix #1666. We'll need to add a test. |
We'll need to add some tests for:
We'll need to come up with a better name for this PR too. It changes some messaging behavior and we'll want that reflected in the changelog. |
I noticed some problems with incorrect count messages while testing this out today, so I added some failing tests for those issues. |
This is green but not finished. We still need to add the tests I mentioned in my comment last week. We also changed the messaging for when you delete all entries in the editor. Instead of the
|
I added some failing tests that we should look at. I'm not 100% certain what the added/found/deleted counts should be with certain combinations of actions, but I still think they are wrong now in certain situations. |
I finally decided to just keep a register of deleted and added entries in the Journal class. We're already tracking modified entries in its member class Entry so this is not a significant deviation, and now the counts reflect exactly what jrnl did to the journal, even when combining all three actions (change-time, delete, and edit). This change also has a nice side effect of moving all counting logic outside of the controller class, which has no business doing that anyway. In the long run, I'd like to separate this logic from the data representation of the journal, but I think that's outside of the scope of this PR. |
--change-time
, --delete
, and --edit
while correctly counting the number of entries affected
I still want to add more tests to this. The combination tests are a good start, but I want to test them with search criteria as well. |
…g search behavior
- streamline `run` function in `controller.py` - add debug logging - fix unnecessary import of Journal class (only needed for typing) - standardize summary display across different actions
…g time and deleting
…hen no entries found by short-circuiting display method
…testing incorrect message
…ing journal with no entries
* Add documentation about using Vim/Neovim as editor * Add documentation about information leaks in editors * Spelling fix --------- Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
…same as the template itself (jrnl-org#1653)
… edit, delete) and for change-time counts. Some are failing and should be investigated
… of attempting to infer it via controller counting
Conflicts: CHANGELOG.md docs/privacy-and-security.md jrnl/controller.py tests/bdd/features/change_time.feature
--change-time
, --delete
, and --edit
while correctly counting the number of entries affected--change-time
, --delete
, and --edit
while correctly counting the number of entries affected
cc:
Related issues:
--change-time
,--delete
, and--edit
don't work consistently #1696--delete
#1666--change-time
#1644Todo
develop
branchChecklist
for the same issue.