add exportedtree to info

info: When used with an exporttree remote, includes an "exportedtree" info,
which is the tree last exported to the remote. During an export conflict,
multiple values will be listed.

This commit was sponsored by John Pellman on Patreon.
This commit is contained in:
Joey Hess 2018-12-03 14:15:15 -04:00
parent 3ad7b7927e
commit b8f9dea27d
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 32 additions and 1 deletions

View file

@ -18,6 +18,8 @@ import Remote.Helper.Encryptable (isEncrypted)
import Database.Export
import Annex.Export
import Config
import Git.Types (fromRef)
import Logs.Export
import qualified Data.Map as M
import Control.Concurrent.STM
@ -186,8 +188,11 @@ adjustExportable r = case M.lookup "exporttree" (config r) of
, checkPresentCheap = False
, mkUnavailable = return Nothing
, getInfo = do
ts <- map (\t -> ("exportedtree", fromRef t) )
. map exportedTreeish
<$> getExport (uuid r)
is <- getInfo r
return (is++[("export", "yes")])
return (is++[("export", "yes")]++ts)
}
retrieveKeyFileFromExport getexportlocs exportinconflict k _af dest p = unVerified $
if maybe False (isJust . verifyKeyContent) (maybeLookupBackendVariety (keyVariety k))