Jump to content


How to delete Changelist form .NET API?

.NET API

  • Please log in to reply
2 replies to this topic

#1 Yoganand

Yoganand

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 25 June 2013 - 11:52 AM

I am developing tool which integrates all developer activities. For that I am integrating perforce as source control component. I am developing the tool in WPF with C#, so I am using perforce .NET API.

I achieved the creation of changelist and adding files to changelist, but I can't able to delete it.
my code as follows:

public bool DeleteChangeList(string paramEncryptedPassword, Changelist paramChngList)
{
try
{
using (P4Manager.p4Connection = P4Manager.p4Repository.Connection)
{

P4Manager.p4Connection.UserName = p4User;
P4Manager.p4Connection.Connect(null);
P4Manager.p4Credential = P4Manager.p4Connection.Login(SecurityManager.DecryptPassword(paramEncryptedPassword));
if (P4Manager.p4Credential != null)
{
if (p4Connection.Status == ConnectionStatus.Connected)
{

p4Repository.DeleteChangelist(paramChngList, new Options());
return true;
}
else
{
throw new Exception("Unable to connect P4 Server");
}
}
else return false;
}
}
catch (Exception ex)
{
throw ex;
}
}

I doubted that I am not sending proper options, but I donno exact parameters that i need to pass.
Please advise me with proper solution.

#2 Yoganand

Yoganand

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 27 June 2013 - 05:37 AM

Any of the folks in this community can help me?

#3 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 27 June 2013 - 03:55 PM

What error message are you getting? Are you moving the files out of the changelist before deleting it?





Also tagged with one or more of these keywords: .NET API

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users