C# 如何从SVN存储库中获取分支的顶级修订号?
我正在使用此代码片段从svn中查找顶级修订号,但我的页面没有响应。它只会继续搜索C# 如何从SVN存储库中获取分支的顶级修订号?,c#,visual-studio-2008,sharpsvn,C#,Visual Studio 2008,Sharpsvn,我正在使用此代码片段从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;
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存储库中的mybranch1
中获取最高版本号svn://india01/repository/branches/mybranch1
这里我们需要将SharpSvn Api dll引用添加到c#项目中。
及
获取顶级修订号的代码
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;`
您是否尝试使用http://而不是svn://协议?我是否可以在svn://协议处使用http://协议?是,例如,在运行网页后,它正在查找一个文件,如下所示:f:\qqn\sharpsvn dist\src\sharpsvn\svnclientargs.cpp将协议从SVN://更改为Http://后,显示以下错误
http://india01/repository/branches/mybranch1“:无法连接到服务器
`