2017-03-28 48 views
0

我试图用拉库Mercurial.NET从水银代码更改。我得到一个授权例外,并没有获得任何结果,下面是代码。Mercurial.Net pullCommand使用授权

Repository repository = new Repository(@"D:\sandeep\work\20Dec2016"); 

PullCommand pullcommand = new PullCommand(); 
repository.Pull(pullcommand); 

这是我的代码,有没有办法,我可以指定我的凭据(用户名和密码)进行身份验证,以便拉取最近的更改?

回答

0

我可以用下面的代码实现的结果和拉塞五卡尔森

Repository repository = new Repository(@"D:\sandeep\Work\20Dec2016"); 
pullCommand.WithConfigurationOverride("auth", "x.prefix", "*"); 
pullCommand.WithConfigurationOverride("auth", "x.username", "ssk"); 
pullCommand.WithConfigurationOverride("auth", "x.password", "ssk"); 
repository.Pull(pullCommand); 
帮助