gpt4 book ai didi

c# - 如何从 SVN 存储库获取分支的最高修订号?

转载 作者:太空宇宙 更新时间:2023-11-03 13:52:12 24 4
gpt4 key购买 nike

我正在使用此代码片段从 svn 中查找最高修订号,但我的页面没有响应。它只继续搜索

using (SvnClient client = new SvnClient())
{
SvnInfoEventArgs info;
Uri repos = new Uri("svn://india01/repository/branches/mybranch1");
client.GetInfo(repos, out info);
lblMsg.Visible = true;
lblMsg.Text = (string.Format("The last revision of {0} is {1}",
repos, info.Revision));
}

我想从位于 svn://india01/repository/branches/mybranch1< 的 svn 存储库中的 mybranch1 获取最高修订号.

最佳答案

这里我们需要将 SharpSvn Api dll 引用添加到 c# 项目中。 link for SharpSvn package downloadthen follow the below link for example获取最高修订号的代码

SvnInfoEventArgs statuses;
SvnClient client = new SvnClient();
client.Authentication.Clear();//clear a previous authentication
client.Authentication.DefaultCredentials =
new System.Net.NetworkCredential("usr", "pass");
client.GetInfo("svn://india00/Repo/branches/xyz", out statuses);
int LastRevision = (int)statuses.LastChangeRevision;`

添加引用为

using SharpSvn;
using System.Collections.Generic;
using System.Collections.ObjectModel;`

关于c# - 如何从 SVN 存储库获取分支的最高修订号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13416606/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com