Source

ocaml-bitbucket / hg.ml

open Spotlib.Spot

let clone ?credential user package =
  let cred = match credential with
    | None -> ""
    | Some (user, pass) -> Printf.sprintf "%s:%s@" user pass
  in
  Unix.shell_command 
    (Printf.sprintf "hg clone http://%sbitbucket.org/%s/%s"
       cred
       user package)