NetBeans Subversion Support F.A.Q.
1. General Questions
2. Netbeans 6.0 (dev) specific questions
1.1 What's the goal of NetBeans Subversion Support?
The goal is to integrate Subversion with the NetBeans IDE functionality.
1.2 What are the main features of NetBeans Subversion Support?
Module functionality focuses on daily version control tasks and integrates them into the IDE workflow:
- A checkout wizard with a repository browser
- A project import wizard with the repository browser
- The project explorer decorations showing files status
- A project update with dependencies
- A multi-file graphical diff
- A Subversion view monitoring files status
- An integrated editor blame (annotations) sidebar
- A commit dialog that automatically adds all locally new files
- A multicriteria history search with Revert Changes and Export Diff Patch functionality
1.3 What do I need for NetBeans Subversion Support?
Before taking advantage of the IDE's Subversion Support, you need to have subversion client installed on your system. The IDE supports subversion client versions 1.3.x and 1.4.0. You can download Subversion as either sources or as a binary from the following link:
http://subversion.tigris.org/project_packages.html
1.4 Are JavaHL and JavaSVN supported?
No, they aren't.
1.5 What versions of working copies are supported?
IDE supports only working copies created by subversion clients 1.3.x and 1.4.0. But it can work with subversion repositories based on previous versions of subversion.
1.6 Why does NetBeans complain about missing subversion client?
Default installation path for Subversion executables is
/usr/local/bin for Unix-like systems. MacOS and other platforms that allow users to run applications within the desktop face to the problem of not shared system variables. ("PATH" system variable).
Therefore NetBeans Subversion provides
1.7 How to setup svn+ssh for subversion?
svn+ssh access method type is one of the subversion's protocols supported in NetBeans that calls for valid settings in subversion *config* file. This file is placed in:
- windows:
%APPDATA%\Subversion\config
- *nix (mac):
$HOME/.subversion/config>
Open this file and edit [tunnels] section:
- windows:
# with the use of private key authentication
ssh = $SVN_SSH plink.exe -l <username> -i D:/new_my_private_key.ppk
# or with password authentication
ssh = $SVN_SSH plink.exe -l <username> -pw password
Putty applications can be downloaded as binaries from the following link:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
- other systems:
ssh = $SVN_SSH ssh -l <username> -i identy_file
SSH password-caching tools can help if ssh is repeatedly asking for password. Such tools are
Pageant (as a part of Putty applications) on Windows and
ssh-agent on Unix-like system.
If key was generated also with the
PassPhrase, then you will have to use "ssh password-caching" tool.
windows
- modify [tunnels] section of subversion config file:
ssh = $SVN_SSH plink -l <username>
-
- download and start Pageant tool. (it's shown in the system tray)
- open it and add the key, you will be prompted for PassPhrase
*nix (MacOS)
- modify [tunnels] section of subversion config file:
ssh = $SVN_SSH ssh -l <username>
- run ssh-agent in terminal
- export all variables generated by ssh-agent
- run svn-add /path_to_indentity_file
- start NetBeans IDE from same terminal
1.8 How to show subversion branch/tag annotations?
- in Netbeans 5.5 use the Recommended repository layout for branches and tags if you want to take advantage of the NetBeans Subversion Support Annotations:
/
trunk/
project/
branches/
<name_for_branch>/
project/
...
tags/
<name_for_tag>/
project/
...
or
/
branches/
<name_for_branch>/
project/
...
tags/
<name_for_tag>/
project/
...
Then if Show Subversion Status Labels (in View main menu item) option is checked sources will be annotated with <name_for_branch> (<name_for_tag>). Annotation comes from first directory under "branches" (tags) folder. Project root is not being annotated.
- for Netbeans 6.0 (dev) there is a Option Dialog to specify rules how a file should be annotated
see also 2.2 How to setup the Subversion Status Labels?
1.9 How can the file be added as binary?
Mysterious Commit Action column in "Commit" dialog and in 3rd step of "Import" wizard is editable. According to the status of the file/directory there are available actions:
[Locally New]:
- Add as Text: file is added textually and committed into a repository. Then diff action show textual diff.
- Add as Binary: file is added binary and committed into a repository. Diff action doesn't show textual diff.
- Exclude from Commit: neither addition nor committing is performed. File/directory is striken through and it's excluded from all commit operations.
- Add as Directory: this option is shown only for directories.
[Locally Modified]:
- Commit: file/directory will be committed.
- Exclude from Commit: file/directory will be omitted from commit. File/directory is striken through and it's excluded from all commit operations.
1.10 How can I avoid checking out top folder from the repository? Can I use the other name for it?
Layouts of subversion repositories can be various. For example:
/
project
trunk/
src/
test/
branches/
src/
test/
tags/
src/
test/
Now I want to checkout content of the trunk folder directly into the "Project" directory in my working copy. (I want to avoid creation of the trunk folder in "Project" directory.)
- Invoke Checkout wizard and setup all necessary fields and push "Next" button.
- Setup "Resitory Folder(s)" field to "project/trunk".
- Check Checkout only folder content option. (Skip <folder_name> and checkout only its content for NetBeans IDE 6.0)
- Setup "Local Folder" field to "/desired_path/Project". And push "Finish" button.
Content of the trunk folder is checked out into "/desired_path/Project" directory without creation of the trunk as top folder in a working copy.
2.1 How to setup the path to the SVN excutable?
There is a new Options dialog for the Netbeans 6.0 Subversion support under Tools/Options/Miscellaneous
Write the SVN exectables path into the 'SVN executable Path' field.
2.2 How to setup the Subversion Status Labels?
There is a new Options dialog for the Netbeans 6.0 Subversion support under Tools/Options/Miscellaneous
The Labels can be set in the 'Subversion Status Labels Section'

where:
- the Status Label Format textfield specifies how the files in the project explorer are to be annotated
- the following variables may be used as a reference to a specific value:
- {status} - stays for the files svn status
- {mime_type} - stays for the files svn:mime_type property
- {revision} - stays for the files svn revision
- {folder} - this one can be usefull when working with copies representing branches or tags.
It stays for a repository folders symbolic name which has to be specified in the 'Repository Folder Name' table.
How exactly do it will be explained later in this section.
So if the value specified in the 'Status Label Format' field is
[{status}; {revision}]
the files in the project exporer will be labeled like

- the Repository Folder Name table specifies a set of generic rules defining how a file in the Project Explorer should be annotated
depending on the Repository Folder it comes from
- this can be done as explained below
- Repository URL Pattern - a regex pattern to match a URL (Repository Folder)
- Folder Name - may be one of the following values
- a simple string - e.g. "mybranch"
- a reference to a group from the regular expression in the 'Repository URL Pattern' column - e.g "\2" gives the value
represented by the second group in the regular expression from the 'Repository URL Pattern' column
- a combination from references and strings - e.g. "mybranch - \2"
So if there are the following values in the table

then all files from a URL 'http://svn.server.org/svn/branches/JavaApplication28_b1' will be annotated like in the following example
