M000016.html #1

  • //
  • guest/
  • tony_smith/
  • perforce/
  • P4Rubylib/
  • triggers/
  • doc/
  • classes/
  • CaseTrigger.src/
  • M000016.html
  • View
  • Commits
  • Open Download .zip Download (2 KB)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>mismatch_dirs (CaseTrigger)</title>
<link rel=StyleSheet href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body bgcolor="white">
<pre><span class="cmt"># File checkcase.rb, line 121</span>
    <span class="kw">def</span> mismatch_dirs( depot, dirs )
        match = <span class="kw">false</span>
        path = <span class="str">&quot;//&quot;</span> + depot
        dirs.each <span class="kw">do</span>
            |dir|
            lcpath = path.downcase
            p4.run_dirs( path + <span class="str">&quot;/*&quot;</span> ).each <span class="kw">do</span>
                |d|
                d = d[ <span class="str">&quot;dir&quot;</span> ] <span class="cmt"># We're in tagged mode</span>
                dname = d.sub( path + <span class="str">&quot;/&quot;</span>, <span class="str">&quot;&quot;</span> )

                <span class="kw">if</span> ( dir.downcase == dname.downcase )
                    <span class="cmt"># We found a match</span>
                    <span class="kw">if</span> ( dir != dname )
                        match = <span class="kw">true</span>
                        @mismatch = d
                    <span class="kw">end</span>
                    <span class="kw">break</span>
                <span class="kw">end</span>
            <span class="kw">end</span>

            <span class="cmt"># If we found a mismatch, we can break out now</span>
            <span class="kw">break</span> <span class="kw">if</span> ( match )

            <span class="cmt"># This level is now OK, we need to descend to the</span>
            <span class="cmt"># next level in the tree</span>
            path &lt;&lt; <span class="str">&quot;/&quot;</span> &lt;&lt; dir
        <span class="kw">end</span>
        match
    <span class="kw">end</span></pre>
</body>
</html>
# Change User Description Committed
#1 3637 Tony Smith Add RDoc documentation to the sample triggers.