require 'helix_web_services_client/open_model' require 'open-uri' class HelixWebServicesClient # Create a new client workspace specification for a Helix Sync project. # # Returns a simple object with a 'client' property. def create_helix_sync_client(project_id, device, root) data = { project: project_id, device: device, root: root } obj = execute_method_with_body(:post, '/helix_sync/v1/clients', nil, data) OpenModel.new(obj) end # Get a pending changelist number for the Helix Sync project. # # If the changelist already exists, it should just return that. # # IMPORTANT: The changelist should be updated to use your local client. # You won't be able to use or submit this changelist. # # @param project_id {String} The project ID. # @return A hash containing a `change` field def create_helix_sync_pending_changelist(project_id) obj = execute_method_no_body(:post, "/helix_sync/v1/changes/#{URI.encode(project_id)}") OpenModel.new(obj) end # Retrieve the latest changelist. # # If the change doesn't exist, you'll get a ResourceNotFound exception. def fetch_helix_sync_latest_changelist(project_id) obj = execute_method_no_body(:get, "/helix_sync/v1/changes/#{URI.encode(project_id)}") OpenModel.new(obj) end # Retrieve the pending changelist. # # If the change doesn't exist, you'll get a ResourceNotFound exception. def fetch_helix_sync_pending_changelist(project_id) obj = execute_method_no_body(:get, "/helix_sync/v1/changes/#{URI.encode(project_id)}/pending") OpenModel.new(obj) end # Submits the pending changelist for the helix sync project. # # Currently this assumes that all files are shelved and nothing's open on # the client. This is likely not what we want ... but it's a start. # # @param project_id [String] def submit_helix_sync_pending_change(project_id) obj = execute_method_no_body(:post, "/helix_sync/v1/changes/#{URI.encode(project_id)}/pending") OpenModel.new(obj) end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15741 | ptomiak | Branch HWS for my use. | ||
//guest/perforce_software/helix-web-services/main/source/helix_web_services_client/lib/helix_web_services_client/helix_sync.rb | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/lib/helix_web_services_client/helix_sync.rb | |||||
#6 | 15517 | tjuricek | Do not require changelist ID for submitting Helix Sync pending changelists. | ||
#5 | 15499 | tjuricek | Naive implementation of helix sync project submit for "helix versioning engine projects". | ||
#4 | 15497 | tjuricek | Add support to fetch the latest change of a project. | ||
#3 | 15496 | tjuricek |
Revise GET /helix_sync/v1/changes/[project] to /helix_sync/v1/changes/[project]/pending The base method is really intended for the latest changelist number. Meh. |
||
#2 | 15487 | tjuricek | Add basic ability to create pending changelists for helix sync projects. | ||
#1 | 15479 | tjuricek | Added a basic "HVE project" implementation for creating clients. |