Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#34 incorrect command line parameters for Perforce interface

closed-fixed
nobody
None
5
2006-04-19
2006-03-04
No

I believe that I have found the solution for a problem
with CodeStriker's Perforce interface that others in
the mailing list have noticed. (see mailing list,
subject is "Problems retrieving files from Perforce"
dated 2005-09-26).

The problem is that CodeStriker isn't interacting with
Perforce. That is, it isn't successful in retrieving
the files from the server when showing the originals,
or any of the lines other then what was included in the
uploaded diff.

The cause of the problem is that CodeStriker using the
wrong command. It's currently using the following
perforce command:
p4 -p {host}:{port} \ -u {username}
-c {client_workspace_name}
print -q {filename}#{revision_number}
With this command, the user's password is expected to
be retrieved from the environment. However, if the P4
server's security level has been set to 2 or above, the
p4 command line client completly ignores this password
location. With this security setting, the password
needs to be stated on the command line, especially for
automated (or non-human users).

Also, the {client_workspace_name} really isn't used.

Therefore, a solution for this problem is to use the
following command line:
p4 -p {host}:{port} \ -u {username}
-P {password}
print -q {filename}#{revision_number}
The above command will work for all security levels.

As a test, I modified line 35 of
lib/Codestriker/Repository/Perforce.pm and replaced "
-c " with " -P ". Additionally, in the
codestriker.conf file, I used the following configuration:
@valid_repositories =
(
'perforce:userid:password@host:port'
);
(i.e.: I used the spot that used to hold the client
workspace name and replaced it with the user's password.)

This solved all my problems.

Hope to see this fix in 1.9.2!

Thanks

JDG

Discussion

  • David Sitsky
    David Sitsky
    2006-04-19

    Logged In: YES
    user_id=208928

    Hi,

    Thanks for your message. I have incorporated your change,
    and have released 1.9.2-alpha-4. Can you please download
    this release and let me know if this fixes your problem?
    Thanks.

     
  • David Sitsky
    David Sitsky
    2006-04-19

    • status: open --> closed-fixed