1

Does FogBugz 6 support integration with multiple source control systems?

flag

2 Answers

2

FogBugz 7

FogBugz 7 supports multiple repositories, just create them in Admin -> Source Control and download the scripts from there. FogBugz identifies the repos by ixRepository, not sRepo.

FogBugz 6

FogBugz has a very open and configurable source control integration system.  Many users might have multiple repositories or multiple systems and they want to know how to set it up so FogBugz can link to all of them.

FogBugz 6.1 and higher supports multiple repositories within a single source control system. This will even work for FogBugz On Demand users, unlike the other suggestion below. FogBugz 6.1 added the sRepo field to the CVS table for FogBugz which can be used in the Source Control URLs. To do so, add the sRepo argument to the trigger script for your source control system (on the line where the URL with sFile and sPrev and sNew is constructed). To refer to the sRepo value in the Source Control URL, use ^REPO. For instance, if you were using Mercurial and entered the fully-qualified repository URL as sRepo, then the corresponding Source Control URL for logs would be: ^REPO/log/^R2/^FILE

If you are running FogBugz on your Server, or are using multiple source control systems, another way to do this is to have a director script gather your FogBugz requests when you click on links and figure out where to send the user to, based on the repository of that checked in file. This method will work on FogBugz 4 and higher.

  1. Download this script (windows, unix, mac)
  2. Modify the rgRepos array at the top of the file
    Add the name of the repository and the two urls, first the log url then the diff url.  These urls should be in the same format that FogBugz would have taken them in.  (see your Site page in FogBugz for examples)
  3. Then replace the Source Control urls in FogBugz (on the Site page) with
    LOG: repo.asp?LOG=1&FILE=^FILE&R1=^R1&R2=^R2
    DIFF: repo.asp?DIFF=1&FILE=^FILE&R1=^R1&R2=^R2
  4. Have your hook scripts pass the repository in prepended to the FILE parameter
    At the bottom of the hook scripts you will see a request to CVSSUBMIT and you should see something that says "sFile=" & sFile which you would just change to "sFile=repo1:" & sFile for repo1's hook script.

Example for two Source Control Systems

  • I have a subversion repository and a VSS repository.
  • My subversion repository has a WebSVN interface at 
    http://company.com/subversion/
  • My VSS repository can use FogBugz as its Web interface.
  • First I follow all the instructions for connecting to Subversion here and verify that it works.
  • Then I follow all the instructions for connecting to VSS here and verify that it works.
  • I download the above script and edit the rgRepos array so it says the following using the URLs on the Site page from FogBugz:

    Dim rgRepos: rgRepos = Array( "SVN", _
    "http://company.com/subversion/filedetails.php?rep=0&path=^FILE&rev=0&sc=1", _
    "http://company.com/subversion/diff.php?rep=0&path=^FILE&rev=^R2&sc=1", _
    "VSS", _
    "http://your.fogbugz.server/default.asp?pg=pgShowVSSFileHist&FILE=^FILE", _
    "http://your.fogbugz.server/default.asp?pg=pgShowVSSFileDiff&FILE=^FILE&R1=^R1&R2=^R2" )


  • I change the source controls in FogBugz:
    LOG: repo.asp?LOG=1&FILE=^FILE&R1=^R1&R2=^R2
    DIFF: repo.asp?DIFF=1&FILE=^FILE&R1=^R1&R2=^R2
  • I modify logBugDataSVN.vbs to include SVN: as a prefix to the filename
       http.Open "GET", BUGZ_URL_FINAL & CVSSUBMIT & _
        "?ixBug=" & ixBug & "&sFile=" & sFile & "&sPrev=" & sPrev & "&sNew=" & sNew & sTrialClause, False
    becomes
       http.Open "GET", BUGZ_URL_FINAL & CVSSUBMIT & _
        "?ixBug=" & ixBug & "&sFile=SVN:" & sFile & "&sPrev=" & sPrev & "&sNew=" & sNew & sTrialClause, False
  • I modify vss_fbupdate.wsf to include VSS: as a prefix to the filename

      http.Open "GET", BUGZ_URL_FINAL & CVSSUBMIT & _
       "?ixBug=" & sBug & "&sFile=" & DBFolder & ":$/" & Mid(ItemName, 2) & "&sPrev=" & sPrevVersion & "&sNew=" & ItemVersion & sTrialClause, False

    becomes

      http.Open "GET", BUGZ_URL_FINAL & CVSSUBMIT & _
       "?ixBug=" & sBug & "&sFile=VSS:" & DBFolder & ":$/" & Mid(ItemName, 2) & "&sPrev=" & sPrevVersion & "&sNew=" & ItemVersion & sTrialClause, False

link|flag
When I look at my version of logBugDataSVN.pl the URL has a sRepo parameter. Does this change the behaviour noted above? Can I use this to distinguish between repos in repos.asp? – nickd Apr 30 2010 at 11:37
0

What I found differs from above a little. This is with FogBugz 6 with Subversion on Ubuntu 9.10 through Apache with WebSVN 2.2.1

The logBugDataSVN.pl distributed with 6.1 doesn't need to be changed because I use the repository parameter in the URLs, but I did have to add #! /bin/sh to the top of the supplied post-commit script. I also made the invocation of svnlook include an explicit path because there is no environment when invoked through the web server.

I added the repository name to the two urls

repo.asp?LOG=1&FILE=^FILE&R1=^R1&R2=^R2&REPO=^REPO
repo.asp?DIFF=1&FILE=^FILE&R1=^R1&R2=^R2&REPO=^REPO

and changed the URLs in repo.asp like this:

Dim rgRepos: rgRepos = Array( _
   "repos", _
   "http://myserver/websvn/filedetails.php?repname=^REPO&path=/^FILE&rev=^R2", _
   "http://myserver/websvn/diff.php?repname=^REPO&path=/^FILE&rev=^R2", _
)

to work with my version of WebSVN. I also made sRepo default to the repository from the DB.

Dim sRepo: sRepo = Request("REPO")

The only thing left then was to ensue that the repository made it into the redirect URL

If Request("LOG") = "1" Then
    Response.Redirect Replace(Replace(Replace(Replace(_
       rgRepos(i+1),"^FILE", sFile),_
                    "^R1", Request("R1")),_
                    "^R2", Request("R2")),_
                    "^REPO", sRepo)
Else
    Response.Redirect Replace(Replace(Replace(Replace(_
       rgRepos(i+2), "^FILE", sFile),_
                     "^R1", Request("R1")),_
                     "^R2", Request("R2")),_
                     "^REPO", sRepo)
End If
link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.