Name

Subversion

Download URL

C# source code attached. See How do I...Write my first extension in .Net? for compilation instructions.

Overview

I modified the MindTouch Subversion extension to add the following features:

  • added a config key bug-regex to specify the regular expression for matching bug id's
  • added code to retrieve some bugtraq properties from Subversion

Note: this has been tested only minimally so I'm just providing the source for now. Hope this is helpful and that some or all of these changes are eventually integrated back into the original extension.

bug-regex config key

If bug-regex is specified, it will override the following default bug id matching regular expression:

(?:bugfix|bug|fixes|\#)+(?:[\s|\W]*[0]*(?<bug>\d+))+

Use a capturing group around the actual bug id expression (other grouping should be non-capturing).

Note: if use-bugtraq-props is true and the bugtraq:logregex property is found then bugtraq:logregex will take precedence.

bugtraq properties

If the config key use-bugtraq-props is set to true, this extension will attempt to retrieve bugtraq:url and bugtraq:logregex properties from svn. These properties are discussed in the TortoiseSVN documentation under Integration with Bug Tracking Systems / Issue Trackers.

  • If path refers to a file, this extension will attempt to retrieve the properties from the containing folder.
    • E.g. if path="trunk/www/index.php" then it will attempt to retrieve properties from "trunk/www"
  • If use-bugtraq-props is true and bugtraq:url is found, it will take precedence over the bugs-uri config key.
  • If use-bugtraq-props is true and bugtraq:logregex is found, it will take precedence over the bug-regex config key.
  • Both single-line and two-line values are handled for bugtraq:logregex.
  • Note: enabling use-bugtraq-props adds 3 additional calls to svn on the repository which could affect performance.

Configuration

All configuration options from the original Subversion extension plus the following:

Config Key Description
bug-regex Optional regular expression to match bug IDs in the log message. Example: [Ii]ssue(?:s)? #?(\d+)
use-bugtraq-props Optional boolean to specify whether or not to retrieve bugtraq:url and bugtraq:logregex properties from svn (may have a performance impact). Default: false

mhenry07 01 July 2008

  

  

Change log

  • 2008-06-30: Added support for bugtraq:url and bugtraq:logregex svn properties (enable via use-bugtraq-props) and added a configurable regex for bug-id's via bugregex. - MH
  • 2008-07-03: Modified SvnNodeKind to retrieve type attribute via XDoc rather than a regex. Fixed GetParentPath to properly handle top-level files (a file with no containing folder specified in the path). - MH

TODO

  • Convert to use SharpSvn instead of the command-line Subversion client

  

Below are the contents of the Subversion extension page:

Subversion

Vendor MindTouch
Type Extension
Categories Developers
Requires MindTouch 1.9 or later
OS Restriction None
Status Stable
License Free/Open Source
SID (service id) sid://mindtouch.com/2008/02/svn
Assembly mindtouch.deki.services

 

Table of Contents

Description

This extension contains functions for embeding Subversion (SVN) commit logs with automatic links to a bug tracker.

See also How to add an extension, Using the Extension Dialog, Learn about DekiScript, Extensions Directory.

Configuration:

Before the Subversion service can be used, it must be configured.

Config Key Description
svn-uri URI to the SVN repository. Example: https://dekiwiki.svn.sourceforge.net/svnroot/dekiwiki
username Optional username for SVN repository
password Optional password for SVN repository
path-to-svn Path to the 'svn' binary on the file system. Default: /usr/bin/svn
bugs-uri Optional URI to a bug tracker with the bug# replaced with '$1'. Example: http://bugs.opengarden.org/view.php?id=$1
svn-revision-uri Optional URI to a web based SVN revision viewer with the revision# replaced with '$1' . Example: http://dekiwiki.svn.sourceforge.net/...ev&revision=$1

  

Additional Information:

As for every extension, the subversion extension can be added several times, e.g. for different servers. To accomplish this, set the service preference "namespace". If it is set e.g. to "mysvn", the subversion service is being invoked by mysvn.table(...). If all repositories are on the same server, this is not needed, use the parameter "path" (see below) for this.


svn.table(path : str, range : str, limit : num, verbose : bool ) : xml

The SVN revision log from a given path. Bug numbers mentioned in the commit messages can be automatically linked to a bug tracking system

Parameters:

Name Type Description
path string optional. Path within the repository to include
range string optional. Revision ranges to include. Same syntax as described in 'svn help log'
limit int optional. Limit the number of revisions returned
verbose bool optional. Show full log message or just the first line. (Default: false)

Samples:

   Output

Output up to 30 revisions from trunk with the given revision range. Output full log comments.

{{ svn.table{ path: "public/dekiwiki/trunk", range: "8465:8450", limit: 30, verbose: true} }}
svn table.PNG

Output the last 30 entries from trunk.

{{ svn.table{ path: "public/dekiwiki/trunk", limit: 30} }}
  

  


Known issues

Bug#SummaryStatusOpened ByAssigned ToSeverity
#6744LDAP module on Fedora freezes dekihost upon loginnewMaxMmajor
#6523API service ends up crashing on Ubuntu 8.04 LTSnewopenseomajor
#6356Visifire: update component to 2.2assignedSteveBSteveBminor
#6254Dapp/PageBus demo is broken due to a JS errorassignedSteveBSteveBminor
#6240Advanced Search Extension not returning resultsassignedcoreygSteveBminor
#6458HTTP Headers are not passed through to APIassignedptGuerrictweak
#6666void return type not supported for native extension functionsnewSteveBminor
#6442Allow extensions to have a restricted flag similar to UnSafeContent role flagassignedrionSteveBfeature
#6524Media Extension automatically starts Windows filesnewcoreygminor
#6525Media Extension disappers in saved mode when scrollingnewcoreygminor
#6496Advanced Search uses OR and not ANDassignedbohappaGuerricmajor
#6495Google Calendar doesn't work for Private calendarsnewcoreygminor
#6486Config keys work only for new changes, not for allnewDmitryAtweak
#5925Math Extension Gives Unhelpful Error in Response to Bad LaTexassignedbarko192brianhminor
#6405Field with username/IP does not contain search enginenewDmitryAminor
#6422Unable to see deleted pagesnewDmitryAminor
#6295Advanced Search extension does not function properly on 9.02.1assignedmcravenSteveBminor
#6293multiple posts to google maps not workingnewSteveBminor
#6111generalize Subversion extension regex for bug matchingassignedmaphewMaxMminor
#6275Google.gadget extension errors with "Google gadget must be originating from gmodules.com"newcoreygminor

Development log

RevisionDateAuthorMessage
r148766/22/2009 7:40:04 PMstevebDeki (trunk):

* misc: replaced InvariantCulture with Ordinal for string comparisons
r126271/20/2009 5:42:55 PMstevebDeki (trunk):

* misc: updated and normalized all copyright notices
r99618/13/2008 6:17:10 PMmaximmDeki Extension - Subversion

* Displayed date now uses the wiki's culture.

4766: SVN service: date format in subversion extension needs to use the wiki's language/culture settings

Thanks http://wiki.developer.mindtouch.com/User:demonicus
r97488/1/2008 10:41:58 PMstevebDeki (trunk):

DekiServices:

* updated service-type in service blueprint (passive attribute that's not yet used anyway)
r97277/31/2008 7:11:51 PMstevebDeki (trunk):

Services/Scripts`:

* iframe.xml: new script added

* updated all services/scripts to point their help URI to wiki.developer.mindtouch.com (instead of opengarden)
r88205/31/2008 4:07:18 PMstevebDeki Wiki (trunk):

* redist: updated redistributable files

* misc:

* updated all occurrences of 'MindTouch Deki Wiki' to 'MindTouch Deki'

* extended all copyright notices to 2008
r87635/29/2008 6:06:42 PMstevebDeki Wiki (trunk):

* misc: removed an extra space from the default copyright notice

Tools:

* DekiExt.php: added 'protocol' attribute to <uri> element

* GoogleAppEngine: added sample application
r82904/27/2008 10:53:35 PMstevebDeki Wiki (trunk):

* Misc: fixed xpath expressions

* DekiXmlParser:

* Xinha adds garbage to 'onclick', 'onblur', etc. attributes; detect it and remove it

* only process edit links in main content body

* remove 'class' and 'function' attributes on content before sending it to a function as input argument

* PageBL: moved content validation methods to DekiScriptLibrary

DekiServices:

* DekiScriptService: convert script arguments to declared type

* SubversionService: DON'T assume a default location for the SVN executable

DekiScript:

* Misc: added 'Convert()' method to convert from any DekiScriptLiteral to any other (when supported)

* DekiScriptAccess: allow xpath expression on XML values

* DekiScriptLibrary:

* added 'safe' XHTML content definition

* added 'web.checkuri' function to check for unsafe URIs

* added 'web.checkstyle' function to check for unsafe styles

* DekiScriptRuntime:

* allow iterating over XML values

* remove 'function' attribute on content before sending it to a function as input argument

* xhtml-safe.txt, xhtml-unsafe.txt: allow 'function' attribute on 'img', 'ul', 'ol', and 'textarea' elements

Tests:

* fixed xpath expressions

DesktopConnector:

* fixed xpath expressions

MWConverter-Test:

* updated tests
r81924/21/2008 5:13:40 AMstevebDekiWiki (trunk):

* updated DekiScript binary

* MISC: updated all relevant SIDs to new shorter format (e.g. sid://mindtouch.com/2006/11/dekiwiki) (NOTE: old SIDS are preserved for backwards compatibility)

* DekiXmlParser: evaluate attributes which have their value enclosed in double-curly braces
r76883/14/2008 8:37:52 PMmaximmDeki JiraService MantisService SubversionService TracService

* Updated div css classes
r76803/14/2008 7:18:55 PMmaximmDeki SubversionService

* Changed to css class DW-table SVN-table for the div

* Added class bg1 or bg2 on the <tr>
r76623/12/2008 9:06:27 PMmaximmDeki SubversionService

* Added stoponcopy option. Default is true
r76153/6/2008 11:57:38 PMmaximmLdapService, AdoDotNetService, SubversionService

* LdapService.cs: dont kill the service if unable to contact the ldap server.

* SubversionService.cs: tweaked the display of log message and bug fixes

* AdoDotNetService.cs: added more verbose method descriptions
r74962/29/2008 12:44:35 AMmaximmDeki Extensions

Trac, Jira, Mantis, Subversion:

* Added links to documentation
r73972/25/2008 8:15:49 PMmaximmDeki extensions: MantisService and SubversionService

MantisService:

* Refactored to pass in output xdoc to inner functions to avoid Xdoc.Add calls

* BuildBugLink now used for table as well as link now. Displaying reporter and handler as the hover-over title

SubversionService:

* Initial implementation allows "svn log" like output.

* Revisions can optionally be linked to a web gui that display revision info (diffs, etc)

* Bug numbers in log messages can be linked to a web based bug tracker. Bug prefixes: bug, fixes, bugfix, #123

       

Tag page

Files 1

FileSizeDateAttached by 
SubversionService.cs
Subversion extension source
16.64 kB02:44, 11 Jul 2008mhenry07Actions
Viewing 1 of 1 comments: view all
it would be good to generalise this so that it worked with any bug tracker, not just bugtraq: http://bugs.developer.mindtouch.com/view.php?id=6111
Posted 22:52, 15 May 2009
Viewing 1 of 1 comments: view all
You must login to post a comment.