Determining VCS repository and credentials
Hi, could someone please point me to the correct API (doc or code) for determining information about the version control system that is managing a file? For example, if a file is managed by subversion, I want to be able to programmatically determine the subversion repo this file was checked out from, and the username and password that was used. I think IntelliJ must have this information, whether it gets it from the subversion configuration directory or by prompting the user. I understand that VCS settings are per module. I'm just wondering if there's any way to get this information through the Open API.
Thanks!
Please sign in to leave a comment.
Hi, I never got an answer to this. If anybody can help it would be greatly appreciated. Thanks!
Hello Nik,
To get the versioning VCS, you can use ProjectLevelVcsManager.getInstance(project).getVcsFor(file).
For anything more specific, there is no general VCS-independent API. You
can look at the sources of the Subversion plugin (for example, the SvnFileUrlMapping
class) to see how it manages that.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thanks once again, Dmitry. This was the info I needed.