Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to get hold of the repository(CVS) revision of a file ?
How to get hold of the repository(CVS) revision of a file ? [message #290513] Thu, 25 August 2005 20:15 Go to next message
Eclipse UserFriend
Originally posted by: ohnygaard.online.no

Hi,

If I have a element (a ICompilationUnit) how should I best go about getting
the
repository (CVS) revision preferably as a ICompilationUnit or the source
code using public APIs ?

And is it possible to listen to Commit and Update CVS events?

Thanks in advance,
Otto
Re: How to get hold of the repository(CVS) revision of a file ? [message #290570 is a reply to message #290513] Fri, 26 August 2005 13:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Michael_Valenta.oti.com

First of all, there is no CVS API so anything you do would have to be done
using internal code. I know that there are many people how do this for
non-product based development and you are free to do it yourself with the
understanding that future versions of Eclipse may break your code.

Having gotten the disclaimer out of the way, I don't really understand what
you are asking. Given a compilation unit, you can get the IFile. Are you
then asking how to get other revisions of the IFile? If so, this is possible
using internal CVS code. However, I doubt that you could get a compilation
unit for the revision.

For the fetching of revisions, you would do something like (internal code
found in org.eclipse.team.cvs.core plugin)

CVSWorkspaceRoot.getCVSFileFor(myIFile).getLogEntries(monito r)

Each log entry has an ICVSFile associated with it.

Michael

"Otto Nygaard" <ohnygaard@online.no> wrote in message
news:del8sr$u85$1@news.eclipse.org...
> Hi,
>
> If I have a element (a ICompilationUnit) how should I best go about
> getting the
> repository (CVS) revision preferably as a ICompilationUnit or the source
> code using public APIs ?
>
> And is it possible to listen to Commit and Update CVS events?
>
> Thanks in advance,
> Otto
>
>
>
Re: How to get hold of the repository(CVS) revision of a file ? [message #290582 is a reply to message #290570] Fri, 26 August 2005 13:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ohnygaard.online.no

Thank you for your answer Michael. What I want to do is something simailar
to "Comapre with latest from HEAD". Have been trying to find the source for
this but haven`t fond it yet, if you or anybody know please let me know.

I know that the CVS has no API, and that the team API have to be used to
avoid using internal code. So let me refrase my question: Is there anyway to
use the team API to get the revision and events?

Sorry for beeing unclear,

Otto

"Michael Valenta" <Michael_Valenta@oti.com> wrote in message
news:den54u$3l7$1@news.eclipse.org...
> First of all, there is no CVS API so anything you do would have to be done
> using internal code. I know that there are many people how do this for
> non-product based development and you are free to do it yourself with the
> understanding that future versions of Eclipse may break your code.
>
> Having gotten the disclaimer out of the way, I don't really understand
> what you are asking. Given a compilation unit, you can get the IFile. Are
> you then asking how to get other revisions of the IFile? If so, this is
> possible using internal CVS code. However, I doubt that you could get a
> compilation unit for the revision.
>
> For the fetching of revisions, you would do something like (internal code
> found in org.eclipse.team.cvs.core plugin)
>
> CVSWorkspaceRoot.getCVSFileFor(myIFile).getLogEntries(monito r)
>
> Each log entry has an ICVSFile associated with it.
>
> Michael
>
> "Otto Nygaard" <ohnygaard@online.no> wrote in message
> news:del8sr$u85$1@news.eclipse.org...
>> Hi,
>>
>> If I have a element (a ICompilationUnit) how should I best go about
>> getting the
>> repository (CVS) revision preferably as a ICompilationUnit or the source
>> code using public APIs ?
>>
>> And is it possible to listen to Commit and Update CVS events?
>>
>> Thanks in advance,
>> Otto
>>
>>
>>
>
>
Re: How to get hold of the repository(CVS) revision of a file ? [message #290659 is a reply to message #290582] Mon, 29 August 2005 14:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Michael_Valenta.oti.com

No there is currently no API for this. For the Comapre with HEAD
functionality, have a look at the SyncAction class in the
org.eclipse.team.cvs.ui plugin.

Michael

"Otto Nygaard" <ohnygaard@online.no> wrote in message
news:den6sf$5vt$1@news.eclipse.org...
> Thank you for your answer Michael. What I want to do is something simailar
> to "Comapre with latest from HEAD". Have been trying to find the source
> for this but haven`t fond it yet, if you or anybody know please let me
> know.
>
> I know that the CVS has no API, and that the team API have to be used to
> avoid using internal code. So let me refrase my question: Is there anyway
> to use the team API to get the revision and events?
>
> Sorry for beeing unclear,
>
> Otto
>
> "Michael Valenta" <Michael_Valenta@oti.com> wrote in message
> news:den54u$3l7$1@news.eclipse.org...
>> First of all, there is no CVS API so anything you do would have to be
>> done using internal code. I know that there are many people how do this
>> for non-product based development and you are free to do it yourself with
>> the understanding that future versions of Eclipse may break your code.
>>
>> Having gotten the disclaimer out of the way, I don't really understand
>> what you are asking. Given a compilation unit, you can get the IFile. Are
>> you then asking how to get other revisions of the IFile? If so, this is
>> possible using internal CVS code. However, I doubt that you could get a
>> compilation unit for the revision.
>>
>> For the fetching of revisions, you would do something like (internal code
>> found in org.eclipse.team.cvs.core plugin)
>>
>> CVSWorkspaceRoot.getCVSFileFor(myIFile).getLogEntries(monito r)
>>
>> Each log entry has an ICVSFile associated with it.
>>
>> Michael
>>
>> "Otto Nygaard" <ohnygaard@online.no> wrote in message
>> news:del8sr$u85$1@news.eclipse.org...
>>> Hi,
>>>
>>> If I have a element (a ICompilationUnit) how should I best go about
>>> getting the
>>> repository (CVS) revision preferably as a ICompilationUnit or the source
>>> code using public APIs ?
>>>
>>> And is it possible to listen to Commit and Update CVS events?
>>>
>>> Thanks in advance,
>>> Otto
>>>
>>>
>>>
>>
>>
>
>
Re: How to get hold of the repository(CVS) revision of a file ? [message #290676 is a reply to message #290659] Mon, 29 August 2005 17:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ohnygaard.online.no

Thanks again Michael!

One last question about this: if I only want to observ when a user updates
the local code with the repository revision is there a way using the API? I
guess I can use and store local revisions to get what I want, but I need to
know (observ) when the users updates with the repository and then
react/update my local datamodel.

In short, to explain, I`m trying to track and iform distributed programmers
in a team setting about changes done to code locally/ in the (private)
workspace.

Much appriciated

Otto

"Michael Valenta" <Michael_Valenta@oti.com> wrote in message
news:dev4ma$p0f$1@news.eclipse.org...
> No there is currently no API for this. For the Comapre with HEAD
> functionality, have a look at the SyncAction class in the
> org.eclipse.team.cvs.ui plugin.
>
> Michael
>
> "Otto Nygaard" <ohnygaard@online.no> wrote in message
> news:den6sf$5vt$1@news.eclipse.org...
>> Thank you for your answer Michael. What I want to do is something
>> simailar to "Comapre with latest from HEAD". Have been trying to find the
>> source for this but haven`t fond it yet, if you or anybody know please
>> let me know.
>>
>> I know that the CVS has no API, and that the team API have to be used to
>> avoid using internal code. So let me refrase my question: Is there anyway
>> to use the team API to get the revision and events?
>>
>> Sorry for beeing unclear,
>>
>> Otto
>>
>> "Michael Valenta" <Michael_Valenta@oti.com> wrote in message
>> news:den54u$3l7$1@news.eclipse.org...
>>> First of all, there is no CVS API so anything you do would have to be
>>> done using internal code. I know that there are many people how do this
>>> for non-product based development and you are free to do it yourself
>>> with the understanding that future versions of Eclipse may break your
>>> code.
>>>
>>> Having gotten the disclaimer out of the way, I don't really understand
>>> what you are asking. Given a compilation unit, you can get the IFile.
>>> Are you then asking how to get other revisions of the IFile? If so, this
>>> is possible using internal CVS code. However, I doubt that you could get
>>> a compilation unit for the revision.
>>>
>>> For the fetching of revisions, you would do something like (internal
>>> code found in org.eclipse.team.cvs.core plugin)
>>>
>>> CVSWorkspaceRoot.getCVSFileFor(myIFile).getLogEntries(monito r)
>>>
>>> Each log entry has an ICVSFile associated with it.
>>>
>>> Michael
>>>
>>> "Otto Nygaard" <ohnygaard@online.no> wrote in message
>>> news:del8sr$u85$1@news.eclipse.org...
>>>> Hi,
>>>>
>>>> If I have a element (a ICompilationUnit) how should I best go about
>>>> getting the
>>>> repository (CVS) revision preferably as a ICompilationUnit or the
>>>> source code using public APIs ?
>>>>
>>>> And is it possible to listen to Commit and Update CVS events?
>>>>
>>>> Thanks in advance,
>>>> Otto
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: How to get hold of the repository(CVS) revision of a file ? [message #290706 is a reply to message #290676] Tue, 30 August 2005 13:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Michael_Valenta.oti.com

There is no specific way to do this. One way to do this would be to listen
to resource deltas (see IResourceChangeListener) and recheck the revision
after each change to see if it is changed.

Michael

"Otto Nygaard" <ohnygaard@online.no> wrote in message
news:devgg5$a52$1@news.eclipse.org...
> Thanks again Michael!
>
> One last question about this: if I only want to observ when a user updates
> the local code with the repository revision is there a way using the API?
> I guess I can use and store local revisions to get what I want, but I need
> to know (observ) when the users updates with the repository and then
> react/update my local datamodel.
>
> In short, to explain, I`m trying to track and iform distributed
> programmers in a team setting about changes done to code locally/ in the
> (private) workspace.
>
> Much appriciated
>
> Otto
>
> "Michael Valenta" <Michael_Valenta@oti.com> wrote in message
> news:dev4ma$p0f$1@news.eclipse.org...
>> No there is currently no API for this. For the Comapre with HEAD
>> functionality, have a look at the SyncAction class in the
>> org.eclipse.team.cvs.ui plugin.
>>
>> Michael
>>
>> "Otto Nygaard" <ohnygaard@online.no> wrote in message
>> news:den6sf$5vt$1@news.eclipse.org...
>>> Thank you for your answer Michael. What I want to do is something
>>> simailar to "Comapre with latest from HEAD". Have been trying to find
>>> the source for this but haven`t fond it yet, if you or anybody know
>>> please let me know.
>>>
>>> I know that the CVS has no API, and that the team API have to be used to
>>> avoid using internal code. So let me refrase my question: Is there
>>> anyway to use the team API to get the revision and events?
>>>
>>> Sorry for beeing unclear,
>>>
>>> Otto
>>>
>>> "Michael Valenta" <Michael_Valenta@oti.com> wrote in message
>>> news:den54u$3l7$1@news.eclipse.org...
>>>> First of all, there is no CVS API so anything you do would have to be
>>>> done using internal code. I know that there are many people how do this
>>>> for non-product based development and you are free to do it yourself
>>>> with the understanding that future versions of Eclipse may break your
>>>> code.
>>>>
>>>> Having gotten the disclaimer out of the way, I don't really understand
>>>> what you are asking. Given a compilation unit, you can get the IFile.
>>>> Are you then asking how to get other revisions of the IFile? If so,
>>>> this is possible using internal CVS code. However, I doubt that you
>>>> could get a compilation unit for the revision.
>>>>
>>>> For the fetching of revisions, you would do something like (internal
>>>> code found in org.eclipse.team.cvs.core plugin)
>>>>
>>>> CVSWorkspaceRoot.getCVSFileFor(myIFile).getLogEntries(monito r)
>>>>
>>>> Each log entry has an ICVSFile associated with it.
>>>>
>>>> Michael
>>>>
>>>> "Otto Nygaard" <ohnygaard@online.no> wrote in message
>>>> news:del8sr$u85$1@news.eclipse.org...
>>>>> Hi,
>>>>>
>>>>> If I have a element (a ICompilationUnit) how should I best go about
>>>>> getting the
>>>>> repository (CVS) revision preferably as a ICompilationUnit or the
>>>>> source code using public APIs ?
>>>>>
>>>>> And is it possible to listen to Commit and Update CVS events?
>>>>>
>>>>> Thanks in advance,
>>>>> Otto
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: How to get hold of the repository(CVS) revision of a file ? [message #290728 is a reply to message #290706] Tue, 30 August 2005 22:48 Go to previous message
Eclipse UserFriend
Originally posted by: ohnygaard.online.no

Ok I`ll try that. Thank you for all your help!


"Michael Valenta" <Michael_Valenta@oti.com> wrote in message
news:df1lja$oq9$1@news.eclipse.org...
> There is no specific way to do this. One way to do this would be to listen
> to resource deltas (see IResourceChangeListener) and recheck the revision
> after each change to see if it is changed.
>
> Michael
>
> "Otto Nygaard" <ohnygaard@online.no> wrote in message
> news:devgg5$a52$1@news.eclipse.org...
>> Thanks again Michael!
>>
>> One last question about this: if I only want to observ when a user
>> updates the local code with the repository revision is there a way using
>> the API? I guess I can use and store local revisions to get what I want,
>> but I need to know (observ) when the users updates with the repository
>> and then react/update my local datamodel.
>>
>> In short, to explain, I`m trying to track and iform distributed
>> programmers in a team setting about changes done to code locally/ in the
>> (private) workspace.
>>
>> Much appriciated
>>
>> Otto
>>
>> "Michael Valenta" <Michael_Valenta@oti.com> wrote in message
>> news:dev4ma$p0f$1@news.eclipse.org...
>>> No there is currently no API for this. For the Comapre with HEAD
>>> functionality, have a look at the SyncAction class in the
>>> org.eclipse.team.cvs.ui plugin.
>>>
>>> Michael
>>>
>>> "Otto Nygaard" <ohnygaard@online.no> wrote in message
>>> news:den6sf$5vt$1@news.eclipse.org...
>>>> Thank you for your answer Michael. What I want to do is something
>>>> simailar to "Comapre with latest from HEAD". Have been trying to find
>>>> the source for this but haven`t fond it yet, if you or anybody know
>>>> please let me know.
>>>>
>>>> I know that the CVS has no API, and that the team API have to be used
>>>> to avoid using internal code. So let me refrase my question: Is there
>>>> anyway to use the team API to get the revision and events?
>>>>
>>>> Sorry for beeing unclear,
>>>>
>>>> Otto
>>>>
>>>> "Michael Valenta" <Michael_Valenta@oti.com> wrote in message
>>>> news:den54u$3l7$1@news.eclipse.org...
>>>>> First of all, there is no CVS API so anything you do would have to be
>>>>> done using internal code. I know that there are many people how do
>>>>> this for non-product based development and you are free to do it
>>>>> yourself with the understanding that future versions of Eclipse may
>>>>> break your code.
>>>>>
>>>>> Having gotten the disclaimer out of the way, I don't really understand
>>>>> what you are asking. Given a compilation unit, you can get the IFile.
>>>>> Are you then asking how to get other revisions of the IFile? If so,
>>>>> this is possible using internal CVS code. However, I doubt that you
>>>>> could get a compilation unit for the revision.
>>>>>
>>>>> For the fetching of revisions, you would do something like (internal
>>>>> code found in org.eclipse.team.cvs.core plugin)
>>>>>
>>>>> CVSWorkspaceRoot.getCVSFileFor(myIFile).getLogEntries(monito r)
>>>>>
>>>>> Each log entry has an ICVSFile associated with it.
>>>>>
>>>>> Michael
>>>>>
>>>>> "Otto Nygaard" <ohnygaard@online.no> wrote in message
>>>>> news:del8sr$u85$1@news.eclipse.org...
>>>>>> Hi,
>>>>>>
>>>>>> If I have a element (a ICompilationUnit) how should I best go about
>>>>>> getting the
>>>>>> repository (CVS) revision preferably as a ICompilationUnit or the
>>>>>> source code using public APIs ?
>>>>>>
>>>>>> And is it possible to listen to Commit and Update CVS events?
>>>>>>
>>>>>> Thanks in advance,
>>>>>> Otto
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Previous Topic:caching on site update
Next Topic:how to change fonts in Eclipse 3.1?
Goto Forum:
  


Current Time: Fri Apr 26 10:32:58 GMT 2024

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

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

Back to the top