Source

VersionControl_Hg / src / Documentation / Code / Hg / Container / Repository.php.html

The default branch has multiple heads

Full commit
<!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/Container/Repository.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;definition&nbsp;of&nbsp;the&nbsp;Repository&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;Container</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;&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;the&nbsp;abstraction&nbsp;for&nbsp;containers</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">'Abstract.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;the&nbsp;container&nbsp;interface</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="keyword">require_once&nbsp;</span><span class="string">'Interface.php'</span><span class="keyword">;</span><a name="line_24"></a></li><li id="line_25" class="odd"><span class="lineNumber">&nbsp;25&nbsp;</span><a name="line_25"></a></li><li id="line_26" class="even"><span class="lineNumber">&nbsp;26&nbsp;</span><span class="comment">/**</span><a name="line_26"></a></li><li id="line_27" class="odd"><span class="lineNumber">&nbsp;27&nbsp;</span><span class="comment">&nbsp;*&nbsp;Provides&nbsp;the&nbsp;container&nbsp;exception</span><a name="line_27"></a></li><li id="line_28" class="even"><span class="lineNumber">&nbsp;28&nbsp;</span><span class="comment">&nbsp;*/</span><a name="line_28"></a></li><li id="line_29" class="odd"><span class="lineNumber">&nbsp;29&nbsp;</span><span class="keyword">require_once&nbsp;</span><span class="string">'Repository/Exception.php'</span><span class="keyword">;</span><a name="line_29"></a></li><li id="line_30" class="even"><span class="lineNumber">&nbsp;30&nbsp;</span><a name="line_30"></a></li><li id="line_31" class="odd"><span class="lineNumber">&nbsp;31&nbsp;</span><span class="comment">/**</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;The&nbsp;Mercurial&nbsp;repository</span><a name="line_32"></a></li><li id="line_33" class="odd"><span class="lineNumber">&nbsp;33&nbsp;</span><span class="comment">&nbsp;*</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;Usage:</span><a name="line_34"></a></li><li id="line_35" class="odd"><span class="lineNumber">&nbsp;35&nbsp;</span><span class="comment">&nbsp;*&nbsp;All&nbsp;calls&nbsp;are&nbsp;proxied&nbsp;from&nbsp;Hg</span><a name="line_35"></a></li><li id="line_36" class="even"><span class="lineNumber">&nbsp;36&nbsp;</span><span class="comment">&nbsp;*&nbsp;&lt;code&gt;</span><a name="line_36"></a></li><li id="line_37" class="odd"><span class="lineNumber">&nbsp;37&nbsp;</span><span class="comment">&nbsp;*&nbsp;$hg&nbsp;=&nbsp;new&nbsp;VersionControl_Hg('/path/to/repo');</span><a name="line_37"></a></li><li id="line_38" class="even"><span class="lineNumber">&nbsp;38&nbsp;</span><span class="comment">&nbsp;*&nbsp;$repository&nbsp;=&nbsp;$hg-&gt;getRepository()-&gt;getPath();</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;&lt;/code&gt;</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;or</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;&lt;code&gt;$repository&nbsp;=&nbsp;$hg-&gt;repository-&gt;delete();&lt;/code&gt;</span><a name="line_41"></a></li><li id="line_42" class="even"><span class="lineNumber">&nbsp;42&nbsp;</span><span class="comment">&nbsp;*</span><a name="line_42"></a></li><li id="line_43" class="odd"><span class="lineNumber">&nbsp;43&nbsp;</span><span class="comment">&nbsp;*&nbsp;PHP&nbsp;version&nbsp;5</span><a name="line_43"></a></li><li id="line_44" class="even"><span class="lineNumber">&nbsp;44&nbsp;</span><span class="comment">&nbsp;*</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;@category&nbsp;&nbsp;&nbsp;VersionControl</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;@package&nbsp;&nbsp;&nbsp;&nbsp;Hg</span><a name="line_46"></a></li><li id="line_47" class="odd"><span class="lineNumber">&nbsp;47&nbsp;</span><span class="comment">&nbsp;*&nbsp;@subpackage&nbsp;Container</span><a name="line_47"></a></li><li id="line_48" class="even"><span class="lineNumber">&nbsp;48&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_48"></a></li><li id="line_49" class="odd"><span class="lineNumber">&nbsp;49&nbsp;</span><span class="comment">&nbsp;*&nbsp;@copyright&nbsp;&nbsp;2011&nbsp;Lisantra&nbsp;Technologies,&nbsp;LLC</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;@license&nbsp;&nbsp;&nbsp;&nbsp;http://www.opensource.org/licenses/mit-license.html&nbsp;&nbsp;MIT&nbsp;License</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;@link&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://pear.php.net/package/VersionControl_Hg</span><a name="line_51"></a></li><li id="line_52" class="even"><span class="lineNumber">&nbsp;52&nbsp;</span><span class="comment">&nbsp;*/</span><a name="line_52"></a></li><li id="line_53" class="odd"><span class="lineNumber">&nbsp;53&nbsp;</span><span class="keyword">class&nbsp;</span><span class="default">VersionControl_Hg_Container_Repository</span><a name="line_53"></a></li><li id="line_54" class="even"><span class="lineNumber">&nbsp;54&nbsp;</span><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">extends&nbsp;</span><span class="default">VersionControl_Hg_Container_Abstract</span><a name="line_54"></a></li><li id="line_55" class="odd"><span class="lineNumber">&nbsp;55&nbsp;</span><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">implements&nbsp;</span><span class="default">VersionControl_Hg_Container_Interface</span><a name="line_55"></a></li><li id="line_56" class="even"><span class="lineNumber">&nbsp;56&nbsp;</span><span class="keyword">{</span><a name="line_56"></a></li><li id="line_57" class="odd"><span class="lineNumber">&nbsp;57&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;*&nbsp;The&nbsp;name&nbsp;of&nbsp;all&nbsp;Mercurial&nbsp;repository&nbsp;roots.</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;*</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;*&nbsp;Leading&nbsp;backslash&nbsp;is&nbsp;needed&nbsp;since&nbsp;path&nbsp;may&nbsp;not&nbsp;have&nbsp;a&nbsp;trailing&nbsp;slash.</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;&nbsp;*/</span><a name="line_61"></a></li><li id="line_62" class="even"><span class="lineNumber">&nbsp;62&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">const&nbsp;</span><span class="default">ROOT_NAME&nbsp;</span><span class="keyword">=&nbsp;</span><span class="string">'.hg'</span><span class="keyword">;</span><a name="line_62"></a></li><li id="line_63" class="odd"><span class="lineNumber">&nbsp;63&nbsp;</span><a name="line_63"></a></li><li id="line_64" class="even"><span class="lineNumber">&nbsp;64&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;*&nbsp;Base&nbsp;class&nbsp;in&nbsp;this&nbsp;package</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;*</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;*&nbsp;Provides&nbsp;ability&nbsp;to&nbsp;call&nbsp;commands</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;&nbsp;*</span><a name="line_68"></a></li><li id="line_69" class="odd"><span class="lineNumber">&nbsp;69&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;VersionControl_Hg</span><a name="line_69"></a></li><li id="line_70" class="even"><span class="lineNumber">&nbsp;70&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</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;</span><span class="keyword">protected&nbsp;</span><span class="default">$hg</span><span class="keyword">;</span><a name="line_71"></a></li><li id="line_72" class="even"><span class="lineNumber">&nbsp;72&nbsp;</span><a name="line_72"></a></li><li id="line_73" class="odd"><span class="lineNumber">&nbsp;73&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*</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;Hold&nbsp;an&nbsp;instance&nbsp;of&nbsp;the&nbsp;class</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;</span><span class="keyword">private&nbsp;static&nbsp;</span><span class="default">$_instance</span><span class="keyword">;</span><a name="line_76"></a></li><li id="line_77" class="odd"><span class="lineNumber">&nbsp;77&nbsp;</span><a name="line_77"></a></li><li id="line_78" class="even"><span class="lineNumber">&nbsp;78&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;*&nbsp;Path&nbsp;to&nbsp;a&nbsp;local&nbsp;Mercurial&nbsp;repository</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;*</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;*&nbsp;@var&nbsp;string</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;&nbsp;*/</span><a name="line_82"></a></li><li id="line_83" class="odd"><span class="lineNumber">&nbsp;83&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_83"></a></li><li id="line_84" class="even"><span class="lineNumber">&nbsp;84&nbsp;</span><a name="line_84"></a></li><li id="line_85" class="odd"><span class="lineNumber">&nbsp;85&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;*&nbsp;Repository&nbsp;constructor&nbsp;which&nbsp;currently&nbsp;does&nbsp;nothing.</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;*</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;*&nbsp;@param&nbsp;VersionControl_Hg&nbsp;$hg&nbsp;&nbsp;&nbsp;is&nbsp;the&nbsp;root&nbsp;object&nbsp;and&nbsp;as&nbsp;a&nbsp;singleton</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;&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;will&nbsp;always&nbsp;be&nbsp;an&nbsp;instance&nbsp;of</span><a name="line_89"></a></li><li id="line_90" class="even"><span class="lineNumber">&nbsp;90&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;VersionControl_Hg</span><a name="line_90"></a></li><li id="line_91" class="odd"><span class="lineNumber">&nbsp;91&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;is&nbsp;the&nbsp;full&nbsp;path&nbsp;to&nbsp;the&nbsp;user&nbsp;defined</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;&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_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;@return&nbsp;void</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;*/</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;</span><span class="keyword">private&nbsp;function&nbsp;</span><span class="default">__construct</span><span class="keyword">(</span><span class="default">VersionControl_Hg&nbsp;$hg</span><span class="keyword">,&nbsp;</span><span class="default">$path</span><span class="keyword">)</span><a name="line_96"></a></li><li id="line_97" class="odd"><span class="lineNumber">&nbsp;97&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_97"></a></li><li id="line_98" class="even"><span class="lineNumber">&nbsp;98&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">setPath</span><span class="keyword">(</span><span class="default">$path</span><span class="keyword">);</span><a name="line_98"></a></li><li id="line_99" class="odd"><span class="lineNumber">&nbsp;99&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_99"></a></li><li id="line_100" class="even"><span class="lineNumber">100&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_100"></a></li><li id="line_101" class="odd"><span class="lineNumber">101&nbsp;</span><a name="line_101"></a></li><li id="line_102" class="even"><span class="lineNumber">102&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;The&nbsp;singleton&nbsp;method</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;*</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;@param&nbsp;object&nbsp;$hg&nbsp;&nbsp;&nbsp;Instance&nbsp;of&nbsp;VersionControl_Hg</span><a name="line_105"></a></li><li id="line_106" class="even"><span class="lineNumber">106&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;executable&nbsp;to&nbsp;use</span><a name="line_106"></a></li><li id="line_107" class="odd"><span class="lineNumber">107&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_107"></a></li><li id="line_108" class="even"><span class="lineNumber">108&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;VersionControl_Hg_Repository</span><a name="line_108"></a></li><li id="line_109" class="odd"><span class="lineNumber">109&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_109"></a></li><li id="line_110" class="even"><span class="lineNumber">110&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_110"></a></li><li id="line_111" class="odd"><span class="lineNumber">111&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</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;if&nbsp;(&nbsp;!&nbsp;isset(</span><span class="default">self</span><span class="keyword">::</span><span class="default">$_instance</span><span class="keyword">)&nbsp;)&nbsp;{</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="default">$singleton_class&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">__CLASS__</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="default">self</span><span class="keyword">::</span><span class="default">$_instance&nbsp;</span><span class="keyword">=&nbsp;new&nbsp;</span><span class="default">$singleton_class</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_114"></a></li><li id="line_115" class="odd"><span class="lineNumber">115&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_115"></a></li><li id="line_116" class="even"><span class="lineNumber">116&nbsp;</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;return&nbsp;</span><span class="default">self</span><span class="keyword">::</span><span class="default">$_instance</span><span class="keyword">;</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;}</span><a name="line_118"></a></li><li id="line_119" class="odd"><span class="lineNumber">119&nbsp;</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;</span><span class="comment">/**</span><a name="line_120"></a></li><li id="line_121" class="odd"><span class="lineNumber">121&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;FOR&nbsp;UNIT&nbsp;TESTING&nbsp;OF&nbsp;THIS&nbsp;SINGLETON,&nbsp;ONLY!</span><a name="line_121"></a></li><li id="line_122" class="even"><span class="lineNumber">122&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_122"></a></li><li id="line_123" class="odd"><span class="lineNumber">123&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;null</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;*/</span><a name="line_124"></a></li><li id="line_125" class="odd"><span class="lineNumber">125&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;static&nbsp;function&nbsp;</span><span class="default">reset</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;{</span><a name="line_126"></a></li><li id="line_127" class="odd"><span class="lineNumber">127&nbsp;</span><span class="keyword">&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;</span><span class="default">null</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;Sets&nbsp;the&nbsp;path&nbsp;of&nbsp;a&nbsp;Mercurial&nbsp;repository&nbsp;after&nbsp;validating&nbsp;it&nbsp;as&nbsp;a&nbsp;Hg</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;*&nbsp;repository</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;*</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;@param&nbsp;string&nbsp;$path&nbsp;The&nbsp;path&nbsp;to&nbsp;the&nbsp;hg&nbsp;executable</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;@see&nbsp;self::$path</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;*</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;@return&nbsp;VersionControl_Hg</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;</span><span class="keyword">public&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_140"></a></li><li id="line_141" class="odd"><span class="lineNumber">141&nbsp;</span><span class="keyword">&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="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;not&nbsp;passing&nbsp;in&nbsp;a&nbsp;path&nbsp;is&nbsp;OK,&nbsp;especially&nbsp;since&nbsp;the&nbsp;programmer&nbsp;may</span><a name="line_142"></a></li><li id="line_143" class="odd"><span class="lineNumber">143&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;want&nbsp;to&nbsp;call&nbsp;create()&nbsp;*/</span><a name="line_143"></a></li><li id="line_144" class="even"><span class="lineNumber">144&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;</span><span class="default">is_null</span><span class="keyword">(</span><span class="default">$path</span><span class="keyword">)&nbsp;)&nbsp;{</span><a name="line_144"></a></li><li id="line_145" class="odd"><span class="lineNumber">145&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;</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><a name="line_146"></a></li><li id="line_147" class="odd"><span class="lineNumber">147&nbsp;</span><a name="line_147"></a></li><li id="line_148" class="even"><span class="lineNumber">148&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span class="default">is_array</span><span class="keyword">(</span><span class="default">$path</span><span class="keyword">))&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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$path&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">$path</span><span class="keyword">[</span><span class="default">0</span><span class="keyword">];</span><a name="line_149"></a></li><li id="line_150" class="even"><span class="lineNumber">150&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</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">//is&nbsp;it&nbsp;even&nbsp;a&nbsp;real&nbsp;path?</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;</span><span class="keyword">if&nbsp;(&nbsp;!&nbsp;</span><span class="default">realpath</span><span class="keyword">(</span><span class="default">$path</span><span class="keyword">))&nbsp;{</span><a name="line_153"></a></li><li id="line_154" class="even"><span class="lineNumber">154&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_Container_Repository_Exception</span><span class="keyword">(</span><a name="line_154"></a></li><li id="line_155" class="odd"><span class="lineNumber">155&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_Container_Repository_Exception</span><span class="keyword">::</span><span class="default">DOES_NOT_EXIST</span><a name="line_155"></a></li><li id="line_156" class="even"><span class="lineNumber">156&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_156"></a></li><li id="line_157" class="odd"><span class="lineNumber">157&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_157"></a></li><li id="line_158" class="even"><span class="lineNumber">158&nbsp;</span><a name="line_158"></a></li><li id="line_159" class="odd"><span class="lineNumber">159&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*</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;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Let's&nbsp;not&nbsp;guess&nbsp;that&nbsp;the&nbsp;user&nbsp;wants&nbsp;to&nbsp;create&nbsp;a&nbsp;repo&nbsp;if&nbsp;none&nbsp;exists;</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;&nbsp;&nbsp;&nbsp;*&nbsp;Throw&nbsp;and&nbsp;exception&nbsp;and&nbsp;let&nbsp;them&nbsp;decide&nbsp;what&nbsp;to&nbsp;do&nbsp;next.</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;&nbsp;&nbsp;&nbsp;*&nbsp;Maybe&nbsp;they&nbsp;just&nbsp;gave&nbsp;the&nbsp;wrong&nbsp;path.</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;&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;&nbsp;&nbsp;&nbsp;*&nbsp;Line&nbsp;breaks&nbsp;are&nbsp;transmitted&nbsp;to&nbsp;CLI&nbsp;apps;&nbsp;concat&nbsp;the&nbsp;strings&nbsp;to</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;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;ignore&nbsp;them&nbsp;in&nbsp;output.</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_166"></a></li><li id="line_167" class="odd"><span class="lineNumber">167&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;!&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">isRepository</span><span class="keyword">(</span><span class="default">$path</span><span class="keyword">))&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;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Container_Repository_Exception</span><span class="keyword">(</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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">VersionControl_Hg_Container_Repository_Exception</span><span class="keyword">::</span><span class="default">NO_REPOSITORY</span><a name="line_169"></a></li><li id="line_170" class="even"><span class="lineNumber">170&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_170"></a></li><li id="line_171" class="odd"><span class="lineNumber">171&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_171"></a></li><li id="line_172" class="even"><span class="lineNumber">172&nbsp;</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;&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_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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;For&nbsp;fluid&nbsp;API&nbsp;*/</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;&nbsp;&nbsp;</span><span class="keyword">return&nbsp;</span><span class="default">$this</span><span class="keyword">;</span><a name="line_176"></a></li><li id="line_177" class="odd"><span class="lineNumber">177&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_177"></a></li><li id="line_178" class="even"><span class="lineNumber">178&nbsp;</span><a name="line_178"></a></li><li id="line_179" class="odd"><span class="lineNumber">179&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;Checks&nbsp;if&nbsp;$this&nbsp;is&nbsp;in&nbsp;fact&nbsp;a&nbsp;valid</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;@param&nbsp;string&nbsp;$path&nbsp;The&nbsp;full&nbsp;repository&nbsp;path.</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;*</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;*&nbsp;@return&nbsp;boolean</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;&nbsp;*/</span><a name="line_185"></a></li><li id="line_186" class="even"><span class="lineNumber">186&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">protected&nbsp;function&nbsp;</span><span class="default">isRepository</span><span class="keyword">(</span><span class="default">$path</span><span class="keyword">)</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;{</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;</span><span class="comment">/*</span><a name="line_188"></a></li><li id="line_189" class="odd"><span class="lineNumber">189&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@todo&nbsp;a&nbsp;valid&nbsp;repo&nbsp;has&nbsp;this&nbsp;structure,&nbsp;so&nbsp;test&nbsp;for&nbsp;this:</span><a name="line_189"></a></li><li id="line_190" class="even"><span class="lineNumber">190&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;.hg</span><a name="line_190"></a></li><li id="line_191" class="odd"><span class="lineNumber">191&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;|---store/</span><a name="line_191"></a></li><li id="line_192" class="even"><span class="lineNumber">192&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|---data/&nbsp;(directory)</span><a name="line_192"></a></li><li id="line_193" class="odd"><span class="lineNumber">193&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;|---dirstate&nbsp;(file)</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;&nbsp;*/</span><a name="line_194"></a></li><li id="line_195" class="odd"><span class="lineNumber">195&nbsp;</span><a name="line_195"></a></li><li id="line_196" class="even"><span class="lineNumber">196&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$is_repository&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">false</span><span class="keyword">;</span><a name="line_196"></a></li><li id="line_197" class="odd"><span class="lineNumber">197&nbsp;</span><a name="line_197"></a></li><li id="line_198" class="even"><span class="lineNumber">198&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$repository&nbsp;</span><span class="keyword">=&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">self</span><span class="keyword">::</span><span class="default">ROOT_NAME</span><span class="keyword">;</span><a name="line_198"></a></li><li id="line_199" class="odd"><span class="lineNumber">199&nbsp;</span><a name="line_199"></a></li><li id="line_200" class="even"><span class="lineNumber">200&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;both&nbsp;conditions&nbsp;must&nbsp;be&nbsp;satisfied.&nbsp;*/</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;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(</span><span class="default">is_dir</span><span class="keyword">(</span><span class="default">$repository</span><span class="keyword">)&nbsp;&amp;&amp;&nbsp;(!&nbsp;empty(</span><span class="default">$repository</span><span class="keyword">)))&nbsp;{</span><a name="line_201"></a></li><li id="line_202" class="even"><span class="lineNumber">202&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$is_repository&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">true</span><span class="keyword">;</span><a name="line_202"></a></li><li id="line_203" class="odd"><span class="lineNumber">203&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_203"></a></li><li id="line_204" class="even"><span class="lineNumber">204&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">$is_repository</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;Create&nbsp;a&nbsp;repository</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;*</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;*&nbsp;This&nbsp;would&nbsp;make&nbsp;sense&nbsp;in&nbsp;only&nbsp;a&nbsp;very&nbsp;few&nbsp;isntances.&nbsp;For&nbsp;example,&nbsp;if&nbsp;a</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;programmer&nbsp;instantiated&nbsp;$hg&nbsp;without&nbsp;a&nbsp;path,&nbsp;and&nbsp;did&nbsp;this:</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;&lt;code&gt;</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;*&nbsp;$hg&nbsp;=&nbsp;new&nbsp;VersionControl_Hg();</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;$repository&nbsp;=&nbsp;$hg-&gt;repository()-&gt;create('/path/to/repo');</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;</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;*</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;*&nbsp;However,&nbsp;its&nbsp;probably&nbsp;better&nbsp;to&nbsp;directly&nbsp;use&nbsp;the&nbsp;Init&nbsp;command,&nbsp;since</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;this&nbsp;create()&nbsp;function&nbsp;merely&nbsp;proxies&nbsp;it.</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;@param&nbsp;string&nbsp;$path&nbsp;The&nbsp;path&nbsp;at&nbsp;which&nbsp;to&nbsp;create&nbsp;a&nbsp;new&nbsp;Mercurial</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;repository.</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;&nbsp;*&nbsp;@return&nbsp;VersionControl_Hg_Container_Repository</span><a name="line_224"></a></li><li id="line_225" class="odd"><span class="lineNumber">225&nbsp;</span><span class="comment">&nbsp;&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="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">create</span><span class="keyword">(</span><span class="default">$path</span><span class="keyword">)</span><a name="line_226"></a></li><li id="line_227" class="odd"><span class="lineNumber">227&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&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;Init&nbsp;assumes&nbsp;it&nbsp;will&nbsp;have&nbsp;an&nbsp;array&nbsp;as&nbsp;an&nbsp;argument&nbsp;since&nbsp;the&nbsp;args</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;&nbsp;*&nbsp;are&nbsp;usually&nbsp;passed&nbsp;into&nbsp;it&nbsp;by&nbsp;call_user_func_array()&nbsp;*/</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="default">$command&nbsp;</span><span class="keyword">=&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Command_Init</span><span class="keyword">(array(</span><span class="default">$path</span><span class="keyword">));</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;</span><span class="default">$repository&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">$command</span><span class="keyword">-&gt;</span><span class="default">run</span><span class="keyword">(</span><span class="string">'verbose'</span><span class="keyword">);</span><a name="line_231"></a></li><li id="line_232" class="even"><span class="lineNumber">232&nbsp;</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;</span><span class="comment">//@TODO&nbsp;It&nbsp;needs&nbsp;$hg&nbsp;to&nbsp;be&nbsp;passed&nbsp;in...</span><a name="line_233"></a></li><li id="line_234" class="even"><span class="lineNumber">234&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;return&nbsp;it&nbsp;so&nbsp;we&nbsp;can&nbsp;chain&nbsp;it&nbsp;*/</span><a name="line_234"></a></li><li id="line_235" class="odd"><span class="lineNumber">235&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">return&nbsp;</span><span class="default">$repository</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;}</span><a name="line_236"></a></li><li id="line_237" class="odd"><span class="lineNumber">237&nbsp;</span><a name="line_237"></a></li><li id="line_238" class="even"><span class="lineNumber">238&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_238"></a></li><li id="line_239" class="odd"><span class="lineNumber">239&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Deletes&nbsp;the&nbsp;repository,&nbsp;but&nbsp;not&nbsp;the&nbsp;working&nbsp;copy</span><a name="line_239"></a></li><li id="line_240" class="even"><span class="lineNumber">240&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</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;On&nbsp;Windows,&nbsp;this&nbsp;will&nbsp;fail&nbsp;if&nbsp;any&nbsp;process&nbsp;has&nbsp;a&nbsp;lock&nbsp;on&nbsp;the&nbsp;repository's</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;directory;&nbsp;for&nbsp;example,&nbsp;if&nbsp;the&nbsp;repository&nbsp;is&nbsp;open&nbsp;in&nbsp;Windows&nbsp;Explorer.</span><a name="line_242"></a></li><li id="line_243" class="odd"><span class="lineNumber">243&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_243"></a></li><li id="line_244" class="even"><span class="lineNumber">244&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;boolean</span><a name="line_244"></a></li><li id="line_245" class="odd"><span class="lineNumber">245&nbsp;</span><span class="comment">&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="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">delete</span><span class="keyword">()</span><a name="line_246"></a></li><li id="line_247" class="odd"><span class="lineNumber">247&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&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">//validate&nbsp;first&nbsp;with&nbsp;is_dir();&nbsp;?&nbsp;It&nbsp;may&nbsp;have&nbsp;been&nbsp;deleted&nbsp;by&nbsp;another</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;//process,&nbsp;you&nbsp;know.</span><a name="line_249"></a></li><li id="line_250" class="even"><span class="lineNumber">250&nbsp;</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;//is_writable($this-&gt;path)</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;or&nbsp;is_writable($this-&gt;path&nbsp;.&nbsp;DIRECTORY_SEPARATOR&nbsp;.&nbsp;self::ROOT_NAME)</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="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//chdir&nbsp;to&nbsp;outside&nbsp;the&nbsp;repo&nbsp;to&nbsp;avoid&nbsp;unlink&nbsp;error&nbsp;if&nbsp;the&nbsp;user&nbsp;is</span><a name="line_254"></a></li><li id="line_255" class="odd"><span class="lineNumber">255&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//running&nbsp;this&nbsp;inside&nbsp;the&nbsp;dir&nbsp;or&nbsp;something...but&nbsp;when/how&nbsp;would&nbsp;this</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;//actually&nbsp;occur?</span><a name="line_256"></a></li><li id="line_257" class="odd"><span class="lineNumber">257&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;&nbsp;&nbsp;&nbsp;$old&nbsp;=&nbsp;getcwd();&nbsp;//&nbsp;Save&nbsp;the&nbsp;current&nbsp;directory</span><a name="line_257"></a></li><li id="line_258" class="even"><span class="lineNumber">258&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chdir($path_to_file);</span><a name="line_258"></a></li><li id="line_259" class="odd"><span class="lineNumber">259&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unlink($filename);</span><a name="line_259"></a></li><li id="line_260" class="even"><span class="lineNumber">260&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chdir($old);&nbsp;//&nbsp;Restore&nbsp;the&nbsp;old&nbsp;working&nbsp;directory</span><a name="line_260"></a></li><li id="line_261" class="odd"><span class="lineNumber">261&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_261"></a></li><li id="line_262" class="even"><span class="lineNumber">262&nbsp;</span><a name="line_262"></a></li><li id="line_263" class="odd"><span class="lineNumber">263&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//This&nbsp;may&nbsp;be&nbsp;necessary&nbsp;sometimes:</span><a name="line_263"></a></li><li id="line_264" class="even"><span class="lineNumber">264&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//chown($TempDirectory."/".$FileName,666);</span><a name="line_264"></a></li><li id="line_265" class="odd"><span class="lineNumber">265&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Insert&nbsp;an&nbsp;Invalid&nbsp;UserId&nbsp;to&nbsp;set&nbsp;to&nbsp;Nobody&nbsp;Owner;</span><a name="line_265"></a></li><li id="line_266" class="even"><span class="lineNumber">266&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//666&nbsp;is&nbsp;my&nbsp;standard&nbsp;for&nbsp;"Nobody"</span><a name="line_266"></a></li><li id="line_267" class="odd"><span class="lineNumber">267&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;/*&nbsp;Destroy&nbsp;the&nbsp;physical&nbsp;filesystem&nbsp;*/</span><a name="line_268"></a></li><li id="line_269" class="odd"><span class="lineNumber">269&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;</span><span class="default">unlink</span><span class="keyword">(</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">DIRECTORY_SEPARATOR&nbsp;</span><span class="keyword">.&nbsp;</span><span class="default">self</span><span class="keyword">::</span><span class="default">ROOT_NAME</span><span class="keyword">)&nbsp;)&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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;Remove&nbsp;the&nbsp;path&nbsp;from&nbsp;the&nbsp;object&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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">self</span><span class="keyword">::</span><span class="default">reset</span><span class="keyword">();</span><a name="line_271"></a></li><li id="line_272" class="even"><span class="lineNumber">272&nbsp;</span><a name="line_272"></a></li><li id="line_273" class="odd"><span class="lineNumber">273&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span class="default">true</span><span class="keyword">;</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;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{</span><a name="line_274"></a></li><li id="line_275" class="odd"><span class="lineNumber">275&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;Its&nbsp;hard&nbsp;to&nbsp;see&nbsp;how&nbsp;this&nbsp;'else'&nbsp;code&nbsp;would&nbsp;ever&nbsp;execute&nbsp;*/</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">throw&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Container_Repository_Exception</span><span class="keyword">(</span><a name="line_276"></a></li><li id="line_277" class="odd"><span class="lineNumber">277&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'The&nbsp;repository&nbsp;could&nbsp;not&nbsp;be&nbsp;deleted.'</span><a name="line_277"></a></li><li id="line_278" class="even"><span class="lineNumber">278&nbsp;</span><span class="string">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">);</span><a name="line_278"></a></li><li id="line_279" class="odd"><span class="lineNumber">279&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*@TODO&nbsp;or,&nbsp;return&nbsp;false&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;&nbsp;&nbsp;&nbsp;&nbsp;</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><a name="line_282"></a></li><li id="line_283" class="odd"><span class="lineNumber">283&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;Prevent&nbsp;users&nbsp;to&nbsp;clone&nbsp;the&nbsp;instance</span><a name="line_284"></a></li><li id="line_285" class="odd"><span class="lineNumber">285&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_285"></a></li><li id="line_286" class="even"><span class="lineNumber">286&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;Exception</span><a name="line_286"></a></li><li id="line_287" class="odd"><span class="lineNumber">287&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><a name="line_287"></a></li><li id="line_288" class="even"><span class="lineNumber">288&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_288"></a></li><li id="line_289" class="odd"><span class="lineNumber">289&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&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;</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_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><span class="keyword">}</span><span>
</span><a name="line_292"></a></li></ol>
                    </div>
    </body>
</html>