From ec10906a7a219ce603f3a49e1c35250c17a77fc9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 7 Jan 2014 13:23:58 -0400 Subject: add DEBUG --- Remote/External.hs | 1 + Remote/External/Types.hs | 2 ++ debian/changelog | 2 +- doc/design/external_special_remote_protocol.mdwn | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Remote/External.hs b/Remote/External.hs index a91ea8697..f09589b25 100644 --- a/Remote/External.hs +++ b/Remote/External.hs @@ -242,6 +242,7 @@ handleRequest' lck external req mp responsehandler state <- fromMaybe "" <$> getRemoteState (externalUUID external) key send $ VALUE state + handleRemoteRequest (DEBUG msg) = liftIO $ debugM "external" msg handleRemoteRequest (VERSION _) = sendMessage lck external $ ERROR "too late to send VERSION" diff --git a/Remote/External/Types.hs b/Remote/External/Types.hs index 88c2126d7..4c62c2f84 100644 --- a/Remote/External/Types.hs +++ b/Remote/External/Types.hs @@ -172,6 +172,7 @@ data RemoteRequest | GETWANTED | SETSTATE Key String | GETSTATE Key + | DEBUG String deriving (Show) instance Receivable RemoteRequest where @@ -187,6 +188,7 @@ instance Receivable RemoteRequest where parseCommand "GETWANTED" = parse0 GETWANTED parseCommand "SETSTATE" = parse2 SETSTATE parseCommand "GETSTATE" = parse1 GETSTATE + parseCommand "DEBUG" = parse1 DEBUG parseCommand _ = parseFail -- Responses to RemoteRequest. diff --git a/debian/changelog b/debian/changelog index b17c8e344..8a973a29e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,7 @@ git-annex (5.20140107) unstable; urgency=medium * mirror: Support --all (and --unused). * external special remote protocol: Added GETUUID, GETWANTED, SETWANTED, - SETSTATE, GETSTATE. + SETSTATE, GETSTATE, DEBUG. * Windows: Fix bug in direct mode merge code that could cause files in subdirectories to go missing. * Windows: Avoid eating stdin when running ssh to add a authorized key, diff --git a/doc/design/external_special_remote_protocol.mdwn b/doc/design/external_special_remote_protocol.mdwn index 22a44b089..3f4cdcb73 100644 --- a/doc/design/external_special_remote_protocol.mdwn +++ b/doc/design/external_special_remote_protocol.mdwn @@ -233,6 +233,8 @@ in control. * `GETSTATE Key` Gets any state that has been stored for the key. (git-annex replies with VALUE followed by the state.) +* `DEBUG message` + Tells git-annex to display the message if --debug is enabled. ## general messages -- cgit v1.2.3