Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » integrating Team CVS API
integrating Team CVS API [message #326973] Thu, 03 April 2008 19:16 Go to next message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
Hi,

I an trying to use Team CVS API to checkout files outside of Eclipse
workspace, but now I am not sure if Team CVS is exposing such API and
wonder if this is even possible. Can someone clarify this or give some
pointers to the code? Basically all I need is to run checkout operation
using given cvs location/tag and target location on local file system
(outside workspace).

Thank you in advance

Eugene
Re: integrating Team CVS API [message #326992 is a reply to message #326973] Fri, 04 April 2008 05:16 Go to previous messageGo to next message
Vladimir Grishchenko is currently offline Vladimir GrishchenkoFriend
Messages: 104
Registered: July 2009
Senior Member
I don't think there is a published API but you can probably get some mileage
by calling into cvs.core internal packages, however this will not guarantee
any kind of compatibility across releases. If you don't get a more specific
reply here try asking on the team mailing list. There may be additional
difficulties with regards to checking out outside of workspace if you mean
just any arbitrary directory that is not under an existent Eclipse project
(Eclipse projects can reside outside of workspace directory but they are
still logically in the workspace).

Cheers,
V.



"Eugene Kuleshov" <eu@md.pp.ru> wrote in message
news:ft3aes$efv$1@build.eclipse.org...
> Hi,
>
> I an trying to use Team CVS API to checkout files outside of Eclipse
> workspace, but now I am not sure if Team CVS is exposing such API and
> wonder if this is even possible. Can someone clarify this or give some
> pointers to the code? Basically all I need is to run checkout operation
> using given cvs location/tag and target location on local file system
> (outside workspace).
>
> Thank you in advance
>
> Eugene
>
Re: integrating Team CVS API [message #327010 is a reply to message #326992] Fri, 04 April 2008 14:28 Go to previous messageGo to next message
Michael Valenta is currently offline Michael ValentaFriend
Messages: 35
Registered: July 2009
Member
Yes, you would need to use internals to do this. The other thing that is
missing is a CVS filesystem abstraction that resides on top of EFS or
java.io.File. There are currently two implementations of ICVSResource:
one on top of IResource and one on top of a memory model for fetching
remote state.

Michael

Vladimir Grishchenko wrote:
> I don't think there is a published API but you can probably get some mileage
> by calling into cvs.core internal packages, however this will not guarantee
> any kind of compatibility across releases. If you don't get a more specific
> reply here try asking on the team mailing list. There may be additional
> difficulties with regards to checking out outside of workspace if you mean
> just any arbitrary directory that is not under an existent Eclipse project
> (Eclipse projects can reside outside of workspace directory but they are
> still logically in the workspace).
>
> Cheers,
> V.
>
>
>
> "Eugene Kuleshov" <eu@md.pp.ru> wrote in message
> news:ft3aes$efv$1@build.eclipse.org...
>> Hi,
>>
>> I an trying to use Team CVS API to checkout files outside of Eclipse
>> workspace, but now I am not sure if Team CVS is exposing such API and
>> wonder if this is even possible. Can someone clarify this or give some
>> pointers to the code? Basically all I need is to run checkout operation
>> using given cvs location/tag and target location on local file system
>> (outside workspace).
>>
>> Thank you in advance
>>
>> Eugene
>>
>
>
Re: integrating Team CVS API [message #327016 is a reply to message #327010] Fri, 04 April 2008 18:07 Go to previous messageGo to next message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
Michael Valenta wrote:
> Yes, you would need to use internals to do this. The other thing that
> is missing is a CVS filesystem abstraction that resides on top of EFS
> or java.io.File. There are currently two implementations of
> ICVSResource: one on top of IResource and one on top of a memory model
> for fetching remote state.
Thanks Michael. I looked at the internal packages, but having troubles
to find relevant API and came up with the following code, but can't
figure out how to get ICVSFolder instance for destFolder. From what you
are saying it sounds like I'd have to implement that interface myself if
I need to use java.io.File or EFS?

String location;
String moduleName;

ICVSRepositoryLocation repository =
CVSRepositoryLocation.fromString(location, false);

ICVSFolder destFolder = ?????;

Session session = new Session(repository, destFolder);
session.open(monitor, false /* read-only */);

try {
Command.LocalOption[] localOptions = new Command.LocalOption[] {
Update.makeTagOption(CVSTag.DEFAULT)
};

IStatus status = Command.CHECKOUT.execute(session,
Command.NO_GLOBAL_OPTIONS,
localOptions,
new String[] { moduleName },
null, // listener
monitor);
} finally {
session.close();
}


regards,
Eugene


> Vladimir Grishchenko wrote:
>> I don't think there is a published API but you can probably get some
>> mileage
>> by calling into cvs.core internal packages, however this will not
>> guarantee
>> any kind of compatibility across releases. If you don't get a more
>> specific
>> reply here try asking on the team mailing list. There may be additional
>> difficulties with regards to checking out outside of workspace if you
>> mean
>> just any arbitrary directory that is not under an existent Eclipse
>> project
>> (Eclipse projects can reside outside of workspace directory but they are
>> still logically in the workspace).
>>
>> Cheers,
>> V.
>>
>>
>>
>> "Eugene Kuleshov" <eu@md.pp.ru> wrote in message
>> news:ft3aes$efv$1@build.eclipse.org...
>>> Hi,
>>>
>>> I an trying to use Team CVS API to checkout files outside of Eclipse
>>> workspace, but now I am not sure if Team CVS is exposing such API and
>>> wonder if this is even possible. Can someone clarify this or give some
>>> pointers to the code? Basically all I need is to run checkout operation
>>> using given cvs location/tag and target location on local file system
>>> (outside workspace).
>>>
>>> Thank you in advance
>>>
>>> Eugene
>>>
>>
>>
Re: integrating Team CVS API [message #327021 is a reply to message #327016] Sat, 05 April 2008 04:34 Go to previous messageGo to next message
Vladimir Grishchenko is currently offline Vladimir GrishchenkoFriend
Messages: 104
Registered: July 2009
Senior Member
Looks like CVSWorkspaceRoot.getCVSFolderFor(IContainer resource) will give
you what you need.

-V.


"Eugene Kuleshov" <eu@md.pp.ru> wrote in message
news:ft5qpl$hh8$1@build.eclipse.org...
>... but can't
> figure out how to get ICVSFolder instance for destFolder. From what you
> are saying it sounds like I'd have to implement that interface myself if
> I need to use java.io.File or EFS?
>
> String location;
> String moduleName;
>
> ICVSRepositoryLocation repository =
> CVSRepositoryLocation.fromString(location, false);
>
> ICVSFolder destFolder = ?????;
>
> Session session = new Session(repository, destFolder);
> session.open(monitor, false /* read-only */);
>
> try {
> Command.LocalOption[] localOptions = new Command.LocalOption[] {
> Update.makeTagOption(CVSTag.DEFAULT)
> };
>
> IStatus status = Command.CHECKOUT.execute(session,
> Command.NO_GLOBAL_OPTIONS,
> localOptions,
> new String[] { moduleName },
> null, // listener
> monitor);
> } finally {
> session.close();
> }
>
>
> regards,
> Eugene
Re: integrating Team CVS API [message #327023 is a reply to message #327021] Sat, 05 April 2008 20:12 Go to previous messageGo to next message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
Vladimir Grishchenko wrote:
> Looks like CVSWorkspaceRoot.getCVSFolderFor(IContainer resource) will give
> you what you need.
>
Unfortunately it won't. There is no IContainer neither IResource,
because project does not exist yet when checkout is happening.

regards,
Eugene


> "Eugene Kuleshov" <eu@md.pp.ru> wrote in message
> news:ft5qpl$hh8$1@build.eclipse.org...
>
>> ... but can't
>> figure out how to get ICVSFolder instance for destFolder. From what you
>> are saying it sounds like I'd have to implement that interface myself if
>> I need to use java.io.File or EFS?
>>
>> String location;
>> String moduleName;
>>
>> ICVSRepositoryLocation repository =
>> CVSRepositoryLocation.fromString(location, false);
>>
>> ICVSFolder destFolder = ?????;
>>
>> Session session = new Session(repository, destFolder);
>> session.open(monitor, false /* read-only */);
>>
>> try {
>> Command.LocalOption[] localOptions = new Command.LocalOption[] {
>> Update.makeTagOption(CVSTag.DEFAULT)
>> };
>>
>> IStatus status = Command.CHECKOUT.execute(session,
>> Command.NO_GLOBAL_OPTIONS,
>> localOptions,
>> new String[] { moduleName },
>> null, // listener
>> monitor);
>> } finally {
>> session.close();
>> }
>>
>>
>> regards,
>> Eugene
>>
>
>
>
Re: integrating Team CVS API [message #327024 is a reply to message #327023] Sun, 06 April 2008 03:41 Go to previous messageGo to next message
Vladimir Grishchenko is currently offline Vladimir GrishchenkoFriend
Messages: 104
Registered: July 2009
Senior Member
This is the thing, a project must exist prior to fetch, if there is none you
can always create one. If you don't need afterwards it you can delete it
after checkout.

I don't think it is easy to implement ICVSResource hierarchy on top of
java.io.File to be able to checkout to any filesystem location. For one, you
need to be able to answer a corresponding IResource from
ICVSResource.getResource(), and if there is no project you will face the
same issue.


"Eugene Kuleshov" <eu@md.pp.ru> wrote in message
news:ft8mfp$kql$1@build.eclipse.org...
> Vladimir Grishchenko wrote:
> > Looks like CVSWorkspaceRoot.getCVSFolderFor(IContainer resource) will
give
> > you what you need.
> >
> Unfortunately it won't. There is no IContainer neither IResource,
> because project does not exist yet when checkout is happening.
>
> regards,
> Eugene
>
>
> > "Eugene Kuleshov" <eu@md.pp.ru> wrote in message
> > news:ft5qpl$hh8$1@build.eclipse.org...
> >
> >> ... but can't
> >> figure out how to get ICVSFolder instance for destFolder. From what you
> >> are saying it sounds like I'd have to implement that interface myself
if
> >> I need to use java.io.File or EFS?
> >>
> >> String location;
> >> String moduleName;
> >>
> >> ICVSRepositoryLocation repository =
> >> CVSRepositoryLocation.fromString(location, false);
> >>
> >> ICVSFolder destFolder = ?????;
> >>
> >> Session session = new Session(repository, destFolder);
> >> session.open(monitor, false /* read-only */);
> >>
> >> try {
> >> Command.LocalOption[] localOptions = new Command.LocalOption[] {
> >> Update.makeTagOption(CVSTag.DEFAULT)
> >> };
> >>
> >> IStatus status = Command.CHECKOUT.execute(session,
> >> Command.NO_GLOBAL_OPTIONS,
> >> localOptions,
> >> new String[] { moduleName },
> >> null, // listener
> >> monitor);
> >> } finally {
> >> session.close();
> >> }
> >>
> >>
> >> regards,
> >> Eugene
> >>
> >
> >
> >
Re: integrating Team CVS API [message #327038 is a reply to message #327016] Mon, 07 April 2008 13:20 Go to previous messageGo to next message
Michael Valenta is currently offline Michael ValentaFriend
Messages: 35
Registered: July 2009
Member
Yes, you would need to implement your own ICVSFile and ICVSFolder. Much
of the implementation would be straight forward. The complication is in
the management of the meta-data (i.e. the content that goes into the CVS
folder). For the commands to run efficiently, you cannot simply read and
write meta-data each time it is changed. For instance, for operations
that touch multiple files in the same folder, you would want to load the
meta-data once, keep it in memory while the multiple files are touched
and then write the meta-data to disk when the operation moves on to
another folder.

Michael

Eugene Kuleshov wrote:
> Michael Valenta wrote:
>> Yes, you would need to use internals to do this. The other thing that
>> is missing is a CVS filesystem abstraction that resides on top of EFS
>> or java.io.File. There are currently two implementations of
>> ICVSResource: one on top of IResource and one on top of a memory model
>> for fetching remote state.
> Thanks Michael. I looked at the internal packages, but having troubles
> to find relevant API and came up with the following code, but can't
> figure out how to get ICVSFolder instance for destFolder. From what you
> are saying it sounds like I'd have to implement that interface myself if
> I need to use java.io.File or EFS?
>
> String location;
> String moduleName;
> ICVSRepositoryLocation repository =
> CVSRepositoryLocation.fromString(location, false);
> ICVSFolder destFolder = ?????;
>
> Session session = new Session(repository, destFolder);
> session.open(monitor, false /* read-only */);
> try {
> Command.LocalOption[] localOptions = new Command.LocalOption[] {
> Update.makeTagOption(CVSTag.DEFAULT)
> };
> IStatus status = Command.CHECKOUT.execute(session,
> Command.NO_GLOBAL_OPTIONS,
> localOptions,
> new String[] { moduleName },
> null, // listener
> monitor);
> } finally {
> session.close();
> }
>
> regards,
> Eugene
>
>
>> Vladimir Grishchenko wrote:
>>> I don't think there is a published API but you can probably get some
>>> mileage
>>> by calling into cvs.core internal packages, however this will not
>>> guarantee
>>> any kind of compatibility across releases. If you don't get a more
>>> specific
>>> reply here try asking on the team mailing list. There may be additional
>>> difficulties with regards to checking out outside of workspace if you
>>> mean
>>> just any arbitrary directory that is not under an existent Eclipse
>>> project
>>> (Eclipse projects can reside outside of workspace directory but they are
>>> still logically in the workspace).
>>>
>>> Cheers,
>>> V.
>>>
>>>
>>>
>>> "Eugene Kuleshov" <eu@md.pp.ru> wrote in message
>>> news:ft3aes$efv$1@build.eclipse.org...
>>>> Hi,
>>>>
>>>> I an trying to use Team CVS API to checkout files outside of Eclipse
>>>> workspace, but now I am not sure if Team CVS is exposing such API and
>>>> wonder if this is even possible. Can someone clarify this or give some
>>>> pointers to the code? Basically all I need is to run checkout operation
>>>> using given cvs location/tag and target location on local file system
>>>> (outside workspace).
>>>>
>>>> Thank you in advance
>>>>
>>>> Eugene
>>>>
>>>
>>>
Re: integrating Team CVS API [message #327046 is a reply to message #327038] Mon, 07 April 2008 15:37 Go to previous messageGo to next message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
Thanks Michael.

I've done partial and very naive implementation of that ICVSResource
API that is sufficient for checkout operation. I have to admit that it
was quite strange that metadata files are not handled by CVS code as
other regular files and require reimplementing metadata handling for
each physical system. For instance it is still unclear to me how to
detect that operation moves to another folder?

regards,
Eugene


Michael Valenta wrote:
> Yes, you would need to implement your own ICVSFile and ICVSFolder.
> Much of the implementation would be straight forward. The complication
> is in the management of the meta-data (i.e. the content that goes into
> the CVS folder). For the commands to run efficiently, you cannot
> simply read and write meta-data each time it is changed. For instance,
> for operations that touch multiple files in the same folder, you would
> want to load the meta-data once, keep it in memory while the multiple
> files are touched and then write the meta-data to disk when the
> operation moves on to another folder.
>
> Michael
>
> Eugene Kuleshov wrote:
>> Michael Valenta wrote:
>>> Yes, you would need to use internals to do this. The other thing
>>> that is missing is a CVS filesystem abstraction that resides on top
>>> of EFS or java.io.File. There are currently two implementations of
>>> ICVSResource: one on top of IResource and one on top of a memory
>>> model for fetching remote state.
>> Thanks Michael. I looked at the internal packages, but having
>> troubles to find relevant API and came up with the following code,
>> but can't figure out how to get ICVSFolder instance for destFolder.
>> From what you are saying it sounds like I'd have to implement that
>> interface myself if I need to use java.io.File or EFS?
>>
>> String location;
>> String moduleName;
>> ICVSRepositoryLocation repository =
>> CVSRepositoryLocation.fromString(location, false);
>> ICVSFolder destFolder = ?????;
>>
>> Session session = new Session(repository, destFolder);
>> session.open(monitor, false /* read-only */);
>> try {
>> Command.LocalOption[] localOptions = new Command.LocalOption[] {
>> Update.makeTagOption(CVSTag.DEFAULT)
>> };
>> IStatus status = Command.CHECKOUT.execute(session,
>> Command.NO_GLOBAL_OPTIONS,
>> localOptions,
>> new String[] { moduleName },
>> null, // listener
>> monitor);
>> } finally {
>> session.close();
>> }
>> regards,
>> Eugene
>>
>>
>>> Vladimir Grishchenko wrote:
>>>> I don't think there is a published API but you can probably get
>>>> some mileage
>>>> by calling into cvs.core internal packages, however this will not
>>>> guarantee
>>>> any kind of compatibility across releases. If you don't get a more
>>>> specific
>>>> reply here try asking on the team mailing list. There may be
>>>> additional
>>>> difficulties with regards to checking out outside of workspace if
>>>> you mean
>>>> just any arbitrary directory that is not under an existent Eclipse
>>>> project
>>>> (Eclipse projects can reside outside of workspace directory but
>>>> they are
>>>> still logically in the workspace).
>>>>
>>>> Cheers,
>>>> V.
>>>>
>>>>
>>>>
>>>> "Eugene Kuleshov" <eu@md.pp.ru> wrote in message
>>>> news:ft3aes$efv$1@build.eclipse.org...
>>>>> Hi,
>>>>>
>>>>> I an trying to use Team CVS API to checkout files outside of
>>>>> Eclipse
>>>>> workspace, but now I am not sure if Team CVS is exposing such API and
>>>>> wonder if this is even possible. Can someone clarify this or give
>>>>> some
>>>>> pointers to the code? Basically all I need is to run checkout
>>>>> operation
>>>>> using given cvs location/tag and target location on local file system
>>>>> (outside workspace).
>>>>>
>>>>> Thank you in advance
>>>>>
>>>>> Eugene
>>>>>
>>>>
>>>>
Re: integrating Team CVS API [message #327070 is a reply to message #327046] Tue, 08 April 2008 14:26 Go to previous message
Michael Valenta is currently offline Michael ValentaFriend
Messages: 35
Registered: July 2009
Member
Eugene,

I agree that ideally, we would have meta-data management that was
re-usable. However, out current story makes use of the Eclipse Resource
layer (i.e. session properties) as the in memory cache and we right all
the meta-data out at the end of the operation. We have discussed
decoupling this from the resources layer but have never had the time to
pursue it.

Michael

Eugene Kuleshov wrote:
>
> Thanks Michael.
>
> I've done partial and very naive implementation of that ICVSResource
> API that is sufficient for checkout operation. I have to admit that it
> was quite strange that metadata files are not handled by CVS code as
> other regular files and require reimplementing metadata handling for
> each physical system. For instance it is still unclear to me how to
> detect that operation moves to another folder?
>
> regards,
> Eugene
>
>
> Michael Valenta wrote:
>> Yes, you would need to implement your own ICVSFile and ICVSFolder.
>> Much of the implementation would be straight forward. The complication
>> is in the management of the meta-data (i.e. the content that goes into
>> the CVS folder). For the commands to run efficiently, you cannot
>> simply read and write meta-data each time it is changed. For instance,
>> for operations that touch multiple files in the same folder, you would
>> want to load the meta-data once, keep it in memory while the multiple
>> files are touched and then write the meta-data to disk when the
>> operation moves on to another folder.
>>
>> Michael
>>
>> Eugene Kuleshov wrote:
>>> Michael Valenta wrote:
>>>> Yes, you would need to use internals to do this. The other thing
>>>> that is missing is a CVS filesystem abstraction that resides on top
>>>> of EFS or java.io.File. There are currently two implementations of
>>>> ICVSResource: one on top of IResource and one on top of a memory
>>>> model for fetching remote state.
>>> Thanks Michael. I looked at the internal packages, but having
>>> troubles to find relevant API and came up with the following code,
>>> but can't figure out how to get ICVSFolder instance for destFolder.
>>> From what you are saying it sounds like I'd have to implement that
>>> interface myself if I need to use java.io.File or EFS?
>>>
>>> String location;
>>> String moduleName;
>>> ICVSRepositoryLocation repository =
>>> CVSRepositoryLocation.fromString(location, false);
>>> ICVSFolder destFolder = ?????;
>>>
>>> Session session = new Session(repository, destFolder);
>>> session.open(monitor, false /* read-only */);
>>> try {
>>> Command.LocalOption[] localOptions = new Command.LocalOption[] {
>>> Update.makeTagOption(CVSTag.DEFAULT)
>>> };
>>> IStatus status = Command.CHECKOUT.execute(session,
>>> Command.NO_GLOBAL_OPTIONS,
>>> localOptions,
>>> new String[] { moduleName },
>>> null, // listener
>>> monitor);
>>> } finally {
>>> session.close();
>>> } regards,
>>> Eugene
>>>
>>>
>>>> Vladimir Grishchenko wrote:
>>>>> I don't think there is a published API but you can probably get
>>>>> some mileage
>>>>> by calling into cvs.core internal packages, however this will not
>>>>> guarantee
>>>>> any kind of compatibility across releases. If you don't get a more
>>>>> specific
>>>>> reply here try asking on the team mailing list. There may be
>>>>> additional
>>>>> difficulties with regards to checking out outside of workspace if
>>>>> you mean
>>>>> just any arbitrary directory that is not under an existent Eclipse
>>>>> project
>>>>> (Eclipse projects can reside outside of workspace directory but
>>>>> they are
>>>>> still logically in the workspace).
>>>>>
>>>>> Cheers,
>>>>> V.
>>>>>
>>>>>
>>>>>
>>>>> "Eugene Kuleshov" <eu@md.pp.ru> wrote in message
>>>>> news:ft3aes$efv$1@build.eclipse.org...
>>>>>> Hi,
>>>>>>
>>>>>> I an trying to use Team CVS API to checkout files outside of
>>>>>> Eclipse
>>>>>> workspace, but now I am not sure if Team CVS is exposing such API and
>>>>>> wonder if this is even possible. Can someone clarify this or give
>>>>>> some
>>>>>> pointers to the code? Basically all I need is to run checkout
>>>>>> operation
>>>>>> using given cvs location/tag and target location on local file system
>>>>>> (outside workspace).
>>>>>>
>>>>>> Thank you in advance
>>>>>>
>>>>>> Eugene
>>>>>>
>>>>>
>>>>>
Previous Topic:how eclipse.exe call startup.jar
Next Topic:CommonNavigator versus TreeView to display entitys from a remote database?
Goto Forum:
  


Current Time: Fri Apr 26 17:46:22 GMT 2024

Powered by FUDForum. Page generated in 0.04380 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top