Fastest way to retrieve VcsRevisionNumber
Hi,
I am looking for the fastest way to retrieve the current VCS revision number for a given file.
In my reVu plugin, I use com.intellij.openapi.vcs.diff.DiffProvider#getCurrentRevision(VirtualFile) method, but this is based on VCS implementation which call their internal service to retrieve this number. Since I want to apply a filter on project files based on a range of revisions, this may be a huge operation for large projects.
I wish I could find a way to retrieve these revision numbers from a local cache maintained in Idea, could someone confirm this is not available ?
Thanks
Sylvain
Please sign in to leave a comment.
Hello Sylvain,
ChangelistManager.getChange(VirtualFile).getBeforeRevision().getRevisionNumber()
(with appropriate null checks added, of course)
This works for modified files; IDEA doesn't keep track of the version number
for files which aren't modified.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
OK, thanks for confirmation Dmitry.
Sylvain