This Question is Answered

2 "helpful" answers available (2 pts)
3 Replies Last post: Jan 10, 2010 8:26 PM by Nik Krishna  
Nik Krishna Newbie 7 posts since
Jul 28, 2008
Currently Being Moderated

Dec 2, 2009 8:36 AM

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!

Dmitry Jemerov JetBrains 11,356 posts since
Aug 19, 2002
Currently Being Moderated
Jan 7, 2010 2:28 PM in response to: Nik Krishna
Re: Determining VCS repository and credentials

Hello Nik,

 

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.

 

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!"

 

 

 

More Like This

  • Retrieving data ...