[darcs-users] [patch350] Add serve.pl to contrib (and 1 more)

Alexey Levan bugs at darcs.net
Tue Aug 17 10:45:49 UTC 2010


Alexey Levan <exlevan at gmail.com> added the comment:

(just realized that mail wasn't sent to BTS, sorry for duplicate)

>> +serveCmd :: [DarcsFlag] -> [String] -> IO ()
>> +serveCmd opts _ = do
>> +  setProgressMode False
>> +  withRepoIO opts "." $ \rio -> do
>> +    c <- try getLine
>> +    case c of
>> +      Left (e :: IOException) -> print404 $ show e
>> +      Right x -> print404 $ "darcs serve error: Unknown command " ++ x
>> +
>> +print404 :: String -> IO ()
>> +print404 x = putStr $ unlines
>> +  [ "Status: 404 Not Found"
>> +  , "Content-Type: text/plain"
>> +  , ""
>> +  , x
>> +  ]
>
> What I don't understand is what is this "darcs serve" supposed to be
> doing. Whatever that is and however I look at this code, all I can see
> is "error out with 404 no matter what".
>
> How is this ever going to work?

It's stub for smart server, and is meant to be extended to support
vsrious commands. Currently the only command send to server is "ping",
and I should have added a line to support it.  However, that wouldn't
make a difference as for everyting else smart server should fall back
to old repository interface.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch350>
__________________________________


More information about the darcs-users mailing list