<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<html><head>
<title>Class: LabelMgr</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel=StyleSheet href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript" language="JavaScript">
<!--
function popCode(url) {
window.open(url, "Code",
"resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
//-->
</script>
</head>
<body bgcolor="white">
<table summary="Information on class" width="100%" border="0" cellspacing="0">
<tr class="title-row">
<td class="big-title-font">
<sup><font color="aqua">Class</font></sup> LabelMgr
</td>
<td align="right">
<table summary="layout" cellspacing="0" cellpadding="2">
<tr valign="top">
<td class="small-title-font">In:</td>
<td class="small-title-font">
<a href="../files/specsaver_rb.html" class="aqua">
specsaver.rb
</a>
<br />
</td>
</tr>
<tr>
<td class="small-title-font">Parent:</td>
<td class="small-title-font">
<a href="GenSpecMgr.html" class="aqua">
GenSpecMgr
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- banner header -->
<div class="description"><p>
<a href="GenSpecMgr.html">GenSpecMgr</a> subclass for Labels. Labels differ
slightly from the generic model in that we also archive the file list for
the label.
</p>
</div>
<table summary="Methods" cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Methods</td></tr>
</table>
<div class="name-list">
<a href="#M000042">new</a>
<a href="#M000044">save_files</a>
<a href="#M000043">update</a>
</div>
<table summary="Method list" cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Public Class methods</td></tr>
</table>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000042"></a>
<b>new</b>( root, p4t, p4u )
</td></tr>
</table>
<div class="description">
<p>
Constructor. Provide the client root and tagged and non-tagged P4 client
instances.
</p>
</div>
<pre class="source">
<span class="cmt"># File specsaver.rb, line 314</span>
<span class="kw">def</span> initialize( root, p4t, p4u )
<span class="kw">super</span>( <span class="str">"label"</span>, root, p4t, p4u )
<span class="kw">end</span>
</pre>
<table summary="Method list" cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Public Instance methods</td></tr>
</table>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000043"></a>
<b>update</b>( since )
</td></tr>
</table>
<div class="description">
<p>
Override SpecMgr#update() so that we can archive the file list as well as
the spec
</p>
</div>
<pre class="source">
<span class="cmt"># File specsaver.rb, line 322</span>
<span class="kw">def</span> update( since )
list_specs.each <span class="kw">do</span>
|l|
<span class="kw">if</span> ( changed?( l, since ) )
save_spec( <span class="str">"label"</span>, l )
save_files( l[ <span class="str">"label"</span> ] )
<span class="kw">end</span>
<span class="kw">end</span>
submit( description() )
<span class="kw">end</span>
</pre>
<table summary="Method list" cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Protected Instance methods</td></tr>
</table>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000044"></a>
<b>save_files</b>( label )
</td></tr>
</table>
<div class="description">
<p>
Method to save the file list for a label. Appends ".files" to the
label name and saves the output of "p4 files //...@label" there.
</p>
</div>
<pre class="source">
<span class="cmt"># File specsaver.rb, line 339</span>
<span class="kw">def</span> save_files( label )
filename = @root + <span class="str">"/labels/"</span> + label + <span class="str">".files"</span>
files = @p4t.run_files( "//...@#{label}" ).collect <span class="kw">do</span>
|l|
l[ <span class="str">"depotFile"</span> ] + "#" + l[ <span class="str">"rev"</span> ]
<span class="kw">end</span>
add_edit_file( filename, label )
write_ws_file( filename, files.join( <span class="str">"\n"</span> ) )
<span class="kw">end</span>
</pre>
</body>
# |
Change |
User |
Description |
Committed |
|
#1
|
3095 |
Tony Smith |
First batch of documentation for specsaver.rb |
|
|