Sharpsvn 并未指定所有必需的修订

发布于 2024-07-10 05:17:41 字数 1383 浏览 8 评论 0原文

我正在尝试使用 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
}
// ...

I am attempting to do a merge using SharpSVN. A bit of research and I have learned the SharpSVN supports the MergDiff function, however when I attempt the code as listed below I am getting an error message of not all required revisions are specified.

Thanks

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
}
// ...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

゛清羽墨安 2024-07-17 05:17:41

正如 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 修订版本,而是必须显式使用 head 修订版本。

此问题在 http://sharpsvn.net/daily/ 上提供的当前每日构建中已修复

As noted on the SharpSvn user list the following example would have resolved the
missing revisions:

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));
 }

The error was that the passed Uris didn't default to the HEAD revision, but had to use the head revision explicitly.

This is fixed in the current daily build available on http://sharpsvn.net/daily/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文