Source

VersionControl_Hg / src / Documentation / Code / Hg / Command / Archive.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/Command/Archive.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;VersionControl_Hg_Repository_Command_Archive</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;*&nbsp;class</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;*</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;*&nbsp;PHP&nbsp;version&nbsp;5</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;*</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;@category&nbsp;&nbsp;&nbsp;VersionControl</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;@package&nbsp;&nbsp;&nbsp;&nbsp;Hg</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;@subpackage&nbsp;Command</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;@author&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Michael&nbsp;Gatto&nbsp;&lt;mgatto@lisantra.com&gt;</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;@copyright&nbsp;&nbsp;2011&nbsp;Lisantra&nbsp;Technologies,&nbsp;LLC</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;@license&nbsp;&nbsp;&nbsp;&nbsp;http://www.opensource.org/licenses/mit-license.html&nbsp;&nbsp;MIT&nbsp;License</span><a name="line_13"></a></li><li id="line_14" class="even"><span class="lineNumber">&nbsp;14&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_14"></a></li><li id="line_15" class="odd"><span class="lineNumber">&nbsp;15&nbsp;</span><span class="comment">&nbsp;*/</span><a name="line_15"></a></li><li id="line_16" class="even"><span class="lineNumber">&nbsp;16&nbsp;</span><a name="line_16"></a></li><li id="line_17" class="odd"><span class="lineNumber">&nbsp;17&nbsp;</span><span class="comment">/**</span><a name="line_17"></a></li><li id="line_18" class="even"><span class="lineNumber">&nbsp;18&nbsp;</span><span class="comment">&nbsp;*&nbsp;Provides&nbsp;the&nbsp;required&nbsp;interface&nbsp;for&nbsp;all&nbsp;commands</span><a name="line_18"></a></li><li id="line_19" class="odd"><span class="lineNumber">&nbsp;19&nbsp;</span><span class="comment">&nbsp;*/</span><a name="line_19"></a></li><li id="line_20" class="even"><span class="lineNumber">&nbsp;20&nbsp;</span><span class="keyword">require_once&nbsp;</span><span class="string">'Interface.php'</span><span class="keyword">;</span><a name="line_20"></a></li><li id="line_21" class="odd"><span class="lineNumber">&nbsp;21&nbsp;</span><a name="line_21"></a></li><li id="line_22" class="even"><span class="lineNumber">&nbsp;22&nbsp;</span><span class="comment">/**</span><a name="line_22"></a></li><li id="line_23" class="odd"><span class="lineNumber">&nbsp;23&nbsp;</span><span class="comment">&nbsp;*&nbsp;Provides&nbsp;base&nbsp;functionality&nbsp;common&nbsp;to&nbsp;all&nbsp;commands</span><a name="line_23"></a></li><li id="line_24" class="even"><span class="lineNumber">&nbsp;24&nbsp;</span><span class="comment">&nbsp;*/</span><a name="line_24"></a></li><li id="line_25" class="odd"><span class="lineNumber">&nbsp;25&nbsp;</span><span class="keyword">require_once&nbsp;</span><span class="string">'Abstract.php'</span><span class="keyword">;</span><a name="line_25"></a></li><li id="line_26" class="even"><span class="lineNumber">&nbsp;26&nbsp;</span><a name="line_26"></a></li><li id="line_27" class="odd"><span class="lineNumber">&nbsp;27&nbsp;</span><span class="comment">/**</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;Provides&nbsp;Exceptions&nbsp;for&nbsp;commands&nbsp;(VersionControl_Hg_Command_Exception)</span><a name="line_28"></a></li><li id="line_29" class="odd"><span class="lineNumber">&nbsp;29&nbsp;</span><span class="comment">&nbsp;*/</span><a name="line_29"></a></li><li id="line_30" class="even"><span class="lineNumber">&nbsp;30&nbsp;</span><span class="keyword">require_once&nbsp;</span><span class="string">'Exception.php'</span><span class="keyword">;</span><a name="line_30"></a></li><li id="line_31" class="odd"><span class="lineNumber">&nbsp;31&nbsp;</span><a name="line_31"></a></li><li id="line_32" class="even"><span class="lineNumber">&nbsp;32&nbsp;</span><span class="comment">/**</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;Exports&nbsp;repository&nbsp;to&nbsp;a&nbsp;(optionally&nbsp;compressed)&nbsp;archive&nbsp;file.</span><a name="line_33"></a></li><li id="line_34" class="even"><span class="lineNumber">&nbsp;34&nbsp;</span><span class="comment">&nbsp;*</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;Usage:</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-&gt;archive('tip')-&gt;to('/home/myself/releases/')-&gt;with('tgz')-&gt;run();</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;&lt;/code&gt;</span><a name="line_38"></a></li><li id="line_39" class="odd"><span class="lineNumber">&nbsp;39&nbsp;</span><span class="comment">&nbsp;*</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;PHP&nbsp;version&nbsp;5</span><a name="line_40"></a></li><li id="line_41" class="odd"><span class="lineNumber">&nbsp;41&nbsp;</span><span class="comment">&nbsp;*</span><a name="line_41"></a></li><li id="line_42" class="even"><span class="lineNumber">&nbsp;42&nbsp;</span><span class="comment">&nbsp;*&nbsp;@category&nbsp;&nbsp;&nbsp;VersionControl</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;@package&nbsp;&nbsp;&nbsp;&nbsp;Hg</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;@subpackage&nbsp;Command</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;@author&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Michael&nbsp;Gatto&nbsp;&lt;mgatto@lisantra.com&gt;</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;@copyright&nbsp;&nbsp;2011&nbsp;Lisantra&nbsp;Technologies,&nbsp;LLC</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;@license&nbsp;&nbsp;&nbsp;&nbsp;http://www.opensource.org/licenses/mit-license.html&nbsp;&nbsp;MIT&nbsp;License</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;@link&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://pear.php.net/package/VersionControl_Hg</span><a name="line_48"></a></li><li id="line_49" class="odd"><span class="lineNumber">&nbsp;49&nbsp;</span><span class="comment">&nbsp;*/</span><a name="line_49"></a></li><li id="line_50" class="even"><span class="lineNumber">&nbsp;50&nbsp;</span><span class="keyword">class&nbsp;</span><span class="default">VersionControl_Hg_Command_Archive</span><a name="line_50"></a></li><li id="line_51" class="odd"><span class="lineNumber">&nbsp;51&nbsp;</span><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">extends&nbsp;</span><span class="default">VersionControl_Hg_Command_Abstract</span><a name="line_51"></a></li><li id="line_52" class="even"><span class="lineNumber">&nbsp;52&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_Command_Interface</span><a name="line_52"></a></li><li id="line_53" class="odd"><span class="lineNumber">&nbsp;53&nbsp;</span><span class="keyword">{</span><a name="line_53"></a></li><li id="line_54" class="even"><span class="lineNumber">&nbsp;54&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span><a name="line_54"></a></li><li id="line_55" class="odd"><span class="lineNumber">&nbsp;55&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;name&nbsp;of&nbsp;the&nbsp;mercurial&nbsp;command&nbsp;implemented&nbsp;here</span><a name="line_55"></a></li><li id="line_56" class="even"><span class="lineNumber">&nbsp;56&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</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;@var&nbsp;string</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;</span><span class="keyword">protected&nbsp;</span><span class="default">$command&nbsp;</span><span class="keyword">=&nbsp;</span><span class="string">'archive'</span><span class="keyword">;</span><a name="line_59"></a></li><li id="line_60" class="even"><span class="lineNumber">&nbsp;60&nbsp;</span><a name="line_60"></a></li><li id="line_61" class="odd"><span class="lineNumber">&nbsp;61&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;&nbsp;*&nbsp;The&nbsp;path&nbsp;where&nbsp;the&nbsp;archive&nbsp;will&nbsp;be&nbsp;saved</span><a name="line_62"></a></li><li id="line_63" class="odd"><span class="lineNumber">&nbsp;63&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</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;@var&nbsp;string</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;</span><span class="keyword">protected&nbsp;</span><span class="default">$destination</span><span class="keyword">;</span><a name="line_66"></a></li><li id="line_67" class="odd"><span class="lineNumber">&nbsp;67&nbsp;</span><a name="line_67"></a></li><li id="line_68" class="even"><span class="lineNumber">&nbsp;68&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;Required&nbsp;options&nbsp;this&nbsp;command&nbsp;needs</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;&nbsp;*&nbsp;destination&nbsp;is&nbsp;always&nbsp;variable</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;@var&nbsp;mixed</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;*/</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;</span><span class="keyword">protected&nbsp;</span><span class="default">$required_options&nbsp;</span><span class="keyword">=&nbsp;array(</span><a name="line_75"></a></li><li id="line_76" class="even"><span class="lineNumber">&nbsp;76&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'files'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="default">null</span><span class="keyword">,&nbsp;</span><span class="comment">//AKA&nbsp;destination</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;&nbsp;&nbsp;</span><span class="string">'noninteractive'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="default">null</span><span class="keyword">,</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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'repository'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="default">null</span><span class="keyword">,</span><a name="line_78"></a></li><li id="line_79" class="odd"><span class="lineNumber">&nbsp;79&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;);</span><a name="line_79"></a></li><li id="line_80" class="even"><span class="lineNumber">&nbsp;80&nbsp;</span><a name="line_80"></a></li><li id="line_81" class="odd"><span class="lineNumber">&nbsp;81&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;*&nbsp;Possible&nbsp;options&nbsp;this&nbsp;command&nbsp;may&nbsp;have</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;&nbsp;*</span><a name="line_83"></a></li><li id="line_84" class="even"><span class="lineNumber">&nbsp;84&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;--type&nbsp;defaults&nbsp;to&nbsp;'files'</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;--prefix&nbsp;defaults&nbsp;to&nbsp;''</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;--rev&nbsp;defaults&nbsp;to&nbsp;tip</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;@var&nbsp;mixed</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;*/</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;</span><span class="keyword">protected&nbsp;</span><span class="default">$allowed_options&nbsp;</span><span class="keyword">=&nbsp;array(</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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'rev'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="default">null</span><span class="keyword">,</span><a name="line_91"></a></li><li id="line_92" class="even"><span class="lineNumber">&nbsp;92&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'prefix'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="default">null</span><span class="keyword">,</span><a name="line_92"></a></li><li id="line_93" class="odd"><span class="lineNumber">&nbsp;93&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'type'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="default">null</span><span class="keyword">,</span><a name="line_93"></a></li><li id="line_94" class="even"><span class="lineNumber">&nbsp;94&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;);</span><a name="line_94"></a></li><li id="line_95" class="odd"><span class="lineNumber">&nbsp;95&nbsp;</span><a name="line_95"></a></li><li id="line_96" class="even"><span class="lineNumber">&nbsp;96&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;Valid&nbsp;formats&nbsp;for&nbsp;the&nbsp;archive</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;&nbsp;*&nbsp;Keys&nbsp;are&nbsp;the&nbsp;'type',&nbsp;while&nbsp;values&nbsp;are&nbsp;the&nbsp;file&nbsp;extensions.</span><a name="line_99"></a></li><li id="line_100" class="even"><span class="lineNumber">100&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;is&nbsp;dictated&nbsp;by&nbsp;the&nbsp;formats&nbsp;which&nbsp;Mercurial&nbsp;natively&nbsp;supports.</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;*</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;LZMA&nbsp;would&nbsp;be&nbsp;nice.</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;*</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;@var&nbsp;mixed</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;*/</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;</span><span class="keyword">protected&nbsp;</span><span class="default">$archive_types&nbsp;</span><span class="keyword">=&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;</span><span class="string">'files'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="string">''</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;</span><span class="string">'tar'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="string">'tar'</span><span class="keyword">,</span><a name="line_108"></a></li><li id="line_109" class="odd"><span class="lineNumber">109&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'bzip2'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="string">'tbz2'</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">'gzip'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="string">'tgz'</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">'zip'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="string">'zip'</span><span class="keyword">,</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;</span><span class="string">'uzip'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="string">'zip'</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;);</span><a name="line_113"></a></li><li id="line_114" class="even"><span class="lineNumber">114&nbsp;</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;</span><span class="comment">/**</span><a name="line_115"></a></li><li id="line_116" class="even"><span class="lineNumber">116&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Constructor</span><a name="line_116"></a></li><li id="line_117" class="odd"><span class="lineNumber">117&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_117"></a></li><li id="line_118" class="even"><span class="lineNumber">118&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;mixed&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$params&nbsp;Data&nbsp;values&nbsp;passed&nbsp;to&nbsp;the&nbsp;command</span><a name="line_118"></a></li><li id="line_119" class="odd"><span class="lineNumber">119&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;VersionControl_Hg&nbsp;$hg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Instance&nbsp;of&nbsp;the&nbsp;base&nbsp;object</span><a name="line_119"></a></li><li id="line_120" class="even"><span class="lineNumber">120&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</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;@return&nbsp;void</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;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">__construct</span><span class="keyword">(</span><span class="default">$params&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">null</span><span class="keyword">,&nbsp;</span><span class="default">VersionControl_Hg&nbsp;$hg</span><span class="keyword">)</span><a name="line_123"></a></li><li id="line_124" class="even"><span class="lineNumber">124&nbsp;</span><span class="keyword">&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="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;Make&nbsp;$hg&nbsp;available&nbsp;to&nbsp;option&nbsp;methods&nbsp;*/</span><a name="line_125"></a></li><li id="line_126" class="even"><span class="lineNumber">126&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">hg&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">$hg</span><span class="keyword">;</span><a name="line_126"></a></li><li id="line_127" class="odd"><span class="lineNumber">127&nbsp;</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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;should&nbsp;always&nbsp;be&nbsp;called&nbsp;so&nbsp;we&nbsp;have&nbsp;a&nbsp;full&nbsp;array&nbsp;of&nbsp;valid&nbsp;options&nbsp;*/</span><a name="line_128"></a></li><li id="line_129" class="odd"><span class="lineNumber">129&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">setOptions</span><span class="keyword">(array());&nbsp;</span><span class="comment">//should&nbsp;be&nbsp;renamed&nbsp;as&nbsp;joinPossibleOptions()</span><a name="line_129"></a></li><li id="line_130" class="even"><span class="lineNumber">130&nbsp;</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;&nbsp;&nbsp;/*&nbsp;Remap&nbsp;the&nbsp;options&nbsp;to&nbsp;match&nbsp;the&nbsp;function&nbsp;names&nbsp;with&nbsp;valid&nbsp;hg&nbsp;options</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;&nbsp;&nbsp;&nbsp;*&nbsp;Normally,&nbsp;this&nbsp;would&nbsp;be&nbsp;handled&nbsp;by&nbsp;setOptions($params),&nbsp;but&nbsp;the&nbsp;names</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;&nbsp;&nbsp;&nbsp;*&nbsp;such&nbsp;as&nbsp;'revision'&nbsp;are&nbsp;not&nbsp;valid&nbsp;HG&nbsp;options,&nbsp;but&nbsp;are&nbsp;just&nbsp;so&nbsp;darn</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;&nbsp;&nbsp;&nbsp;*&nbsp;semantic&nbsp;and&nbsp;"fluidic",&nbsp;that&nbsp;I&nbsp;can't&nbsp;give&nbsp;them&nbsp;up.&nbsp;Thus:&nbsp;*/</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;&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">0</span><span class="keyword">,&nbsp;</span><span class="default">$params</span><span class="keyword">)&nbsp;)&nbsp;{</span><a name="line_135"></a></li><li id="line_136" class="even"><span class="lineNumber">136&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;sometimes&nbsp;$params&nbsp;is&nbsp;not&nbsp;an&nbsp;array!&nbsp;*/</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">foreach&nbsp;(&nbsp;</span><span class="default">$params</span><span class="keyword">[</span><span class="default">0</span><span class="keyword">]&nbsp;as&nbsp;</span><span class="default">$key&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="default">$value&nbsp;</span><span class="keyword">)&nbsp;{</span><a name="line_137"></a></li><li id="line_138" class="even"><span class="lineNumber">138&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch&nbsp;(</span><span class="default">$key</span><span class="keyword">)&nbsp;{</span><a name="line_138"></a></li><li id="line_139" class="odd"><span class="lineNumber">139&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;case&nbsp;</span><span class="string">'revision'</span><span class="keyword">:</span><a name="line_139"></a></li><li id="line_140" class="even"><span class="lineNumber">140&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;case&nbsp;</span><span class="string">'to'</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;</span><span class="string">'with'</span><span class="keyword">:</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;</span><span class="string">'prefix'</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">$key</span><span class="keyword">(</span><span class="default">$value</span><span class="keyword">);</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default:</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;default&nbsp;is&nbsp;to&nbsp;just&nbsp;ignore&nbsp;unkown&nbsp;ones&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">break;</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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><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><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_151"></a></li><li id="line_152" class="even"><span class="lineNumber">152&nbsp;</span><a name="line_152"></a></li><li id="line_153" class="odd"><span class="lineNumber">153&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;Sets&nbsp;the&nbsp;directory&nbsp;path&nbsp;to&nbsp;which&nbsp;the&nbsp;archive&nbsp;will&nbsp;be&nbsp;saved</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;*</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;&nbsp;*&nbsp;Must&nbsp;be&nbsp;the&nbsp;last&nbsp;option,&nbsp;like&nbsp;files</span><a name="line_156"></a></li><li id="line_157" class="odd"><span class="lineNumber">157&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span><a name="line_157"></a></li><li id="line_158" class="even"><span class="lineNumber">158&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;$directory&nbsp;is&nbsp;directory&nbsp;to&nbsp;which&nbsp;archives&nbsp;are&nbsp;saved</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;*</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;@return&nbsp;VersionControl_Hg_Command_Abstract</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;@throws&nbsp;VersionControl_Hg_Repository_Command_Exception</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;*/</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;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">to</span><span class="keyword">(</span><span class="default">$directory</span><span class="keyword">)</span><a name="line_163"></a></li><li id="line_164" class="even"><span class="lineNumber">164&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;{</span><a name="line_164"></a></li><li id="line_165" class="odd"><span class="lineNumber">165&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;empty&nbsp;paths&nbsp;not&nbsp;valid&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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;empty(</span><span class="default">$directory</span><span class="keyword">)&nbsp;)&nbsp;{</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Repository_Command_Exception</span><span class="keyword">(</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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">VersionControl_Hg_Command_Exception</span><span class="keyword">::</span><span class="default">BAD_ARGUMENT</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="string">'You&nbsp;must&nbsp;supply&nbsp;a&nbsp;directory&nbsp;to&nbsp;archive&nbsp;to.'&nbsp;</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'Instead,&nbsp;its&nbsp;empty.'</span><a name="line_170"></a></li><li id="line_171" class="odd"><span class="lineNumber">171&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_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;}</span><a name="line_172"></a></li><li id="line_173" class="odd"><span class="lineNumber">173&nbsp;</span><a name="line_173"></a></li><li id="line_174" class="even"><span class="lineNumber">174&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;test&nbsp;path's&nbsp;validity&nbsp;*/</span><a name="line_174"></a></li><li id="line_175" class="odd"><span class="lineNumber">175&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;</span><span class="default">$directory&nbsp;</span><span class="keyword">!=&nbsp;</span><span class="default">realpath</span><span class="keyword">(</span><span class="default">$directory</span><span class="keyword">)&nbsp;)&nbsp;{</span><a name="line_175"></a></li><li id="line_176" class="even"><span class="lineNumber">176&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_Repository_Command_Exception</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">VersionControl_Hg_Command_Exception</span><span class="keyword">::</span><span class="default">BAD_ARGUMENT</span><span class="keyword">,</span><a name="line_177"></a></li><li id="line_178" class="even"><span class="lineNumber">178&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;canonical&nbsp;path&nbsp;'</span><span class="keyword">{</span><span class="default">$directory</span><span class="keyword">}</span><span class="string">'&nbsp;does&nbsp;not&nbsp;seem&nbsp;to&nbsp;exist&nbsp;on</span><a name="line_178"></a></li><li id="line_179" class="odd"><span class="lineNumber">179&nbsp;</span><span class="string">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;server.&nbsp;"</span><a name="line_179"></a></li><li id="line_180" class="even"><span class="lineNumber">180&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_180"></a></li><li id="line_181" class="odd"><span class="lineNumber">181&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_181"></a></li><li id="line_182" class="even"><span class="lineNumber">182&nbsp;</span><a name="line_182"></a></li><li id="line_183" class="odd"><span class="lineNumber">183&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">destination&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">$directory</span><span class="keyword">;</span><a name="line_183"></a></li><li id="line_184" class="even"><span class="lineNumber">184&nbsp;</span><a name="line_184"></a></li><li id="line_185" class="odd"><span class="lineNumber">185&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;for&nbsp;the&nbsp;fluent&nbsp;api&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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">return&nbsp;</span><span class="default">$this</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><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;</span><span class="comment">/**</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;Sets&nbsp;type&nbsp;of&nbsp;archive&nbsp;format.</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;*</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;Valid&nbsp;values&nbsp;are&nbsp;'files',&nbsp;'tar',&nbsp;'bzip2',&nbsp;'gzip',&nbsp;'zip',&nbsp;'uzip'</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;*</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;@param&nbsp;string&nbsp;$type&nbsp;is&nbsp;the&nbsp;archive&nbsp;type</span><a name="line_194"></a></li><li id="line_195" class="odd"><span class="lineNumber">195&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&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;@return&nbsp;VersionControl_Hg_Command_Archive</span><a name="line_196"></a></li><li id="line_197" class="odd"><span class="lineNumber">197&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;VersionControl_Hg_Repository_Command_Exception</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;*/</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;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">with</span><span class="keyword">(</span><span class="default">$type&nbsp;</span><span class="keyword">=&nbsp;</span><span class="string">'files'</span><span class="keyword">)</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;{</span><a name="line_200"></a></li><li id="line_201" class="odd"><span class="lineNumber">201&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;!&nbsp;</span><span class="default">array_key_exists</span><span class="keyword">(</span><span class="default">$type</span><span class="keyword">,&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">archive_types</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;throw&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Repository_Command_Exception</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">VersionControl_Hg_Command_Exception</span><span class="keyword">::</span><span class="default">BAD_ARGUMENT</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">"The&nbsp;</span><span class="keyword">{</span><span class="default">$type</span><span class="keyword">}</span><span class="string">&nbsp;archive&nbsp;type&nbsp;is&nbsp;not&nbsp;supported.&nbsp;"</span><a name="line_204"></a></li><li id="line_205" class="odd"><span class="lineNumber">205&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_205"></a></li><li id="line_206" class="even"><span class="lineNumber">206&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">addOption</span><span class="keyword">(</span><span class="string">'type'</span><span class="keyword">,&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">archive_types</span><span class="keyword">[</span><span class="default">$type</span><span class="keyword">]);</span><a name="line_208"></a></li><li id="line_209" class="odd"><span class="lineNumber">209&nbsp;</span><a name="line_209"></a></li><li id="line_210" class="even"><span class="lineNumber">210&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;for&nbsp;the&nbsp;fluent&nbsp;api&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;&nbsp;&nbsp;</span><span class="keyword">return&nbsp;</span><span class="default">$this</span><span class="keyword">;</span><a name="line_211"></a></li><li id="line_212" class="even"><span class="lineNumber">212&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_212"></a></li><li id="line_213" class="odd"><span class="lineNumber">213&nbsp;</span><a name="line_213"></a></li><li id="line_214" class="even"><span class="lineNumber">214&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</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;Specified&nbsp;the&nbsp;revision&nbsp;to&nbsp;restrict&nbsp;the&nbsp;archive&nbsp;operation&nbsp;to</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;*</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;Usage:</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;&lt;code&gt;$hg-&gt;archive()-&gt;revision(7)-&gt;run();&lt;/code&gt;</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;or</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;*&nbsp;&lt;code&gt;$hg-&gt;archive(array('revision'&nbsp;=&gt;&nbsp;7&nbsp;))-&gt;to('path/to)-&gt;run();&lt;/code&gt;</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;*</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;@param&nbsp;string&nbsp;$revision&nbsp;is&nbsp;the&nbsp;optional&nbsp;revision&nbsp;to&nbsp;archive</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;void</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">revision</span><span class="keyword">(</span><span class="default">$revision&nbsp;</span><span class="keyword">=&nbsp;</span><span class="string">'tip'</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">//@TODO&nbsp;Technically,&nbsp;this&nbsp;shouldn't&nbsp;occur&nbsp;since&nbsp;'tip'&nbsp;is&nbsp;default</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;</span><span class="keyword">if&nbsp;(&nbsp;empty(</span><span class="default">$revision</span><span class="keyword">))&nbsp;{</span><a name="line_229"></a></li><li id="line_230" class="even"><span class="lineNumber">230&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_Command_Exception</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">VersionControl_Hg_Command_Exception</span><span class="keyword">::</span><span class="default">BAD_ARGUMENT</span><a name="line_231"></a></li><li id="line_232" class="even"><span class="lineNumber">232&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_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><a name="line_233"></a></li><li id="line_234" class="even"><span class="lineNumber">234&nbsp;</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;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">addOption</span><span class="keyword">(</span><span class="string">'rev'</span><span class="keyword">,&nbsp;</span><span class="default">$revision</span><span class="keyword">);</span><a name="line_235"></a></li><li id="line_236" class="even"><span class="lineNumber">236&nbsp;</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;return&nbsp;</span><span class="default">$this</span><span class="keyword">;&nbsp;</span><span class="comment">//for&nbsp;the&nbsp;fluent&nbsp;API</span><a name="line_237"></a></li><li id="line_238" class="even"><span class="lineNumber">238&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span><a name="line_238"></a></li><li id="line_239" class="odd"><span class="lineNumber">239&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;</span><span class="comment">/**</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;Adds&nbsp;'prefix'&nbsp;to&nbsp;the&nbsp;stack&nbsp;of&nbsp;command&nbsp;line&nbsp;options</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;*</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;*&nbsp;Specifies&nbsp;a&nbsp;directory&nbsp;prefix&nbsp;to&nbsp;wrap&nbsp;the&nbsp;exported&nbsp;files&nbsp;to&nbsp;within&nbsp;the&nbsp;archive</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="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Usage:</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;&nbsp;*&nbsp;&lt;code&gt;$hg-&gt;archive()-&gt;prefix('My&nbsp;Project')-&gt;to('/path/to')-&gt;run();&lt;/code&gt;</span><a name="line_246"></a></li><li id="line_247" class="odd"><span class="lineNumber">247&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;or</span><a name="line_247"></a></li><li id="line_248" class="even"><span class="lineNumber">248&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;code&gt;</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;$hg-&gt;archive(array('prefix'&nbsp;=&gt;&nbsp;'My&nbsp;Project'))-&gt;to('path/to)-&gt;run();</span><a name="line_249"></a></li><li id="line_250" class="even"><span class="lineNumber">250&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;/code&gt;</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;*</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;@param&nbsp;string&nbsp;$prefix&nbsp;is&nbsp;the&nbsp;string&nbsp;prefixed&nbsp;to&nbsp;the&nbsp;directory&nbsp;within</span><a name="line_252"></a></li><li id="line_253" class="odd"><span class="lineNumber">253&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;the&nbsp;archive.</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;*</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;@return&nbsp;void</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;*/</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;</span><span class="keyword">public&nbsp;function&nbsp;</span><span class="default">prefix</span><span class="keyword">(</span><span class="default">$prefix</span><span class="keyword">)</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;{</span><a name="line_258"></a></li><li id="line_259" class="odd"><span class="lineNumber">259&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;empty(</span><span class="default">$prefix</span><span class="keyword">)&nbsp;)&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;throw&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Command_Exception</span><span class="keyword">(</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;</span><span class="default">VersionControl_Hg_Command_Exception</span><span class="keyword">::</span><span class="default">BAD_ARGUMENT</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;</span><span class="string">"A&nbsp;prefix&nbsp;must&nbsp;not&nbsp;be&nbsp;empty&nbsp;if&nbsp;you&nbsp;use&nbsp;this&nbsp;function&nbsp;or</span><a name="line_262"></a></li><li id="line_263" class="odd"><span class="lineNumber">263&nbsp;</span><span class="string">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option.&nbsp;"</span><a name="line_263"></a></li><li id="line_264" class="even"><span class="lineNumber">264&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_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="default">$this</span><span class="keyword">-&gt;</span><span class="default">addOption</span><span class="keyword">(</span><span class="string">'prefix'</span><span class="keyword">,&nbsp;</span><span class="default">$prefix</span><span class="keyword">);</span><a name="line_267"></a></li><li id="line_268" class="even"><span class="lineNumber">268&nbsp;</span><a name="line_268"></a></li><li id="line_269" class="odd"><span class="lineNumber">269&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span class="default">$this</span><span class="keyword">;&nbsp;</span><span class="comment">//for&nbsp;the&nbsp;fluent&nbsp;API</span><a name="line_269"></a></li><li id="line_270" class="even"><span class="lineNumber">270&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span><a name="line_270"></a></li><li id="line_271" class="odd"><span class="lineNumber">271&nbsp;</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><span class="comment">/**</span><a name="line_272"></a></li><li id="line_273" class="odd"><span class="lineNumber">273&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Execute&nbsp;the&nbsp;command&nbsp;and&nbsp;return&nbsp;the&nbsp;results.</span><a name="line_273"></a></li><li id="line_274" class="even"><span class="lineNumber">274&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</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;@param&nbsp;mixed&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$params&nbsp;Options&nbsp;passed&nbsp;to&nbsp;the&nbsp;Log&nbsp;command</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;@param&nbsp;VersionControl_Hg&nbsp;$hg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Instance&nbsp;of&nbsp;the&nbsp;base&nbsp;object</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;*</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;@return&nbsp;string</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">execute</span><span class="keyword">(array&nbsp;</span><span class="default">$params&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">null</span><span class="keyword">,&nbsp;</span><span class="default">VersionControl_Hg&nbsp;$hg&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">null</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;take&nbsp;care&nbsp;of&nbsp;options&nbsp;passed&nbsp;in&nbsp;as&nbsp;such:</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;$hg-&gt;archive(array('revision'&nbsp;=&gt;&nbsp;'tip',&nbsp;'to'&nbsp;=&gt;&nbsp;realpath('../')));</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;&nbsp;*/</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;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if&nbsp;(&nbsp;!&nbsp;empty(</span><span class="default">$params</span><span class="keyword">)&nbsp;)&nbsp;{</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;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">setOptions</span><span class="keyword">(</span><span class="default">$params</span><span class="keyword">);</span><a name="line_286"></a></li><li id="line_287" class="odd"><span class="lineNumber">287&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_287"></a></li><li id="line_288" class="even"><span class="lineNumber">288&nbsp;</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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;--noninteractive&nbsp;is&nbsp;required&nbsp;since&nbsp;issuing&nbsp;the&nbsp;command&nbsp;is</span><a name="line_289"></a></li><li id="line_290" class="even"><span class="lineNumber">290&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;unattended&nbsp;by&nbsp;nature&nbsp;of&nbsp;using&nbsp;this&nbsp;package.</span><a name="line_290"></a></li><li id="line_291" class="odd"><span class="lineNumber">291&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;--repository&nbsp;PATH&nbsp;is&nbsp;required&nbsp;since&nbsp;the&nbsp;PWD&nbsp;on&nbsp;which&nbsp;hg&nbsp;is&nbsp;invoked</span><a name="line_291"></a></li><li id="line_292" class="even"><span class="lineNumber">292&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;will&nbsp;not&nbsp;be&nbsp;within&nbsp;the&nbsp;working&nbsp;copy&nbsp;of&nbsp;the&nbsp;repo.&nbsp;*/</span><a name="line_292"></a></li><li id="line_293" class="odd"><span class="lineNumber">293&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">addOptions</span><span class="keyword">(</span><a name="line_293"></a></li><li id="line_294" class="even"><span class="lineNumber">294&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(</span><a name="line_294"></a></li><li id="line_295" class="odd"><span class="lineNumber">295&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">'noninteractive'&nbsp;</span><span class="keyword">=&gt;&nbsp;</span><span class="default">null</span><span class="keyword">,</span><a name="line_295"></a></li><li id="line_296" class="even"><span class="lineNumber">296&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">'repository'&nbsp;</span><span class="keyword">=&gt;&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">getRepository</span><span class="keyword">()-&gt;</span><span class="default">getPath</span><span class="keyword">(),</span><a name="line_296"></a></li><li id="line_297" class="odd"><span class="lineNumber">297&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">'cwd'&nbsp;</span><span class="keyword">=&gt;&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">getRepository</span><span class="keyword">()-&gt;</span><span class="default">getPath</span><span class="keyword">(),</span><a name="line_297"></a></li><li id="line_298" class="even"><span class="lineNumber">298&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)</span><a name="line_298"></a></li><li id="line_299" class="odd"><span class="lineNumber">299&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);</span><a name="line_299"></a></li><li id="line_300" class="even"><span class="lineNumber">300&nbsp;</span><a name="line_300"></a></li><li id="line_301" class="odd"><span class="lineNumber">301&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;If&nbsp;files:&nbsp;destination&nbsp;must&nbsp;not&nbsp;already&nbsp;exist!&nbsp;Else,&nbsp;Hg&nbsp;will&nbsp;report</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;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;"Permission&nbsp;denied"</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;seems&nbsp;not&nbsp;to&nbsp;be&nbsp;the&nbsp;case&nbsp;anymore...at&nbsp;least&nbsp;with&nbsp;hg&nbsp;cli&nbsp;1.8.2.</span><a name="line_303"></a></li><li id="line_304" class="even"><span class="lineNumber">304&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*if&nbsp;(is_file($destination)&nbsp;||&nbsp;is_dir($destination)&nbsp;)&nbsp;{</span><a name="line_305"></a></li><li id="line_306" class="even"><span class="lineNumber">306&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;VersionControl_Hg_Repository_Command_Exception(</span><a name="line_306"></a></li><li id="line_307" class="odd"><span class="lineNumber">307&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;null,</span><a name="line_307"></a></li><li id="line_308" class="even"><span class="lineNumber">308&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'The&nbsp;destination&nbsp;directory&nbsp;already&nbsp;exists,&nbsp;but&nbsp;it&nbsp;should&nbsp;not'</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);</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;&nbsp;&nbsp;&nbsp;}*/</span><a name="line_310"></a></li><li id="line_311" class="odd"><span class="lineNumber">311&nbsp;</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;&nbsp;&nbsp;/*&nbsp;build&nbsp;the&nbsp;full&nbsp;path&nbsp;to&nbsp;the&nbsp;archive.</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;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Default&nbsp;name,&nbsp;hardcoded&nbsp;is:&nbsp;Test_Repository-r4.zip&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;&nbsp;&nbsp;</span><span class="default">$saved_to&nbsp;</span><span class="keyword">=&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">destination&nbsp;</span><span class="keyword">.</span><a name="line_314"></a></li><li id="line_315" class="odd"><span class="lineNumber">315&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">DIRECTORY_SEPARATOR&nbsp;</span><span class="keyword">.</span><a name="line_315"></a></li><li id="line_316" class="even"><span class="lineNumber">316&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="string">'%b-r%R.'&nbsp;</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">options</span><span class="keyword">[</span><span class="string">'type'</span><span class="keyword">];</span><a name="line_317"></a></li><li id="line_318" class="even"><span class="lineNumber">318&nbsp;</span><a name="line_318"></a></li><li id="line_319" class="odd"><span class="lineNumber">319&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">addOption</span><span class="keyword">(</span><span class="string">'files'</span><span class="keyword">,&nbsp;</span><span class="default">$saved_to</span><span class="keyword">);</span><a name="line_319"></a></li><li id="line_320" class="even"><span class="lineNumber">320&nbsp;</span><a name="line_320"></a></li><li id="line_321" class="odd"><span class="lineNumber">321&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;Despite&nbsp;its&nbsp;being&nbsp;so&nbsp;not&nbsp;variable,&nbsp;we&nbsp;need&nbsp;to&nbsp;set&nbsp;the&nbsp;command&nbsp;string</span><a name="line_321"></a></li><li id="line_322" class="even"><span class="lineNumber">322&nbsp;</span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;only&nbsp;after&nbsp;manually&nbsp;setting&nbsp;options&nbsp;and&nbsp;other&nbsp;command-specific&nbsp;data&nbsp;*/</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;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">setCommandString</span><span class="keyword">();</span><a name="line_323"></a></li><li id="line_324" class="even"><span class="lineNumber">324&nbsp;</span><a name="line_324"></a></li><li id="line_325" class="odd"><span class="lineNumber">325&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/*&nbsp;no&nbsp;var&nbsp;assignment,&nbsp;since&nbsp;2nd&nbsp;param&nbsp;holds&nbsp;output&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="default">exec</span><span class="keyword">(</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">command_string</span><span class="keyword">,&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">output</span><span class="keyword">,&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">status</span><span class="keyword">);</span><a name="line_326"></a></li><li id="line_327" class="odd"><span class="lineNumber">327&nbsp;</span><a name="line_327"></a></li><li id="line_328" class="even"><span class="lineNumber">328&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">status&nbsp;</span><span class="keyword">!==&nbsp;</span><span class="default">0&nbsp;</span><span class="keyword">)&nbsp;{</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;throw&nbsp;new&nbsp;</span><span class="default">VersionControl_Hg_Command_Exception</span><span class="keyword">(</span><a name="line_329"></a></li><li id="line_330" class="even"><span class="lineNumber">330&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_Command_Exception</span><span class="keyword">::</span><span class="default">COMMANDLINE_ERROR</span><a name="line_330"></a></li><li id="line_331" class="odd"><span class="lineNumber">331&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_331"></a></li><li id="line_332" class="even"><span class="lineNumber">332&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span class="default">$saved_to</span><span class="keyword">;</span><a name="line_334"></a></li><li id="line_335" class="odd"><span class="lineNumber">335&nbsp;</span><span class="keyword">&nbsp;&nbsp;&nbsp;&nbsp;}</span><a name="line_335"></a></li><li id="line_336" class="even"><span class="lineNumber">336&nbsp;</span><span class="keyword">}</span><span>
</span><a name="line_336"></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.