improve messages around export/import conflicts
A conflict can be caused by either export or import when the remote supports both.
This commit is contained in:
parent
b51eceb326
commit
37041b629d
3 changed files with 11 additions and 7 deletions
|
@ -42,8 +42,12 @@ exportKey sha = mk <$> catKey sha
|
|||
, keyChunkNum = Nothing
|
||||
}
|
||||
|
||||
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."
|
||||
warnExportImportConflict :: Remote -> Annex ()
|
||||
warnExportImportConflict r = do
|
||||
ops <- Remote.isImportSupported r >>= return . \case
|
||||
True -> "exported to and/or imported from"
|
||||
False -> "exported to"
|
||||
toplevelWarning True $
|
||||
"Conflict detected. Different trees have been " ++ ops ++
|
||||
Remote.name r ++
|
||||
". Use git-annex export to resolve this conflict."
|
||||
|
|
|
@ -156,7 +156,7 @@ changeExport r db new = do
|
|||
startMoveFromTempName r db ek newf
|
||||
_ -> stop
|
||||
ts -> do
|
||||
warning "Export conflict detected. Different trees have been exported to the same special remote. Resolving.."
|
||||
warning "Resolving export conflict.."
|
||||
forM_ ts $ \oldtreesha -> do
|
||||
-- Unexport both the srcsha and the dstsha,
|
||||
-- because the wrong content may have
|
||||
|
|
|
@ -755,7 +755,7 @@ seekExportContent o rs (currbranch, _) = or <$> forM rs go
|
|||
fillexport _ _ [] _ = return False
|
||||
fillexport r db (t:[]) mtbcommitsha = Command.Export.fillExport r db t mtbcommitsha
|
||||
fillexport r _ _ _ = do
|
||||
warnExportConflict r
|
||||
warnExportImportConflict r
|
||||
return False
|
||||
|
||||
cleanupLocal :: CurrBranch -> CommandStart
|
||||
|
|
Loading…
Reference in a new issue