Verifying SVN symbolic rules

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

This page describes a simple command-line tool ('svnrules') that you can use to find branch and tag creation changes for which there may not be SVN symbolic rules defined. The tool is available on all supported platforms but the examples below feature a Linux installation.

You may have configured SVN symbolic rules in Fisheye if your SVN repository structure doesn't strictly follow the Subversion Repository Layout conventions; these rules allow Fisheye to understand your custom layout.

A possible consequence of not using symbolic rules for custom repository layouts, or of configuring these incorrectly, is that Fisheye may not recognize separate trunk, branch and tag creation changes, and spend excessive time indexing those as genuine changes.  

The svnrules tool ships with Fisheye 3.0, and later versions. It parses the SVN log and compares that against the SVN symbolic rules configured in Fisheye to find commits that are likely to be branch or tag creation changes for which there are no SVN symbolic rule defined.

You may find the svnrules tool helpful if you use a custom SVN repository structure, and

  • you want to analyze your repositories before indexing them, to avoid excessive time spent indexing
  • you wish to analyze your repository structure yourself that must remain confidential.

Disclaimer: Please note that svnrules is very simple and doesn't attempt to perform a thorough inspection of the repository. It simply scans the repository history for copy/move operations, which in most cases indicate branch or tag creation changes. Those may be genuine copy operations within a repository, so false positives may be reported. 

Running the svnrules tool

The svnrules tool ships with Fisheye and can be run from the command line as follows:

$ ./bin/fisheyectl.sh svnrules <REPOSITORY_NAME>
# e.g.
$ ./bin/fisheyectl.sh svnrules supercollider

You can point it to your existing Fisheye instance folder with:

$ FISHEYE_INST=<FISHEYE_INST_FOLDER> ./bin/fisheyectl.sh svnrules <REPOSITORY_NAME>
# e.g.
$ FISHEYE_INST=/home/fecru/fecru_inst ./bin/fisheyectl.sh svnrules supercollider

The tool can be safely run when Fisheye is already running, because it never attempts to modify any Fisheye data or configuration files. It only analyzes the given repository structure and reports copy operations that may be unrecognized tag/branch creation changes because of missing symbolic rules.

If you run the tool on a properly configured repository that has no copy operations in its history, it would generate output similar to:

$ FISHEYE_INST=/home/fecru/fecru_inst ./bin/fisheyectl.sh svnrules sanity-svn
INFO  - Using log4j configuration file: /home/fecru/fecru_home/log4j-client.xml
INFO  - FishEye SVN Symbolic Rules Verifier
INFO  - FishEye arguments: [sanity-svn]
INFO  - loading config from file: /home/fecru/fecru_inst/config.xml
INFO  - Testing connection to repo sanity-svn
INFO  - Connected to repo sanity-svn
INFO  - Processing svn log for a revision range: 0 ... HEAD
INFO  - Verification complete, no issues found.

 

Any suspected copy operations are reported similarly to this:

