Source

VersionControl_Hg / src / Documentation / Code / Hg / Executable.php.html

The default branch has multiple heads

<!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">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>
            Mayflower Code Browser - Source Code
        </title>
        <link rel="stylesheet" type="text/css" href="js/jquery.sidebar/css/codebrowser/sidebar.css" />
        <link rel="stylesheet" type="text/css" href="css/global.css" />
        <link rel="stylesheet" type="text/css" href="css/cruisecontrol.css" />
        <link rel="stylesheet" type="text/css" href="css/review.css" />

        <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
        <script type="text/javascript" src="js/jquery.sidebar/jquery-ui-1.7.2.custom.min.js"></script>
        <script type="text/javascript" src="js/jquery.sidebar/jquery.sidebar.js"></script>
        <script type="text/javascript" src="js/jquery.cluetip/lib/jquery.hoverIntent.js"></script>
        <script type="text/javascript" src="js/jquery.cluetip/lib/jquery.bgiframe.min.js"></script>
        <script type="text/javascript" src="js/jquery.cluetip/jquery.cluetip.min.js"></script>

        <script type="text/javascript" src="js/review.js"></script>
    </head>
    <body class="codebrowser">
        <div class="header">
            <a href="./index.html">Go back to index</a> |
            <a href="http://github.com/mayflowergmbh/PHP_CodeBrowser">PHP CodeBrowser</a>
        </div>
        <hr/>
        <div id="review">
            <div class="filepath">
                Hg/Executable.php            </div>

            <ol class="code"><li id="line_1" class="odd"><span class="lineNumber">&nbsp;&nbsp;1&nbsp;</span><span>
