-
Notifications
You must be signed in to change notification settings - Fork 50
/
svn-diff.xml
251 lines (240 loc) · 7 KB
/
svn-diff.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: e41806c30bf6975e452c0d4ce35ab0984c2fa68c Maintainer: regiemix Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.svn-diff" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>svn_diff</refname>
<refpurpose>Compara dos rutas de acceso recursivamente</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>svn_diff</methodname>
<methodparam><type>string</type><parameter>path1</parameter></methodparam>
<methodparam><type>int</type><parameter>rev1</parameter></methodparam>
<methodparam><type>string</type><parameter>path2</parameter></methodparam>
<methodparam><type>int</type><parameter>rev2</parameter></methodparam>
</methodsynopsis>
<para>
Compara dos rutas de acceso recursivamente, <parameter>path1</parameter> y
<parameter>path2</parameter>.
</para>
<note>
<para>
No es una utilidad general de comparación. Únicamente se pueden comparar
ficheros locales que estan versionados: los otros ficheros fallarán.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>path1</parameter></term>
<listitem>
<para>
La primera ruta de acceso a comparar. Puede ser una URL a un fichero/directorio en un repositorio
SVN o una ruta de acceso a un fichero/directorio local.
</para>
&svn.relativepath;
<warning>
<simpara>
Si la ruta de acceso a un fichero local únicamente tiene el caracter de barra invertida '\' y no la barra '/',
esta extensión no podrá encontrar la ruta de acceso. Se debe
reemplazar siempre la barra invertida '\' con la barra '/' cuando se utilice esta
función.
</simpara>
</warning>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>rev1</parameter></term>
<listitem>
<para>
Número de revisión de la primera ruta de acceso. Utilizar <constant>SVN_REVISION_HEAD</constant>
para especificar la versión más reciente.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>path2</parameter></term>
<listitem>
<para>
Segunda ruta de acceso a comparar. Ver <parameter>path1</parameter>para descripción.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>rev2</parameter></term>
<listitem>
<para>
Número de revisión de la segunda ruta de acceso. Ver <parameter>rev1</parameter>
para descripción.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Devuelve un array consistente en dos flujos: el primero es la salida de la comparación
y el segundo contiene el flujo de salida de error. El flujo se puede
leer utilizando <function>fread</function>. Devuelve &false; o &null; en
caso de error.
</para>
<para>
Por defecto, la salida de la comparación tendrá el formato Subversión
de cliente unificado, pero un
<link xlink:href="&url.svn.manual.externaldifftools;"> motor externo
de comparativa</link> puede ser
utilizado dependiendo de la configuración de la Subversión.
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&warn.experimental.func;
</refsect1>
<!-- Use when ERRORS exist
<refsect1 role="errors">
&reftitle.errors;
<para>
When does this function throw E_* level errors, or exceptions?
</para>
</refsect1>
-->
<!-- Use when a CHANGELOG exists
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>Enter the PHP version of change here</entry>
<entry>Description of change</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
-->
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Ejemplo básico</title>
<para>
Este ejemplo demuestra el uso básico de esta función, y
la obtención de contenidos del flujo:
</para>
<programlisting role="php">
<![CDATA[
<?php
list($diff, $errors) = svn_diff(
'http://www.example.com/svnroot/trunk/foo', SVN_REVISION_HEAD,
'http://www.example.com/svnroot/branches/dev/foo', SVN_REVISION_HEAD
);
if (!$diff) exit;
$contents = '';
while (!feof($diff)) {
$contents .= fread($diff, 8192);
}
fclose($diff);
fclose($errors);
var_dump($contents);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Index: http://www.example.com/svnroot/trunk/foo
===================================================================
--- http://www.example.com/svnroot/trunk/foo (.../foo) (revision 23)
+++ http://www.example.com/svnroot/branches/dev/foo (.../foo) (revision 27)
// further diff output
]]>
</screen>
</example>
</para>
<para>
<example>
<title>Comparando dos revisiones de una ruta de acceso a repositorio</title>
<para>
Este ejemplo implementa una función de envoltorio que permite a un usuario
comparar fácilmente dos revisiones del mismo elemento utilizando un camino de acceso
externo al repositorio (la sintaxis por defecto es detallada):
</para>
<programlisting role="php">
<![CDATA[
<?php
function svn_diff_same_item($path, $rev1, $rev2) {
return svn_diff($path, $rev1, $path, $rev2);
}
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Comparativa portable de dos ficheros locales</title>
<para>
Este ejemplo implementa una función envoltorio que compara de forma
portable dos ficheros locales, compensando el problema <function>realpath</function>
y el de las barras invertidas '\':
</para>
<programlisting role="php">
<![CDATA[
<?php
function svn_diff_local($path1, $rev1, $path2, $rev2) {
$path1 = str_replace('\\', '/', realpath($path1));
$path2 = str_replace('\\', '/', realpath($path2));
return svn_diff($path1, $rev1, $path2, $rev2);
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><link xlink:href="&url.svn.manual.diff;">documentación SVN bajo el comando "svn diff"</link></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->