Configuring TortoiseSVN in Intellij

Why using source control plugins in IDE instead of stand alone client application?

Usually source version control systems are offering plugins for different integrated development environment (IDE). Using these plugins will save time and will make developers more effective. They have not to leave the IDE for different version control operations like commit, checkout, update, revert and more. They can get revision history and compare different revisions or get some specific changes in one file inside the IDE.

Another benefit of using these plugins are ability to integrate them with issue tracking systems. It will be possible to create change lists based on a some specific issue and connect source control and issue tracking to each other.

Configuring TortoiseSVN in Intellij

The SVN plugin installed in Intellij is not working with the new version of SVN (while writing this post TortoiseSVN 1.8.5 and Intellij IDEA 13.5). So it is not possible to use stand alone application and the SVN plugin in Intellij on the same folder. With other words you should either use stand alone application or Intellij plugin.

To solve this you should download and install SVN command line client. In this page you can find some implementation of command line client. I chose VisualSVN and downloaded its command line client. After downloading zip file and unzipping it copy the content of ”bin” directory to   your TortoiseSVN  bin directory (probably this path: C:\Program Files\TortoiseSVN\bin).

Now you should configure Intellij so it uses the new downloaded client.  In Settings->Version Control->Subversion check ”Use command line client” and then browse to svn.exe file in the above path. See the figure below:

Use SVN command line client

Use SVN command line client

 

The next step will be to checkout files from your repository inside Intellij. In the Intellij menu choose VCS->Checkout from version control->subversion.

In the new window add your repository and click on checkout. In next window select the checkout destination directory. In next one you can choose some checkout options like folder and the revision. See figure below.

checkout_options_svn

 

The next window is asking about the working copy format. You should choose the same format as your ToroiseSVN version number in this case 1.8.

Answer to the warning about creating project no and then you are finished. You can see the files in Intellij.

The next step is to introduce the folder or whole project to Intellij as version controlled by subversion.  By doing this you can see the subversion alternative while right clicking on version controlled files and folders in the Intellij Project view. For this purpose in Settings->Version Control choose that your project is version controlled by subversion or add the folder that you want to version control it. See the figure below:

project_folder_version_controlled

After this it is possible to see the Subversion on the context menu while right clicking on a file or folder and do usual version control operations. See the figure below.

Subversion_contextmenu

The ”changes” view in Intellij will help you to see the last changes and manage your change list. If it is not activated you can activate it by pressing Alt+9 short commando or by choosing the menu option View->Tool Windows->Changes.

With right clicking on your version controlled folder and choosing ”show in explorer” option you can open the folder in the windows explorer.  You can see that the folder even is version controlled by the ToroiseSVN stand alone application and you can use it for version control your files while having the ability to do that inside Intellij.

Upgrading the third-party libraries under Perforce source control

Some times it is easier to keep track of the third-party libraries in your project with help of the source control system. If the library has too many files it can be little complex to upgrade it. You are going to get some new files, you have to delete some old files and you should replace some existing files with the new one. Doing this while using Perforce as version control system is something that I am forgetting every time. So I am going to register it here.

For example if you have the recommended ”jre” for running your application under Perforce,  you should upgrade it as below.

  1. Open the ”jre” folder under Perforce in Windows File explorer.
  2. Right click on it and uncheck the read-only check box. Press OK.
  3. Delete all files and folders under the ”jre” folder.
  4. Copy files and folders from the new ”jre” folder to the empty ”jre” folder under Perforce.
  5. Open Perforce (P4V) with your workspace. Run refresh on the ”jre” folder.
  6. right click on the ”jre” folder in Perforce and choose ”reconcile offline work”.
  7. You should see a Windows like below. Click on reconcile and submit your changelist.

reconcileoflinework