我正在尝试使用SharpSVN进行合并。一些研究和我已经了解到SharpSVN支持MergDiff函数,但是当我尝试下面列出的代码时,我收到的错误消息是并未指定所有必需的修订版。
谢谢
try
{
SvnCheckOutArgs argsSVNCheckout = new SvnCheckOutArgs();
SvnUpdateResult result;
SvnTarget _rootSVNTarget = null; // = new SvnTarget();
string serverUrl = "http://svn.snaffpaw.com:8080/CPM Creator/";
// The Subversion target to run log against
SvnTarget target = null;
// Attempt to create an SvnTarget by parsing the targetPath
if (string.IsNullOrEmpty(targetPath) ||
!SvnTarget.TryParse(targetPath, out target))
if (string.IsNullOrEmpty(serverUrl) || (!SvnTarget.TryParse(serverUrl,out _rootSVNTarget)))
//SvnStatusArgs argSVN = new SvnStatusArgs();
//argSVN.RetrieveRemoteStatus = true;
//Collection<SvnStatusEventArgs> infos;
//bool isChecked = client.GetStatus(targetPath, argSVN, out infos);
// Attempt to create an SvnTarget by parsing the targetPath
if (string.IsNullOrEmpty(targetPath) ||
!SvnTarget.TryParse(targetPath, out target))
if (string.IsNullOrEmpty(serverUrl) || !SvnTarget.TryParse(serverUrl, out _rootSVNTarget))
client.Authentication.DefaultCredentials = new NetworkCredential("guest", "guestpwd");
client.DiffMerge(targetPath, _rootSVNTarget, target); //<<<-- errors here
}
// ...
答案 0 :(得分:1)
如SharpSvn用户列表中所述,以下示例将解决该问题 缺少修订:
using (SvnClient client = new SvnClient())
{
client.DiffMerge(
"CHANGES", // Target to merge to
new SvnUriTarget(new Uri("http://svn.collab.net/repos/svn/tags/1.5.0/CHANGES")), SvnRevision.Head),
new SvnUriTarget(new Uri("http://svn.collab.net/repos/svn/tags/1.5.5/CHANGES"), SvnRevision.Head));
}
错误是传递的Uris没有默认为HEAD修订版,但必须明确使用头版本。
上提供的当前每日版本中修复