From 904615c1509b0923ba9b785d41cafcd264952d54 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Fri, 26 Oct 2012 02:50:24 +0200 Subject: [PATCH] Update satellite action docs --- lib/gitlab/satellite/edit_file_action.rb | 11 +++++++---- lib/gitlab/satellite/merge_action.rb | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/gitlab/satellite/edit_file_action.rb b/lib/gitlab/satellite/edit_file_action.rb index 1e2a2163..336afc88 100644 --- a/lib/gitlab/satellite/edit_file_action.rb +++ b/lib/gitlab/satellite/edit_file_action.rb @@ -1,9 +1,6 @@ module Gitlab module Satellite - # GitLab file editor - # - # It gives you ability to make changes to files - # & commit this changes from GitLab UI. + # GitLab server-side file update and commit class EditFileAction < Action attr_accessor :file_path, :ref @@ -13,6 +10,12 @@ module Gitlab @ref = ref end + # Updates the files content and creates a new commit for it + # + # Returns false if the ref has been updated while editing the file + # Returns false if commiting the change fails + # Returns false if pushing from the satellite to Gitolite failed or was rejected + # Returns true otherwise def commit!(content, commit_message, last_commit) return false unless can_edit?(last_commit) diff --git a/lib/gitlab/satellite/merge_action.rb b/lib/gitlab/satellite/merge_action.rb index 6818e780..832db662 100644 --- a/lib/gitlab/satellite/merge_action.rb +++ b/lib/gitlab/satellite/merge_action.rb @@ -1,5 +1,6 @@ module Gitlab module Satellite + # GitLab server-side merge class MergeAction < Action attr_accessor :merge_request @@ -8,6 +9,7 @@ module Gitlab @merge_request = merge_request end + # Checks if a merge request can be executed without user interaction def can_be_merged? in_locked_and_timed_satellite do |merge_repo| merge_in_satellite!(merge_repo)