Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用Mercurial.net执行推送?_C#_.net_Mercurial_Bitbucket_Bitbucket Api - Fatal编程技术网

C# 如何使用Mercurial.net执行推送?

C# 如何使用Mercurial.net执行推送?,c#,.net,mercurial,bitbucket,bitbucket-api,C#,.net,Mercurial,Bitbucket,Bitbucket Api,是否有任何示例演示如何使用Mercurial.net库推送到位于Bitbucket的远程Mercurial存储库 var workingDir = @"E:\testrepo"; var repository = new Mercurial.Repository(workingDir); repository.Clone(repourl, new Mercurial.CloneCommand().WithObserver(new Mercurial.DebugObserver()).WithUp

是否有任何示例演示如何使用Mercurial.net库推送到位于Bitbucket的远程Mercurial存储库

var workingDir = @"E:\testrepo";
var repository = new Mercurial.Repository(workingDir);
repository.Clone(repourl, new Mercurial.CloneCommand().WithObserver(new Mercurial.DebugObserver()).WithUpdate(false));
例如,我在本地repo中添加了一些txt文件,而不是:

repository.AddRemove(new AddRemoveCommand().WithIncludePattern("*.txt"));
repository.Commit("test commit");     
repository.Push(repourl); //How to push?
我想我必须创建一个PushCommand的新实例,并在Push()中使用它。但是如何设置PushCommand的参数呢?如何添加凭据


多谢各位

一般的建议是首先确定如何仅使用命令行客户机,即,为了推送和添加凭据,需要添加哪些
hg push XXX
选项?然后查看PushCommand类型中是否有允许此操作的内容,否则请使用generic
.AdditionalArguments
集合添加其他参数。是否可能没有此类hg push选项?每个向mercurial.ini文件添加凭据的代码都不能解决我的问题。是的,这是可能的。我不知道怎么做,但这是一个mercurial问题,不是mercurial.net问题。您可以查看“-config”选项,它可以用来指定配置项,就像它们在配置文件中一样。例如,
--config security.oauth=123456
会让人觉得您在配置文件的
[security]
部分中有
oauth=123456
。可能是你需要的。我得到的答案是,这些代币不是OAuth代币。它们是仅对团队帐户可用的简单基本身份验证令牌。此外,Bitbucket使用OAuth 1.0,它始终提供非常严格的安全性,因此在该令牌的帮助下,我无法执行推送操作,我必须找到另一种方法来解决我的问题。再次感谢你!