add DEBUG

This commit is contained in:
Joey Hess 2014-01-07 13:23:58 -04:00
parent d8e8128b50
commit 5e23dfabd6
4 changed files with 6 additions and 1 deletions

View file

@ -242,6 +242,7 @@ handleRequest' lck external req mp responsehandler
state <- fromMaybe "" state <- fromMaybe ""
<$> getRemoteState (externalUUID external) key <$> getRemoteState (externalUUID external) key
send $ VALUE state send $ VALUE state
handleRemoteRequest (DEBUG msg) = liftIO $ debugM "external" msg
handleRemoteRequest (VERSION _) = handleRemoteRequest (VERSION _) =
sendMessage lck external $ ERROR "too late to send VERSION" sendMessage lck external $ ERROR "too late to send VERSION"

View file

@ -172,6 +172,7 @@ data RemoteRequest
| GETWANTED | GETWANTED
| SETSTATE Key String | SETSTATE Key String
| GETSTATE Key | GETSTATE Key
| DEBUG String
deriving (Show) deriving (Show)
instance Receivable RemoteRequest where instance Receivable RemoteRequest where
@ -187,6 +188,7 @@ instance Receivable RemoteRequest where
parseCommand "GETWANTED" = parse0 GETWANTED parseCommand "GETWANTED" = parse0 GETWANTED
parseCommand "SETSTATE" = parse2 SETSTATE parseCommand "SETSTATE" = parse2 SETSTATE
parseCommand "GETSTATE" = parse1 GETSTATE parseCommand "GETSTATE" = parse1 GETSTATE
parseCommand "DEBUG" = parse1 DEBUG
parseCommand _ = parseFail parseCommand _ = parseFail
-- Responses to RemoteRequest. -- Responses to RemoteRequest.

2
debian/changelog vendored
View file

@ -2,7 +2,7 @@ git-annex (5.20140107) unstable; urgency=medium
* mirror: Support --all (and --unused). * mirror: Support --all (and --unused).
* external special remote protocol: Added GETUUID, GETWANTED, SETWANTED, * 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 * Windows: Fix bug in direct mode merge code that could cause files
in subdirectories to go missing. in subdirectories to go missing.
* Windows: Avoid eating stdin when running ssh to add a authorized key, * Windows: Avoid eating stdin when running ssh to add a authorized key,

View file

@ -233,6 +233,8 @@ in control.
* `GETSTATE Key` * `GETSTATE Key`
Gets any state that has been stored for the key. Gets any state that has been stored for the key.
(git-annex replies with VALUE followed by the state.) (git-annex replies with VALUE followed by the state.)
* `DEBUG message`
Tells git-annex to display the message if --debug is enabled.
## general messages ## general messages