0

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.

Piyush
  • 5,145
  • 16
  • 49
  • 71

1 Answers1

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";
}
webnoob
  • 15,747
  • 13
  • 83
  • 165
Piyush
  • 5,145
  • 16
  • 49
  • 71