note description: "API interface to internal_commit services." author: "Peter Wyss " date: "$Date$" revision: "$Revision$" class INTERNAL_COMMIT_SERVICE inherit API_SERVICE create make feature -- Basic operations commit_add (a_user: STRING; a_project: STRING; a_revision: STRING; a_log: STRING; a_diff: STRING; a_web_reference: STRING): BOOLEAN_REF -- Create a new commit workitem with a_user, a_project, a_revision, a_log and a_diff. local l_msg: O_COMMIT_ADD_MESSAGE do -- argument validiation if a_user.is_empty then last_fault := err_invalid_user elseif a_revision.is_empty or else a_revision.is_equal ("0") or else a_revision.to_integer < 0 then last_fault := err_invalid_revision elseif a_log = Void then last_fault := err_invalid_log elseif a_diff = Void then last_fault := err_invalid_diff else -- generate and send message create l_msg.make ( a_user, a_project, a_revision, a_log, a_diff, a_web_reference) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end feature -- Creation new_tuple (a_name: STRING): TUPLE -- Tuple of default-valued arguments to pass to call `a_name'. do if a_name.is_equal (commit_add_name) then create {TUPLE [STRING, STRING, STRING, STRING, STRING, STRING]}Result end end feature -- Initialisation self_register -- Register all actions for this service do register_with_help (agent commit_add, commit_add_name, "Add a commit workitem.") end feature {NONE} -- Implementation commit_add_name: STRING = "add" end