<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Module: HelixSync::Methods
— Documentation by YARD 0.8.7.6
</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
hasFrames = window.top.frames.main ? true : false;
relpath = '../';
framesUrl = "../frames.html#!HelixSync/Methods.html";
</script>
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
</head>
<body>
<div id="header">
<div id="menu">
<a href="../_index.html">Index (M)</a> »
<span class='title'><span class='object_link'><a href="../HelixSync.html" title="HelixSync (module)">HelixSync</a></span></span>
»
<span class="title">Methods</span>
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../class_list.html">
Class List
</a>
<a class="full_list_link" id="method_list_link"
href="../method_list.html">
Method List
</a>
<a class="full_list_link" id="file_list_link"
href="../file_list.html">
File List
</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><h1>Module: HelixSync::Methods
</h1>
<dl class="box">
<dt class="r1">Included in:</dt>
<dd class="r1"><span class='object_link'><a href="App.html" title="HelixSync::App (class)">App</a></span></dd>
<dt class="r2 last">Defined in:</dt>
<dd class="r2 last">lib/helix_sync/methods.rb</dd>
</dl>
<div class="clear"></div>
<h2>Defined Under Namespace</h2>
<p class="children">
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Methods/Describe.html" title="HelixSync::Methods::Describe (class)">Describe</a></span>, <span class='object_link'><a href="Methods/Plan.html" title="HelixSync::Methods::Plan (class)">Plan</a></span>, <span class='object_link'><a href="Methods/ShelfMeta.html" title="HelixSync::Methods::ShelfMeta (class)">ShelfMeta</a></span>, <span class='object_link'><a href="Methods/Subplan.html" title="HelixSync::Methods::Subplan (class)">Subplan</a></span>
</p>
<h2>
Instance Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#assume_client_ownership-instance_method" title="#assume_client_ownership (instance method)">- (Object) <strong>assume_client_ownership</strong>(client_name, root) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_classic_onedir_client-instance_method" title="#create_classic_onedir_client (instance method)">- (Object) <strong>create_classic_onedir_client</strong>(client_name, project_id, root) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Generate a new client that only contains the project mapping.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_client-instance_method" title="#create_client (instance method)">- (Object) <strong>create_client</strong>(client_name, project_id, root) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_device_client-instance_method" title="#create_device_client (instance method)">- (Object) <strong>create_device_client</strong>(project_id, device, root) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_device_client_name-instance_method" title="#create_device_client_name (instance method)">- (Object) <strong>create_device_client_name</strong>(project_id, device) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_lock_client_name-instance_method" title="#create_lock_client_name (instance method)">- (Object) <strong>create_lock_client_name</strong>(project_id) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_pending_change-instance_method" title="#create_pending_change (instance method)">- (Object) <strong>create_pending_change</strong>(project_id) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>If the user doesn't have a current pending change for the project,
create one, and return that.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_shelf_client-instance_method" title="#create_shelf_client (instance method)">- (Object) <strong>create_shelf_client</strong>(project_id, root) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_shelf_client_name-instance_method" title="#create_shelf_client_name (instance method)">- (Object) <strong>create_shelf_client_name</strong>(project_id) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#delete_client-instance_method" title="#delete_client (instance method)">- (Object) <strong>delete_client</strong>(client_name) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Deletes the client and ignores “client doesn't exist” errors.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#delete_device_client-instance_method" title="#delete_device_client (instance method)">- (Object) <strong>delete_device_client</strong>(project_id, device_id) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#delete_pending_change_for_project-instance_method" title="#delete_pending_change_for_project (instance method)">- (Object) <strong>delete_pending_change_for_project</strong>(project_id) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Remove the HVE project changelist (if it exists).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#delete_shelf_client-instance_method" title="#delete_shelf_client (instance method)">- (Object) <strong>delete_shelf_client</strong>(project_id) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#depot_path_for_name-instance_method" title="#depot_path_for_name (instance method)">- (Object) <strong>depot_path_for_name</strong>(name) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#encode_name-instance_method" title="#encode_name (instance method)">- (Object) <strong>encode_name</strong>(name) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#fetch-instance_method" title="#fetch (instance method)">- (Object) <strong>fetch</strong>(id) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The ID is a URL encoded version of the directory name under
HVE_PROJECTS_PATH.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#fetch_by_name-instance_method" title="#fetch_by_name (instance method)">- (Object) <strong>fetch_by_name</strong>(name) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the project's “details” based on the project name.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#find_latest_change_for_project-instance_method" title="#find_latest_change_for_project (instance method)">- (Object) <strong>find_latest_change_for_project</strong>(project_id) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Find the latest submitted change for the project restricted to the shelf
client.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#find_pending_change_for_project-instance_method" title="#find_pending_change_for_project (instance method)">- (Object) <strong>find_pending_change_for_project</strong>(project_id) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The HVE project 'changelist' is a shelved changelist whose client
is the shelf client name.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#hve_projects_path-instance_method" title="#hve_projects_path (instance method)">- (Object) <strong>hve_projects_path</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#list-instance_method" title="#list (instance method)">- (Object) <strong>list</strong>(details: false, extension: nil) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>List HVE Projects as configured in the system.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#list_project_names-instance_method" title="#list_project_names (instance method)">- (Object) <strong>list_project_names</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#load_fstat_files-instance_method" title="#load_fstat_files (instance method)">- (Object) <strong>load_fstat_files</strong>(project_id, change) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#load_shelf_plan-instance_method" title="#load_shelf_plan (instance method)">- (Object) <strong>load_shelf_plan</strong>(project_id, change, describe, shelf_meta) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#obtain_client_lock-instance_method" title="#obtain_client_lock (instance method)">- (Object) <strong>obtain_client_lock</strong>(project_id) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Will attempt to create a special “-x” client, and if that fails after
re-attempting a few times, will throw a.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#p4_where_path-instance_method" title="#p4_where_path (instance method)">- (Object) <strong>p4_where_path</strong>(depot_path) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Determines the local path of the file on disk using “p4 where”.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#p4host-instance_method" title="#p4host (instance method)">- (Object) <strong>p4host</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#p4port-instance_method" title="#p4port (instance method)">- (Object) <strong>p4port</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#preview_pending_change-instance_method" title="#preview_pending_change (instance method)">- (Object) <strong>preview_pending_change</strong>(project_id) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Generates the resolution plan for the shelf.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#readd-instance_method" title="#readd (instance method)">- (Object) <strong>readd</strong>(subplans, change) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#remove_from_shelf_and_plan-instance_method" title="#remove_from_shelf_and_plan (instance method)">- (Object) <strong>remove_from_shelf_and_plan</strong>(plan, change) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Remove all remove_actions from the shelf, and the plan.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#rename_all_locked_by_other-instance_method" title="#rename_all_locked_by_other (instance method)">- (Object) <strong>rename_all_locked_by_other</strong>(plan, change) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Will return true if anything actually happened.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#resolve_and_submit_plan-instance_method" title="#resolve_and_submit_plan (instance method)">- (Object) <strong>resolve_and_submit_plan</strong>(plan, change) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#resolve_and_submit_shelf-instance_method" title="#resolve_and_submit_shelf (instance method)">- (Object) <strong>resolve_and_submit_shelf</strong>(project_id) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Will attempt to resolve all changes on the shelf and submit it.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#safe_hve_projects_path-instance_method" title="#safe_hve_projects_path (instance method)">- (Object) <strong>safe_hve_projects_path</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#server-instance_method" title="#server (instance method)">- (Object) <strong>server</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#server_uri_for_id-instance_method" title="#server_uri_for_id (instance method)">- (Object) <strong>server_uri_for_id</strong>(id) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#shelf_meta_from_json-instance_method" title="#shelf_meta_from_json (instance method)">- (Object) <strong>shelf_meta_from_json</strong>(description) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#shelve_revert_and_sync-instance_method" title="#shelve_revert_and_sync (instance method)">- (Object) <strong>shelve_revert_and_sync</strong>(subplans, change) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#unencode_name-instance_method" title="#unencode_name (instance method)">- (Object) <strong>unencode_name</strong>(name) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#unshelve_and_resolve-instance_method" title="#unshelve_and_resolve (instance method)">- (Object) <strong>unshelve_and_resolve</strong>(subplans, change) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#userinfo-instance_method" title="#userinfo (instance method)">- (Object) <strong>userinfo</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>For HVE Projects, it may be interesting to people to see various connection
settings for each server URL.</p>
</div></span>
</li>
</ul>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="assume_client_ownership-instance_method">
- (<tt>Object</tt>) <strong>assume_client_ownership</strong>(client_name, root)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
303
304
305
306
307</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 303</span>
<span class='kw'>def</span> <span class='id identifier rubyid_assume_client_ownership'>assume_client_ownership</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client_spec'>client_spec</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_fetch_client'>fetch_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client_spec'>client_spec</span><span class='period'>.</span><span class='id identifier rubyid__root'>_root</span> <span class='op'>=</span> <span class='id identifier rubyid_root'>root</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_save_client'>save_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_spec'>client_spec</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="create_classic_onedir_client-instance_method">
- (<tt>Object</tt>) <strong>create_classic_onedir_client</strong>(client_name, project_id, root)
</h3><div class="docstring">
<div class="discussion">
<p>Generate a new client that only contains the project mapping.</p>
<p>The client name is a combination of user, project, and device. We prefix it
with “_hve” just for clarity.</p>
<p>We do not host lock the client.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>project_id</span>
<span class='type'>(<tt>String</tt>)</span>
—
<div class='inline'>
<p>Our encoded project name</p>
</div>
</li>
<li>
<span class='name'>device</span>
<span class='type'>(<tt>String</tt>)</span>
—
<div class='inline'>
<p>A device ID, like a hostname</p>
</div>
</li>
<li>
<span class='name'>root</span>
<span class='type'>(<tt>String</tt>)</span>
—
<div class='inline'>
<p>The <code>Root</code> value for the client parameter</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 112</span>
<span class='kw'>def</span> <span class='id identifier rubyid_create_classic_onedir_client'>create_classic_onedir_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='comma'>,</span> <span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>hws_settings</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='const'>HVE_PROJECTS_PATH</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='id identifier rubyid_client_spec'>client_spec</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_fetch_client'>fetch_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client_spec'>client_spec</span><span class='period'>.</span><span class='id identifier rubyid__root'>_root</span> <span class='op'>=</span> <span class='id identifier rubyid_root'>root</span><span class='semicolon'>;</span>
<span class='id identifier rubyid_client_spec'>client_spec</span><span class='period'>.</span><span class='id identifier rubyid__host'>_host</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='semicolon'>;</span>
<span class='id identifier rubyid_client_spec'>client_spec</span><span class='period'>.</span><span class='id identifier rubyid__options'>_options</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>allwrite clobber nocompress unlocked nomodtime rmdir</span><span class='tstring_end'>'</span></span><span class='semicolon'>;</span>
<span class='id identifier rubyid_project_name'>project_name</span> <span class='op'>=</span> <span class='id identifier rubyid_unencode_name'>unencode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client_spec'>client_spec</span><span class='period'>.</span><span class='id identifier rubyid__view'>_view</span> <span class='op'>=</span> <span class='lbracket'>[</span>
<span class='tstring'><span class='tstring_beg'>%Q|</span><span class='tstring_content'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_depot_path_for_name'>depot_path_for_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_name'>project_name</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>/..." "//</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_client_name'>client_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>/..."</span><span class='tstring_end'>|</span></span>
<span class='rbracket'>]</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_save_client'>save_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_spec'>client_spec</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client_name'>client_name</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="create_client-instance_method">
- (<tt>Object</tt>) <strong>create_client</strong>(client_name, project_id, root)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
73
74
75
76
77
78
79
80</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 73</span>
<span class='kw'>def</span> <span class='id identifier rubyid_create_client'>create_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='comma'>,</span> <span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='op'>!</span><span class='const'>Cloud</span><span class='op'>::</span><span class='const'>Settings</span><span class='period'>.</span><span class='id identifier rubyid_cloud_enabled?'>cloud_enabled?</span>
<span class='kw'>return</span> <span class='id identifier rubyid_create_classic_onedir_client'>create_classic_onedir_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='comma'>,</span> <span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_project_service'>project_service</span> <span class='op'>=</span> <span class='const'>Cloud</span><span class='op'>::</span><span class='const'>Projects</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>env:</span><span class='id identifier rubyid_env'>env</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='id identifier rubyid_project_service'>project_service</span><span class='period'>.</span><span class='id identifier rubyid_create_client'>create_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='comma'>,</span> <span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="create_device_client-instance_method">
- (<tt>Object</tt>) <strong>create_device_client</strong>(project_id, device, root)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
68
69
70
71</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 68</span>
<span class='kw'>def</span> <span class='id identifier rubyid_create_device_client'>create_device_client</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_device'>device</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client_name'>client_name</span> <span class='op'>=</span> <span class='id identifier rubyid_create_device_client_name'>create_device_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_device'>device</span><span class='rparen'>)</span>
<span class='id identifier rubyid_create_client'>create_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='comma'>,</span> <span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="create_device_client_name-instance_method">
- (<tt>Object</tt>) <strong>create_device_client_name</strong>(project_id, device)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
132
133
134</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 132</span>
<span class='kw'>def</span> <span class='id identifier rubyid_create_device_client_name'>create_device_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_device'>device</span><span class='rparen'>)</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_hve_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_user'>user</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_project_id'>project_id</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_device'>device</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="create_lock_client_name-instance_method">
- (<tt>Object</tt>) <strong>create_lock_client_name</strong>(project_id)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
140
141
142</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 140</span>
<span class='kw'>def</span> <span class='id identifier rubyid_create_lock_client_name'>create_lock_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_create_shelf_client_name'>create_shelf_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>_lock</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="create_pending_change-instance_method">
- (<tt>Object</tt>) <strong>create_pending_change</strong>(project_id)
</h3><div class="docstring">
<div class="discussion">
<p>If the user doesn't have a current pending change for the project,
create one, and return that.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 431</span>
<span class='kw'>def</span> <span class='id identifier rubyid_create_pending_change'>create_pending_change</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_change'>change</span> <span class='op'>=</span> <span class='id identifier rubyid_find_pending_change_for_project'>find_pending_change_for_project</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='id identifier rubyid_change'>change</span> <span class='kw'>if</span> <span class='id identifier rubyid_change'>change</span>
<span class='id identifier rubyid_shelf_client'>shelf_client</span> <span class='op'>=</span> <span class='id identifier rubyid_create_shelf_client'>create_shelf_client</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/dev/null</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='id identifier rubyid_shelf_client'>shelf_client</span>
<span class='id identifier rubyid_change_spec'>change_spec</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_fetch_change'>fetch_change</span>
<span class='id identifier rubyid_change_spec'>change_spec</span><span class='period'>.</span><span class='id identifier rubyid__description'>_description</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_hws_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_user'>user</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_project_id'>project_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='id identifier rubyid_change_spec'>change_spec</span><span class='period'>.</span><span class='id identifier rubyid__client'>_client</span> <span class='op'>=</span> <span class='id identifier rubyid_shelf_client'>shelf_client</span>
<span class='id identifier rubyid_save_results'>save_results</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_save_change'>save_change</span><span class='lparen'>(</span><span class='id identifier rubyid_change_spec'>change_spec</span><span class='rparen'>)</span>
<span class='id identifier rubyid_change'>change</span> <span class='op'>=</span> <span class='id identifier rubyid_save_results'>save_results</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>Change (\d+) created.</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>\1</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>INVALID</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_change'>change</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="create_shelf_client-instance_method">
- (<tt>Object</tt>) <strong>create_shelf_client</strong>(project_id, root)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
63
64
65
66</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 63</span>
<span class='kw'>def</span> <span class='id identifier rubyid_create_shelf_client'>create_shelf_client</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client_name'>client_name</span> <span class='op'>=</span> <span class='id identifier rubyid_create_shelf_client_name'>create_shelf_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_create_client'>create_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='comma'>,</span> <span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="create_shelf_client_name-instance_method">
- (<tt>Object</tt>) <strong>create_shelf_client_name</strong>(project_id)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
136
137
138</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 136</span>
<span class='kw'>def</span> <span class='id identifier rubyid_create_shelf_client_name'>create_shelf_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_hve_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_user'>user</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_project_id'>project_id</span><span class='embexpr_end'>}</span><span class='tstring_content'>_shelf</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="delete_client-instance_method">
- (<tt>Object</tt>) <strong>delete_client</strong>(client_name)
</h3><div class="docstring">
<div class="discussion">
<p>Deletes the client and ignores “client doesn't exist” errors</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
93
94
95
96
97
98
99
100</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 93</span>
<span class='kw'>def</span> <span class='id identifier rubyid_delete_client'>delete_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_at_exception_level'>at_exception_level</span><span class='lparen'>(</span><span class='const'>P4</span><span class='op'>::</span><span class='const'>RAISE_NONE</span><span class='rparen'>)</span> <span class='kw'>do</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_client'>run_client</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-d</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_client_name'>client_name</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_messages'>messages</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_m'>m</span><span class='op'>|</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_msgid'>msgid</span> <span class='op'>==</span> <span class='int'>6178</span> <span class='op'>||</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_severity'>severity</span> <span class='op'><</span> <span class='const'>P4</span><span class='op'>::</span><span class='const'>E_FAILED</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='const'>P4Util</span><span class='period'>.</span><span class='id identifier rubyid_make_p4_error'>make_p4_error</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="delete_device_client-instance_method">
- (<tt>Object</tt>) <strong>delete_device_client</strong>(project_id, device_id)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
87
88
89
90</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 87</span>
<span class='kw'>def</span> <span class='id identifier rubyid_delete_device_client'>delete_device_client</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_device_id'>device_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client_name'>client_name</span> <span class='op'>=</span> <span class='id identifier rubyid_create_device_client_name'>create_device_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_device_id'>device_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_delete_client'>delete_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="delete_pending_change_for_project-instance_method">
- (<tt>Object</tt>) <strong>delete_pending_change_for_project</strong>(project_id)
</h3><div class="docstring">
<div class="discussion">
<p>Remove the HVE project changelist (if it exists).</p>
<p>The general algorithm:</p>
<ol><li>
<p>Take over ownership of our shelf client</p>
</li><li>
<p>Revert everything</p>
</li><li>
<p>Delete any shelved files</p>
</li><li>
<p>Delete the changelist</p>
</li></ol>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
182
183
184
185
186
187
188
189
190
191
192
193
194
195</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 182</span>
<span class='kw'>def</span> <span class='id identifier rubyid_delete_pending_change_for_project'>delete_pending_change_for_project</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_mktmpdir'>mktmpdir</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>delete_pending_change</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_dir'>dir</span><span class='op'>|</span>
<span class='id identifier rubyid_shelf_client'>shelf_client</span> <span class='op'>=</span> <span class='id identifier rubyid_create_shelf_client_name'>create_shelf_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_assume_client_ownership'>assume_client_ownership</span><span class='lparen'>(</span><span class='id identifier rubyid_shelf_client'>shelf_client</span><span class='comma'>,</span> <span class='id identifier rubyid_dir'>dir</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='id identifier rubyid_shelf_client'>shelf_client</span>
<span class='id identifier rubyid_change'>change</span> <span class='op'>=</span> <span class='id identifier rubyid_find_pending_change_for_project'>find_pending_change_for_project</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_change'>change</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_revert'>run_revert</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>//...</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_shelve'>run_shelve</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-d</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_change'>run_change</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-d</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="delete_shelf_client-instance_method">
- (<tt>Object</tt>) <strong>delete_shelf_client</strong>(project_id)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
82
83
84
85</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 82</span>
<span class='kw'>def</span> <span class='id identifier rubyid_delete_shelf_client'>delete_shelf_client</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client_name'>client_name</span> <span class='op'>=</span> <span class='id identifier rubyid_create_shelf_client_name'>create_shelf_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_delete_client'>delete_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="depot_path_for_name-instance_method">
- (<tt>Object</tt>) <strong>depot_path_for_name</strong>(name)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
465
466
467</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 465</span>
<span class='kw'>def</span> <span class='id identifier rubyid_depot_path_for_name'>depot_path_for_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_hve_projects_path'>hve_projects_path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="encode_name-instance_method">
- (<tt>Object</tt>) <strong>encode_name</strong>(name)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
453
454
455</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 453</span>
<span class='kw'>def</span> <span class='id identifier rubyid_encode_name'>encode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='const'>HWSStrings</span><span class='period'>.</span><span class='id identifier rubyid_component_encode'>component_encode</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="fetch-instance_method">
- (<tt>Object</tt>) <strong>fetch</strong>(id)
</h3><div class="docstring">
<div class="discussion">
<p>The ID is a URL encoded version of the directory name under
HVE_PROJECTS_PATH.</p>
<p>This will unencode the ID and fetch by name.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
41
42
43
44</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 41</span>
<span class='kw'>def</span> <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_unencode_name'>unencode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_fetch_by_name'>fetch_by_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="fetch_by_name-instance_method">
- (<tt>Object</tt>) <strong>fetch_by_name</strong>(name)
</h3><div class="docstring">
<div class="discussion">
<p>Returns the project's “details” based on the project name.</p>
<p>No validation is done to ensure this directory actually exists in the
system.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
50
51
52
53
54
55
56
57
58
59
60
61</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 50</span>
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_by_name'>fetch_by_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='id identifier rubyid_encode_name'>encode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id</span><span class='label_end'>':</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>name</span><span class='label_end'>':</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>server</span><span class='label_end'>':</span> <span class='id identifier rubyid_server_uri_for_id'>server_uri_for_id</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='comma'>,</span>
<span class='const'>HVE_ID</span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>depotPath</span><span class='label_end'>':</span> <span class='id identifier rubyid_depot_path_for_name'>depot_path_for_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="find_latest_change_for_project-instance_method">
- (<tt>Object</tt>) <strong>find_latest_change_for_project</strong>(project_id)
</h3><div class="docstring">
<div class="discussion">
<p>Find the latest submitted change for the project restricted to the shelf
client.</p>
<p>Uses the command: 'p4 changes -m 1 -s submitted [shelf client]'</p>
<p>This has subtle surprises:</p>
<ul><li>
<p>If a the client has not been used or does not exist, this does not return
a changelist.</p>
</li></ul>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>project_id</span>
<span class='type'>(<tt>String</tt>)</span>
—
<div class='inline'>
<p>The encoded project ID</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
155
156
157
158
159
160
161
162
163
164</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 155</span>
<span class='kw'>def</span> <span class='id identifier rubyid_find_latest_change_for_project'>find_latest_change_for_project</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client_name'>client_name</span> <span class='op'>=</span> <span class='id identifier rubyid_create_shelf_client_name'>create_shelf_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='id identifier rubyid_client_name'>client_name</span>
<span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_changes'>run_changes</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-m</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-s</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>submitted</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>//</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_client_name'>client_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>/...</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>change</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='kw'>ensure</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>INVALID</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="find_pending_change_for_project-instance_method">
- (<tt>Object</tt>) <strong>find_pending_change_for_project</strong>(project_id)
</h3><div class="docstring">
<div class="discussion">
<p>The HVE project 'changelist' is a shelved changelist whose client
is the shelf client name</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
168
169
170
171
172</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 168</span>
<span class='kw'>def</span> <span class='id identifier rubyid_find_pending_change_for_project'>find_pending_change_for_project</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client_name'>client_name</span> <span class='op'>=</span> <span class='id identifier rubyid_create_shelf_client_name'>create_shelf_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_changes'>run_changes</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-m</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-u</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_user'>user</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-s</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shelved</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_client_name'>client_name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>change</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="hve_projects_path-instance_method">
- (<tt>Object</tt>) <strong>hve_projects_path</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
469
470
471</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 469</span>
<span class='kw'>def</span> <span class='id identifier rubyid_hve_projects_path'>hve_projects_path</span>
<span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>hws_settings</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='const'>HVE_PROJECTS_PATH</span> <span class='op'>||</span> <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>HVE_PROJECTS_PATH not set</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="list-instance_method">
- (<tt>Object</tt>) <strong>list</strong>(details: false, extension: nil)
</h3><div class="docstring">
<div class="discussion">
<p>List HVE Projects as configured in the system.</p>
<p>See the Appendix in the documentation for details on values.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
13
14
15
16
17
18
19
20
21
22
23
24</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 13</span>
<span class='kw'>def</span> <span class='id identifier rubyid_list'>list</span><span class='lparen'>(</span><span class='label'>details:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>extension:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_extension'>extension</span> <span class='kw'>and</span> <span class='lparen'>(</span><span class='id identifier rubyid_extension'>extension</span> <span class='op'>!=</span> <span class='const'>HVE_ID</span> <span class='kw'>or</span> <span class='id identifier rubyid_extension'>extension</span> <span class='op'>!=</span> <span class='const'>HVE_CONTENT_TYPE</span><span class='rparen'>)</span>
<span class='id identifier rubyid_project_dirs'>project_dirs</span> <span class='op'>=</span> <span class='id identifier rubyid_list_project_names'>list_project_names</span>
<span class='id identifier rubyid_project_names'>project_names</span> <span class='op'>=</span> <span class='id identifier rubyid_project_dirs'>project_dirs</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_d'>d</span><span class='op'>|</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='id identifier rubyid_d'>d</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
<span class='kw'>if</span> <span class='id identifier rubyid_details'>details</span>
<span class='id identifier rubyid_project_names'>project_names</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_n'>n</span><span class='op'>|</span> <span class='id identifier rubyid_fetch_by_name'>fetch_by_name</span><span class='lparen'>(</span><span class='id identifier rubyid_n'>n</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_project_names'>project_names</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_n'>n</span><span class='op'>|</span> <span class='id identifier rubyid_encode_name'>encode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_n'>n</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="list_project_names-instance_method">
- (<tt>Object</tt>) <strong>list_project_names</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
26
27
28
29
30
31
32
33
34
35</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 26</span>
<span class='kw'>def</span> <span class='id identifier rubyid_list_project_names'>list_project_names</span>
<span class='kw'>if</span> <span class='op'>!</span><span class='const'>Cloud</span><span class='op'>::</span><span class='const'>Settings</span><span class='period'>.</span><span class='id identifier rubyid_cloud_enabled?'>cloud_enabled?</span>
<span class='id identifier rubyid_pattern'>pattern</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_hve_projects_path'>hve_projects_path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/*</span><span class='tstring_end'>"</span></span>
<span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_dirs'>run_dirs</span><span class='lparen'>(</span><span class='id identifier rubyid_pattern'>pattern</span><span class='rparen'>)</span>
<span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dir</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_project_service'>project_service</span> <span class='op'>=</span> <span class='const'>Cloud</span><span class='op'>::</span><span class='const'>Projects</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>env:</span><span class='id identifier rubyid_env'>env</span><span class='rparen'>)</span>
<span class='id identifier rubyid_project_service'>project_service</span><span class='period'>.</span><span class='id identifier rubyid_list'>list</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="load_fstat_files-instance_method">
- (<tt>Object</tt>) <strong>load_fstat_files</strong>(project_id, change)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
423
424
425
426
427</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 423</span>
<span class='kw'>def</span> <span class='id identifier rubyid_load_fstat_files'>load_fstat_files</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='id identifier rubyid_fstat_files'>fstat_files</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_fstat'>run_fstat</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-Rs</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-e</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>//</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_create_shelf_client_name'>create_shelf_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>/...</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_fstat_files'>fstat_files</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span> <span class='op'>!</span><span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>depotFile</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_fstat_files'>fstat_files</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="load_shelf_plan-instance_method">
- (<tt>Object</tt>) <strong>load_shelf_plan</strong>(project_id, change, describe, shelf_meta)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
414
415
416
417
418
419
420
421</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 414</span>
<span class='kw'>def</span> <span class='id identifier rubyid_load_shelf_plan'>load_shelf_plan</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='id identifier rubyid_describe'>describe</span><span class='comma'>,</span> <span class='id identifier rubyid_shelf_meta'>shelf_meta</span><span class='rparen'>)</span>
<span class='id identifier rubyid_fstat_files'>fstat_files</span> <span class='op'>=</span> <span class='id identifier rubyid_load_fstat_files'>load_fstat_files</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='id identifier rubyid_plan'>plan</span> <span class='op'>=</span> <span class='const'>Plan</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
<span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_subplans'>subplans</span> <span class='op'>=</span> <span class='id identifier rubyid_fstat_files'>fstat_files</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span> <span class='const'>Subplan</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_f'>f</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_plan'>plan</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="obtain_client_lock-instance_method">
- (<tt>Object</tt>) <strong>obtain_client_lock</strong>(project_id)
</h3><div class="docstring">
<div class="discussion">
<p>Will attempt to create a special “-x” client, and if that fails after
re-attempting a few times, will throw a</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 270</span>
<span class='kw'>def</span> <span class='id identifier rubyid_obtain_client_lock'>obtain_client_lock</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_lock_p4'>lock_p4</span> <span class='op'>=</span> <span class='const'>P4Util</span><span class='period'>.</span><span class='id identifier rubyid_open_from_env'>open_from_env</span><span class='lparen'>(</span><span class='id identifier rubyid_env'>env</span><span class='rparen'>)</span>
<span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_connect'>connect</span>
<span class='id identifier rubyid_client_name'>client_name</span> <span class='op'>=</span> <span class='id identifier rubyid_create_lock_client_name'>create_lock_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_locked'>locked</span> <span class='op'>=</span> <span class='kw'>false</span>
<span class='id identifier rubyid_retries_left'>retries_left</span> <span class='op'>=</span> <span class='const'>HWSSettings</span><span class='period'>.</span><span class='id identifier rubyid_system'>system</span><span class='period'>.</span><span class='const'>HELIX_SYNC_LOCK_RETRIES</span>
<span class='id identifier rubyid_lock_client'>lock_client</span> <span class='op'>=</span> <span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_fetch_client'>fetch_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='id identifier rubyid_lock_client'>lock_client</span><span class='period'>.</span><span class='id identifier rubyid__client'>_client</span>
<span class='kw'>while</span> <span class='op'>!</span><span class='id identifier rubyid_locked'>locked</span> <span class='op'>&&</span> <span class='id identifier rubyid_retries_left'>retries_left</span> <span class='op'>></span> <span class='int'>0</span>
<span class='id identifier rubyid_retries_left'>retries_left</span> <span class='op'>-=</span> <span class='int'>1</span>
<span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_at_exception_level'>at_exception_level</span><span class='lparen'>(</span><span class='const'>P4</span><span class='op'>::</span><span class='const'>RAISE_NONE</span><span class='rparen'>)</span> <span class='kw'>do</span>
<span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_save_client'>save_client</span><span class='lparen'>(</span><span class='id identifier rubyid_lock_client'>lock_client</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-x</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>if</span> <span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_messages'>messages</span> <span class='op'>&&</span>
<span class='op'>!</span><span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_messages'>messages</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>&&</span>
<span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_messages'>messages</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_msgid'>msgid</span> <span class='op'>==</span> <span class='int'>7748</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_sleep'>sleep</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_retries_left'>retries_left</span> <span class='op'>></span> <span class='int'>0</span>
<span class='kw'>elsif</span> <span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_messages'>messages</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_severity'>severity</span> <span class='op'><</span> <span class='const'>P4</span><span class='op'>::</span><span class='const'>E_FAILED</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_locked'>locked</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>else</span>
<span class='comment'># This is a different error altogether
</span> <span class='id identifier rubyid_fail'>fail</span> <span class='const'>P4Util</span><span class='period'>.</span><span class='id identifier rubyid_make_p4_error'>make_p4_error</span><span class='lparen'>(</span><span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='const'>LockFailed</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_locked'>locked</span>
<span class='kw'>return</span> <span class='id identifier rubyid_lock_p4'>lock_p4</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="p4_where_path-instance_method">
- (<tt>Object</tt>) <strong>p4_where_path</strong>(depot_path)
</h3><div class="docstring">
<div class="discussion">
<p>Determines the local path of the file on disk using “p4 where”.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
374
375
376
377</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 374</span>
<span class='kw'>def</span> <span class='id identifier rubyid_p4_where_path'>p4_where_path</span><span class='lparen'>(</span><span class='id identifier rubyid_depot_path'>depot_path</span><span class='rparen'>)</span>
<span class='id identifier rubyid_where_results'>where_results</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_where'>run_where</span><span class='lparen'>(</span><span class='id identifier rubyid_depot_path'>depot_path</span><span class='rparen'>)</span>
<span class='id identifier rubyid_where_results'>where_results</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='kw'>nil</span> <span class='op'>:</span> <span class='id identifier rubyid_where_results'>where_results</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>path</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="p4host-instance_method">
- (<tt>Object</tt>) <strong>p4host</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
505
506
507</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 505</span>
<span class='kw'>def</span> <span class='id identifier rubyid_p4host'>p4host</span>
<span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>hws_settings</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='const'>P4HOST</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="p4port-instance_method">
- (<tt>Object</tt>) <strong>p4port</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
501
502
503</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 501</span>
<span class='kw'>def</span> <span class='id identifier rubyid_p4port'>p4port</span>
<span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>hws_settings</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='const'>P4PORT</span> <span class='op'>||</span> <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>P4PORT setting not available</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="preview_pending_change-instance_method">
- (<tt>Object</tt>) <strong>preview_pending_change</strong>(project_id)
</h3><div class="docstring">
<div class="discussion">
<p>Generates the resolution plan for the shelf</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 198</span>
<span class='kw'>def</span> <span class='id identifier rubyid_preview_pending_change'>preview_pending_change</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_mktmpdir'>mktmpdir</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>hve_resolve</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_dir'>dir</span><span class='op'>|</span>
<span class='id identifier rubyid_shelf_client'>shelf_client</span> <span class='op'>=</span> <span class='id identifier rubyid_create_shelf_client_name'>create_shelf_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_assume_client_ownership'>assume_client_ownership</span><span class='lparen'>(</span><span class='id identifier rubyid_shelf_client'>shelf_client</span><span class='comma'>,</span> <span class='id identifier rubyid_dir'>dir</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='id identifier rubyid_shelf_client'>shelf_client</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_change'>change</span> <span class='op'>=</span> <span class='id identifier rubyid_find_pending_change_for_project'>find_pending_change_for_project</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_describe_results'>describe_results</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_describe'>run_describe</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-S</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-s</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='id identifier rubyid_describe'>describe</span> <span class='op'>=</span> <span class='const'>Describe</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_describe_results'>describe_results</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='rparen'>)</span>
<span class='id identifier rubyid_shelf_meta'>shelf_meta</span> <span class='op'>=</span> <span class='id identifier rubyid_shelf_meta_from_json'>shelf_meta_from_json</span><span class='lparen'>(</span><span class='id identifier rubyid_describe'>describe</span><span class='period'>.</span><span class='id identifier rubyid_desc'>desc</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='id identifier rubyid_load_shelf_plan'>load_shelf_plan</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='id identifier rubyid_describe'>describe</span><span class='comma'>,</span> <span class='id identifier rubyid_shelf_meta'>shelf_meta</span><span class='rparen'>)</span>
<span class='kw'>ensure</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>INVALID</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="readd-instance_method">
- (<tt>Object</tt>) <strong>readd</strong>(subplans, change)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
386
387
388
389
390
391
392</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 386</span>
<span class='kw'>def</span> <span class='id identifier rubyid_readd'>readd</span><span class='lparen'>(</span><span class='id identifier rubyid_subplans'>subplans</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='id identifier rubyid_depot_files'>depot_files</span> <span class='op'>=</span> <span class='id identifier rubyid_subplans'>subplans</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:depotFile</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_sync'>run_sync</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-f</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_unshelve'>run_unshelve</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-s</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_revert'>run_revert</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-k</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_add'>run_add</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="remove_from_shelf_and_plan-instance_method">
- (<tt>Object</tt>) <strong>remove_from_shelf_and_plan</strong>(plan, change)
</h3><div class="docstring">
<div class="discussion">
<p>Remove all remove_actions from the shelf, and the plan.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
380
381
382
383
384</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 380</span>
<span class='kw'>def</span> <span class='id identifier rubyid_remove_from_shelf_and_plan'>remove_from_shelf_and_plan</span><span class='lparen'>(</span><span class='id identifier rubyid_plan'>plan</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='id identifier rubyid_files_to_remove'>files_to_remove</span> <span class='op'>=</span> <span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_remove_actions'>remove_actions</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:depotFile</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_shelve'>run_shelve</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-d</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_files_to_remove'>files_to_remove</span><span class='rparen'>)</span>
<span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_remove_actions'>remove_actions</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_subplans'>subplans</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="rename_all_locked_by_other-instance_method">
- (<tt>Object</tt>) <strong>rename_all_locked_by_other</strong>(plan, change)
</h3><div class="docstring">
<div class="discussion">
<p>Will return true if anything actually happened. If that's true, you
should rebuild the revised plan.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 344</span>
<span class='kw'>def</span> <span class='id identifier rubyid_rename_all_locked_by_other'>rename_all_locked_by_other</span><span class='lparen'>(</span><span class='id identifier rubyid_plan'>plan</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='id identifier rubyid_to_remove'>to_remove</span> <span class='op'>=</span> <span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_subplans'>subplans</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span> <span class='id identifier rubyid_s'>s</span><span class='period'>.</span><span class='id identifier rubyid_locked_by_other_than?'>locked_by_other_than?</span><span class='lparen'>(</span><span class='id identifier rubyid_user'>user</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_to_remove'>to_remove</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_depot_files'>depot_files</span> <span class='op'>=</span> <span class='id identifier rubyid_to_remove'>to_remove</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span> <span class='id identifier rubyid_s'>s</span><span class='period'>.</span><span class='id identifier rubyid_depotFile'>depotFile</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_sync'>run_sync</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-f</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_unshelve'>run_unshelve</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-s</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_shelve'>run_shelve</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-d</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_revert'>run_revert</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-k</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='id identifier rubyid_to_readd'>to_readd</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_to_remove'>to_remove</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_subplan'>subplan</span><span class='op'>|</span>
<span class='id identifier rubyid_old_name'>old_name</span> <span class='op'>=</span> <span class='id identifier rubyid_p4_where_path'>p4_where_path</span><span class='lparen'>(</span><span class='id identifier rubyid_subplan'>subplan</span><span class='period'>.</span><span class='id identifier rubyid_depotFile'>depotFile</span><span class='rparen'>)</span>
<span class='id identifier rubyid_new_name'>new_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_old_name'>old_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_change'>change</span><span class='embexpr_end'>}</span><span class='tstring_content'>.locked</span><span class='tstring_end'>"</span></span>
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_rename'>rename</span><span class='lparen'>(</span><span class='id identifier rubyid_old_name'>old_name</span><span class='comma'>,</span> <span class='id identifier rubyid_new_name'>new_name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_to_readd'>to_readd</span> <span class='op'><<</span> <span class='id identifier rubyid_new_name'>new_name</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_add'>run_add</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_to_readd'>to_readd</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_shelve'>run_shelve</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-f</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_to_readd'>to_readd</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_revert'>run_revert</span><span class='lparen'>(</span><span class='id identifier rubyid_to_readd'>to_readd</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>return</span> <span class='kw'>false</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="resolve_and_submit_plan-instance_method">
- (<tt>Object</tt>) <strong>resolve_and_submit_plan</strong>(plan, change)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 309</span>
<span class='kw'>def</span> <span class='id identifier rubyid_resolve_and_submit_plan'>resolve_and_submit_plan</span><span class='lparen'>(</span><span class='id identifier rubyid_plan'>plan</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='kw'>if</span> <span class='id identifier rubyid_rename_all_locked_by_other'>rename_all_locked_by_other</span><span class='lparen'>(</span><span class='id identifier rubyid_plan'>plan</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>false</span>
<span class='kw'>end</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_remove_actions'>remove_actions</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_remove_from_shelf_and_plan'>remove_from_shelf_and_plan</span><span class='lparen'>(</span><span class='id identifier rubyid_plan'>plan</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_readd_actions'>readd_actions</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_readd'>readd</span><span class='lparen'>(</span><span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_readd_actions'>readd_actions</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_resolve_actions'>resolve_actions</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_unshelve_and_resolve'>unshelve_and_resolve</span><span class='lparen'>(</span><span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_resolve_actions'>resolve_actions</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_readd_actions'>readd_actions</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='kw'>or</span> <span class='op'>!</span><span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_resolve_actions'>resolve_actions</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_shelve_revert_and_sync'>shelve_revert_and_sync</span><span class='lparen'>(</span><span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_readd_actions'>readd_actions</span> <span class='op'>+</span> <span class='id identifier rubyid_plan'>plan</span><span class='period'>.</span><span class='id identifier rubyid_resolve_actions'>resolve_actions</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_at_exception_level'>at_exception_level</span><span class='lparen'>(</span><span class='const'>P4</span><span class='op'>::</span><span class='const'>RAISE_NONE</span><span class='rparen'>)</span> <span class='kw'>do</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_submit'>run_submit</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-e</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='kw'>end</span>
<span class='kw'>return</span> <span class='kw'>true</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="resolve_and_submit_shelf-instance_method">
- (<tt>Object</tt>) <strong>resolve_and_submit_shelf</strong>(project_id)
</h3><div class="docstring">
<div class="discussion">
<p>Will attempt to resolve all changes on the shelf and submit it</p>
<p>Note: there may be addition</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 222</span>
<span class='kw'>def</span> <span class='id identifier rubyid_resolve_and_submit_shelf'>resolve_and_submit_shelf</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_lock_p4'>lock_p4</span> <span class='op'>=</span> <span class='id identifier rubyid_obtain_client_lock'>obtain_client_lock</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='comment'># All resolves require setting the local client to a local directory,
</span> <span class='comment'># that we delete when done.
</span> <span class='id identifier rubyid_dir'>dir</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_mktmpdir'>mktmpdir</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>hve_resolve</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_shelf_client'>shelf_client</span> <span class='op'>=</span> <span class='id identifier rubyid_create_shelf_client_name'>create_shelf_client_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_assume_client_ownership'>assume_client_ownership</span><span class='lparen'>(</span><span class='id identifier rubyid_shelf_client'>shelf_client</span><span class='comma'>,</span> <span class='id identifier rubyid_dir'>dir</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='id identifier rubyid_shelf_client'>shelf_client</span>
<span class='id identifier rubyid_change'>change</span> <span class='op'>=</span> <span class='id identifier rubyid_find_pending_change_for_project'>find_pending_change_for_project</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_retries'>retries</span> <span class='op'>=</span> <span class='const'>HWSSettings</span><span class='period'>.</span><span class='id identifier rubyid_system'>system</span><span class='period'>.</span><span class='const'>HELIX_SYNC_RECONCILE_RETRIES</span>
<span class='id identifier rubyid_is_resolved'>is_resolved</span> <span class='op'>=</span> <span class='kw'>false</span>
<span class='kw'>while</span> <span class='op'>!</span><span class='id identifier rubyid_is_resolved'>is_resolved</span> <span class='op'>&&</span> <span class='id identifier rubyid_retries'>retries</span> <span class='op'>></span> <span class='int'>0</span>
<span class='id identifier rubyid_describe_results'>describe_results</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_describe'>run_describe</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-S</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-s</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='id identifier rubyid_describe'>describe</span> <span class='op'>=</span> <span class='const'>Describe</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_describe_results'>describe_results</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='rparen'>)</span>
<span class='id identifier rubyid_shelf_meta'>shelf_meta</span> <span class='op'>=</span> <span class='id identifier rubyid_shelf_meta_from_json'>shelf_meta_from_json</span><span class='lparen'>(</span><span class='id identifier rubyid_describe'>describe</span><span class='period'>.</span><span class='id identifier rubyid_desc'>desc</span><span class='rparen'>)</span>
<span class='id identifier rubyid_shelf_plan'>shelf_plan</span> <span class='op'>=</span> <span class='id identifier rubyid_load_shelf_plan'>load_shelf_plan</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='id identifier rubyid_describe'>describe</span><span class='comma'>,</span> <span class='id identifier rubyid_shelf_meta'>shelf_meta</span><span class='rparen'>)</span>
<span class='id identifier rubyid_is_resolved'>is_resolved</span> <span class='op'>=</span> <span class='id identifier rubyid_resolve_and_submit_plan'>resolve_and_submit_plan</span><span class='lparen'>(</span><span class='id identifier rubyid_shelf_plan'>shelf_plan</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='id identifier rubyid_retries'>retries</span> <span class='op'>-=</span> <span class='int'>1</span>
<span class='id identifier rubyid_sleep'>sleep</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_is_resolved'>is_resolved</span> <span class='op'>&&</span> <span class='id identifier rubyid_retries'>retries</span> <span class='op'>></span> <span class='int'>0</span>
<span class='kw'>end</span>
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_is_resolved'>is_resolved</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='const'>SubmitFailed</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>ensure</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_run_client'>run_client</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-d</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span>
<span class='id identifier rubyid_lock_p4'>lock_p4</span><span class='period'>.</span><span class='id identifier rubyid_disconnect'>disconnect</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>INVALID</span><span class='tstring_end'>'</span></span>
<span class='comment'># Our client has the 'rmdir' option set, which can delete the local
</span> <span class='comment'># directory if there's nothing else remaining in the client.
</span> <span class='kw'>unless</span> <span class='id identifier rubyid_dir'>dir</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_rmtree'>rmtree</span><span class='lparen'>(</span><span class='id identifier rubyid_dir'>dir</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_dir'>dir</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="safe_hve_projects_path-instance_method">
- (<tt>Object</tt>) <strong>safe_hve_projects_path</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
473
474
475</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 473</span>
<span class='kw'>def</span> <span class='id identifier rubyid_safe_hve_projects_path'>safe_hve_projects_path</span>
<span class='id identifier rubyid_hve_projects_path'>hve_projects_path</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>//</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="server-instance_method">
- (<tt>Object</tt>) <strong>server</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
492
493
494
495
496
497
498
499</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 492</span>
<span class='kw'>def</span> <span class='id identifier rubyid_server'>server</span>
<span class='kw'>return</span> <span class='id identifier rubyid_p4port'>p4port</span> <span class='kw'>if</span> <span class='id identifier rubyid_p4port'>p4port</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>:</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_host'>host</span> <span class='op'>=</span> <span class='id identifier rubyid_p4host'>p4host</span> <span class='op'>?</span> <span class='id identifier rubyid_p4host'>p4host</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>localhost</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_port'>port</span> <span class='op'>=</span> <span class='id identifier rubyid_p4port'>p4port</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_host'>host</span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_port'>port</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="server_uri_for_id-instance_method">
- (<tt>Object</tt>) <strong>server_uri_for_id</strong>(id)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
461
462
463</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 461</span>
<span class='kw'>def</span> <span class='id identifier rubyid_server_uri_for_id'>server_uri_for_id</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>p4://</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_userinfo'>userinfo</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_server'>server</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_safe_hve_projects_path'>safe_hve_projects_path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="shelf_meta_from_json-instance_method">
- (<tt>Object</tt>) <strong>shelf_meta_from_json</strong>(description)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
409
410
411
412</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 409</span>
<span class='kw'>def</span> <span class='id identifier rubyid_shelf_meta_from_json'>shelf_meta_from_json</span><span class='lparen'>(</span><span class='id identifier rubyid_description'>description</span><span class='rparen'>)</span>
<span class='id identifier rubyid_parsed'>parsed</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_description'>description</span><span class='rparen'>)</span>
<span class='const'>ShelfMeta</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_parsed'>parsed</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="shelve_revert_and_sync-instance_method">
- (<tt>Object</tt>) <strong>shelve_revert_and_sync</strong>(subplans, change)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
401
402
403
404
405
406
407</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 401</span>
<span class='kw'>def</span> <span class='id identifier rubyid_shelve_revert_and_sync'>shelve_revert_and_sync</span><span class='lparen'>(</span><span class='id identifier rubyid_subplans'>subplans</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='id identifier rubyid_depot_files'>depot_files</span> <span class='op'>=</span> <span class='id identifier rubyid_subplans'>subplans</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:depotFile</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_shelve'>run_shelve</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-f</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_revert'>run_revert</span><span class='lparen'>(</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='id identifier rubyid_df_no_specs'>df_no_specs</span> <span class='op'>=</span> <span class='id identifier rubyid_depot_files'>depot_files</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_f'>f</span><span class='embexpr_end'>}</span><span class='tstring_content'>#none</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_sync'>run_sync</span><span class='lparen'>(</span><span class='id identifier rubyid_df_no_specs'>df_no_specs</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="unencode_name-instance_method">
- (<tt>Object</tt>) <strong>unencode_name</strong>(name)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
457
458
459</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 457</span>
<span class='kw'>def</span> <span class='id identifier rubyid_unencode_name'>unencode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='const'>HWSStrings</span><span class='period'>.</span><span class='id identifier rubyid_component_decode'>component_decode</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="unshelve_and_resolve-instance_method">
- (<tt>Object</tt>) <strong>unshelve_and_resolve</strong>(subplans, change)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
394
395
396
397
398
399</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 394</span>
<span class='kw'>def</span> <span class='id identifier rubyid_unshelve_and_resolve'>unshelve_and_resolve</span><span class='lparen'>(</span><span class='id identifier rubyid_subplans'>subplans</span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
<span class='id identifier rubyid_depot_files'>depot_files</span> <span class='op'>=</span> <span class='id identifier rubyid_subplans'>subplans</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:depotFile</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_unshelve'>run_unshelve</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-s</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_sync'>run_sync</span><span class='lparen'>(</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_resolve'>run_resolve</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-ay</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_depot_files'>depot_files</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="userinfo-instance_method">
- (<tt>Object</tt>) <strong>userinfo</strong>
</h3><div class="docstring">
<div class="discussion">
<p>For HVE Projects, it may be interesting to people to see various connection
settings for each server URL.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
479
480
481
482
483
484
485
486
487
488
489
490</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/helix_sync/methods.rb', line 479</span>
<span class='kw'>def</span> <span class='id identifier rubyid_userinfo'>userinfo</span>
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
<span class='kw'>if</span> <span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>hws_settings</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='const'>P4CHARSET</span>
<span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>P4CHARSET</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>hws_settings</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='const'>P4CHARSET</span>
<span class='kw'>end</span>
<span class='kw'>if</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
<span class='kw'>else</span>
<span class='id identifier rubyid_encoded_data'>encoded_data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_v'>v</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>;</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_encoded_data'>encoded_data</span><span class='embexpr_end'>}</span><span class='tstring_content'>@</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Oct 12 22:20:50 2015 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.7.6 (ruby-2.2.3).
</div>
</body>
</html>