Debugging Subversion Source Control Integration

Monday, December 10, 2007 by Michael H. Pryor

FogBugz Subversion Source Control integration consists of two parts:

  1. a trigger script run from the source control system to notify FogBugz of a checkin
  2. a link in FogBugz to a web front end of the source control system


If you check in a file and don't see any corresponding info appear in the FogBugz bug

  • make sure you are using the correct syntax when referring to the case.  Try BugzID:1 (if you have a case number 1)
  • see if the trigger is running.  The post-commit script for Subversion has a line at the end that says
    rm /var/tmp/$LOGSVNCHANGEFILE (unix)
    del %temp%\%logsvnfile% (windows)

    Add a # character to the beggining of this line so after the commit runs it does NOT delete the file in /var/tmp (or c:\temp, c:\windows\temp)
    Run a commit again and validate the file is there
  • see if the logBugDataSVN file is working.  The easiest way to do this is to call it from the command line
    Unix:
    svnlook changed -r $REV $REPOS > /var/tmp/svnfile
    svnlook log -r $REV $REPOS | perl /path/to/logBugDataSVN.pl $REV /var/tmp/svnfile
    Windows:
    svnlook changed -r $REV $REPOS > /var/tmp/svnfile
    svnlook log -r $REV $REPOS | cscript /path/to/logBugDataSVN.vbs $REV /var/tmp/svnfile
    Replace $REV with a valid revision number and $REPOS with the path to your repository.
  • If the above lines DID make an entry on your case, focus on the post-commit script.  It's likely that svnlook is not in the scripts path and you need to rewrite those lines in the script to use the full path to svnlook.  Or the user that subversion runs as may not have permission to run cscript.exe (on windows).
  • If the above lines DID NOT make an entry on your case, logBugDataSVN is failing.
  • If you are using On Demand, or have a SSL FogBugz install, one of the most common reasons for logBugDataSVN.pl failing is the script cannot find wget.  At the top of the script it may say $wget_path = `which wget`; and you should change this to $wget_path = "/actual/path/to/wget";
    Also at the bottom of the script you should change the line that calls system to be system("$wget_path --no-check-certificate '$url' -q -O /dev/null");

If the info is actually getting into FogBugz but the link back to WebSVN is not working

  • Outside of FogBugz navigate to your site and make sure WebSVN is working on its own.  Note the URLs that it is using and make sure you have set the appropriate pointers to this install in your FogBugz Settings->Site page.
  • If you are using an older version of FogBugz and you see %2F in the URLs where you should see "/", go here and change your Apache AllowEncodedSlashes configuration.
This article talks about debugging Subversion Source Control Integration.