Home » Eclipse Projects » Eclipse Platform » CVS Diff Initialisation
CVS Diff Initialisation [message #51522] |
Wed, 28 May 2003 06:32  |
Eclipse User |
|
|
|
Originally posted by: Pete.shotgunlan.com
Hi all,
I'm trying to create CVS Diff's of files in the workspace for a plugin
I'm putting together, but I'm seeing a bit of a problem with it...
Having reverse engineered the "Team -> Create Patch" code, I'm making
the following calls (excuse mozilla's line breaking):
IProgressMonitor p = new NullProgressMonitor();
CVSTeamProvider provider
=(CVSTeamProvider)RepositoryProvider.getProvider(resource.ge tProject(),
CVSProviderPlugin.getTypeId());
System.out.println("Diff");
List options = new ArrayList(5);
options.add(Diff.INCLUDE_NEWFILES);
options.add(Diff.UNIFIED_FORMAT);
provider.diff(resource, (LocalOption[]) options.toArray(new
LocalOption[options.size()]), System.out, p);
System.out.println("/Diff");
If I just call this code, it results in an exception about not being
able to call ssh (the default ext program, I use a different one), as
follows:
org.eclipse.team.internal.ccvs.core.connection.CVSCommunicat ionException:
I/O exception occurred: Error starting external connection program: ssh.
Ensure that the path is correct and that you can connect manually using
this program.
But if I generate a patch (Team -> Create patch), then call this code,
it works fine, even if the patch is created on a different file. I guess
there's some settings or something that I'm no initialising properly,
but I really can't find them... Any offers?
For the sake of completeness, I'm developing in 2.1, on Windows XP.
Other stuff related to the project includes Tomcat server and AXIS, and
the CVS is being run on Unix.
Ta in advance
Pete
|
|
|
Re: CVS Diff Initialisation [message #51756 is a reply to message #51522] |
Wed, 28 May 2003 09:19   |
Eclipse User |
|
|
|
Originally posted by: Michael_Valenta.oti.com
Pete,
The code you are using is not API so there's really no support for what
you are doing. Having said that, I don't see why the code doesn't work.
I suspect the problem may be in how you are launching your test Eclipse
(i.e. ext may be configured properly in your developement environment
but not in your test environment).
Michael
Pete Matthews wrote:
> Hi all,
>
> I'm trying to create CVS Diff's of files in the workspace for a plugin
> I'm putting together, but I'm seeing a bit of a problem with it...
>
> Having reverse engineered the "Team -> Create Patch" code, I'm making
> the following calls (excuse mozilla's line breaking):
>
> IProgressMonitor p = new NullProgressMonitor();
>
> CVSTeamProvider provider
> =(CVSTeamProvider)RepositoryProvider.getProvider(resource.ge tProject(),
> CVSProviderPlugin.getTypeId());
> System.out.println("Diff");
>
> List options = new ArrayList(5);
>
> options.add(Diff.INCLUDE_NEWFILES);
> options.add(Diff.UNIFIED_FORMAT);
>
> provider.diff(resource, (LocalOption[]) options.toArray(new
> LocalOption[options.size()]), System.out, p);
>
> System.out.println("/Diff");
>
>
> If I just call this code, it results in an exception about not being
> able to call ssh (the default ext program, I use a different one), as
> follows:
> org.eclipse.team.internal.ccvs.core.connection.CVSCommunicat ionException:
> I/O exception occurred: Error starting external connection program: ssh.
> Ensure that the path is correct and that you can connect manually using
> this program.
>
> But if I generate a patch (Team -> Create patch), then call this code,
> it works fine, even if the patch is created on a different file. I guess
> there's some settings or something that I'm no initialising properly,
> but I really can't find them... Any offers?
>
> For the sake of completeness, I'm developing in 2.1, on Windows XP.
> Other stuff related to the project includes Tomcat server and AXIS, and
> the CVS is being run on Unix.
>
> Ta in advance
>
> Pete
>
|
|
|
Re: CVS Diff Initialisation [message #51782 is a reply to message #51756] |
Wed, 28 May 2003 09:27  |
Eclipse User |
|
|
|
Originally posted by: Pete.shotgunlan.com
Having spent most of the morning playing with this, I found a way to get
it working, though it's not pretty...
If you enter the org.eclipse.team.cvs.ui package as a dependancy, then
call the CVSUIPlugin.getPlugin().startup() method, it seems to work.
There are probably neater ways of doing this, but this'll do for the
moment.
I discovered this by breakpointing some of the attribute set routines in
the CVSProviderPlugin, and checking the call stack. Any cleaner offers?
Pete
Michael Valenta wrote:
> Pete,
>
> The code you are using is not API so there's really no support for what
> you are doing. Having said that, I don't see why the code doesn't work.
> I suspect the problem may be in how you are launching your test Eclipse
> (i.e. ext may be configured properly in your developement environment
> but not in your test environment).
>
> Michael
>
> Pete Matthews wrote:
>
>> Hi all,
>>
>> I'm trying to create CVS Diff's of files in the workspace for a plugin
>> I'm putting together, but I'm seeing a bit of a problem with it...
>>
>> Having reverse engineered the "Team -> Create Patch" code, I'm making
>> the following calls (excuse mozilla's line breaking):
>>
>> IProgressMonitor p = new NullProgressMonitor();
>>
>> CVSTeamProvider provider
>> =(CVSTeamProvider)RepositoryProvider.getProvider(resource.ge tProject(),
>> CVSProviderPlugin.getTypeId());
>> System.out.println("Diff");
>>
>> List options = new ArrayList(5);
>>
>> options.add(Diff.INCLUDE_NEWFILES);
>> options.add(Diff.UNIFIED_FORMAT);
>>
>> provider.diff(resource, (LocalOption[]) options.toArray(new
>> LocalOption[options.size()]), System.out, p);
>>
>> System.out.println("/Diff");
>>
>>
>> If I just call this code, it results in an exception about not being
>> able to call ssh (the default ext program, I use a different one), as
>> follows:
>> org.eclipse.team.internal.ccvs.core.connection.CVSCommunicat ionException:
>> I/O exception occurred: Error starting external connection program:
>> ssh. Ensure that the path is correct and that you can connect manually
>> using this program.
>> But if I generate a patch (Team -> Create patch), then call this
>> code, it works fine, even if the patch is created on a different file.
>> I guess there's some settings or something that I'm no initialising
>> properly, but I really can't find them... Any offers?
>>
>> For the sake of completeness, I'm developing in 2.1, on Windows XP.
>> Other stuff related to the project includes Tomcat server and AXIS,
>> and the CVS is being run on Unix.
>>
>> Ta in advance
>>
>> Pete
>>
>
|
|
|
Goto Forum:
Current Time: Fri May 02 22:51:29 EDT 2025
Powered by FUDForum. Page generated in 0.02894 seconds
|