improve display when lockcontent fails

/dev/null stderr; ssh is still able to display a password prompt
despite this

Show some messages so the user knows it's locking a remote, and
knows if that locking failed.
This commit is contained in:
Joey Hess 2015-10-09 17:21:02 -04:00
parent 3b89d5a20c
commit 6145f905e0
Failed to extract signature
3 changed files with 40 additions and 22 deletions

View file

@ -13,20 +13,23 @@ import Common.Annex
import qualified Git
import qualified Types.Remote as Remote
class Checkable a where
descCheckable :: a -> String
class Describable a where
describe :: a -> String
instance Checkable Git.Repo where
descCheckable = Git.repoDescribe
instance Describable Git.Repo where
describe = Git.repoDescribe
instance Checkable (Remote.RemoteA a) where
descCheckable = Remote.name
instance Describable (Remote.RemoteA a) where
describe = Remote.name
instance Checkable String where
descCheckable = id
instance Describable String where
describe = id
showChecking :: Checkable a => a -> Annex ()
showChecking v = showAction $ "checking " ++ descCheckable v
showChecking :: Describable a => a -> Annex ()
showChecking v = showAction $ "checking " ++ describe v
cantCheck :: Checkable a => a -> e
cantCheck v = error $ "unable to check " ++ descCheckable v
cantCheck :: Describable a => a -> e
cantCheck v = error $ "unable to check " ++ describe v
showLocking :: Describable a => a -> Annex ()
showLocking v = showAction $ "locking " ++ describe v