Search code examples
eclipsesvneclipse-pluginsubclipse

Using ISVNClientAdapter for svn operations in eclipse plugin


I am trying to use ISVNClientAdapter from org.tigris.subversion.svnclientadapter to invoke svn operations from my eclipse plugin. It seems to offer support for various operations, but it is unclear to me how to use them, starting from a project given as IProject or an SVNTeamProvider.

Can anyone give me a short example how to apply operations (like commit or getStatus)?


Solution

  • One way to go seems to be (If project is the object of type IProject):

    ISVNClientAdapter adapter = SVNProviderPlugin.getPlugin().getSVNClient();
    File file = new File(project.getLocation().toString());
    ISVNStatus[] status = adapter.getStatus(file, true, false);
    

    Together with the absolute path stored in file, adapter can perform different operations on the svn.