Commit Graph

877 Commits

Author SHA1 Message Date
Matthias Beyer 5a250bd991 Remove InternalLinker::set_internal_links()
This function needs to be removed because of the following problem:

When linking from one entry to another, and then removing the link in
the first entry with ::set_internal_links(vec![]), we end up with a
dangling link in the second entry, because the ::set_internal_links()
function does not take care of removing the links in the "other"
entries.

Actually, it is not even able to do so, because it would need to
`Store::get()` those entries, but it does not have access to the store.

Adding a `store` parameter to the function would be possible, but only
increase its complexity unnecessarily. This is why I opt for removing
this function (which is btw not used once in the whole imag codebase).

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 02:31:03 +02:00
Matthias Beyer d034a6f0e2 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer 27b75ba2fc Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer 5ebbcb774a Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer b808658648 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer f540a317b0 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer c02b2f88de Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer c7ea58eda2 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer d8bcb8ca8e Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer f44e10e295 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer 322c063450 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer 6e0a179550 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer 740729bfda Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer 06e78c75de Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer 99ee4fdf43 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer 26de159415 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer 3321b9a643 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer e200e40070 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:55:10 +02:00
Matthias Beyer 1f97584738 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:54:35 +02:00
Matthias Beyer 741e8acb8a Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:54:35 +02:00
Matthias Beyer 5f07d7d21a Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:54:35 +02:00
Matthias Beyer 112a2d6af8 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:53:40 +02:00
Matthias Beyer 00fa3e7b78 Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:53:40 +02:00
Matthias Beyer c7f5420c1d Change is_log() implementation to use kindflag utility
This patch changes the Log::is_log() implementation for Entry to use the
provide_kindflag_path!() infrastructure.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:52:13 +02:00
Matthias Beyer 9f100f2f75 Fix: Do not write newline character when asked not to do
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:52:13 +02:00
Matthias Beyer 1d89844613 Run 'cargo fix' for rust-2018
With this patch we move the codebase to Rust-2018.

The diff was generated by executing

    cargo fix --all --all-features --edition

on the codebase.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 00:20:59 +02:00
Matthias Beyer 26664a5aec Merge branch 'libimagentryref-override-base' into master 2019-04-22 14:40:30 +02:00
Matthias Beyer 427eac76fe Add Ref::get_path_with_basepath_setting()
This function can be used to override the basepath setting from the
header of the entry so that another basepath is used for looking
up/constructing the actual filepath.

This might come in handy at some point.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 14:40:07 +02:00
Matthias Beyer ff5e6653ed Add option to override ref data in contact entries
This patch adds a flag to the ContactStore::retrieve* functions so one
can override the ref data in the store for the retrieved entry.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 14:37:43 +02:00
Matthias Beyer 99576bf5bc Merge branch 'remove-libimagnotification' into master 2019-04-22 14:28:23 +02:00
Matthias Beyer 1c851bbb79 Rewrite store interface abstraction
Because we pull in libimagentryref here to create actual references to
the files we parse here, we need to rewrite the interface to be able to
pass the required information to the libimagentryref API.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 14:26:56 +02:00
Matthias Beyer 204da1b0bd Remove libimagnotification
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 14:05:55 +02:00
Matthias Beyer cf234437d7 Implement Partial for Config
With this implemented, we can fetch the appropriate configuration easily
from the configuration.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 13:06:26 +02:00
Matthias Beyer 2854e88dcc Rename: "ref.collection" to "ref.basepath"
The setting in the header should reflect the name of the setting in the
configuration file, for a better user experience.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 13:06:26 +02:00
Matthias Beyer 7ae2d926cc Use toml-query master branch during development
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 13:06:26 +02:00
Matthias Beyer 31e3116b48 Revert "Remove GetIter"
This reverts commit a49522dc86770a741d61d548351ad69dfc56d1fa.
2019-04-14 00:16:47 +02:00
Matthias Beyer b8cd9c6efa Add debug output
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-14 00:16:47 +02:00
Matthias Beyer aa3fdb88d5 Remove GetIter
Because the code is not used.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-14 00:16:47 +02:00
Matthias Beyer 4afebbe9e4 Remove FilterLinksIter
Because the code is not used.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-14 00:16:47 +02:00
Matthias Beyer 1f515b1d0d Remove DeleteUnlinkedIter
Because the code is not used.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-14 00:16:47 +02:00
Matthias Beyer 0283c3af7a Merge branch 'fix-path-iterator' into master-ff
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-13 23:42:20 +02:00
Matthias Beyer 526885ee19 Fix: PathIterBuilder should not yield directories
PathIterBuilder should yield iterator that does only yield file pathes,
not directories.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-13 23:00:06 +02:00
Matthias Beyer cb4d5367e4 Rewrite all usages of ModuleEntryPath
Because the code was so complex before, we had to create an object and
then cast that object into a `StoreId` rather than just creating a
`StoreId` object right away.

With this patch, we're using the code-generation approach to generate a
function that creates a `StoreId` object based on the name of the
current module. That's way easier and error handling was also improved
by the switch to the new implementation.

The patch also includes a rewrite of all usages of ModuleEntryPath and
changes them to `module_path::new_id()` calls.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-13 22:39:39 +02:00
Matthias Beyer de522ec0f2 Fix for rust beta compiler
The beta compiler reports duplicated input:

error: the item `IntoValues` is imported redundantly
   --> lib/entry/libimagentrylink/src/internal.rs:398:13
    |
36  | use self::iter::IntoValues;
    |     ---------------------- the item `IntoValues` is already imported here
...
398 |         use internal::iter::IntoValues;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |

so we fix this here.

Other imports were fixed as well.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-13 22:06:53 +02:00
Matthias Beyer 82a2fa1528 Remove old TODO
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 13:30:12 +01:00
Matthias Beyer 19622f41ae Do not ignore errors when collecting links
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 13:30:12 +01:00
Matthias Beyer 581da9c9cf Remove old comment
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 13:30:12 +01:00
Matthias Beyer 71cccad665 Remove old comment
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 13:30:12 +01:00
Matthias Beyer ca2f130995 Rewrite: Diary::get_youngest_entry_id()
Rewrite to collect not so often internally. This removes one collect()
from the implementation. One is still there in the sorted_by() call,
though.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 13:30:12 +01:00
Matthias Beyer 205c2b09b6 Remove outcommented code
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 12:26:21 +01:00