Multiple Repositories - Multiple Source Control Systems
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.
- Download this script (windows, unix, mac)
- 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) - 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 - 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 & _becomes
"?ixBug=" & ixBug & "&sFile=" & sFile & "&sPrev=" & sPrev & "&sNew=" & sNew & sTrialClause, False
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 & _becomes
"?ixBug=" & sBug & "&sFile=" & DBFolder & ":$/" & Mid(ItemName, 2) & "&sPrev=" & sPrevVersion & "&sNew=" & ItemVersion & sTrialClause, False
http.Open "GET", BUGZ_URL_FINAL & CVSSUBMIT & _
"?ixBug=" & sBug & "&sFile=VSS:" & DBFolder & ":$/" & Mid(ItemName, 2) & "&sPrev=" & sPrevVersion & "&sNew=" & ItemVersion & sTrialClause, False
