简体   繁体   中英

Creating patch using P4Eclipse plugin fails with “Perforce password (P4PASSWD) invalid or unset”

I searched and saw a couple of semi-relevant posts but none specifically for the P4Eclipse plugin in OS X. I have been able to create a patch from the command line, but I would like to get the plugin working since it will make my life much easier. Any help is appreciated.

I am trying to create a patch which will be used for a pre-commit code review. To do so I am right-clicking my project in the Package Explorer, then navigating through "Team > Create Patch" to open the Create Patch Wizard. I select an export location by providing a filesystem path, then select the files I'd like to include in my patch, then provide the path to the p4 executable. I click "Finish" and a "Patch failed" dialog comes up with multiple exceptions which are all the same and say "Patch Exception: Perforce password (P4PASSWD) invalid or unset."

This is the most helpful link I've found but I'm not sure exactly what it's saying. Thanks in advance.

I was having the same problem and by setting the command to point to a custom batch file and recording what was being passed to the command, I figured out what was happening. The problem is that the Eclipse plugin is passing the password to p4 command using the -P parameter and if perforce is set to disallow passwords in this way, you will see the "Perforce password (P4PASSWD) invalid or unset." error. If you login first using: p4 login it will create a ticket and you don't need to specify the password.

My fix was to create a simple batch file which simply passes on all parameters apart from -P and the password and select this in the Eclipse patch dialog instead of p4.exe:

p4-pw.cmd:

@SETLOCAL ENABLEEXTENSIONS
@SHIFT /7
@SHIFT /7
"C:\Program Files (x86)\Perforce\p4.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9

I was getting the same issue while trying to commit a new file but then I added P4PASSWD in system variables(Windows) with my password as the value. Restarted eclipse and it solved my problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM