need info on new 10652 VCS apis

In latest build new interface methods have been added to the VCS interfaces.

com.intellij.openapi.vcs.diff.DiffProvider#getLastRevision(FilePath) : I guess this is the same as com.intellij.openapi.vcs.diff.DiffProvider#getLastRevision(VirtualFile) but would allow to query info for files that have been locally deleted ?

com.intellij.openapi.vcs.diff.DiffProvider#getLatestCommittedRevision : I'm not sure here, the name of the parameter is "vcsRoot", thus it would suggest it only makes sense for those VCSs that have repository wide revision numbers, am I right ?
What should VCS impls return when revisions are only file based ?

Also I don't quite get the new VcsKey that appeared in AbstractVCS. Looking at the Svn source code it seems that 2 instances of this class will be created , one as static member of SvnVcs and one  as part of constructor of AbstracVcs.
Why isn't the svn implementation using com.intellij.openapi.vcs.AbstractVcs#getKeyInstanceMethod to fetch the key ? What would be the recommended usage?

2 comments
Comment actions Permalink

com.intellij.openapi.vcs.diff.DiffProvider#getLastRevision(FilePath) : I guess this is the same as com.intellij.openapi.vcs.diff.DiffProvider#getLastRevision(VirtualFile) but would allow to query info for files that have been locally deleted ?
Yes

com.intellij.openapi.vcs.diff.DiffProvider#getLatestCommittedRevision : I'm not sure here, the name of the parameter is "vcsRoot", thus it would suggest it only makes sense for those VCSs that have repository wide revision numbers, am I right ?
What should VCS impls return when revisions are only file based ?
The method is used to check whether there were any new commits under some root. It can return null - than it would mean that there's no information about whether something had changed (result of this method invocation is cached and compared with next invocation's result).
So, return null.

Also I don't quite get the new VcsKey that appeared in AbstractVCS. Looking at the Svn source code it seems that 2 instances of this class will be created , one as static member of SvnVcs and one  as part of constructor of AbstracVcs.
Why isn't the svn implementation using com.intellij.openapi.vcs.AbstractVcs#getKeyInstanceMethod to fetch the key ? What would be the recommended usage?
This key is used to authenticate VCS to the system. An instance of this class can only be created by AbstractVCS's descendant, so using key is more secure then just using String = VCS name. In fact, it is VCS name wrapper. From any VCS plugin, this key can be created statically, you don't need to pass Project for it. It was the point - to don't require passing Project parameter everywhere where we just need to identify VCS.



0
Comment actions Permalink

Thanks for the prompt reply, this clarifies a lot

0

Please sign in to leave a comment.