improve messages around export conflicts

When an export conflict prevents accessing a special remote, be clearer
about what the problem is and how to resolve it.

This commit was sponsored by Trenton Cronholm on Patreon.
This commit is contained in:
Joey Hess 2018-11-13 15:50:06 -04:00
parent 6a0618f7b3
commit d65df7ab21
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 64 additions and 24 deletions

View file

@ -9,10 +9,12 @@ module Annex.Export where
import Annex
import Annex.CatFile
import Types
import Types.Key
import Types.Remote
import qualified Git
import qualified Types.Remote as Remote
import Config
import Messages
import qualified Data.Map as M
import Control.Applicative
@ -41,5 +43,11 @@ exportKey sha = mk <$> catKey sha
, keyChunkNum = Nothing
}
exportTree :: RemoteConfig -> Bool
exportTree :: Remote.RemoteConfig -> Bool
exportTree c = fromMaybe False $ yesNo =<< M.lookup "exporttree" c
warnExportConflict :: Remote -> Annex ()
warnExportConflict r = toplevelWarning True $
"Export conflict detected. Different trees have been exported to " ++
Remote.name r ++
". Use git-annex export to resolve this conflict."