</span><span class="default">&lt;?php</span><a name="line_1"></a></li><li id="line_2" class="even"><span class="lineNumber">&nbsp;&nbsp;2&nbsp;</span><span class="comment">/**</span><a name="line_2"></a></li><li id="line_3" class="odd"><span class="lineNumber">&nbsp;&nbsp;3&nbsp;</span><span class="comment">&nbsp;*&nbsp;Contains&nbsp;the&nbsp;definition&nbsp;of&nbsp;the&nbsp;Executable&nbsp;class</span><a name="line_3"></a></li><li id="line_4" class="even"><span class="lineNumber">&nbsp;&nbsp;4&nbsp;</span><span class="comment">&nbsp;*</span><a name="line_4"></a></li><li id="line_5" class="odd"><span class="lineNumber">&nbsp;&nbsp;5&nbsp;</span><span class="comment">&nbsp;*&nbsp;PHP&nbsp;version&nbsp;5</span><a name="line_5"></a></li><li id="line_6" class="even"><span class="lineNumber">&nbsp;&nbsp;6&nbsp;</span><span class="comment">&nbsp;*</span><a name="line_6"></a></li><li id="line_7" class="odd"><span class="lineNumber">&nbsp;&nbsp;7&nbsp;</span><span class="comment">&nbsp;*&nbsp;@category&nbsp;&nbsp;&nbsp;VersionControl</span><a name="line_7"></a></li><li id="line_8" class="even"><span class="lineNumber">&nbsp;&nbsp;8&nbsp;</span><span class="comment">&nbsp;*&nbsp;@package&nbsp;&nbsp;&nbsp;&nbsp;Hg</span><a name="line_8"></a></li><li id="line_9" class="odd"><span class="lineNumber">&nbsp;&nbsp;9&nbsp;</span><span class="comment">&nbsp;*&nbsp;@subpackage&nbsp;Executable</span><a name="line_9"></a></li><li id="line_10" class="even"><span class="lineNumber">&nbsp;10&nbsp;</span><span class="comment">&nbsp;*&nbsp;@author&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Michael&nbsp;Gatto&nbsp;&lt;mgatto@lisantra.com&gt;</span><a name="line_10"></a></li><li id="line_11" class="odd"><span class="lineNumber">&nbsp;11&nbsp;</span><span class="comment">&nbsp;*&nbsp;@copyright&nbsp;&nbsp;2011&nbsp;Lisantra&nbsp;Technologies,&nbsp;LLC</span><a name="line_11"></a></li><li id="line_12" class="even"><span class="lineNumber">&nbsp;12&nbsp;</span><span class="comment">&nbsp;*&nbsp;@license&nbsp;&nbsp;&nbsp;&nbsp;http://www.opensource.org/licenses/mit-license.html&nbsp;MIT&nbsp;License</span><a name="line_12"></a></li><li id="line_13" class="odd"><span class="lineNumber">&nbsp;13&nbsp;</span><span class="comment">&nbsp;*&nbsp;@link&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://pear.php.net/package/VersionControl_Hg</span><a name="line_13"></a></li><li id="line_14" class="even"><span class="lineNumber">&nbsp;14&nbsp;</span><span class="comment">&nbsp;*/</span><a name="line_14"></a></li><li id="line_15" class="odd"><span class="lineNumber">&nbsp;15&nbsp;</span><a name="line_15"></a></li><li id="line_16" class="even"><span class="lineNumber">&nbsp;16&nbsp;</span><span class="comment">/**</span><a name="line_16"></a></li><li id="line_17" class="odd"><span class="lineNumber">&nbsp;17&nbsp;</span><span class="comment">&nbsp;*&nbsp;Provides&nbsp;Exceptions&nbsp;for&nbsp;the&nbsp;Executable</span><a name="line_17"></a></li><li id="line_18" class="even"><span class="lineNumber">&nbsp;18&nbsp;</span><span class="comment">&nbsp;*/</span><a name="line_18"></a></li><li id="line_19" class="odd"><span class="lineNumber">&nbsp;19&nbsp;</span><span class="keyword">require_once&nbsp;</span><span class="string">'Executable/Exception.php'</span><span class="keyword">;</span><a name="line_19"></a></li><li id="line_20" class="even"><span class="lineNumber">&nbsp;20&nbsp;</span><a name="line_20"></a></li><li id="line_21" class="odd"><span class="lineNumber">&nbsp;21&nbsp;</span><span class="comment">/**</span><a name="line_21"></a></li><li id="line_22" class="even"><span class="lineNumber">&nbsp;22&nbsp;</span><span class="comment">&nbsp;*&nbsp;Provides&nbsp;access&nbsp;to&nbsp;the&nbsp;Hg&nbsp;executable</span><a name="line_22"></a></li><li id="line_23" class="odd"><span class="lineNumber">&nbsp;23&nbsp;</span><span class="comment">&nbsp;*</span><a name="line_23"></a></li><li id="line_24" class="even"><span class="lineNumber">&nbsp;24&nbsp;</span><span class="comment">&nbsp;*&nbsp;This&nbsp;is&nbsp;the&nbsp;de-facto&nbsp;parent&nbsp;container&nbsp;of&nbsp;all&nbsp;operations</span><a name="line_24"></a></li><li id="line_25" class="odd"><span class="lineNumber">&nbsp;25&nbsp;</span><span class="comment">&nbsp;*</span><a name="line_25"></a></li><li id="line_26" class="even"><span class="lineNumber">&nbsp;26&nbsp;</span><span class="comment">&nbsp;*&nbsp;PHP&nbsp;version&nbsp;5</span><a name="line_26"></a></li><li id="line_27" class="odd"><span class="lineNumber">&nbsp;27&nbsp;</span><span class="comment">&nbsp;*</span><a name="line_27"></a></li><li id="line_28" class="even"><span class="lineNumber">&nbsp;28&nbsp;</span><span class="comment">&nbsp;*&nbsp;@category&nbsp;&nbsp;&nbsp;VersionControl</span><a name="line_28"></a></li><li id="line_29" class="odd"><span class="lineNumber">&nbsp;29&nbsp;</span><span class="comment">&nbsp;*&nbsp;@package&nbsp;&nbsp;&nbsp;&nbsp;Hg</span><a name="line_29"></a></li><li id="line_30" class="even"><span class="lineNumber">&nbsp;30&nbsp;</span><span class="comment">&nbsp;*&nbsp;@subpackage&nbsp;Executable</span><a name="line_30"></a></li><li id="line_31" class="odd"><span class="lineNumber">&nbsp;31&nbsp;</span><span class="comment">&nbsp;*&nbsp;@author&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Michael&nbsp;Gatto&nbsp;&lt;mgatto@lisantra.com&gt;</span><a name="line_31"></a></li><li id="line_32" class="even"><span class="lineNumber">&nbsp;32&nbsp;</span><span class="comment">&nbsp;*&nbsp;@copyright&nbsp;&nbsp;2011&nbsp;Lisantra&nbsp;Technologies,&nbsp;LLC</span><a name="line_32"></a></li><li id="line_33" class="odd"><span class="lineNumber">&nbsp;33&nbsp;</span><span class="comment">&nbsp;*&nbsp;@license&nbsp;&nbsp;&nbsp;&nbsp;http://www.opensource.org/licenses/mit-license.html&nbsp;MIT&nbsp;License</span><a name="line_33"></a></li><li id="line_34" class="even"><span class="lineNumber">&nbsp;34&nbsp;</span><span class="comment">&nbsp;*&nbsp;@link&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://pear.php.net/package/VersionControl_Hg</span><a name="line_34"></a></li><li id="line_35" class="odd"><span class="lineNumber">&nbsp;35&nbsp;</span><span class="comment">&nbsp;*/</span><a name="line_35"></a></li><li id="line_36" class="even"><span class="lineNumber">&nbsp;36&nbsp;</span><span class="keyword">class&nbsp;</span><span class="default">VersionControl_Hg_Executable</span><a name="line_36"></a></li><li id="line_37" class="odd"><span class="lineNumber">&nbsp;37&nbsp;</span><span class="keyword">{</span><a name="line_37"></a></li><li id="line_38" class="even"><span class="lineNumber">&nbsp;38&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_38"></a></li><li id="line_39" class="odd"><span class="lineNumber">&nbsp;39&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Use&nbsp;the&nbsp;executable&nbsp;found&nbsp;in&nbsp;the&nbsp;default&nbsp;installation&nbsp;location</span><a name="line_39"></a></li><li id="line_40" class="even"><span class="lineNumber">&nbsp;40&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_40"></a></li><li id="line_41" class="odd"><span class="lineNumber">&nbsp;41&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">const&nbsp;</span><span class="default">DEFAULTEXECUTABLE&nbsp;</span><span class="keyword">=&nbsp;</span><span class="string">"default"</span><span class="keyword">;</span><a name="line_41"></a></li><li id="line_42" class="even"><span class="lineNumber">&nbsp;42&nbsp;</span><a name="line_42"></a></li><li id="line_43" class="odd"><span class="lineNumber">&nbsp;43&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_43"></a></li><li id="line_44" class="even"><span class="lineNumber">&nbsp;44&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Use&nbsp;the&nbsp;executable&nbsp;specified&nbsp;by&nbsp;the&nbsp;user</span><a name="line_44"></a></li><li id="line_45" class="odd"><span class="lineNumber">&nbsp;45&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_45"></a></li><li id="line_46" class="even"><span class="lineNumber">&nbsp;46&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">const&nbsp;</span><span class="default">CUSTOMEXECUTABLE&nbsp;</span><span class="keyword">=&nbsp;</span><span class="string">"custom"</span><span class="keyword">;</span><a name="line_46"></a></li><li id="line_47" class="odd"><span class="lineNumber">&nbsp;47&nbsp;</span><a name="line_47"></a></li><li id="line_48" class="even"><span class="lineNumber">&nbsp;48&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_48"></a></li><li id="line_49" class="odd"><span class="lineNumber">&nbsp;49&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Base&nbsp;class&nbsp;in&nbsp;this&nbsp;package&nbsp;which&nbsp;provides&nbsp;access&nbsp;to&nbsp;the&nbsp;repository&nbsp;and</span><a name="line_49"></a></li><li id="line_50" class="even"><span class="lineNumber">&nbsp;50&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;command&nbsp;objects</span><a name="line_50"></a></li><li id="line_51" class="odd"><span class="lineNumber">&nbsp;51&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_51"></a></li><li id="line_52" class="even"><span class="lineNumber">&nbsp;52&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;VersionControl_Hg</span><a name="line_52"></a></li><li id="line_53" class="odd"><span class="lineNumber">&nbsp;53&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_53"></a></li><li id="line_54" class="even"><span class="lineNumber">&nbsp;54&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">protected&nbsp;</span><span class="default">$hg</span><span class="keyword">;</span><a name="line_54"></a></li><li id="line_55" class="odd"><span class="lineNumber">&nbsp;55&nbsp;</span><a name="line_55"></a></li><li id="line_56" class="even"><span class="lineNumber">&nbsp;56&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_56"></a></li><li id="line_57" class="odd"><span class="lineNumber">&nbsp;57&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Storage&nbsp;var&nbsp;for&nbsp;the&nbsp;singleton</span><a name="line_57"></a></li><li id="line_58" class="even"><span class="lineNumber">&nbsp;58&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_58"></a></li><li id="line_59" class="odd"><span class="lineNumber">&nbsp;59&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;VersionControl_Hg_Executable</span><a name="line_59"></a></li><li id="line_60" class="even"><span class="lineNumber">&nbsp;60&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_60"></a></li><li id="line_61" class="odd"><span class="lineNumber">&nbsp;61&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">private&nbsp;static&nbsp;</span><span class="default">$_instance</span><span class="keyword">;</span><a name="line_61"></a></li><li id="line_62" class="even"><span class="lineNumber">&nbsp;62&nbsp;</span><a name="line_62"></a></li><li id="line_63" class="odd"><span class="lineNumber">&nbsp;63&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_63"></a></li><li id="line_64" class="even"><span class="lineNumber">&nbsp;64&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Path&nbsp;to&nbsp;the&nbsp;excutable&nbsp;binary</span><a name="line_64"></a></li><li id="line_65" class="odd"><span class="lineNumber">&nbsp;65&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_65"></a></li><li id="line_66" class="even"><span class="lineNumber">&nbsp;66&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;string</span><a name="line_66"></a></li><li id="line_67" class="odd"><span class="lineNumber">&nbsp;67&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_67"></a></li><li id="line_68" class="even"><span class="lineNumber">&nbsp;68&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">protected&nbsp;</span><span class="default">$path</span><span class="keyword">;</span><a name="line_68"></a></li><li id="line_69" class="odd"><span class="lineNumber">&nbsp;69&nbsp;</span><a name="line_69"></a></li><li id="line_70" class="even"><span class="lineNumber">&nbsp;70&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_70"></a></li><li id="line_71" class="odd"><span class="lineNumber">&nbsp;71&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;Mercurial&nbsp;binary&nbsp;being&nbsp;used</span><a name="line_71"></a></li><li id="line_72" class="even"><span class="lineNumber">&nbsp;72&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_72"></a></li><li id="line_73" class="odd"><span class="lineNumber">&nbsp;73&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;There&nbsp;may&nbsp;well&nbsp;be&nbsp;multiple&nbsp;versions&nbsp;in&nbsp;use;&nbsp;lets&nbsp;track&nbsp;which&nbsp;one</span><a name="line_73"></a></li><li id="line_74" class="even"><span class="lineNumber">&nbsp;74&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;I&nbsp;am&nbsp;using&nbsp;so&nbsp;the&nbsp;user&nbsp;knows&nbsp;which&nbsp;one&nbsp;is&nbsp;being&nbsp;used.</span><a name="line_74"></a></li><li id="line_75" class="odd"><span class="lineNumber">&nbsp;75&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_75"></a></li><li id="line_76" class="even"><span class="lineNumber">&nbsp;76&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It&nbsp;is&nbsp;labeled&nbsp;as&nbsp;$hg&nbsp;because&nbsp;this&nbsp;is&nbsp;the&nbsp;symbology&nbsp;adopted&nbsp;by&nbsp;the</span><a name="line_76"></a></li><li id="line_77" class="odd"><span class="lineNumber">&nbsp;77&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Mercurial&nbsp;project,&nbsp;since&nbsp;HG&nbsp;is&nbsp;the&nbsp;chemical&nbsp;symbol&nbsp;of&nbsp;the&nbsp;element:</span><a name="line_77"></a></li><li id="line_78" class="even"><span class="lineNumber">&nbsp;78&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Mercury.</span><a name="line_78"></a></li><li id="line_79" class="odd"><span class="lineNumber">&nbsp;79&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_79"></a></li><li id="line_80" class="even"><span class="lineNumber">&nbsp;80&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;string</span><a name="line_80"></a></li><li id="line_81" class="odd"><span class="lineNumber">&nbsp;81&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_81"></a></li><li id="line_82" class="even"><span class="lineNumber">&nbsp;82&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">protected&nbsp;</span><span class="default">$executable</span><span class="keyword">;</span><a name="line_82"></a></li><li id="line_83" class="odd"><span class="lineNumber">&nbsp;83&nbsp;</span><a name="line_83"></a></li><li id="line_84" class="even"><span class="lineNumber">&nbsp;84&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_84"></a></li><li id="line_85" class="odd"><span class="lineNumber">&nbsp;85&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;version&nbsp;of&nbsp;the&nbsp;Mercurial&nbsp;executable.</span><a name="line_85"></a></li><li id="line_86" class="even"><span class="lineNumber">&nbsp;86&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_86"></a></li><li id="line_87" class="odd"><span class="lineNumber">&nbsp;87&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;float</span><a name="line_87"></a></li><li id="line_88" class="even"><span class="lineNumber">&nbsp;88&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_88"></a></li><li id="line_89" class="odd"><span class="lineNumber">&nbsp;89&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">protected&nbsp;</span><span class="default">$version</span><span class="keyword">;</span><a name="line_89"></a></li><li id="line_90" class="even"><span class="lineNumber">&nbsp;90&nbsp;</span><a name="line_90"></a></li><li id="line_91" class="odd"><span class="lineNumber">&nbsp;91&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_91"></a></li><li id="line_92" class="even"><span class="lineNumber">&nbsp;92&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Capabilities&nbsp;per&nbsp;Mercurial&nbsp;version</span><a name="line_92"></a></li><li id="line_93" class="odd"><span class="lineNumber">&nbsp;93&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_93"></a></li><li id="line_94" class="even"><span class="lineNumber">&nbsp;94&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Format&nbsp;is&nbsp;'command:option'&nbsp;or&nbsp;'feature:subfeature'&nbsp;to&nbsp;show&nbsp;when&nbsp;it&nbsp;was</span><a name="line_94"></a></li><li id="line_95" class="odd"><span class="lineNumber">&nbsp;95&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;added&nbsp;to&nbsp;Mercurial</span><a name="line_95"></a></li><li id="line_96" class="even"><span class="lineNumber">&nbsp;96&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_96"></a></li><li id="line_97" class="odd"><span class="lineNumber">&nbsp;97&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;mixed</span><a name="line_97"></a></li><li id="line_98" class="even"><span class="lineNumber">&nbsp;98&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_98"></a></li><li id="line_99" class="odd"><span class="lineNumber">&nbsp;99&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">protected&nbsp;</span><span class="default">$capabilities&nbsp;</span><span class="keyword">=&nbsp;array(</span><a name="line_99"></a></li><li id="line_100" class="even"><span class="lineNumber">100&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">//All&nbsp;pre-1.0&nbsp;features&nbsp;are&nbsp;merged&nbsp;into&nbsp;1.0</span><a name="line_100"></a></li><li id="line_101" class="odd"><span class="lineNumber">101&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'1.0'&nbsp;</span><span class="keyword">=&gt;&nbsp;array(</span><span class="string">'glob'</span><span class="keyword">,</span><span class="string">'re'</span><span class="keyword">,</span><span class="string">'path'</span><span class="keyword">,</span><span class="string">'listfile'</span><span class="keyword">),&nbsp;</span><span class="comment">//released&nbsp;2008-03-24</span><a name="line_101"></a></li><li id="line_102" class="even"><span class="lineNumber">102&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//1.2&nbsp;released&nbsp;2009-03-04</span><a name="line_102"></a></li><li id="line_103" class="odd"><span class="lineNumber">103&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;'...:files'&nbsp;is&nbsp;an&nbsp;internal&nbsp;VersionControl_Hg&nbsp;option&nbsp;name&nbsp;used&nbsp;for</span><a name="line_103"></a></li><li id="line_104" class="even"><span class="lineNumber">104&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;specifying&nbsp;multiple&nbsp;files&nbsp;*/</span><a name="line_104"></a></li><li id="line_105" class="odd"><span class="lineNumber">105&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'1.2'&nbsp;</span><span class="keyword">=&gt;&nbsp;array(</span><span class="string">'commit:close-branch'</span><span class="keyword">,</span><span class="string">'convert:perforce'</span><span class="keyword">,&nbsp;</span><span class="string">'diff:change'</span><span class="keyword">),</span><a name="line_105"></a></li><li id="line_106" class="even"><span class="lineNumber">106&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'1.3'&nbsp;</span><span class="keyword">=&gt;&nbsp;array(</span><a name="line_106"></a></li><li id="line_107" class="odd"><span class="lineNumber">107&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'subrepos'</span><span class="keyword">,</span><span class="string">'merge:preview'</span><span class="keyword">,</span><span class="string">'update:check'</span><span class="keyword">,&nbsp;</span><span class="string">'branches:closed'</span><span class="keyword">,</span><a name="line_107"></a></li><li id="line_108" class="even"><span class="lineNumber">108&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'heads:closed'</span><a name="line_108"></a></li><li id="line_109" class="odd"><span class="lineNumber">109&nbsp;</span><span class="string">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">),</span><a name="line_109"></a></li><li id="line_110" class="even"><span class="lineNumber">110&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'1.4'&nbsp;</span><span class="keyword">=&gt;&nbsp;array(</span><span class="string">'summary'</span><span class="keyword">,</span><span class="string">'diff:stat'</span><span class="keyword">,&nbsp;</span><span class="string">'diff:reverse'</span><span class="keyword">,&nbsp;</span><span class="string">'clone:updaterev'</span><span class="keyword">),</span><a name="line_110"></a></li><li id="line_111" class="odd"><span class="lineNumber">111&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'1.5'&nbsp;</span><span class="keyword">=&gt;&nbsp;array(</span><a name="line_111"></a></li><li id="line_112" class="even"><span class="lineNumber">112&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'import:files'</span><span class="keyword">,</span><span class="string">'log:xml'</span><span class="keyword">,</span><span class="string">'rebase:detach'</span><span class="keyword">,</span><span class="string">'subrepos:svn'</span><span class="keyword">,</span><a name="line_112"></a></li><li id="line_113" class="odd"><span class="lineNumber">113&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'clone:branch'</span><span class="keyword">,&nbsp;</span><span class="string">'bundle:branch'</span><span class="keyword">,&nbsp;</span><span class="string">'incoming:branch'</span><span class="keyword">,</span><a name="line_113"></a></li><li id="line_114" class="even"><span class="lineNumber">114&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'outgoing:branch'</span><span class="keyword">,&nbsp;</span><span class="string">'pull:branch'</span><span class="keyword">,&nbsp;</span><span class="string">'push:branch'</span><a name="line_114"></a></li><li id="line_115" class="odd"><span class="lineNumber">115&nbsp;</span><span class="string">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">),</span><a name="line_115"></a></li><li id="line_116" class="even"><span class="lineNumber">116&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'1.6'&nbsp;</span><span class="keyword">=&gt;&nbsp;array(</span><span class="string">'log:branch'</span><span class="keyword">),</span><a name="line_116"></a></li><li id="line_117" class="odd"><span class="lineNumber">117&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'1.7'&nbsp;</span><span class="keyword">=&gt;&nbsp;array(</span><a name="line_117"></a></li><li id="line_118" class="even"><span class="lineNumber">118&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'strip:keep'</span><span class="keyword">,</span><span class="string">'strip:files'</span><span class="keyword">,</span><span class="string">'strip:revsets'</span><span class="keyword">,</span><span class="string">'add:subrepos'</span><span class="keyword">,</span><a name="line_118"></a></li><li id="line_119" class="odd"><span class="lineNumber">119&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'diff:subrepos'</span><span class="keyword">,&nbsp;</span><span class="string">'incoming:subrepos'</span><span class="keyword">,&nbsp;</span><span class="string">'outgoing:subrepos'</span><span class="keyword">,</span><a name="line_119"></a></li><li id="line_120" class="even"><span class="lineNumber">120&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'status:subrepos'</span><span class="keyword">,</span><span class="string">'revsets'</span><a name="line_120"></a></li><li id="line_121" class="odd"><span class="lineNumber">121&nbsp;</span><span class="string">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">),</span><a name="line_121"></a></li><li id="line_122" class="even"><span class="lineNumber">122&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'1.8'&nbsp;</span><span class="keyword">=&gt;&nbsp;array(</span><span class="string">'listfile'</span><span class="keyword">,</span><span class="string">'subrepos:git'</span><span class="keyword">,&nbsp;</span><span class="string">'bookmark'</span><span class="keyword">),</span><a name="line_122"></a></li><li id="line_123" class="odd"><span class="lineNumber">123&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">//bookmark&nbsp;was&nbsp;an&nbsp;3rd-party&nbsp;extension&nbsp;prior&nbsp;to&nbsp;1.8</span><a name="line_123"></a></li><li id="line_124" class="even"><span class="lineNumber">124&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'1.9'&nbsp;</span><span class="keyword">=&gt;&nbsp;array(</span><a name="line_124"></a></li><li id="line_125" class="odd"><span class="lineNumber">125&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'filesets'</span><span class="keyword">,&nbsp;</span><span class="string">'manifest:all'</span><span class="keyword">,&nbsp;</span><span class="string">'diff:change:revsets'</span><span class="keyword">,</span><a name="line_125"></a></li><li id="line_126" class="even"><span class="lineNumber">126&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'import:bypass'</span><span class="keyword">,&nbsp;</span><span class="string">'paths:quiet'</span><a name="line_126"></a></li><li id="line_127" class="odd"><span class="lineNumber">127&nbsp;</span><span class="string">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">),</span><a name="line_127"></a></li><li id="line_128" class="even"><span class="lineNumber">128&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;);</span><a name="line_128"></a></li><li id="line_129" class="odd"><span class="lineNumber">129&nbsp;</span><a name="line_129"></a></li><li id="line_130" class="even"><span class="lineNumber">130&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_130"></a></li><li id="line_131" class="odd"><span class="lineNumber">131&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Constructor</span><a name="line_131"></a></li><li id="line_132" class="even"><span class="lineNumber">132&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_132"></a></li><li id="line_133" class="odd"><span class="lineNumber">133&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Finds&nbsp;and&nbsp;sets&nbsp;the&nbsp;system's&nbsp;existing&nbsp;Mercurial&nbsp;executable&nbsp;binary&nbsp;which</span><a name="line_133"></a></li><li id="line_134" class="even"><span class="lineNumber">134&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;with&nbsp;all&nbsp;future&nbsp;operations&nbsp;will&nbsp;use.</span><a name="line_134"></a></li><li id="line_135" class="odd"><span class="lineNumber">135&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_135"></a></li><li id="line_136" class="even"><span class="lineNumber">136&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;VersionControl_Hg&nbsp;$hg&nbsp;&nbsp;&nbsp;The&nbsp;root&nbsp;object</span><a name="line_136"></a></li><li id="line_137" class="odd"><span class="lineNumber">137&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$path&nbsp;The&nbsp;full&nbsp;path&nbsp;to&nbsp;the&nbsp;user&nbsp;defined</span><a name="line_137"></a></li><li id="line_138" class="even"><span class="lineNumber">138&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;executable</span><a name="line_138"></a></li><li id="line_139" class="odd"><span class="lineNumber">139&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_139"></a></li><li id="line_140" class="even"><span class="lineNumber">140&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;void</span><a name="line_140"></a></li><li id="line_141" class="odd"><span class="lineNumber">141&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_141"></a></li><li id="line_142" class="even"><span class="lineNumber">142&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">private&nbsp;function&nbsp;</span><span class="default">__construct</span><span class="keyword">(</span><span class="default">$hg</span><span class="keyword">,&nbsp;</span><span class="default">$path</span><span class="keyword">)</span><a name="line_142"></a></li><li id="line_143" class="odd"><span class="lineNumber">143&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_143"></a></li><li id="line_144" class="even"><span class="lineNumber">144&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">hg&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">$hg</span><span class="keyword">;</span><a name="line_144"></a></li><li id="line_145" class="odd"><span class="lineNumber">145&nbsp;</span><a name="line_145"></a></li><li id="line_146" class="even"><span class="lineNumber">146&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;Attempt&nbsp;to&nbsp;set&nbsp;the&nbsp;executable&nbsp;*/</span><a name="line_146"></a></li><li id="line_147" class="odd"><span class="lineNumber">147&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">setExecutable</span><span class="keyword">(</span><span class="default">$path</span><span class="keyword">);</span><a name="line_147"></a></li><li id="line_148" class="even"><span class="lineNumber">148&nbsp;</span><a name="line_148"></a></li><li id="line_149" class="odd"><span class="lineNumber">149&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;We&nbsp;only&nbsp;set&nbsp;version&nbsp;and&nbsp;path&nbsp;if&nbsp;we&nbsp;found&nbsp;a&nbsp;valid&nbsp;executable&nbsp;*/</span><a name="line_149"></a></li><li id="line_150" class="even"><span class="lineNumber">150&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">setPath</span><span class="keyword">();</span><a name="line_150"></a></li><li id="line_151" class="odd"><span class="lineNumber">151&nbsp;</span><a name="line_151"></a></li><li id="line_152" class="even"><span class="lineNumber">152&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;disabled,&nbsp;since&nbsp;calling&nbsp;a&nbsp;command&nbsp;before&nbsp;setting&nbsp;the&nbsp;executable&nbsp;has</span><a name="line_152"></a></li><li id="line_153" class="odd"><span class="lineNumber">153&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;finished&nbsp;seems&nbsp;to&nbsp;tear&nbsp;a&nbsp;hole&nbsp;in&nbsp;the&nbsp;unniverse...&nbsp;*/</span><a name="line_153"></a></li><li id="line_154" class="even"><span class="lineNumber">154&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//$version&nbsp;=&nbsp;$this-&gt;getVersion();</span><a name="line_154"></a></li><li id="line_155" class="odd"><span class="lineNumber">155&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//$this-&gt;setVersion($version);</span><a name="line_155"></a></li><li id="line_156" class="even"><span class="lineNumber">156&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span><a name="line_156"></a></li><li id="line_157" class="odd"><span class="lineNumber">157&nbsp;</span><a name="line_157"></a></li><li id="line_158" class="even"><span class="lineNumber">158&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_158"></a></li><li id="line_159" class="odd"><span class="lineNumber">159&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;singleton&nbsp;method</span><a name="line_159"></a></li><li id="line_160" class="even"><span class="lineNumber">160&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_160"></a></li><li id="line_161" class="odd"><span class="lineNumber">161&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;object&nbsp;$hg&nbsp;&nbsp;&nbsp;is&nbsp;an&nbsp;instance&nbsp;of&nbsp;VersionControl_Hg</span><a name="line_161"></a></li><li id="line_162" class="even"><span class="lineNumber">162&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;$path&nbsp;is&nbsp;the&nbsp;path&nbsp;to&nbsp;the&nbsp;executable&nbsp;to&nbsp;use</span><a name="line_162"></a></li><li id="line_163" class="odd"><span class="lineNumber">163&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_163"></a></li><li id="line_164" class="even"><span class="lineNumber">164&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;VersionControl_Hg_Executable</span><a name="line_164"></a></li><li id="line_165" class="odd"><span class="lineNumber">165&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_165"></a></li><li id="line_166" class="even"><span class="lineNumber">166&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;static&nbsp;function&nbsp;</span><span class="default">getInstance</span><span class="keyword">(</span><span class="default">$hg&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">null</span><span class="keyword">,&nbsp;</span><span class="default">$path&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">null</span><span class="keyword">)</span><a name="line_166"></a></li><li id="line_167" class="odd"><span class="lineNumber">167&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_167"></a></li><li id="line_168" class="even"><span class="lineNumber">168&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span class="default">self</span><span class="keyword">::</span><span class="default">$_instance&nbsp;</span><span class="keyword">===&nbsp;</span><span class="default">null</span><span class="keyword">)&nbsp;{</span><a name="line_168"></a></li><li id="line_169" class="odd"><span class="lineNumber">169&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">self</span><span class="keyword">::</span><span class="default">$_instance&nbsp;</span><span class="keyword">=&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Executable</span><span class="keyword">(</span><span class="default">$hg</span><span class="keyword">,&nbsp;</span><span class="default">$path</span><span class="keyword">);</span><a name="line_169"></a></li><li id="line_170" class="even"><span class="lineNumber">170&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_170"></a></li><li id="line_171" class="odd"><span class="lineNumber">171&nbsp;</span><a name="line_171"></a></li><li id="line_172" class="even"><span class="lineNumber">172&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span class="default">self</span><span class="keyword">::</span><span class="default">$_instance</span><span class="keyword">;</span><a name="line_172"></a></li><li id="line_173" class="odd"><span class="lineNumber">173&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_173"></a></li><li id="line_174" class="even"><span class="lineNumber">174&nbsp;</span><a name="line_174"></a></li><li id="line_175" class="odd"><span class="lineNumber">175&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_175"></a></li><li id="line_176" class="even"><span class="lineNumber">176&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;path&nbsp;on&nbsp;which&nbsp;the&nbsp;Hg&nbsp;executable&nbsp;exists</span><a name="line_176"></a></li><li id="line_177" class="odd"><span class="lineNumber">177&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_177"></a></li><li id="line_178" class="even"><span class="lineNumber">178&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;For&nbsp;informational&nbsp;purposes&nbsp;only;&nbsp;not&nbsp;used&nbsp;to&nbsp;search&nbsp;a&nbsp;path.</span><a name="line_178"></a></li><li id="line_179" class="odd"><span class="lineNumber">179&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_179"></a></li><li id="line_180" class="even"><span class="lineNumber">180&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;$path&nbsp;is&nbsp;the&nbsp;path&nbsp;to&nbsp;the&nbsp;hg&nbsp;executable</span><a name="line_180"></a></li><li id="line_181" class="odd"><span class="lineNumber">181&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_181"></a></li><li id="line_182" class="even"><span class="lineNumber">182&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;void</span><a name="line_182"></a></li><li id="line_183" class="odd"><span class="lineNumber">183&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;self::$path</span><a name="line_183"></a></li><li id="line_184" class="even"><span class="lineNumber">184&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_184"></a></li><li id="line_185" class="odd"><span class="lineNumber">185&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">protected&nbsp;function&nbsp;</span><span class="default">setPath</span><span class="keyword">(</span><span class="default">$path&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">null</span><span class="keyword">)</span><a name="line_185"></a></li><li id="line_186" class="even"><span class="lineNumber">186&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_186"></a></li><li id="line_187" class="odd"><span class="lineNumber">187&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;empty(</span><span class="default">$path</span><span class="keyword">)&nbsp;)&nbsp;{</span><a name="line_187"></a></li><li id="line_188" class="even"><span class="lineNumber">188&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$path&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">dirname</span><span class="keyword">(</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">executable</span><span class="keyword">);</span><a name="line_188"></a></li><li id="line_189" class="odd"><span class="lineNumber">189&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_189"></a></li><li id="line_190" class="even"><span class="lineNumber">190&nbsp;</span><a name="line_190"></a></li><li id="line_191" class="odd"><span class="lineNumber">191&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">path&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">$path</span><span class="keyword">;</span><a name="line_191"></a></li><li id="line_192" class="even"><span class="lineNumber">192&nbsp;</span><a name="line_192"></a></li><li id="line_193" class="odd"><span class="lineNumber">193&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">//Fluid&nbsp;API</span><a name="line_193"></a></li><li id="line_194" class="even"><span class="lineNumber">194&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">return&nbsp;</span><span class="default">$this</span><span class="keyword">;</span><a name="line_194"></a></li><li id="line_195" class="odd"><span class="lineNumber">195&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_195"></a></li><li id="line_196" class="even"><span class="lineNumber">196&nbsp;</span><a name="line_196"></a></li><li id="line_197" class="odd"><span class="lineNumber">197&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_197"></a></li><li id="line_198" class="even"><span class="lineNumber">198&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Gets&nbsp;the&nbsp;path&nbsp;of&nbsp;a&nbsp;valid&nbsp;Mercurial&nbsp;executable&nbsp;already&nbsp;set</span><a name="line_198"></a></li><li id="line_199" class="odd"><span class="lineNumber">199&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_199"></a></li><li id="line_200" class="even"><span class="lineNumber">200&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string</span><a name="line_200"></a></li><li id="line_201" class="odd"><span class="lineNumber">201&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;self::$path</span><a name="line_201"></a></li><li id="line_202" class="even"><span class="lineNumber">202&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_202"></a></li><li id="line_203" class="odd"><span class="lineNumber">203&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">getPath</span><span class="keyword">()</span><a name="line_203"></a></li><li id="line_204" class="even"><span class="lineNumber">204&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_204"></a></li><li id="line_205" class="odd"><span class="lineNumber">205&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">path</span><span class="keyword">;</span><a name="line_205"></a></li><li id="line_206" class="even"><span class="lineNumber">206&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_206"></a></li><li id="line_207" class="odd"><span class="lineNumber">207&nbsp;</span><a name="line_207"></a></li><li id="line_208" class="even"><span class="lineNumber">208&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_208"></a></li><li id="line_209" class="odd"><span class="lineNumber">209&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Validates&nbsp;the&nbsp;existance&nbsp;and&nbsp;viability&nbsp;of&nbsp;the&nbsp;Mercurial&nbsp;executable&nbsp;on</span><a name="line_209"></a></li><li id="line_210" class="even"><span class="lineNumber">210&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;system</span><a name="line_210"></a></li><li id="line_211" class="odd"><span class="lineNumber">211&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_211"></a></li><li id="line_212" class="even"><span class="lineNumber">212&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;you&nbsp;need&nbsp;to&nbsp;specifiy&nbsp;a&nbsp;particular&nbsp;Hg&nbsp;executable&nbsp;to&nbsp;use,&nbsp;then&nbsp;pass</span><a name="line_212"></a></li><li id="line_213" class="odd"><span class="lineNumber">213&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;full&nbsp;path&nbsp;to&nbsp;Mercurial&nbsp;as&nbsp;a&nbsp;paramter&nbsp;of&nbsp;this&nbsp;function.</span><a name="line_213"></a></li><li id="line_214" class="even"><span class="lineNumber">214&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_214"></a></li><li id="line_215" class="odd"><span class="lineNumber">215&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Usage:</span><a name="line_215"></a></li><li id="line_216" class="even"><span class="lineNumber">216&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;code&gt;$hg-&gt;setExecutable('/path/to/hg');&lt;/code&gt;</span><a name="line_216"></a></li><li id="line_217" class="odd"><span class="lineNumber">217&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;A&nbsp;failed&nbsp;reset/change&nbsp;will&nbsp;not&nbsp;clear&nbsp;the&nbsp;previously&nbsp;set&nbsp;executable.</span><a name="line_217"></a></li><li id="line_218" class="even"><span class="lineNumber">218&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_218"></a></li><li id="line_219" class="odd"><span class="lineNumber">219&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;$path&nbsp;The&nbsp;path&nbsp;to&nbsp;the&nbsp;hg&nbsp;executable</span><a name="line_219"></a></li><li id="line_220" class="even"><span class="lineNumber">220&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_220"></a></li><li id="line_221" class="odd"><span class="lineNumber">221&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;void</span><a name="line_221"></a></li><li id="line_222" class="even"><span class="lineNumber">222&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;VersionControl_Hg_Executable_Exception</span><a name="line_222"></a></li><li id="line_223" class="odd"><span class="lineNumber">223&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_223"></a></li><li id="line_224" class="even"><span class="lineNumber">224&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">setExecutable</span><span class="keyword">(</span><span class="default">$path&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">null</span><span class="keyword">)</span><a name="line_224"></a></li><li id="line_225" class="odd"><span class="lineNumber">225&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_225"></a></li><li id="line_226" class="even"><span class="lineNumber">226&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$executables&nbsp;</span><span class="keyword">=&nbsp;array();</span><a name="line_226"></a></li><li id="line_227" class="odd"><span class="lineNumber">227&nbsp;</span><a name="line_227"></a></li><li id="line_228" class="even"><span class="lineNumber">228&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;Set&nbsp;the&nbsp;binary&nbsp;name&nbsp;per&nbsp;platform&nbsp;*/</span><a name="line_228"></a></li><li id="line_229" class="odd"><span class="lineNumber">229&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//@todo&nbsp;use&nbsp;PHP_OS&nbsp;(best),&nbsp;php_uname('s'),&nbsp;$_SERVER['OS']</span><a name="line_229"></a></li><li id="line_230" class="even"><span class="lineNumber">230&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">switch&nbsp;(</span><span class="default">$_SERVER</span><span class="keyword">[</span><span class="string">'OS'</span><span class="keyword">])&nbsp;{</span><a name="line_230"></a></li><li id="line_231" class="odd"><span class="lineNumber">231&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;</span><span class="string">'Windows_NT'</span><span class="keyword">:</span><a name="line_231"></a></li><li id="line_232" class="even"><span class="lineNumber">232&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$binary&nbsp;</span><span class="keyword">=&nbsp;</span><span class="string">'hg.exe'</span><span class="keyword">;</span><a name="line_232"></a></li><li id="line_233" class="odd"><span class="lineNumber">233&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;</span><a name="line_233"></a></li><li id="line_234" class="even"><span class="lineNumber">234&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default:</span><a name="line_234"></a></li><li id="line_235" class="odd"><span class="lineNumber">235&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$binary&nbsp;</span><span class="keyword">=&nbsp;</span><span class="string">'hg'</span><span class="keyword">;</span><a name="line_235"></a></li><li id="line_236" class="even"><span class="lineNumber">236&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;</span><a name="line_236"></a></li><li id="line_237" class="odd"><span class="lineNumber">237&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_237"></a></li><li id="line_238" class="even"><span class="lineNumber">238&nbsp;</span><a name="line_238"></a></li><li id="line_239" class="odd"><span class="lineNumber">239&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span class="default">null&nbsp;</span><span class="keyword">!==&nbsp;</span><span class="default">$path</span><span class="keyword">)&nbsp;{</span><a name="line_239"></a></li><li id="line_240" class="even"><span class="lineNumber">240&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">//@TODO&nbsp;Do&nbsp;we&nbsp;care&nbsp;to&nbsp;use&nbsp;the&nbsp;CUSTOMEXECUTABLE&nbsp;constant&nbsp;in&nbsp;this&nbsp;case??</span><a name="line_240"></a></li><li id="line_241" class="odd"><span class="lineNumber">241&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;use&nbsp;the&nbsp;user&nbsp;provided&nbsp;path&nbsp;to&nbsp;an&nbsp;executable&nbsp;*/</span><a name="line_241"></a></li><li id="line_242" class="even"><span class="lineNumber">242&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;</span><span class="default">isexecutable</span><span class="keyword">(</span><span class="default">$path&nbsp;</span><span class="keyword">.&nbsp;</span><span class="default">DIRECTORY_SEPARATOR&nbsp;</span><span class="keyword">.&nbsp;</span><span class="default">$binary</span><span class="keyword">)&nbsp;)&nbsp;{</span><a name="line_242"></a></li><li id="line_243" class="odd"><span class="lineNumber">243&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$executables</span><span class="keyword">[]&nbsp;=&nbsp;</span><span class="default">$path&nbsp;</span><span class="keyword">.&nbsp;</span><span class="default">DIRECTORY_SEPARATOR&nbsp;</span><span class="keyword">.&nbsp;</span><span class="default">$binary</span><span class="keyword">;</span><a name="line_243"></a></li><li id="line_244" class="even"><span class="lineNumber">244&nbsp;</span><a name="line_244"></a></li><li id="line_245" class="odd"><span class="lineNumber">245&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_245"></a></li><li id="line_246" class="even"><span class="lineNumber">246&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_246"></a></li><li id="line_247" class="odd"><span class="lineNumber">247&nbsp;</span><a name="line_247"></a></li><li id="line_248" class="even"><span class="lineNumber">248&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;If&nbsp;the&nbsp;user&nbsp;supplied&nbsp;path&nbsp;was&nbsp;bad&nbsp;or&nbsp;not&nbsp;supplied,&nbsp;autosearch&nbsp;*/</span><a name="line_248"></a></li><li id="line_249" class="odd"><span class="lineNumber">249&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;(&nbsp;empty(</span><span class="default">$executables</span><span class="keyword">)&nbsp;)&nbsp;||&nbsp;(&nbsp;</span><span class="default">null&nbsp;</span><span class="keyword">===&nbsp;</span><span class="default">$path&nbsp;</span><span class="keyword">)&nbsp;)&nbsp;{</span><a name="line_249"></a></li><li id="line_250" class="even"><span class="lineNumber">250&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;iterate&nbsp;through&nbsp;the&nbsp;system's&nbsp;path&nbsp;to&nbsp;automagically&nbsp;find&nbsp;an</span><a name="line_250"></a></li><li id="line_251" class="odd"><span class="lineNumber">251&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;executable&nbsp;*/</span><a name="line_251"></a></li><li id="line_252" class="even"><span class="lineNumber">252&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$paths&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">explode</span><span class="keyword">(</span><span class="default">PATH_SEPARATOR</span><span class="keyword">,&nbsp;</span><span class="default">$_SERVER</span><span class="keyword">[</span><span class="string">'Path'</span><span class="keyword">]);</span><a name="line_252"></a></li><li id="line_253" class="odd"><span class="lineNumber">253&nbsp;</span><a name="line_253"></a></li><li id="line_254" class="even"><span class="lineNumber">254&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(&nbsp;</span><span class="default">$paths&nbsp;</span><span class="keyword">as&nbsp;</span><span class="default">$path&nbsp;</span><span class="keyword">)&nbsp;{</span><a name="line_254"></a></li><li id="line_255" class="odd"><span class="lineNumber">255&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span class="default">is_executable</span><span class="keyword">(</span><span class="default">$path&nbsp;</span><span class="keyword">.&nbsp;</span><span class="default">$binary</span><span class="keyword">))&nbsp;{&nbsp;</span><span class="comment">//DIRECTORY_SEPARATOR&nbsp;.</span><a name="line_255"></a></li><li id="line_256" class="even"><span class="lineNumber">256&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$executables</span><span class="keyword">[]&nbsp;=&nbsp;</span><span class="default">$path&nbsp;</span><span class="keyword">.&nbsp;</span><span class="default">$binary</span><span class="keyword">;</span><a name="line_256"></a></li><li id="line_257" class="odd"><span class="lineNumber">257&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_257"></a></li><li id="line_258" class="even"><span class="lineNumber">258&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_258"></a></li><li id="line_259" class="odd"><span class="lineNumber">259&nbsp;</span><a name="line_259"></a></li><li id="line_260" class="even"><span class="lineNumber">260&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;</span><span class="default">count</span><span class="keyword">(</span><span class="default">$executables</span><span class="keyword">)&nbsp;===&nbsp;</span><span class="default">0&nbsp;</span><span class="keyword">)&nbsp;{</span><a name="line_260"></a></li><li id="line_261" class="odd"><span class="lineNumber">261&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Executable_Exception</span><span class="keyword">(</span><a name="line_261"></a></li><li id="line_262" class="even"><span class="lineNumber">262&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">VersionControl_Hg_Executable_Exception</span><span class="keyword">::</span><span class="default">ERROR_HG_NOT_FOUND</span><a name="line_262"></a></li><li id="line_263" class="odd"><span class="lineNumber">263&nbsp;</span><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">);</span><a name="line_263"></a></li><li id="line_264" class="even"><span class="lineNumber">264&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_264"></a></li><li id="line_265" class="odd"><span class="lineNumber">265&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_265"></a></li><li id="line_266" class="even"><span class="lineNumber">266&nbsp;</span><a name="line_266"></a></li><li id="line_267" class="odd"><span class="lineNumber">267&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;use&nbsp;only&nbsp;the&nbsp;first&nbsp;instance&nbsp;found&nbsp;of&nbsp;a&nbsp;mercurial&nbsp;executable&nbsp;*/</span><a name="line_267"></a></li><li id="line_268" class="even"><span class="lineNumber">268&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">executable&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">array_shift</span><span class="keyword">(</span><span class="default">$executables</span><span class="keyword">);</span><a name="line_268"></a></li><li id="line_269" class="odd"><span class="lineNumber">269&nbsp;</span><a name="line_269"></a></li><li id="line_270" class="even"><span class="lineNumber">270&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;For&nbsp;fluid&nbsp;API&nbsp;*/</span><a name="line_270"></a></li><li id="line_271" class="odd"><span class="lineNumber">271&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">return&nbsp;</span><span class="default">$this</span><span class="keyword">;</span><a name="line_271"></a></li><li id="line_272" class="even"><span class="lineNumber">272&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_272"></a></li><li id="line_273" class="odd"><span class="lineNumber">273&nbsp;</span><a name="line_273"></a></li><li id="line_274" class="even"><span class="lineNumber">274&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_274"></a></li><li id="line_275" class="odd"><span class="lineNumber">275&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Get&nbsp;the&nbsp;full&nbsp;path&nbsp;of&nbsp;the&nbsp;currently&nbsp;used&nbsp;Mercurial&nbsp;executable</span><a name="line_275"></a></li><li id="line_276" class="even"><span class="lineNumber">276&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_276"></a></li><li id="line_277" class="odd"><span class="lineNumber">277&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string</span><a name="line_277"></a></li><li id="line_278" class="even"><span class="lineNumber">278&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;VersionControl_Hg_Executable_Exception</span><a name="line_278"></a></li><li id="line_279" class="odd"><span class="lineNumber">279&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_279"></a></li><li id="line_280" class="even"><span class="lineNumber">280&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">getExecutable</span><span class="keyword">()</span><a name="line_280"></a></li><li id="line_281" class="odd"><span class="lineNumber">281&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_281"></a></li><li id="line_282" class="even"><span class="lineNumber">282&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;I&nbsp;don't&nbsp;want&nbsp;programmers&nbsp;to&nbsp;have&nbsp;to&nbsp;test&nbsp;for&nbsp;null,</span><a name="line_282"></a></li><li id="line_283" class="odd"><span class="lineNumber">283&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;especially&nbsp;when&nbsp;this&nbsp;is&nbsp;auto-set&nbsp;in&nbsp;the&nbsp;constructor&nbsp;*/</span><a name="line_283"></a></li><li id="line_284" class="even"><span class="lineNumber">284&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;empty(</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">executable</span><span class="keyword">)&nbsp;)&nbsp;{</span><a name="line_284"></a></li><li id="line_285" class="odd"><span class="lineNumber">285&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Executable_Exception</span><span class="keyword">(</span><a name="line_285"></a></li><li id="line_286" class="even"><span class="lineNumber">286&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">VersionControl_Hg_Executable_Exception</span><span class="keyword">::</span><span class="default">ERROR_HG_YET_UNSET</span><a name="line_286"></a></li><li id="line_287" class="odd"><span class="lineNumber">287&nbsp;</span><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">);</span><a name="line_287"></a></li><li id="line_288" class="even"><span class="lineNumber">288&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_288"></a></li><li id="line_289" class="odd"><span class="lineNumber">289&nbsp;</span><a name="line_289"></a></li><li id="line_290" class="even"><span class="lineNumber">290&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">executable</span><span class="keyword">;</span><a name="line_290"></a></li><li id="line_291" class="odd"><span class="lineNumber">291&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_291"></a></li><li id="line_292" class="even"><span class="lineNumber">292&nbsp;</span><a name="line_292"></a></li><li id="line_293" class="odd"><span class="lineNumber">293&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_293"></a></li><li id="line_294" class="even"><span class="lineNumber">294&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;version&nbsp;of&nbsp;the&nbsp;Mercurial&nbsp;executable</span><a name="line_294"></a></li><li id="line_295" class="odd"><span class="lineNumber">295&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_295"></a></li><li id="line_296" class="even"><span class="lineNumber">296&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Implements&nbsp;the&nbsp;version&nbsp;command&nbsp;of&nbsp;the&nbsp;command-line&nbsp;client.</span><a name="line_296"></a></li><li id="line_297" class="odd"><span class="lineNumber">297&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Possible&nbsp;values&nbsp;are:</span><a name="line_297"></a></li><li id="line_298" class="even"><span class="lineNumber">298&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;(version&nbsp;1.1),&nbsp;(version&nbsp;1.1+20081220),&nbsp;(version&nbsp;1.1+e54ac289bed),&nbsp;(unknown)</span><a name="line_298"></a></li><li id="line_299" class="odd"><span class="lineNumber">299&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_299"></a></li><li id="line_300" class="even"><span class="lineNumber">300&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;array</span><a name="line_300"></a></li><li id="line_301" class="odd"><span class="lineNumber">301&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;$version</span><a name="line_301"></a></li><li id="line_302" class="even"><span class="lineNumber">302&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_302"></a></li><li id="line_303" class="odd"><span class="lineNumber">303&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">protected&nbsp;function&nbsp;</span><span class="default">setVersion</span><span class="keyword">(</span><span class="default">$version</span><span class="keyword">)</span><a name="line_303"></a></li><li id="line_304" class="even"><span class="lineNumber">304&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_304"></a></li><li id="line_305" class="odd"><span class="lineNumber">305&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">version&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">$version</span><span class="keyword">;</span><a name="line_305"></a></li><li id="line_306" class="even"><span class="lineNumber">306&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_306"></a></li><li id="line_307" class="odd"><span class="lineNumber">307&nbsp;</span><a name="line_307"></a></li><li id="line_308" class="even"><span class="lineNumber">308&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_308"></a></li><li id="line_309" class="odd"><span class="lineNumber">309&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Get&nbsp;the&nbsp;version&nbsp;of&nbsp;Mercurial&nbsp;we&nbsp;are&nbsp;currently&nbsp;using</span><a name="line_309"></a></li><li id="line_310" class="even"><span class="lineNumber">310&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_310"></a></li><li id="line_311" class="odd"><span class="lineNumber">311&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Because&nbsp;of&nbsp;circular&nbsp;dependcies,&nbsp;we&nbsp;have&nbsp;to&nbsp;call&nbsp;the&nbsp;command&nbsp;here</span><a name="line_311"></a></li><li id="line_312" class="even"><span class="lineNumber">312&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;instead&nbsp;of&nbsp;in&nbsp;the&nbsp;constructor,&nbsp;since&nbsp;$this-&gt;hg&nbsp;is&nbsp;not&nbsp;yet&nbsp;populated.</span><a name="line_312"></a></li><li id="line_313" class="odd"><span class="lineNumber">313&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_313"></a></li><li id="line_314" class="even"><span class="lineNumber">314&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string</span><a name="line_314"></a></li><li id="line_315" class="odd"><span class="lineNumber">315&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_315"></a></li><li id="line_316" class="even"><span class="lineNumber">316&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">getVersion</span><span class="keyword">()</span><a name="line_316"></a></li><li id="line_317" class="odd"><span class="lineNumber">317&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_317"></a></li><li id="line_318" class="even"><span class="lineNumber">318&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$version&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">hg</span><span class="keyword">-&gt;</span><span class="default">version</span><span class="keyword">()-&gt;</span><span class="default">run</span><span class="keyword">();</span><a name="line_318"></a></li><li id="line_319" class="odd"><span class="lineNumber">319&nbsp;</span><a name="line_319"></a></li><li id="line_320" class="even"><span class="lineNumber">320&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span class="default">$version</span><span class="keyword">[</span><span class="string">'raw'</span><span class="keyword">];</span><a name="line_320"></a></li><li id="line_321" class="odd"><span class="lineNumber">321&nbsp;</span><a name="line_321"></a></li><li id="line_322" class="even"><span class="lineNumber">322&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*</span><a name="line_322"></a></li><li id="line_323" class="odd"><span class="lineNumber">323&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;I&nbsp;don't&nbsp;want&nbsp;programmers&nbsp;to&nbsp;have&nbsp;to&nbsp;test&nbsp;for&nbsp;null,</span><a name="line_323"></a></li><li id="line_324" class="even"><span class="lineNumber">324&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;especially&nbsp;when&nbsp;this&nbsp;is&nbsp;auto-set&nbsp;in&nbsp;the&nbsp;constructor</span><a name="line_324"></a></li><li id="line_325" class="odd"><span class="lineNumber">325&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_325"></a></li><li id="line_326" class="even"><span class="lineNumber">326&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">version&nbsp;</span><span class="keyword">===&nbsp;</span><span class="default">null&nbsp;</span><span class="keyword">)&nbsp;{</span><a name="line_326"></a></li><li id="line_327" class="odd"><span class="lineNumber">327&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">//@todo&nbsp;replace&nbsp;with&nbsp;a&nbsp;constant&nbsp;and&nbsp;a&nbsp;$message&nbsp;entry</span><a name="line_327"></a></li><li id="line_328" class="even"><span class="lineNumber">328&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">throw&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Exception</span><span class="keyword">(</span><a name="line_328"></a></li><li id="line_329" class="odd"><span class="lineNumber">329&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">VersionControl_Hg_Executable_Exception</span><span class="keyword">::</span><span class="default">ERROR_NO_VERSION</span><a name="line_329"></a></li><li id="line_330" class="even"><span class="lineNumber">330&nbsp;</span><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">);</span><a name="line_330"></a></li><li id="line_331" class="odd"><span class="lineNumber">331&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_331"></a></li><li id="line_332" class="even"><span class="lineNumber">332&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_332"></a></li><li id="line_333" class="odd"><span class="lineNumber">333&nbsp;</span><a name="line_333"></a></li><li id="line_334" class="even"><span class="lineNumber">334&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_334"></a></li><li id="line_335" class="odd"><span class="lineNumber">335&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Return&nbsp;Mercurial's&nbsp;capabilities&nbsp;and&nbsp;supported&nbsp;commands&nbsp;and&nbsp;options</span><a name="line_335"></a></li><li id="line_336" class="even"><span class="lineNumber">336&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;for&nbsp;this&nbsp;version.</span><a name="line_336"></a></li><li id="line_337" class="odd"><span class="lineNumber">337&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_337"></a></li><li id="line_338" class="even"><span class="lineNumber">338&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;version&nbsp;may&nbsp;be&nbsp;passed&nbsp;in,&nbsp;but&nbsp;the&nbsp;default&nbsp;is&nbsp;to&nbsp;use&nbsp;the&nbsp;current</span><a name="line_338"></a></li><li id="line_339" class="odd"><span class="lineNumber">339&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;executable's&nbsp;version.</span><a name="line_339"></a></li><li id="line_340" class="even"><span class="lineNumber">340&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_340"></a></li><li id="line_341" class="odd"><span class="lineNumber">341&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string|float&nbsp;$version</span><a name="line_341"></a></li><li id="line_342" class="even"><span class="lineNumber">342&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_342"></a></li><li id="line_343" class="odd"><span class="lineNumber">343&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;mixed</span><a name="line_343"></a></li><li id="line_344" class="even"><span class="lineNumber">344&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_344"></a></li><li id="line_345" class="odd"><span class="lineNumber">345&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">getCapabilities</span><span class="keyword">(</span><span class="default">$version&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">null</span><span class="keyword">)&nbsp;{</span><a name="line_345"></a></li><li id="line_346" class="even"><span class="lineNumber">346&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;Use&nbsp;the&nbsp;executable's&nbsp;version&nbsp;property&nbsp;by&nbsp;default&nbsp;*/</span><a name="line_346"></a></li><li id="line_347" class="odd"><span class="lineNumber">347&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;</span><span class="default">null&nbsp;</span><span class="keyword">===&nbsp;</span><span class="default">$version</span><span class="keyword">)&nbsp;{</span><a name="line_347"></a></li><li id="line_348" class="even"><span class="lineNumber">348&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$version&nbsp;</span><span class="keyword">=&nbsp;(string)&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">getVersion</span><span class="keyword">();</span><a name="line_348"></a></li><li id="line_349" class="odd"><span class="lineNumber">349&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_349"></a></li><li id="line_350" class="even"><span class="lineNumber">350&nbsp;</span><a name="line_350"></a></li><li id="line_351" class="odd"><span class="lineNumber">351&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;Version&nbsp;string&nbsp;must&nbsp;be&nbsp;only&nbsp;major&nbsp;and&nbsp;minor.&nbsp;This&nbsp;stript</span><a name="line_351"></a></li><li id="line_352" class="even"><span class="lineNumber">352&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;anything&nbsp;after&nbsp;the&nbsp;last&nbsp;period.&nbsp;We're&nbsp;assuming&nbsp;that</span><a name="line_352"></a></li><li id="line_353" class="odd"><span class="lineNumber">353&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;only&nbsp;string&nbsp;passed&nbsp;is&nbsp;a&nbsp;3-part&nbsp;version&nbsp;string:&nbsp;1.8.4;</span><a name="line_353"></a></li><li id="line_354" class="even"><span class="lineNumber">354&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;What&nbsp;if&nbsp;its&nbsp;a&nbsp;wrong&nbsp;assumption??&nbsp;*/</span><a name="line_354"></a></li><li id="line_355" class="odd"><span class="lineNumber">355&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$version&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">substr</span><span class="keyword">(</span><span class="default">$version</span><span class="keyword">,&nbsp;</span><span class="default">0</span><span class="keyword">,&nbsp;</span><span class="default">strrpos</span><span class="keyword">(</span><span class="default">$version</span><span class="keyword">,&nbsp;</span><span class="string">'.'</span><span class="keyword">));</span><a name="line_355"></a></li><li id="line_356" class="even"><span class="lineNumber">356&nbsp;</span><a name="line_356"></a></li><li id="line_357" class="odd"><span class="lineNumber">357&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;Ensure&nbsp;the&nbsp;passed-in&nbsp;version&nbsp;string&nbsp;is&nbsp;supported&nbsp;*/</span><a name="line_357"></a></li><li id="line_358" class="even"><span class="lineNumber">358&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(!&nbsp;</span><span class="default">array_key_exists</span><span class="keyword">(</span><span class="default">$version</span><span class="keyword">,&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">capabilities</span><span class="keyword">)&nbsp;)&nbsp;{</span><a name="line_358"></a></li><li id="line_359" class="odd"><span class="lineNumber">359&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Executable_Exception</span><span class="keyword">(</span><a name="line_359"></a></li><li id="line_360" class="even"><span class="lineNumber">360&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">VersionControl_Hg_Executable_Exception</span><span class="keyword">::</span><span class="default">ERROR_VERSION_NOT_SUPPORTED</span><a name="line_360"></a></li><li id="line_361" class="odd"><span class="lineNumber">361&nbsp;</span><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">);</span><a name="line_361"></a></li><li id="line_362" class="even"><span class="lineNumber">362&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_362"></a></li><li id="line_363" class="odd"><span class="lineNumber">363&nbsp;</span><a name="line_363"></a></li><li id="line_364" class="even"><span class="lineNumber">364&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**&nbsp;Break&nbsp;up&nbsp;options&nbsp;from&nbsp;features&nbsp;and&nbsp;subfeatures&nbsp;from&nbsp;features&nbsp;*/</span><a name="line_364"></a></li><li id="line_365" class="odd"><span class="lineNumber">365&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;initialize&nbsp;an&nbsp;empty&nbsp;array&nbsp;to&nbsp;avoid&nbsp;PHP&nbsp;Notices&nbsp;*/</span><a name="line_365"></a></li><li id="line_366" class="even"><span class="lineNumber">366&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$capabilities&nbsp;</span><span class="keyword">=&nbsp;array();</span><a name="line_366"></a></li><li id="line_367" class="odd"><span class="lineNumber">367&nbsp;</span><a name="line_367"></a></li><li id="line_368" class="even"><span class="lineNumber">368&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$raw_capabilities&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">capabilities</span><span class="keyword">[</span><span class="default">$version</span><span class="keyword">];</span><a name="line_368"></a></li><li id="line_369" class="odd"><span class="lineNumber">369&nbsp;</span><a name="line_369"></a></li><li id="line_370" class="even"><span class="lineNumber">370&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">//@TODO&nbsp;handle&nbsp;triples,&nbsp;too:&nbsp;ex.&nbsp;subrepo:git:remote</span><a name="line_370"></a></li><li id="line_371" class="odd"><span class="lineNumber">371&nbsp;</span><a name="line_371"></a></li><li id="line_372" class="even"><span class="lineNumber">372&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">foreach&nbsp;(&nbsp;</span><span class="default">$raw_capabilities&nbsp;</span><span class="keyword">as&nbsp;</span><span class="default">$capability&nbsp;</span><span class="keyword">)&nbsp;{</span><a name="line_372"></a></li><li id="line_373" class="odd"><span class="lineNumber">373&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$capability_group&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">explode</span><span class="keyword">(</span><span class="string">':'</span><span class="keyword">,&nbsp;</span><span class="default">$capability</span><span class="keyword">);</span><a name="line_373"></a></li><li id="line_374" class="even"><span class="lineNumber">374&nbsp;</span><a name="line_374"></a></li><li id="line_375" class="odd"><span class="lineNumber">375&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;handle&nbsp;single&nbsp;capabilities&nbsp;without&nbsp;options&nbsp;or&nbsp;sub-features&nbsp;*/</span><a name="line_375"></a></li><li id="line_376" class="even"><span class="lineNumber">376&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;empty(</span><span class="default">$capability_group</span><span class="keyword">[</span><span class="default">1</span><span class="keyword">]))&nbsp;{</span><a name="line_376"></a></li><li id="line_377" class="odd"><span class="lineNumber">377&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">array_push</span><span class="keyword">(</span><span class="default">$capabilities</span><span class="keyword">,&nbsp;</span><span class="default">$capability_group</span><span class="keyword">[</span><span class="default">0</span><span class="keyword">]);</span><a name="line_377"></a></li><li id="line_378" class="even"><span class="lineNumber">378&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{</span><a name="line_378"></a></li><li id="line_379" class="odd"><span class="lineNumber">379&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$capabilities</span><span class="keyword">[</span><span class="default">$capability_group</span><span class="keyword">[</span><span class="default">0</span><span class="keyword">]]&nbsp;=&nbsp;array(</span><span class="default">$capability_group</span><span class="keyword">[</span><span class="default">1</span><span class="keyword">]);</span><a name="line_379"></a></li><li id="line_380" class="even"><span class="lineNumber">380&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_380"></a></li><li id="line_381" class="odd"><span class="lineNumber">381&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_381"></a></li><li id="line_382" class="even"><span class="lineNumber">382&nbsp;</span><a name="line_382"></a></li><li id="line_383" class="odd"><span class="lineNumber">383&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span class="default">$capabilities</span><span class="keyword">;</span><a name="line_383"></a></li><li id="line_384" class="even"><span class="lineNumber">384&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_384"></a></li><li id="line_385" class="odd"><span class="lineNumber">385&nbsp;</span><a name="line_385"></a></li><li id="line_386" class="even"><span class="lineNumber">386&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_386"></a></li><li id="line_387" class="odd"><span class="lineNumber">387&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Determines&nbsp;if&nbsp;the&nbsp;required&nbsp;capability&nbsp;is&nbsp;present&nbsp;in&nbsp;the&nbsp;user's</span><a name="line_387"></a></li><li id="line_388" class="even"><span class="lineNumber">388&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Mercurial&nbsp;executable&nbsp;version</span><a name="line_388"></a></li><li id="line_389" class="odd"><span class="lineNumber">389&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_389"></a></li><li id="line_390" class="even"><span class="lineNumber">390&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;$capability</span><a name="line_390"></a></li><li id="line_391" class="odd"><span class="lineNumber">391&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_391"></a></li><li id="line_392" class="even"><span class="lineNumber">392&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;boolean</span><a name="line_392"></a></li><li id="line_393" class="odd"><span class="lineNumber">393&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_393"></a></li><li id="line_394" class="even"><span class="lineNumber">394&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">hasCapability</span><span class="keyword">(</span><span class="default">$capability</span><span class="keyword">)&nbsp;{</span><a name="line_394"></a></li><li id="line_395" class="odd"><span class="lineNumber">395&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;default&nbsp;$has_capability&nbsp;to&nbsp;true&nbsp;so&nbsp;as&nbsp;not&nbsp;to&nbsp;give&nbsp;false&nbsp;positives;</span><a name="line_395"></a></li><li id="line_396" class="even"><span class="lineNumber">396&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;worst&nbsp;that&nbsp;can&nbsp;happen&nbsp;now&nbsp;is&nbsp;that&nbsp;HG&nbsp;cli&nbsp;issues&nbsp;an&nbsp;error&nbsp;*/</span><a name="line_396"></a></li><li id="line_397" class="odd"><span class="lineNumber">397&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$has_capability&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">true</span><span class="keyword">;</span><a name="line_397"></a></li><li id="line_398" class="even"><span class="lineNumber">398&nbsp;</span><a name="line_398"></a></li><li id="line_399" class="odd"><span class="lineNumber">399&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;Version&nbsp;string&nbsp;must&nbsp;be&nbsp;only&nbsp;major&nbsp;and&nbsp;minor.&nbsp;This&nbsp;stript</span><a name="line_399"></a></li><li id="line_400" class="even"><span class="lineNumber">400&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;anything&nbsp;after&nbsp;the&nbsp;last&nbsp;period.&nbsp;We're&nbsp;assuming&nbsp;that</span><a name="line_400"></a></li><li id="line_401" class="odd"><span class="lineNumber">401&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;only&nbsp;string&nbsp;passed&nbsp;is&nbsp;a&nbsp;3-part&nbsp;version&nbsp;string:&nbsp;1.8.4;</span><a name="line_401"></a></li><li id="line_402" class="even"><span class="lineNumber">402&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;What&nbsp;if&nbsp;its&nbsp;a&nbsp;wrong&nbsp;assumption??&nbsp;*/</span><a name="line_402"></a></li><li id="line_403" class="odd"><span class="lineNumber">403&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$raw_version&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">getVersion</span><span class="keyword">();</span><a name="line_403"></a></li><li id="line_404" class="even"><span class="lineNumber">404&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$our_version&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">substr</span><span class="keyword">(</span><span class="default">$raw_version</span><span class="keyword">,&nbsp;</span><span class="default">0</span><span class="keyword">,&nbsp;</span><span class="default">strrpos</span><span class="keyword">(</span><span class="default">$raw_version</span><span class="keyword">,&nbsp;</span><span class="string">'.'</span><span class="keyword">));</span><a name="line_404"></a></li><li id="line_405" class="odd"><span class="lineNumber">405&nbsp;</span><a name="line_405"></a></li><li id="line_406" class="even"><span class="lineNumber">406&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;find&nbsp;the&nbsp;first&nbsp;version&nbsp;to&nbsp;support&nbsp;the&nbsp;$capability;&nbsp;if&nbsp;not&nbsp;found,</span><a name="line_406"></a></li><li id="line_407" class="odd"><span class="lineNumber">407&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;then&nbsp;assume&nbsp;its&nbsp;a&nbsp;capability.&nbsp;Adapted&nbsp;from&nbsp;code&nbsp;in&nbsp;the&nbsp;php.net</span><a name="line_407"></a></li><li id="line_408" class="even"><span class="lineNumber">408&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;manual&nbsp;by&nbsp;giulio.provasi@gmail.com&nbsp;on&nbsp;30-Apr-2010&nbsp;09:06,</span><a name="line_408"></a></li><li id="line_409" class="odd"><span class="lineNumber">409&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;http://php.net/manual/en/function.array-search.php&nbsp;*/</span><a name="line_409"></a></li><li id="line_410" class="even"><span class="lineNumber">410&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$array_iterator&nbsp;</span><span class="keyword">=&nbsp;new&nbsp;</span><span class="default">RecursiveArrayIterator</span><span class="keyword">(</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">capabilities</span><span class="keyword">);</span><a name="line_410"></a></li><li id="line_411" class="odd"><span class="lineNumber">411&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$iterator&nbsp;</span><span class="keyword">=&nbsp;new&nbsp;</span><span class="default">RecursiveIteratorIterator</span><span class="keyword">(</span><span class="default">$array_iterator</span><span class="keyword">);</span><a name="line_411"></a></li><li id="line_412" class="even"><span class="lineNumber">412&nbsp;</span><a name="line_412"></a></li><li id="line_413" class="odd"><span class="lineNumber">413&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(</span><span class="default">$iterator</span><span class="keyword">-&gt;</span><span class="default">valid</span><span class="keyword">())&nbsp;{</span><a name="line_413"></a></li><li id="line_414" class="even"><span class="lineNumber">414&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;</span><span class="default">$iterator</span><span class="keyword">-&gt;</span><span class="default">current</span><span class="keyword">()&nbsp;==&nbsp;</span><span class="default">$capability&nbsp;</span><span class="keyword">)&nbsp;{</span><a name="line_414"></a></li><li id="line_415" class="odd"><span class="lineNumber">415&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$capability_version&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">$array_iterator</span><span class="keyword">-&gt;</span><span class="default">key</span><span class="keyword">();</span><a name="line_415"></a></li><li id="line_416" class="even"><span class="lineNumber">416&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_416"></a></li><li id="line_417" class="odd"><span class="lineNumber">417&nbsp;</span><a name="line_417"></a></li><li id="line_418" class="even"><span class="lineNumber">418&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$iterator</span><span class="keyword">-&gt;</span><span class="default">next</span><span class="keyword">();</span><a name="line_418"></a></li><li id="line_419" class="odd"><span class="lineNumber">419&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_419"></a></li><li id="line_420" class="even"><span class="lineNumber">420&nbsp;</span><a name="line_420"></a></li><li id="line_421" class="odd"><span class="lineNumber">421&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;This&nbsp;occurs&nbsp;when&nbsp;the&nbsp;capability&nbsp;is&nbsp;not&nbsp;found.&nbsp;We&nbsp;will&nbsp;issue&nbsp;an</span><a name="line_421"></a></li><li id="line_422" class="even"><span class="lineNumber">422&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;exception,&nbsp;because&nbsp;capability&nbsp;checking&nbsp;should&nbsp;be&nbsp;explicit&nbsp;per&nbsp;command</span><a name="line_422"></a></li><li id="line_423" class="odd"><span class="lineNumber">423&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;or&nbsp;option&nbsp;rather&nbsp;than&nbsp;automatic.&nbsp;If&nbsp;it&nbsp;were&nbsp;automatic,&nbsp;we&nbsp;would&nbsp;need</span><a name="line_423"></a></li><li id="line_424" class="even"><span class="lineNumber">424&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;to&nbsp;make&nbsp;it&nbsp;return&nbsp;true&nbsp;by&nbsp;default,&nbsp;since&nbsp;not&nbsp;exhaustively&nbsp;cataloging</span><a name="line_424"></a></li><li id="line_425" class="odd"><span class="lineNumber">425&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;options&nbsp;and&nbsp;features&nbsp;would&nbsp;result&nbsp;in&nbsp;numerous&nbsp;false&nbsp;negatives!&nbsp;*/</span><a name="line_425"></a></li><li id="line_426" class="even"><span class="lineNumber">426&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;!&nbsp;isset(</span><span class="default">$capability_version</span><span class="keyword">)&nbsp;)&nbsp;{</span><a name="line_426"></a></li><li id="line_427" class="odd"><span class="lineNumber">427&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Executable_Exception</span><span class="keyword">(</span><a name="line_427"></a></li><li id="line_428" class="even"><span class="lineNumber">428&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">VersionControl_Hg_Executable_Exception</span><span class="keyword">::</span><span class="default">ERROR_CAPABILITY_UNKNOWN</span><a name="line_428"></a></li><li id="line_429" class="odd"><span class="lineNumber">429&nbsp;</span><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">);</span><a name="line_429"></a></li><li id="line_430" class="even"><span class="lineNumber">430&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_430"></a></li><li id="line_431" class="odd"><span class="lineNumber">431&nbsp;</span><a name="line_431"></a></li><li id="line_432" class="even"><span class="lineNumber">432&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;(float)&nbsp;</span><span class="default">$capability_version&nbsp;</span><span class="keyword">&gt;&nbsp;(float)&nbsp;</span><span class="default">$our_version&nbsp;</span><span class="keyword">)&nbsp;{</span><a name="line_432"></a></li><li id="line_433" class="odd"><span class="lineNumber">433&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$has_capability&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">false</span><span class="keyword">;</span><a name="line_433"></a></li><li id="line_434" class="even"><span class="lineNumber">434&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_434"></a></li><li id="line_435" class="odd"><span class="lineNumber">435&nbsp;</span><a name="line_435"></a></li><li id="line_436" class="even"><span class="lineNumber">436&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span class="default">$has_capability</span><span class="keyword">;</span><a name="line_436"></a></li><li id="line_437" class="odd"><span class="lineNumber">437&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_437"></a></li><li id="line_438" class="even"><span class="lineNumber">438&nbsp;</span><a name="line_438"></a></li><li id="line_439" class="odd"><span class="lineNumber">439&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_439"></a></li><li id="line_440" class="even"><span class="lineNumber">440&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Print&nbsp;the&nbsp;full&nbsp;path&nbsp;of&nbsp;the&nbsp;system's&nbsp;command&nbsp;line&nbsp;Mercurial</span><a name="line_440"></a></li><li id="line_441" class="odd"><span class="lineNumber">441&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_441"></a></li><li id="line_442" class="even"><span class="lineNumber">442&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string</span><a name="line_442"></a></li><li id="line_443" class="odd"><span class="lineNumber">443&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_443"></a></li><li id="line_444" class="even"><span class="lineNumber">444&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">__toString</span><span class="keyword">()</span><a name="line_444"></a></li><li id="line_445" class="odd"><span class="lineNumber">445&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_445"></a></li><li id="line_446" class="even"><span class="lineNumber">446&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">getExecutable</span><span class="keyword">();</span><a name="line_446"></a></li><li id="line_447" class="odd"><span class="lineNumber">447&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_447"></a></li><li id="line_448" class="even"><span class="lineNumber">448&nbsp;</span><a name="line_448"></a></li><li id="line_449" class="odd"><span class="lineNumber">449&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_449"></a></li><li id="line_450" class="even"><span class="lineNumber">450&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Prevent&nbsp;users&nbsp;to&nbsp;clone&nbsp;the&nbsp;instance</span><a name="line_450"></a></li><li id="line_451" class="odd"><span class="lineNumber">451&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_451"></a></li><li id="line_452" class="even"><span class="lineNumber">452&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;null</span><a name="line_452"></a></li><li id="line_453" class="odd"><span class="lineNumber">453&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_453"></a></li><li id="line_454" class="even"><span class="lineNumber">454&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">__clone</span><span class="keyword">()</span><a name="line_454"></a></li><li id="line_455" class="odd"><span class="lineNumber">455&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_455"></a></li><li id="line_456" class="even"><span class="lineNumber">456&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">trigger_error</span><span class="keyword">(</span><span class="string">'Clone&nbsp;is&nbsp;not&nbsp;allowed.'</span><span class="keyword">,&nbsp;</span><span class="default">E_USER_ERROR</span><span class="keyword">);</span><a name="line_456"></a></li><li id="line_457" class="odd"><span class="lineNumber">457&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_457"></a></li><li id="line_458" class="even"><span class="lineNumber">458&nbsp;</span><a name="line_458"></a></li><li id="line_459" class="odd"><span class="lineNumber">459&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_459"></a></li><li id="line_460" class="even"><span class="lineNumber">460&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Get&nbsp;an&nbsp;unaccessible&nbsp;class&nbsp;property</span><a name="line_460"></a></li><li id="line_461" class="odd"><span class="lineNumber">461&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_461"></a></li><li id="line_462" class="even"><span class="lineNumber">462&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;$value&nbsp;The&nbsp;class&nbsp;property&nbsp;trying&nbsp;to&nbsp;be&nbsp;gotten</span><a name="line_462"></a></li><li id="line_463" class="odd"><span class="lineNumber">463&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_463"></a></li><li id="line_464" class="even"><span class="lineNumber">464&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string</span><a name="line_464"></a></li><li id="line_465" class="odd"><span class="lineNumber">465&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_465"></a></li><li id="line_466" class="even"><span class="lineNumber">466&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">__get</span><span class="keyword">(</span><span class="default">$value</span><span class="keyword">)</span><a name="line_466"></a></li><li id="line_467" class="odd"><span class="lineNumber">467&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_467"></a></li><li id="line_468" class="even"><span class="lineNumber">468&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$method&nbsp;</span><span class="keyword">=&nbsp;</span><span class="string">'get'&nbsp;</span><span class="keyword">.&nbsp;</span><span class="default">ucfirst</span><span class="keyword">(</span><span class="default">$value</span><span class="keyword">);</span><a name="line_468"></a></li><li id="line_469" class="odd"><span class="lineNumber">469&nbsp;</span><a name="line_469"></a></li><li id="line_470" class="even"><span class="lineNumber">470&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">$method</span><span class="keyword">();</span><a name="line_470"></a></li><li id="line_471" class="odd"><span class="lineNumber">471&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_471"></a></li><li id="line_472" class="even"><span class="lineNumber">472&nbsp;</span><a name="line_472"></a></li><li id="line_473" class="odd"><span class="lineNumber">473&nbsp;</span><span class="keyword">}</span><span>
</span><a name="line_473"></a></li></ol>
                    </div>
    </body>
</html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.