|
|||||
|
|||||
SCM Extensions
Source Control Management (SCM) pluginsThis is a guide for people who want to write a new SCM plugin for DamageControl. Writing the SCM classDamageControl relies on the RubySCM API for interaction with underlying SCMs. To prove compliance with the RubySCM API we have written a test suite that you can use. If your class passes that test suite, Write a test class that uses RubySCMs test suiteTODO and a skeleton of your SCM class TODO Try to run the test: ruby -Iserver server/rubyscm/MookyTest This will probably fail, and it is time to fix the first error - implement the create method. def initialize(mooky_dir)
@mooky_dir = mooky_dir
end
def create(&line_proc)
cmd(@mooky_dir, "mooky create", &line_proc)
end
Run the test again. Assuming your code is correct, you should now get a different error, which should lead you to If your SCM's command line interface writes output that needs to be parsed, we recommend you implement the parsing RubySCM APIHere is a more detailed description of the required methods in the RubySCM API. create(&line_proc)(Local method) import(import_dir, &line_proc)(Local method) checkout(checkout_dir, scm_from_time, scm_to_time, &line_proc)(Regular method) Parameters
Return values
RubySCM optional APIIf the SCM supports triggers, you can implement the following methods to allow installation (and uninstallation) of install_trigger(trigger_command, trigger_files_checkout_dir, &line_proc)This method should install the trigger command in such a way that it is executed when a commit to the SCM occurs. Parameters
Web interfaceIf you write your own SCM plugin you would probably also want the DamageControl web admin to display it as a supported SCM in the project configuration pages. Every SCM has its own set of values that needs to be specified in order to check out code. To enable your SCM to be configured from the web you need to implement something we call an SCMWebConfigurator. See CVSWebConfigurator for an example on how to implement one. Basically you need to create an erb file for the part of the form that is the SCM configuration. This will be included into configure.erb. You can also define JavaScript code that will be included in the top of the same page and you can execute JavaScript code on the onLoad event. The details of all this should become quite apparent by reading the code for the above mentioned CVSWebConfigurator. To inform the DamageControl server about your new SCM you edit DamageControlServer.scm_configurator_classes in DamageControlServer.rb. You can also override this method in your own server configuration if you like. CreditIf you contribute all of this with unit tests (see the SVNTest.rb and SVNLogParserTest.rb for inspiration) you will earn lots of DamageControl points. If you know how to write working code, but not how to write unit tests, we'd of course be happy to accept your contribution regardless. If you don't know RubyIf all of this is too big a task for you you can still contribute. The DaamageControl development team doesn't have acces to
Please contact us on dev@damagecontrol.codehaus.org for further information. |
|||||
|
Copyright 2003-2006 - The Codehaus. All rights reserved unless otherwise noted.
Powered by Atlassian Confluence
|
|||||