<p>I've got TotroiseSVN installed and have a majority of my repositories checking in and out from C:\subversion\ <em>and a couple checking in and out from a network share (I forgot about this when I originally posted this question)</em>.</p>

<p>This means that I don't have a "subversion" server per-se.</p>

<p>How do I integrate TortoiseSVN and Fogbugz?</p>

<p><em>Edit: inserted italics</em></p>

[{'answer_id': 3610, 'author': 'cmcculloh', 'author_id': 58, 'author_profile': 'https://Stackoverflow.com/users/58', 'pm_score': 4, 'selected': False, 'text': '<p><strong>This answer is incomplete and flawed! It only works from TortoisSVN to Fogbugz, but not the other way around. I still need to know how to get it to work backwards from Fogbugz (like it\'s designed to) so that I can see the Revision number a bug is addressed in from Fogbugz while looking at a bug.</strong></p>\n\n<hr>\n\n<h2>Helpful URLS</h2>\n\n<p><a href="http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-propertypage.html" rel="nofollow noreferrer">http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-propertypage.html</a></p>\n\n<p><a href="http://tortoisesvn.net/issuetracker_integration" rel="nofollow noreferrer">http://tortoisesvn.net/issuetracker_integration</a></p>\n\n<hr>\n\n<h2>Set the "Hooks"</h2>\n\n<ol>\n<li><p>Go into your fogbugz account and click Extras > Configure Source Control Integration</p></li>\n<li><p>Download "post-commit.bat" and the VBScript file for Subversion</p></li>\n<li><p>Create a "hooks" directory in a common easily accessed location (preferably with no spaces in the file path)</p></li>\n<li><p>Place a copy of the files in the hooks directories</p></li>\n<li><p>Rename the files without the ".safe" extension</p></li>\n<li><p>Right click on any directory.</p></li>\n<li><p>Select "TortoiseSVN > Settings" (in the right click menu from the last step)</p></li>\n<li><p>Select "Hook Scripts"</p></li>\n</ol>\n\n<p><img src="https://i.stack.imgur.com/QmCxE.png" width="600"/></p>\n\n<ol>\n<li><p>Click "Add"</p></li>\n<li><p>Set the properties thus:</p>\n\n<ul>\n<li><p>Hook Type: Post-Commit Hook </p></li>\n<li><p>Working Copy Path: C:\\\\Projects (or whatever your root directory for all of your projects is. If you have multiple you will need to do this step for each one.) </p></li>\n<li><p>Command Line To Execute: C:\\\\subversion\\\\hooks\\\\post-commit.bat (this needs to point to wherever you put your hooks directory from step 3)</p></li>\n<li><p>I also selected the checkbox to Wait for the script to finish...</p></li>\n</ul></li>\n</ol>\n\n<p><strong>WARNING: Don\'t forget the double back-slash! "\\\\"</strong></p>\n\n<p>Click OK...</p>\n\n<p><img src="https://i.stack.imgur.com/GFHEz.png" alt="Adding a Hook Script"></p>\n\n<p><em>Note: the screenshot is different, follow the text for the file paths, NOT the screenshot...</em></p>\n\n<p>At this point it would seem you could click "Issue Tracker Integration" and select Fogbugz. nope. It just returns "There are no issue-tracker providers available".</p>\n\n<ol>\n<li>Click "OK" to close the whole\nsettings dialogue window</li>\n</ol>\n\n<h2>Configure the Properties</h2>\n\n<ol start="2">\n<li><p>Once again, Right click on the root directory of the checked out\nproject you want to work with (you need to do this "configure the properties" step for each project -- See "Migrating Properties Between Projects" below)</p></li>\n<li><p>Select "TortoiseSVN > Properties" (in the right click menu\nfrom the last step)</p></li>\n<li><p>Add five property value pairs by clicking "New..." and inserting the\nfollowing in "Property Name" and\n"Property Value" respectively:</p></li>\n</ol>\n\n<blockquote>\n  <p>bugtraq:label BugzID:<br>\n  bugtraq:message   BugzID: %%BUGID%%</p>\n  \n  <p>bugtraq:number    true</p>\n  \n  <p>bugtraq:url   <a href="http://[your" rel="nofollow noreferrer">http://[your</a> fogbugz URL\n  here]/default.asp?%BUGID%</p>\n  \n  <p>bugtraq:warnifnoissue false</p>\n</blockquote>\n\n<p><img src="https://i.stack.imgur.com/K28XR.png" alt="properties window">\n<img src="https://i.stack.imgur.com/yDnSC.png" alt="adding new property"></p>\n\n<ol start="15">\n<li>Click "OK"</li>\n</ol>\n\n<h2>Commiting Changes and Viewing the Logs</h2>\n\n<p>Now when you are commiting, you can specify one bug that the commit addresses. This kind of forces you to commit after fixing each bug...</p>\n\n<p><img src="https://i.stack.imgur.com/pGnHL.png" alt="specifying bug addressed when commiting"></p>\n\n<p>When you view the log (Right click root of project, TortoiseSVN > show log) you can see the bug id that each checking corresponds to (1), and you can click the bug id number to be taken to fogbugz to view that bug automatically if you are looking at the actual log message. Pretty nifty!</p>\n\n<p><img src="https://i.stack.imgur.com/ejsUb.png" width="600"/></p>\n\n<hr>\n\n<h2>Migrating Properties Between Projects</h2>\n\n<ol>\n<li><p>Right click on a project that already has the proper Properties configuration</p></li>\n<li><p>Select "TortoiseSVN > Properties" (from the right-click menu from step 1)</p></li>\n<li><p>Highlight all of the desired properties</p></li>\n<li><p>Click "Export"</p></li>\n<li><p>Name the file after the property, and place in an easily accessible directory (I placed mine with the hooks files)</p></li>\n</ol>\n\n<p><img src="https://i.stack.imgur.com/ywPry.png" alt="save properties dialogue"></p>\n\n<ol start="5">\n<li><p>Right click on the root directory of the checked out project needing properties set for.</p></li>\n<li><p>Click "Import"</p></li>\n<li><p>Select the file you exported in step 4 above</p></li>\n<li><p>Click Open</p></li>\n</ol>\n'}, {'answer_id': 5810, 'author': 'Lasse V. Karlsen', 'author_id': 267, 'author_profile': 'https://Stackoverflow.com/users/267', 'pm_score': 2, 'selected': False, 'text': '<p>Why can\'t you simply install a subversion server? If you download <a href="http://www.visualsvn.com/server/" rel="nofollow noreferrer">VisualSVN Server</a>, which is free, you get a http server for your source code and can thus use the FogBugz scripts for integrating the two.</p>\n\n<p>The reason I\'m asking is because all scripts and documentation so far assumes you have the server, client-side scripts are too new for FogBugz to have templates for them so you\'re pretty much left to your own devices on that.</p>\n'}, {'answer_id': 5819, 'author': 'Lasse V. Karlsen', 'author_id': 267, 'author_profile': 'https://Stackoverflow.com/users/267', 'pm_score': 0, 'selected': False, 'text': "<p>I am not sure I follow you. Do you have the repositories on the network or on your C:\\ drive? According to two of your posts, you have both, or neither, or one of them or...</p>\n\n<p>You can not get VisualSVN or Apache to safely serve repositories from a network share. Since you originally said you had the repositories on your C:\\ drive, that's what you get advice for. If you have a different setup, you need to tell us about that.</p>\n\n<p>If you have the repositories on your local harddisk, I would install VisualSVN, or integrate it into Apache. VisualSVN can run fine alongside Apache so if you go that route you only have to install it. Your existing repositories can also just be copied into the repository root directory of VisualSVN and you're up and running.</p>\n\n<p>I am unsure why that big post here is labelled as incomplete, as it details the steps necessary to set up a hook script to inform FogBugz about the new revisions linked to the cases, which should be what the <em>incomplete</em> message says it doesn't do. Is that not working?</p>\n"}, {'answer_id': 9764, 'author': 'Lasse V. Karlsen', 'author_id': 267, 'author_profile': 'https://Stackoverflow.com/users/267', 'pm_score': 1, 'selected': False, 'text': '<p>The problem is that FogBugz will link to a web page, and file:///etc is not a web page. To get integration two ways, you need a web server for your subversion repository. Either set up Apache or something else that can host those things the proper way.</p>\n'}, {'answer_id': 370131, 'author': 'Andy Madge', 'author_id': 46433, 'author_profile': 'https://Stackoverflow.com/users/46433', 'pm_score': 5, 'selected': True, 'text': '<p>I\'ve been investigating this issue and have managed to get it working.  There are a couple of minor problems but they can be worked-around.</p>\n\n<p>There are 3 distinct parts to this problem, as follows:</p>\n\n<ol>\n<li><p><strong>The TortoiseSVN part</strong> - getting TortoiseSVN to insert the Bugid and hyperlink in the svn log</p></li>\n<li><p><strong>The FogBugz part</strong> - getting FogBugz to insert the SVN info and corresponding links</p></li>\n<li><p><strong>The WebSVN part</strong> - ensuring the links from FogBugz actually work</p></li>\n</ol>\n\n<p>Instructions for part 1 are in another answer, although it actually does more than required.  The stuff about the hooks is actually for part 2, and as is pointed out - it doesn\'t work "out of the box"</p>\n\n<p><strong>Just to confirm, we are looking at using TortoiseSVN <em>WITHOUT</em> an SVN server (ie. file-based repositories)</strong></p>\n\n<p>I\'m accessing the repositories using UNC paths, but it also works for local drives or mapped drives.</p>\n\n<p>All of this works with TortoiseSVN v1.5.3 and SVN Server v1.5.2 (You need to install SVN Server because part 2 needs <code>svnlook.exe</code> which is in the server package.  You don\'t actually configure it to work as an SVN Server)  It may even be possible to just copy <code>svnlook.exe</code> from another computer and put it somewhere in your path.</p>\n\n<h1>Part 1 - TortoiseSVN</h1>\n\n<p>Creating the TortoiseSVN properties is all that is required in order to get the links in the SVN log.</p>\n\n<p>Previous instructions work fine, I\'ll quote them here for convenience:</p>\n\n<blockquote>\n  <h2>Configure the Properties</h2>\n  \n  <ol>\n  <li><p>Right click on the root directory of the checked out project you want to work with.</p></li>\n  <li><p>Select "TortoiseSVN -> Properties"</p></li>\n  <li><p>Add five property value pairs by clicking "New..." and inserting the following in "Property Name" and "Property Value" respectively: (make sure you tick "Apply property recursively" for each one)</p>\n\n<pre><code>bugtraq:label    BugzID:\nbugtraq:message  BugzID: %BUGID%\nbugtraq:number   true\nbugtraq:url      http://[your fogbugz URL here]/default.asp?%BUGID%\nbugtraq:warnifnoissue   false\n</code></pre></li>\n  <li><p>Click "OK"</p></li>\n  </ol>\n</blockquote>\n\n<p>As Jeff says, you\'ll need to do that for each working copy, so follow his instructions for migrating the properties.</p>\n\n<p>That\'s it.  TortoiseSVN will now add a link to the corresponding FogBugz bugID when you commit.  If that\'s all you want, you can stop here.</p>\n\n<h1>Part 2 - FogBugz</h1>\n\n<p>For this to work we need to set up the hook scripts.  Basically the batch file is called after each commit, and this in turn calls the VBS script which does the submission to FogBugz.  The VBS script actually works fine in this situation so we don\'t need to modify it.</p>\n\n<p>The problem is that the batch file is written to work as a <em>server</em> hook, but we need a <em>client</em> hook.</p>\n\n<p>SVN server calls the post-commit hook with these parameters:</p>\n\n<pre><code>&lt;repository-path&gt; &lt;revision&gt;\n</code></pre>\n\n<p>TortoiseSVN calls the post-commit hook with these parameters:</p>\n\n<pre><code>&lt;affected-files&gt; &lt;depth&gt; &lt;messagefile&gt; &lt;revision&gt; &lt;error&gt; &lt;working-copy-path&gt;\n</code></pre>\n\n<p>So that\'s why it doesn\'t work - the parameters are wrong.  We need to amend the batch file so it passes the correct parameters to the VBS script.</p>\n\n<p>You\'ll notice that TSVN doesn\'t pass the repository path, which is a problem, but it does work in the following circumstances:</p>\n\n<ul>\n<li>The repository name and working copy name are the same</li>\n<li>You do the commit at the root of the working copy, not a subfolder.</li>\n</ul>\n\n<p>I\'m going to see if I can fix this problem and will post back here if I do.</p>\n\n<p>Here\'s my amended batch file which does work (please excuse the excessive comments...)</p>\n\n<p>You\'ll need to set the hook and repository directories to match your setup.</p>\n\n<pre><code>rem @echo off\nrem   SubVersion -&gt; FogBugz post-commit hook file\nrem   Put this into the Hooks directory in your subversion repository\nrem   along with the logBugDataSVN.vbs file\n\nrem   TSVN calls this with args &lt;PATH&gt; &lt;DEPTH&gt; &lt;MESSAGEFILE&gt; &lt;REVISION&gt; &lt;ERROR&gt; &lt;CWD&gt;\nrem   The ones we\'re interested in are &lt;REVISION&gt; and &lt;CWD&gt; which are %4 and %6\n\nrem   YOU NEED TO EDIT THE LINE WHICH SETS RepoRoot TO POINT AT THE DIRECTORY \nrem   THAT CONTAINS YOUR REPOSITORIES AND ALSO YOU MUST SET THE HOOKS DIRECTORY\n\nsetlocal\n\nrem   debugging\nrem echo %1 %2 %3 %4 %5 %6 &gt; c:\\temp\\test.txt\n\nrem   Set Hooks directory location (no trailing slash)\nset HooksDir=\\\\myserver\\svn\\hooks\n\nrem   Set Repo Root location (ie. the directory containing all the repos)\nrem   (no trailing slash)\nset RepoRoot=\\\\myserver\\svn\n\nrem   Build full repo location\nset Repo=%RepoRoot%\\%~n6\n\nrem   debugging\nrem echo %Repo% &gt;&gt; c:\\temp\\test.txt\n\nrem   Grab the last two digits of the revision number\nrem   and append them to the log of svn changes\nrem   to avoid simultaneous commit scenarios causing overwrites\nset ChangeFileSuffix=%~4\nset LogSvnChangeFile=svn%ChangeFileSuffix:~-2,2%.txt\n\nset LogBugDataScript=logBugDataSVN.vbs\nset ScriptCommand=cscript\n\nrem   Could remove the need for svnlook on the client since TSVN \nrem   provides as parameters the info we need to call the script.\nrem   However, it\'s in a slightly different format than the script is expecting\nrem   for parsing, therefore we would have to amend the script too, so I won\'t bother.\nrem @echo on\nsvnlook changed -r %4 %Repo% &gt; %temp%\\%LogSvnChangeFile%\nsvnlook log -r %4 %Repo% | %ScriptCommand% %HooksDir%\\%LogBugDataScript% %4 %temp%\\%LogSvnChangeFile% %~n6\n\ndel %temp%\\%LogSvnChangeFile%\nendlocal\n</code></pre>\n\n<p>I\'m going to assume the repositories are at <code>\\\\myserver\\svn\\</code> and working copies are all under `C:\\Projects\\</p>\n\n<ol>\n<li><p>Go into your FogBugz account and click Extras -> Configure Source Control Integration</p></li>\n<li><p>Download the VBScript file for Subversion (don\'t bother with the batch file)</p></li>\n<li><p>Create a folder to store the hook scripts.  I put it in the same folder as my repositories. eg. <code>\\\\myserver\\svn\\hooks\\</code></p></li>\n<li><p>Rename VBscript to remove the <code>.safe</code> at the end of the filename.</p></li>\n<li><p>Save my version of the batch file in your hooks directory, as <code>post-commit-tsvn.bat</code></p></li>\n<li><p>Right click on any directory.</p></li>\n<li><p>Select "TortoiseSVN > Settings" (in the right click menu from the last step)</p></li>\n<li><p>Select "Hook Scripts"</p></li>\n<li><p>Click "Add" and set the properties as follows:</p>\n\n<ul>\n<li><p>Hook Type: Post-Commit Hook</p></li>\n<li><p>Working Copy Path: <code>C:\\Projects</code> (or whatever your root directory for all of your projects is.)</p></li>\n<li><p>Command Line To Execute: <code>\\\\myserver\\svn\\hooks\\post-commit-tsvn.bat</code> (this needs to point to wherever you put your hooks directory in step 3)</p></li>\n<li><p>Tick "Wait for the script to finish"</p></li>\n</ul></li>\n<li><p>Click OK twice.</p></li>\n</ol>\n\n<p>Next time you commit and enter a Bugid, it will be submitted to FogBugz.  The links won\'t work but at least the revision info is there and you can manually look up the log in TortoiseSVN.</p>\n\n<p>NOTE: You\'ll notice that the repository root is hard-coded into the batch file.  As a result, if you check out from repositories that don\'t have the same root (eg. one on local drive and one on network) then you\'ll need to use 2 batch files and 2 corresponding entries under Hook Scripts in the TSVN settings.  The way to do this would be to have 2 separate Working Copy trees - one for each repository root.</p>\n\n<h1>Part 3 - WebSVN</h1>\n\n<p>Errr, I haven\'t done this :-)</p>\n\n<p>From reading the WebSVN docs, it seems that WebSVN doesn\'t actually integrate with the SVN server, it just behaves like any other SVN client but presents a web interface.  In theory then it should work fine with a file-based repository.  I haven\'t tried it though.</p>\n'}]
['https://Stackoverflow.com/questions/3607', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/58/']