/Examples/020 - Custom command - hg serve.linq

# · Unknown · 32 lines · 29 code · 3 blank · 0 comment · 0 complexity · 76a46a36bebbc27d4cc538d56bc14dcf MD5 · raw file

  1. <Query Kind="Program">
  2. <Reference Relative="..\Mercurial.Net\bin\Debug\Mercurial.Net.dll">C:\dev\vs.net\Mercurial.Net\Mercurial.Net\bin\Debug\Mercurial.Net.dll</Reference>
  3. <Namespace>Mercurial</Namespace>
  4. <Namespace>Mercurial.Extensions.Churn</Namespace>
  5. </Query>
  6. // *****************************************************
  7. // *
  8. // * This example starts the Mercurial web server
  9. // * for the Mercurial.Net repository
  10. // *
  11. // * NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
  12. // *
  13. // * This demo spawns a process that DOES NOT terminate
  14. // * by itself. You will have to open Task Manager,
  15. // * find the "hg.exe" process that is running,
  16. // * and terminate it when you're done with the demo.
  17. // *
  18. // * NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
  19. // *
  20. // ***********************
  21. void Main()
  22. {
  23. var repoPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Util.CurrentQueryPath), ".."));
  24. var repo = new Repository(repoPath);
  25. repo.Execute(new CustomCommand("serve")
  26. .WithObserver(new DebugObserver())
  27. .WithAdditionalArgument("--port 8123")
  28. .WithAdditionalArgument("--verbose"));
  29. }