$ FISHEYE_INST=/home/fecru/fecru_inst ./bin/fisheyectl.sh svnrules supercollider
...
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 9678, path: /trunk/xtralibs/iphone/libsndfile_iphone.a
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 9748, path: /trunk/build/SCClassLibrary/JITLib/basics/EnvironmentRedirect.sc
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 9821, path: /trunk/iphone/lib
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 9822, path: /trunk/mac/Standalone Resources
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 9871, path: /trunk/common/Packager
WARN  - Copy operation recognised as unknown commit, if this is branch or tag creation change consider adding symbolic rule. Revision: 9901, path: /packages/ubuntu/supercollider-vim.menu
WARN  - Copy operation recognised as unknown commit, if this is branch or tag creation change consider adding symbolic rule. Revision: 9901, path: /packages/ubuntu/supercollider-emacs.menu
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 10045, path: /trunk/common/build/SCClassLibrary/Common/GUI/osx/scide_scapp/viewExtensionsOSX.sc
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 10047, path: /trunk/common/build/SCClassLibrary/Common/GUI/SCViewHolder.sc
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 10048, path: /trunk/common/build/SCClassLibrary/Common/GUI/guicrucial/StringGui.sc
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 10058, path: /trunk/common/build/SCClassLibrary/JITLib/GUI/JITGui.sc
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 10059, path: /trunk/common/build/Help/Libraries/JITLib/GUI
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 10069, path: /trunk/common/build/SCClassLibrary/Common/Collections/EnvironmentRedirect.sc
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 10070, path: /trunk/common/build/SCClassLibrary/Common/Streams/History.sc
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 10072, path: /trunk/common/build/SCClassLibrary/JITLib/GUI/ProxyMixerOld.sc
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 10124, path: /trunk/common/Source/common/iPhone/FileBrowserViewController.mm
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 10214, path: /trunk/common/include/nova-simd/vec.hpp
WARN  - Copy operation recognised as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. Revision: 10243, path: /trunk/common/cmake_modules/FindFFTW3f.cmake
WARN  - Verification complete, 76 issues found.
WARN  - Most common issues:
WARN  - Path /trunk reported 72 times.
WARN  - Path /trunk/build reported 36 times.
WARN  - Path /trunk/build/Help reported 22 times.
WARN  - Path /trunk/common reported 12 times.
WARN  - Path /trunk/build/SCClassLibrary reported 11 times.
WARN  - Path /trunk/build/SCClassLibrary/Common reported 8 times.
WARN  - Path /trunk/common/build reported 8 times.
WARN  - Path /trunk/common/build/SCClassLibrary reported 7 times.
WARN  - Path /trunk/common/build/SCClassLibrary/Common reported 5 times.
WARN  - Path /trunk/build/Help/GUI reported 5 times.

As you can see, there are number of warnings reported, followed by a summary of the most common issues.

Interpreting the svnrules report

Symbolic rule evaluation outcomeIssue reported
path recognized to be branch or tagNo issue reported – seems we have the correct SVN symbolic rule in place
path recognized as a trunkCopy operation recognized as commit to trunk, if this is branch or tag creation change consider adding symbolic rule. 
False positives would be reported here where file(s) or folder(s) were genuinely copied within a trunk.
path not recognized as trunk, branch or tagCopy operation recognized as unknown commit, if this is branch or tag creation change consider adding symbolic rule.
You may want to advise the user to consider excluding this folder from indexing.

Implementation information

Internally, the tool runs the following command on the selected repository:

 svn log -v

For large repositories this may take a significant amount of time. You may want to analyze parts of the history, using the -s and -e options:

$ ./bin/fisheyectl.sh svnrules --help
INFO  - Using log4j configuration file: /home/fecru/fecru_home/log4j-client.xml
INFO  - FishEye SVN Symbolic Rules Verifier
INFO  - FishEye arguments: [--help]
ERROR - Usage: fisheyectl.sh svnrules repname
Verifies symbolic rules on selected svn repository.
Please note this command may take very long time to run.
OPTIONS:
   -s, --start         start analysis from given revision number (numeric or START), default START
                       where START is start revision configured in Fisheye for selected repository
                       or revision 1 if start revision is empty.
   -e, --end           finish analysis on a given revision number (numeric or HEAD), default HEAD
   -h, --help          this help
 
# e.g. to analyse only changesets 5..10 use:
$ FISHEYE_INST=/home/fecru/fecru_inst ./bin/fisheyectl.sh svnrules -s 5 -e 10 sanity-svn
INFO  - Using log4j configuration file: /home/fecru/fecru_home/log4j-client.xml
INFO  - FishEye SVN Symbolic Rules Verifier
INFO  - FishEye arguments: [sanity-svn]
INFO  - loading config from file: /home/fecru/fecru_inst/config.xml
INFO  - Testing connection to repo sanity-svn
INFO  - Connected to repo sanity-svn
INFO  - Processing svn log for a revision range: 5 ... 10
INFO  - Verification complete, no issues found.
Last modified on Oct 25, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.