Questions tagged [p4api.net]

P4API.NET is Perforce's own .NET API.

P4API.NET is the .NET API for , released by Perforce themselves.

It is distinct from which is a previous API from a third party.

The API documentation is unfortunately quite sparse.

56 questions
1
vote
1 answer

Creating P4Server vs. Server using p4 api .NET

My end goal is to create a perforce server in which I can log in, create a workspace, and checkin/checkout. I am going through the p4 api and trying to figure out how to do this, and I am unsure on how to make the perforce server. There is a…
JuiceZBox
  • 111
  • 1
  • 8
1
vote
1 answer

open a mysession in perforce using p4api.net

i tried to open my session with p4 api .net but the command is not working. ServerAddress adr = new ServerAddress(p.conStr); Server serv = new Server(adr); P4Server ser = new P4Server(p.conStr, p.user, p.password, p.ws_client); Connection con =…
gasroot
  • 515
  • 3
  • 15
1
vote
2 answers

P4API.NET equivalence of "p4 files" command to find files in depot

I'm using the Perforce .NET APIs P4API.NET library and wonder if there is a "p4 files" command line equivalence that I can call to return a listing of files (such as *.cpp) in my //depot? Thanks in advance!
Kevin
  • 515
  • 4
  • 11
  • 22
0
votes
1 answer

Perforce P4 .NET API GetFileMetaData() returns NullReferenceException

I ran a P4api.net sample C# code downloaded from P4 to traverse a local P4 /depot repository that I have. When the sample code attempts to read the //depot/subdirA for sub directories and files, the call to API function GetFileMetaData() hits a…
Kevin
  • 515
  • 4
  • 11
  • 22
0
votes
1 answer

How do I use Repository.GetFileContents() to get file @Label in p4api.net

Trying this: var path = $"{filePath}@{fileLabel}"; var dloc = new DepotPath(path); var opts = new GetFileContentsCmdOptions(GetFileContentsCmdFlags.Suppress, null); var file = p4repo.GetFileContents(opts, dloc); I always get an empty file back even…
0
votes
1 answer

Looking to get P4PORT from p4api.net

It seems the call is Connection.GetP4EnvironmentVar( "P4PORT" ), but to be able to interrogate a connection I need to connect to a server and hence need a P4PORT in advance, and so have a chicken and egg situation. What is the best practice in this…
0
votes
1 answer

How can I perform a Perforce UNDO operation using p4Api in c#

If I was calling this from the command line, I would call (for example): p4 undo //depot/myfile.txt#2 How can I accomplish the same thing using the perforce API? There appears to be no api for UNDO.
0
votes
1 answer

Can p4api.net connect to a (local) p4 personal server?

Can p4api.net connect to a (local) p4 personal server? I started a personal server with p4 -u itsame -d c:\perforce\local -c itsameClient clone -m 1 -v -p p4server:somePort -f //repo/path/... It works - it can use it in p4v or from the command like…
Matt
  • 25,943
  • 66
  • 198
  • 303
0
votes
1 answer

How to get Perforce (P4Api.net) Workspace Path

var P4USER = p4Config.P4USER; var P4PORT = p4Config.P4PORT; var P4CLIENT = p4Config.P4CLIENT; var P4PASSWD = p4Config.P4PASSWD; Perforce.P4.Server srv = new Perforce.P4.Server(new ServerAddress(P4PORT)); Perforce.P4.Repository p4 = new…
TimChang
  • 2,249
  • 13
  • 25
0
votes
1 answer

Extracting the list of CL that matches a certain condition Failing

I am trying to extract a list of CL in a depot that matches a certain description and i dont have a success. below is my code and the error i get /* ALL MY IMPORTS */ /* MY PERFORCE AND HTTP modules using grapes */ /* SERVER LOGIN CONDITIONS…
DevOops
  • 276
  • 2
  • 8
  • 20
0
votes
1 answer

Trouble with Groovy to print Changelist description

I want to print the Changelist description of each changelist for a Particular stream , but the description that i am getting as output is limited to certain set of characters changelistList.each { IChangelistSummary cl -> println…
DevOops
  • 276
  • 2
  • 8
  • 20
0
votes
1 answer

How to use p4api.net to get pending changelist number for given submitted changelist

Changelist during submission might be re-enumerated. I need to get old changelist number for already submitted changelist. I can do that using p4: p4 -Ztag -F%oldChange% describe 1234 I want to do that using p4api.net but I cannot find the way. Do…
Bartek Kobyłecki
  • 2,365
  • 14
  • 24
0
votes
1 answer

How to get local workspace mapping using p4api

All I want to know is the location of all the work-spaces which are created on user's local machine using p4api. e.g. If user has mapped 'MyProject' workspace at location: "D:\LocalPerforce\MyWS" then I want to know this path ->…
deathrace
  • 908
  • 4
  • 22
  • 48
0
votes
1 answer

p4api.net.dll used in creating a webapi

So I've created this web app that will make a call to a server to get information about branches, streams, changset info, etc. I'm working on creating the api using p4api.net.dll. I've downloaded and extracted it and followed the instruction on…
itsNino91
  • 129
  • 15
0
votes
1 answer

p4 revert files not working with -a option using p4api.net method

Trying to revert files in a changelist using -a option in p4api.net method. It used to work for me but now am getting exception with below message. Also p4 edit and p4 revert with -c option works fine but p4 revert with -a option throws below…
test
  • 91
  • 11