如何使用SharpSvn获取存储库的所有分支?
我正在尝试使用 SharpSvn 获取存储库的所有分支,但我找不到任何方法可以做到这一点。
是否可以使用 SharpSvn 获取所有分支?
I'm trying to get all branches of repository by using SharpSvn but I can not find any method can do it.
Is it possible to get all branches by using SharpSvn?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为 Matt Z 的方向是正确的,但该代码无法编译。这是一个调整后的版本,应与最新版本的 SharpSVN(截至 2015 年 12 月)兼容。
I think Matt Z was on the right track, but that code doesn't compile. Here is an adjusted version that should work with the latest version of SharpSVN (as of Dec 2015).
我对 SharpSVN 一无所知,但 Subversion 中的分支只是目录树——它们没有什么特别的。
如果您的存储库遵循具有三个顶级目录(trunk/branches/tags/)的典型布局,您只需查看 /branches 目录即可并排获取所有分支。
I don't know anything about SharpSVN, but branches in Subversion are just directory trees -- there's nothing special about them.
If your repository follows they typical layout with three top-level directories (trunk/ branches/ tags/), you can just check out the /branches directory to get all the branches side-by-side.
SharpSvn.SvnClient 类有一个工作得非常好的 GetList() 函数:
一旦获得集合,您就可以获得该位置的每个项目的路径。您还可以使用 Entry 对象来获取有关每个项目的信息,包括它是目录还是文件、上次修改时间等。
The SharpSvn.SvnClient class has a GetList() function that works really well:
Once you have the collection, you can get the path of each item at the location. You can also use the Entry object to get information concerning each item, including whether it is a directory or a file, when it was last modified, etc.