使用 SharpSVN 检查文件是否在存储库中
如何检查文件是否已在存储库中(或不在存储库中),以便确定在签入之前是否需要先“添加”它? (根据记录,我已经签入工作,但是当我尝试签入尚未添加到存储库的文件时出现异常。)
How do I check if a file is already in a repository (or NOT in the repository) so I can determine whether I need to 'add' it first before doing the check in? (For the record, I have check-in working, but I get an exception when I try to check in a file that has not yet been added to the repository.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信您可以使用 SvnClient.GetRepositoryIdFromUri 来验证特定文件是否存在。如果该方法返回 false,那么您需要将该文件添加到存储库。
I believe you can use SvnClient.GetRepositoryIdFromUri to verify that a specific file exists. If that method returns false, then you'll need to Add the file to the repository.
虽然 SvnClient.GetRepositoryIdFromUri 可能有效(我无法使其正常工作),但我确实 在其他地方找到答案,这确实有效(这在我最初的搜索中没有出现,所以对重复的问题感到抱歉)。
While SvnClient.GetRepositoryIdFromUri may work (I wasn't able to get it working), I did find an answer elsewhere on SO which did work (this didn't come up in my original search, so sorry about the duplicate question).