Adding a target only modifies a single metadata so making it a "edit" sub
command made sense... However, often user does not know which metadata
should be modified: this is especially the case with succinct
delegations.
Make add-target a top level action instead of a edit subaction:
role can still be optionally specified but it is a starting point for the search
delegation tree is followed from the starting role until the first leaf role (that does not delegate further) is found
command now also outputs which role it inserted the target file into
This means add-target is now a simple repository wide command which
seems quite logical: user does not need to know the details, they just
want to add a target file to the repository.
There is a edit()-refactor here that makes the edit-contextmanager handle AbortEdit silently: the users of edit() can raise AbortEdit to signal they want to exit the contextmanager without saving the edited metadata. This is a bit undiscoverable and not immediately obvious but works quite nicely in both snapshot and add-target in my opinion.
Fixes #32
Adding a target only modifies a single metadata so making it a "edit" sub command made sense... However, often user does not know which metadata should be modified: this is especially the case with succinct delegations.
Make add-target a top level action instead of a edit subaction:
This means add-target is now a simple repository wide command which seems quite logical: user does not need to know the details, they just want to add a target file to the repository.
There is a edit()-refactor here that makes the edit-contextmanager handle
AbortEdit
silently: the users of edit() can raiseAbortEdit
to signal they want to exit the contextmanager without saving the edited metadata. This is a bit undiscoverable and not immediately obvious but works quite nicely in bothsnapshot
andadd-target
in my opinion.