uTools-Manuals/docs/php/svn_log.html
2019-04-28 19:00:34 +08:00

256 lines
8.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Returns the commit log messages of a repository URL</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.svn-log" class="refentry">
<div class="refnamediv">
<h1 class="refname">svn_log</h1>
<p class="verinfo">(PECL svn &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">svn_log</span> &mdash; <span class="dc-title">Returns the commit log messages of a repository URL</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.svn-log-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>svn_log</strong></span>
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$repos_url</code></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$start_revision</code></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$end_revision</code></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$limit</code><span class="initializer"> = 0</span></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = SVN_DISCOVER_CHANGED_PATHS | SVN_STOP_ON_COPY</span></span>
]]]] ) : <span class="type">array</span></div>
<p class="para rdfs-comment">
<span class="function"><strong>svn_log()</strong></span> returns the complete history of the item at the repository URL
<code class="parameter">repos_url</code>, or the history of a specific revision
if <code class="parameter">start_revision</code> is set. This function is equivalent
to <strong class="userinput"><code>svn log --verbose -r $start_revision $repos_url</code></strong>.
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.svn-log-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">repos_url</code></dt>
<dd>
<p class="para">
Repository URL of the item to retrieve log history from.
</p>
</dd>
<dt>
<code class="parameter">start_revision</code></dt>
<dd>
<p class="para">
Revision number of the first log to retrieve. Use
<strong><code>SVN_REVISION_HEAD</code></strong> to retrieve the log from
the most recent revision.
</p>
</dd>
<dt>
<code class="parameter">end_revision</code></dt>
<dd>
<p class="para">
Revision number of the last log to retrieve. Defaults to
<code class="parameter">start_revision</code> if specified or to
<strong><code>SVN_REVISION_INITIAL</code></strong> otherwise.
</p>
</dd>
<dt>
<code class="parameter">limit</code></dt>
<dd>
<p class="para">
Number of logs to retrieve.
</p>
</dd>
<dt>
<code class="parameter">flags</code></dt>
<dd>
<p class="para">
Any combination of <strong><code>SVN_OMIT_MESSAGES</code></strong>,
<strong><code>SVN_DISCOVER_CHANGED_PATHS</code></strong> and
<strong><code>SVN_STOP_ON_COPY</code></strong>.
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.svn-log-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
On success, this function returns an array file listing in the format
of:
<div class="example-contents screen">
<div class="returnvaluescode"><pre class="returnvaluescode">[0] =&gt; Array, ordered most recent (highest) revision first
(
[rev] =&gt; integer revision number
[author] =&gt; string author name
[msg] =&gt; string log message
[date] =&gt; string date formatted per ISO 8601, i.e. date(&#039;c&#039;)
[paths] =&gt; Array, describing changed files
(
[0] =&gt; Array
(
[action] =&gt; string letter signifying change
[path] =&gt; absolute repository path of changed file
)
[1] =&gt; ...
)
)
[1] =&gt; ...</pre>
</div>
</div>
</p>
<blockquote class="note"><p><strong class="note">Note</strong>:
<p class="para">
The output will always be a numerically indexed array of arrays,
even when there are none or only one log message(s).
</p>
</p></blockquote>
<p class="para">
The value of <var class="varname"><var class="varname">action</var></var> is a subset of the
<a href="http://svnbook.red_bean.com/en/1.2/svn.ref.svn.c.status.html" class="link external">&raquo;&nbsp;status output
in the first column</a>, where possible values are:
</p>
<table class="doctable table">
<caption><strong>Actions</strong></caption>
<thead>
<tr>
<th>Letter</th>
<th>Description</th>
</tr>
</thead>
<tbody class="tbody">
<tr>
<td>M</td>
<td>Item/props was modified</td>
</tr>
<tr>
<td>A</td>
<td>Item was added</td>
</tr>
<tr>
<td>D</td>
<td>Item was deleted</td>
</tr>
<tr>
<td>R</td>
<td>Item was replaced</td>
</tr>
</tbody>
</table>
<p class="para">
If no changes were made to the item, an empty array is returned.
</p>
</div>
<div class="refsect1 notes" id="refsect1-function.svn-log-notes">
<h3 class="title">注释</h3>
<div class="warning"><strong class="warning">Warning</strong><p class="simpara">此函数是<em class="emphasis">实验性</em>的。此函数的表象,包括名称及其相关文档都可能在未来的
PHP 发布版本中未通知就被修改。使用本函数风险自担 。</p></div>
</div>
<div class="refsect1 examples" id="refsect1-function.svn-log-examples">
<h3 class="title">范例</h3>
<p class="para">
<div class="example" id="example-5674">
<p><strong>Example #1 <span class="function"><strong>svn_log()</strong></span> example</strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">svn_log</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://www.example.com/'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">23</span><span style="color: #007700">)&nbsp;);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
<div class="example-contents"><p>以上例程的输出类似于:</p></div>
<div class="example-contents screen">
<div class="cdata"><pre>
Array
(
[0] =&gt; Array
(
[rev] =&gt; 23
[author] =&gt; &#039;joe&#039;
[msg] =&gt; &#039;Add cheese and salami to our sandwich.&#039;
[date] =&gt; &#039;2007-04-06T16:00:27-04:00&#039;
[paths] =&gt; Array
(
[0] =&gt; Array
(
[action] =&gt; &#039;M&#039;
[path] =&gt; &#039;/sandwich.txt&#039;
)
)
)
)
</pre></div>
</div>
</div>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.svn-log-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member">
<a href="http://svnbook.red_bean.com/en/1.2/svn.ref.svn.c.log.html" class="link external">&raquo;&nbsp;
SVN documentation on svn log
</a>
</li>
</ul>
</p>
</div>
</div></div></div></body></html>