为什么 SharpSVN SvnClient.Export(...) 并不总是找到应该存在的文件?

发布于 2024-09-06 22:17:47 字数 566 浏览 5 评论 0原文

我正在使用 Export() 成员函数来获取特定修订版的文件,该文件有效,但由于某种原因在其他情况下无效。对于所有修改过的路径,它似乎都可以工作,但是对于该修订版中删除的文件和有时添加的文件,我得到异常,指出使用的 url 处没有文件。当我在这些路径上使用 TurtoiseSVN“将修订版复制到...”时,它工作正常,我只是想知道我是否遗漏了 SharpSVN 的某些内容,我想要所有修改文件修订版的完整版本。这是我的代码的总体思路:

if (logentry.ChangedPaths != null)
{
     foreach (SvnChangeItem svnChangeItem in logentry.ChangedPaths)
     {
         SvnExportArgs ex = new SvnExportArgs();
         ex.Revision = revisionNum;
         client.Export(SvnTarget.FromUri(new Uri(pathInsideRepo)), exportFile, ex);
     }
}

任何帮助或建议将不胜感激,谢谢。

I am using the Export() member function to obtain files at specific revisions which is working but for some reason in other cases it is not. For all the modified paths it seems to be working however with the deleted and sometimes added files in that revision I get the exception stating that there is no file at the url used. When I use the TurtoiseSVNs "Copy Revision to..." on these paths it works fine and I'm just wondering if I am missing something with SharpSVN, I would like the full versions at the revision of all the modified files. Heres the general idea of my code:

if (logentry.ChangedPaths != null)
{
     foreach (SvnChangeItem svnChangeItem in logentry.ChangedPaths)
     {
         SvnExportArgs ex = new SvnExportArgs();
         ex.Revision = revisionNum;
         client.Export(SvnTarget.FromUri(new Uri(pathInsideRepo)), exportFile, ex);
     }
}

Any help or suggestions would be appreciated, thanks.

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

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

发布评论

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

评论(2

っ左 2024-09-13 22:17:47

我发现使用 SvnUriTarget 而不仅仅是带有 SvnExportArgs 的 uri 可以让我获得正确的信息。不太清楚为什么它们不同,但它确实有效。

所以我使用的不是上面的导出:

client.Export(new SvnUriTarget(new Uri(pathInsideRepo), revisionNumber), exportFile, ex);

我找到的答案是 链接文本

I found that using a SvnUriTarget instead of just the uri with the SvnExportArgs allowed me to obtain the correct information. Not too sure on why they are different but it works.

so instead of the Export above I used:

client.Export(new SvnUriTarget(new Uri(pathInsideRepo), revisionNumber), exportFile, ex);

The answer I found was at link text

我爱人 2024-09-13 22:17:47

命令行客户端具有相同的行为。实际情况是指向文件的 URL 可以来来去去。这意味着指向现已删除的文件的 url 无效,除非您指定要使用旧的 url。这称为挂钩修订。

阅读 svnbook 中的挂钩修订

The command line client has the same behavior. What's going on is that the URLs pointing to a file can come and go. This means that the url pointing to a file that is now deleted is invalid, unless you specify you want to use an older url. This is called a peg revision.

Read up on peg revisions in the svnbook.

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