<!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">"//"</span> + depot
dirs.each <span class="kw">do</span>
|dir|
lcpath = path.downcase
p4.run_dirs( path + <span class="str">"/*"</span> ).each <span class="kw">do</span>
|d|
d = d[ <span class="str">"dir"</span> ] <span class="cmt"># We're in tagged mode</span>
dname = d.sub( path + <span class="str">"/"</span>, <span class="str">""</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 << <span class="str">"/"</span> << 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. |
|
|