Module: source-control-manager-internals Synopsis: Environment-Source Control Interface Author: Scott McKay Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc. All rights reserved. License: Functional Objects Library Public License Version 1.0 Dual-license: GNU Lesser General Public License Warranty: Distributed WITHOUT WARRANTY OF ANY KIND /// Source control system commands define open abstract class () sealed each-subclass slot sccs-command-title :: false-or() = #f, init-keyword: title:; sealed constant slot sccs-command-options :: , required-init-keyword: options:; end class ; define method make (class :: subclass(), #rest initargs, #key server) => (command :: ) let sccs = server | current-source-control-system(); let class = class-for-sccs-command(sccs, class); if (class) apply(next-method, class, server: sccs, initargs) else error(make(, source-control: sccs, command: class)) end end method make; define method initialize (command :: , #key pathname) => () ignore(pathname); next-method() end method initialize; define open generic class-for-sccs-command (sccs :: , class :: subclass()) => (class :: false-or(subclass())); define method class-for-sccs-command (sccs :: , class :: subclass()) => (class == #f) #f end method class-for-sccs-command; define function sccs-command-implemented? (sccs :: , class :: subclass()) => (implemented? :: ) class-for-sccs-command(sccs, class) ~= #f end function sccs-command-implemented?; /// Source control options define open abstract class () end class ; define open abstract class () keyword pathname:; end class ; define open abstract class () constant slot command-pathname :: false-or() = #f, init-keyword: pathname:; end class ; define class () constant slot option-label :: , required-init-keyword: label:; constant slot option-keyword :: , required-init-keyword: keyword:; constant slot option-type :: type-union(, ), required-init-keyword: type:; constant slot option-getter :: , required-init-keyword: getter:; constant slot option-documentation :: false-or() = #f, init-keyword: documentation:; constant slot option-default :: = #f, init-keyword: default:; constant slot option-required? :: = #f, init-keyword: required?:; end class ; define open abstract class () constant slot command-title :: , required-init-keyword: title:; constant slot command-class :: subclass(), required-init-keyword: class:; constant slot command-options :: , required-init-keyword: options:; end class ; define class () end class ; define class () end class ; define open generic source-control-login-info (sccs :: , command-class :: subclass(), #key defaults :: false-or(), pathname :: false-or()) => (options :: false-or()); define open generic source-control-login (sccs :: , options :: ) => (logged-in? :: , message :: false-or()); define open generic source-control-command-info (sccs :: , command-class :: subclass(), #key defaults :: false-or(), pathname :: false-or()) => (options :: ); define method source-control-login-info (sccs :: , command-class :: subclass(), #key defaults :: false-or(), pathname :: false-or()) => (options == #f) #f end method source-control-login-info; /// Command patterns // The idea is that source control back-ends implement a method for // 'note-source-control-system-selected' that fills in the default values // for the command strings. We use Settings to save the settings for // (1) which source control back-end is being used, and (2) the strings // for each back-end. We save only the back-end strings so that they // persist even when somebody changes between different back-ends. define variable *claim-command-string* = "checkout -claim soft $(compound)$(unit)$(branch)$(reason)"; define open abstract class () keyword title: = "Checks out the files from source code control"; end class ; define variable *check-out-command-string* = "checkout $(compound)$(unit)$(branch)"; define open abstract class () keyword title: = "Gets the latest version of files from source code control"; end class ; define variable *check-in-command-string* = "checkin $(compound)$(unit)$(branch)$(reason)"; define open abstract class () keyword title: = "Checks in the files to source code control"; end class ; define variable *abandon-command-string* = "abandon $(compound)$(unit)$(branch)"; define open abstract class () keyword title: = "Undoes the checkout of files, without retaining changes"; end class ; define variable *merge-command-string* = "merge $(compound)$(unit)$(branch)$(reason)"; define open abstract class () keyword title: = "Merges the files with the latest versions under source code control"; end class ; define variable *diff-command-string* = "diff $(compound)$(unit)$(branch)"; define open abstract class () keyword title: = "Shows the changes made to a file since it was checked out"; end class ; define variable *report-command-string* = "report $(compound)$(unit)$(branch)"; define open abstract class () keyword title: = "Shows the history of a file or files under source code control"; end class ; define variable *add-command-string* = "add $(compound)$(unit)$(branch)$(reason)"; define open abstract class () keyword title: = "Puts project files under source code control"; end class ; define variable *remove-command-string* = "remove $(compound)$(unit)$(branch)$(reason)"; define open abstract class () keyword title: = "Removes project files from source code control"; end class ;