PageRenderTime 20ms CodeModel.GetById 17ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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// *
 9// * This example starts the Mercurial web server
10// * for the Mercurial.Net repository
11// *
12// * NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
13// *
14// * This demo spawns a process that DOES NOT terminate
15// * by itself. You will have to open Task Manager,
16// * find the "hg.exe" process that is running,
17// * and terminate it when you're done with the demo.
18// *
19// * NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
20// *
21// ***********************
22
23void Main()
24{
25	var repoPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Util.CurrentQueryPath), ".."));
26    var repo = new Repository(repoPath);
27
28    repo.Execute(new CustomCommand("serve")
29        .WithObserver(new DebugObserver())
30        .WithAdditionalArgument("--port 8123")
31        .WithAdditionalArgument("--verbose"));
32}