module HelixVersioningEngine class SubmitService # Require the p4 connection decided by our middleware attr_accessor :p4 # Existing Rack environment attr_accessor :env def initialize(p4: nil, env: nil) @p4 = p4 @env = env # This is created by `submit_shelf` @p4_root = nil end # Perform a 'p4 submit -e change' # # This will need to detect the correct kind of temporary client to create, # create that, and then perform the submission. def submit_shelf(change) stream_client = stream_client_for(change) if stream_client @p4_root = P4Util.create_temp_stream_client_duplicate(p4, stream_client) env['p4_root'] = @p4_root else @p4_root = P4Util.create_temp_client(p4) env['p4_root'] = @p4_root end p4.run_submit('-e', change) end # Returns true if the changelist is associated with a Streams-based client. def stream_client_for(change) change_spec = p4.fetch_change(change) client_spec = p4.fetch_client(change_spec._client) client_spec._stream.nil? ? nil : client_spec end 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/lib/helix_versioning_engine/submit_service.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/lib/helix_versioning_engine/submit_service.rb | |||||
#2 | 15147 | tjuricek |
Enable submissions by files on stream clients This obeys our earlier rules: notably the local client must not have any local files open for edit. |
||
#1 | 15132 | tjuricek | Provde a basic submit -e mechanism on classic perforce workspaces. |