如何使用 SharpSvn 区分 Svn 存储库

发布于 2024-08-28 15:02:30 字数 485 浏览 7 评论 0原文

我的问题非常简单,使用 SharpSvn Api,它也应该很容易。这是我所做的:

path = "c:\project";
using (SvnLookClient client = new SvnLookClient())
{
    SvnLookOrigin o = new SvnLookOrigin(path);
    Collection<SvnChangedEventArgs> changeList;
    client.GetChanged(o, out changeList); // <-- Exception
}

当我调用 GetChanged 时,出现异常:

无法打开文件“c:\project\format”:系统找不到指定的文件。

那么,也许我缺少什么?或者也许这不是找出本地存储库中修改的文件和文件夹列表的正确方法?

提前致谢。

My question is quite simple and with the SharpSvn Api, it should be easy as well. Here what I did:

path = "c:\project";
using (SvnLookClient client = new SvnLookClient())
{
    SvnLookOrigin o = new SvnLookOrigin(path);
    Collection<SvnChangedEventArgs> changeList;
    client.GetChanged(o, out changeList); // <-- Exception
}

and when I call the GetChanged, I get an exception:

Can't open file 'c:\project\format': The system cannot find the file specified.

So, Maybe there is something I'm missing? Or maybe it's not the right way to do find out the list of files and folders that were modified in the local repository?

Thanks in advance.

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

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

发布评论

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

评论(2

孤芳又自赏 2024-09-04 15:02:30

SharpSvn 中的 SvnLookClient 类相当于“svnlook”控制台应用程序。它是一个低级工具,使存储库挂钩能够使用直接文件访问来查看存储库的特定事务。

您可能希望使用 SvnClient 类来查看workingCopy 及其 Status(),或者在某些情况下更简单的 GetStatus() 函数来查看发生了什么变化。

The SvnLookClient class in SharpSvn is the equivalent to the 'svnlook' console application. It is a low level tool that enables repository hooks to look into specific transactions of a repository using direct file access.

You probably want to use the SvnClient class to look at a WorkingCopy and most likely its Status() or in some cases simpler GetStatus() function to see what changed.

新人笑 2024-09-04 15:02:30

SvnLookOrigin 构造函数想要的路径实际上是:

path = "c:\project\.svn\";

也就是说,它想要特殊的“.svn”目录,而不仅仅是签出源的根目录。

虽然你可能确实想听 Bert 的讲话并做一些类似的事情:

path = "c:\project";
using (SvnLookClient client = new SvnLookClient())
{
    SvnLookOrigin o = new SvnLookOrigin(path);
    Collection<SvnChangedEventArgs> changeList;
    client.GetStatus(o, out changeList); // Should now return the differences between this working copy and the remote status.
}

The path that the SvnLookOrigin constructor wants is actually:

path = "c:\project\.svn\";

That is, it wants that special ".svn" directory not just the root of where the source is checked out to.

Although you probably do want to listen to Bert and do something like:

path = "c:\project";
using (SvnLookClient client = new SvnLookClient())
{
    SvnLookOrigin o = new SvnLookOrigin(path);
    Collection<SvnChangedEventArgs> changeList;
    client.GetStatus(o, out changeList); // Should now return the differences between this working copy and the remote status.
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文