Was this page helpful?

Subversion (with support for bugtraq properties)

    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 Native
    Categories Developer
    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

    Install Extension

    URL of your MindTouch install (ex: http://www.mindtouch.com)
        

     

    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} }}
      

           

    Was this page helpful?
    Tag page

    Files 1

    FileVersionSizeModified 
    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 14:52, 15 May 2009
    Viewing 1 of 1 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by