VCS plugin - show file changes from head revision when file opens

I am working on a IDEA VCS plugin for Git and have an issue that I can't figure out. When editing a file, the IDEA editor correctly marks lines with gutter colors when making changes. When re-opening the changed file, all of the change markers are lost. Can I somehow get it to compare agains the VCS HEAD version on open so that it will correctly indicate what has changed in the file since the last VCS commit? Basically, I want the change markers to compare against the VCS, not just the current editing session.


In a probably unrelated issue, when pulling up a diff using my "Compare against repository version..." action, the side-by-side diff does seem to work, but the insert/delete colors/indicators are reversed. It seems to think what was inserted was deleted & etc. Any ideas?

thanks
Mark

3 comments
Comment actions Permalink

On Fri, 23 May 2008 23:20:23 +0000, Mark Scott wrote:

There are two of us! What a scary thought!

--
Mark Scott
mark@codebrewer.com

0
Comment actions Permalink

Hello Mark,

I am working on a IDEA VCS plugin for Git and have an issue that I
can't figure out. When editing a file, the IDEA editor correctly
marks lines with gutter colors when making changes. When re-opening
the changed file, all of the change markers are lost. Can I somehow
get it to compare agains the VCS HEAD version on open so that it will
correctly indicate what has changed in the file since the last VCS
commit? Basically, I want the change markers to compare against the
VCS, not just the current editing session.


The change markers are not supposed to show the difference against the latest
VCS revision - instead, they show the difference against the version that
the user has fetched from the VCS. If someone else commits some other changes
after you pull from git, you are not supposed to get change markers showing
the difference between your version and the latest one on the server.

To get correctly working change markers, you need to implement the ChangeProvider
interface and return correct content in the ContentRevision you specify as
Change.getBeforeRevision().

You can refer to the following document to get more information on this:
http://www.jetbrains.net/confluence/display/IDEADEV/DevelopingVCSIntegrationPluginsforIntelliJIDEA

In a probably unrelated issue, when pulling up a diff using my
"Compare against repository version..." action, the side-by-side diff
does seem to work, but the insert/delete colors/indicators are
reversed. It seems to think what was inserted was deleted & etc. Any
ideas?


You need to implement VcsRevisionNumber.compareTo() correctly. The side-by-side
revisions are placed so that the smaller revision is on the left and the
larger one on the right.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Thanks, that helped!

0

Please sign in to leave a comment.