Indra
Indra

Reputation: 1

How to fix P4 client errors after integrating p4python in code?

I have aligned my client perforce and view perforce with all the files and links. Though, while connected through my p4python code base, then it's not able to get/ fetch the updated paths in the view. Hence while integrating some code from perforce location to my sandbox location it's erroring out:

[Warning]: '/local_source_code_filename' - file(s) not in client view.'

or if I am using perforce path, then it's giving below error:

error: '//perforce_code_path' must refer to client

It throws the below exception:

P4.P4Exception: [P4#run] Warnings during command execution( "p4 integrate '//source_code' '//sandbox')

When I run the command (p4 integrate '//source_code' '//sandbox') through CLI from the same location, then it's integrating the expected file.

Through Code: p4.run_integrate(perforce_file, sandbox_file) << Not Working

Through CLI: p4 integrate '//source_code' '//sandbox' << Working

p4python shall not error out and shall integrate the expected files from perforce location.

Upvotes: 0

Views: 1488

Answers (1)

Samwise
Samwise

Reputation: 71454

It sounds like there's a typo (or bungled string handling) in your script. It's going to be impossible for anyone to point out where it is since all of the potentially useful debugging information is either absent or obfuscated.

P4.P4Exception: [P4#run] Warnings during command execution( "p4 integrate '//source_code' '//sandbox')

When I run the command(p4 integrate '//source_code' '//sandbox') through CLI from the same location, then it's integrating the expected file.

This can't possibly be correct, because //source_code is not a valid Perforce file path. Whatever command you think your script is running is not what you're running at the command line. Or possibly the command is the same, but the environment is completely different.

error: '//perforce_code_path' must refer to client

This error should include a client name. If it looks like the wrong name, you didn't set P4CLIENT. If you weren't trying to use a client-syntax path, this error means that you provided an invalid depot path.

Upvotes: 2

Related Questions