importtree: support preferred content expressions needing keys
authorJoey Hess <joeyh@joeyh.name>
Mon, 18 Dec 2023 20:27:26 +0000 (16:27 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 18 Dec 2023 20:27:59 +0000 (16:27 -0400)
commit9a67ed0f10706141ff21b9c4ea9c148b667c1ffe
treefc029bb65742dd6eaed927667bc619b53c048eb2
parent0e161a74047f26ec1df13d73c913b58500a300a6
importtree: support preferred content expressions needing keys

When importing from a special remote, support preferred content expressions
that use terms that match on keys (eg "present", "copies=1"). Such terms
are ignored when importing, since the key is not known yet.

When "standard" or "groupwanted" is used, the terms in those
expressions also get pruned accordingly.

This does allow setting preferred content to "not (copies=1)" to make a
special remote into a "source" type of repository. Importing from it will
import all files. Then exporting to it will drop all files from it.

In the case of setting preferred content to "present", it's pruned on
import, so everything gets imported from it. Then on export, it's applied,
and everything in it is left on it, and no new content is exported to it.

Since the old behavior on these preferred content expressions was for
importtree to error out, there's no backwards compatability to worry about.
Except that sync/pull/etc will now import where before it errored out.
Annex/FileMatcher.hs
Annex/Import.hs
CHANGELOG
Logs/PreferredContent.hs
Utility/Matcher.hs
doc/git-annex-import.mdwn
doc/todo/import_tree_preferred_content_expansions.mdwn
doc/todo/import_tree_preferred_content_expansions/comment_1_df8ca8665e1dfc530a832b6d24d60ea4._comment [new file with mode: 0644]