Perforce Plugin - Trouble with environment in execution of job?

Aleix Pol aleixpol at kde.org
Tue Nov 23 20:41:04 UTC 2010


On Tue, Nov 23, 2010 at 9:25 PM, Morten Volden <mvolden2 at gmail.com> wrote:

> Hi all
>
> I put the plug-in at:
>
> http://gitorious.org/perforce-plugin/perforce-plugin
>
> For now it doesn't do much - except "edit",  "revert" and show up in the
> plugin list
>
> The usual warnings about not leaving children and kittens unattended with
> the plug-in applies.
>
> Regards
>
> Morten
>
> 2010/11/17 Morten Volden <mvolden2 at gmail.com>
>
>
>>
>> 2010/11/16 Aleix Pol <aleixpol at kde.org>
>>
>> On Mon, Nov 15, 2010 at 10:09 PM, Morten Volden <mvolden2 at gmail.com>wrote:
>>>
>>>> Hi All
>>>>
>>>> A little while ago I asked on this list about the status of a Perforce
>>>> plug-in for Kdevelop4. Since no one replied I take it that development on
>>>> such a plug-in is not going on at the moment. So I started writing a
>>>> perforce plug-in.
>>>>
>>>> My current status in short:
>>>> I have the plug-in loaded, and it will show in the context menu - So far
>>>> so good.
>>>>
>>>> The plugin overrides pure virtual functions in
>>>> ICentralizedVersionControl and in IBasicVersionControl. E.g. for the edit
>>>> function I do something like this:
>>>>
>>>> KDevelop::VcsJob* perforceplugin::edit(const KUrl& localLocation)
>>>> {
>>>>     QFileInfo fsObject(localLocation.toLocalFile());
>>>>     QString filename(fsObject.fileName());
>>>>     QDir path(fsObject.dir());
>>>>
>>>>     DVcsJob* job = new DVcsJob(path, this,
>>>> KDevelop::OutputJob::Verbose);
>>>>     if(job)
>>>>         kDebug() << "After Creating job, the path is " << path.path() <<
>>>> "and the filename is " << filename << "... And the jobs dir is: " <<
>>>> job->directory().path();
>>>>     *job << "p4" << "edit" << filename;
>>>>     return job;
>>>> }
>>>>
>>>> When Trying to edit one of the files in my perforce testbed the kDebug
>>>> gives me the following output:
>>>>
>>>> perforceplugin::edit: After Creating job, the path is
>>>> "/home/mvo/testbed/perforcetest" and the filename is  "main.cpp" ... And the
>>>> jobs dir is:  "/home/mvo/testbed/perforcetest"
>>>>
>>>> Which leads me to believe the DVcsJob I am creating has the correct CWD
>>>> (i.e. /home/mvo/testbed/perforcetest ). However, the command issued by the
>>>> job fails for reasons that escape me (as can be seen in the screenshot
>>>> below).
>>>>
>>>> http://imagebin.ca/view/89faihm.html
>>>>
>>>> The perforce server and port are specified in the file p4config.txt (p4
>>>> will look for its settings in a file of that name).
>>>>
>>>> If I issue the same command in a kdevelop konsole, it works (see konsole
>>>> window in screenshot below)
>>>>
>>>> http://imagebin.ca/view/G4zUSuW.html
>>>>
>>>> Can anyone shed some light on what the difference is between the command
>>>> in the DvcsJob and the command issued in the terminal?
>>>>
>>>>  Thanks.
>>>>
>>>> Morten
>>>>
>>>> --
>>>> KDevelop-devel mailing list
>>>> KDevelop-devel at kdevelop.org
>>>> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>>>>
>>>>
>>> To me it sounds like p4 requires some env variable to be defined that
>>> isn't. I don't know anything about perforce though, so I can't help you with
>>> that. I can help you with the debugging if you tell me what you need.
>>>
>>
>> Indeed,  I believe it is the P4CONFIG variable. It is used to tell
>> Perforce clients the filename of a configuration file. I assumed the
>> perforce client would look for "p4config.txt" if P4CONFIG wasn't set -
>> however that does not seem to be the case.
>>
>> My HD decided to go to lunch a couple of times yesterday so I did not get
>> round to putting the source on gitorious - Hopefully I will get it done
>> within this week.
>>
>> Thanks
>>
>> /Morten
>>
>>
>>
>>>
>>> I agree it looks like the same command, it's really weird that it doesn't
>>> return the same.
>>>
>>> Aleix
>>>
>>> --
>>> KDevelop-devel mailing list
>>> KDevelop-devel at kdevelop.org
>>> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>>>
>>>
>>
>
>
> --
> - When the split is pulled, mr. Grenade is no longer our friend
>
> --
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>
>
Good! If you plan to keep working on/with it it would be interesting to move
it to git.kde.org (with the rest of KDevelop) and eventually release it,
would you be interested on that?

Aleix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20101123/a762ab5f/attachment.html>


More information about the KDevelop-devel mailing list