i m trying to cheack a branch name exists in Svn server or not in svn server using SharpSVN API in c#.net. can i do it? or is there other way to do it in C# except thr command prompt. i have tried thr cmd but it's working in local PC but not after publishing it in IIS server. pls suggest me any sln.
Asked
Active
Viewed 1,144 times
1 Answers
1
we can use below code for checking the branch existence in svn server like below
try
{
SvnClient clientN = new SvnClient();
clientN.Authentication.Clear();//clear a previous authentication
clientN.Authentication.DefaultCredentials = new System.Net.NetworkCredential("pkumar", "pkumar");
Collection<SvnListEventArgs> list;
if (clientN.GetList("svn://india01/Repo/branches/xyz", out list))//this will chk the branch exist or not. if not it will move to catch block
{
lblMsg.text = "branch exist";
//do what you want here
}
}
catch(SvnFileSystemException sfse)
{
lblMsg.text = "branch does not exist";
}
-
1`clientN.Info()` would be a cheaper call, as it doesn't have to fetch all the directory contents of the branch. – Sander Rijken May 14 '13 at 18:37