[svnbook commit] r3099 - trunk/src/en/book

fitz noreply at red-bean.com
Tue Jun 3 01:56:15 CDT 2008


Author: fitz
Date: Tue Jun  3 01:56:14 2008
New Revision: 3099

Log:
Document xml output of, blame, diff, info, list, log, propget,
proplist, and status commands by providing a nice example for each.

This fixes r102.

* book/ch09-reference.xml: Xml examples.


Modified:
   trunk/src/en/book/ch09-reference.xml

Modified: trunk/src/en/book/ch09-reference.xml
==============================================================================
--- trunk/src/en/book/ch09-reference.xml	(original)
+++ trunk/src/en/book/ch09-reference.xml	Tue Jun  3 01:56:14 2008
@@ -869,7 +869,7 @@
         </refsect1>
 
         <refsect1>
-          <title>Example</title>
+          <title>Examples</title>
 
           <para>If you want to see blame annotated source for
             <filename>readme.txt</filename> in your test
@@ -887,6 +887,37 @@
             the <emphasis>context</emphasis> of the line—he may
             have just adjusted the whitespace.
           </para>
+
+          <para>If you use the <option>--xml</option> option, you can
+            get xml output describing the blame annotations, but not
+            the contents of the lines themselves:</para>
+
+          <screen>
+$ svn blame --xml http://svn.red-bean.com/repos/test/readme.txt
+<?xml version="1.0"?>
+<blame>
+<target
+   path="sandwich.txt">
+<entry
+   line-number="1">
+<commit
+   revision="3">
+<author>sally</author>
+<date>2008-05-25T19:12:31.428953Z</date>
+</commit>
+</entry>
+<entry
+   line-number="2">
+<commit
+   revision="5">
+<author>harry</author>
+<date>2008-05-29T03:26:12.293121Z</date>
+</commit>
+</entry>
+</target>
+</blame>
+</screen>
+
         </refsect1>
       </refentry>
 
@@ -2068,7 +2099,33 @@
 > This is a test
 > 
 </screen>
-          
+
+          <para>Lastly, you can use the <option>--xml</option> option
+            along with the <option>--summarize</option> option to view
+            xml describing the changes that occurred between
+            revisions, but not the contents of the diff itself:</para>
+          
+          <screen>
+$ svn diff --summarize --xml http://svn.red-bean.com/repos/test@r2 http://svn.red-bean.com/repos/test
+<?xml version="1.0"?>
+<diff>
+<paths>
+<path
+   props="none"
+   kind="file"
+   item="modified"&gt;http://svn.red-bean.com/repos/test/sandwich.txt&lt;/path&gt;
+<path
+   props="none"
+   kind="file"
+   item="deleted"&gt;http://svn.red-bean.com/repos/test/burrito.txt&lt;/path&gt;
+<path
+   props="none"
+   kind="dir"
+   item="added"&gt;http://svn.red-bean.com/repos/test/snacks&lt;/path&gt;
+</paths>
+</diff>
+</screen>
+
         </refsect1>
       </refentry>
 
@@ -2510,8 +2567,36 @@
 My test lock comment
 </screen>
 
+           <para>Lastly, <command>svn info</command> output is
+             available in xml format by passing
+             the<option>--xml</option> option:</para>
+
+           <screen>
+$ svn info --xml http://svn.red-bean.com/repos/test
+<?xml version="1.0"?>
+<info>
+<entry
+   kind="dir"
+   path="."
+   revision="1">
+<url>http://svn.red-bean.com/repos/test</url>
+<repository>
+<root>http://svn.red-bean.com/repos/test</root>
+<uuid>5e7d134a-54fb-0310-bd04-b611643e5c25</uuid>
+</repository>
+<wc-info>
+<schedule>normal</schedule>
+<depth>infinity</depth>
+</wc-info>
+<commit
+   revision="1">
+<author>sally</author>
+<date>2003-01-15T23:35:12.847647Z</date>
+</commit>
+</entry>
+</info>
+</screen>
 
-          
         </refsect1>
       </refentry>
 
@@ -2629,6 +2714,30 @@
      24 harry               Jan 18 11:27 examples/
 </screen>
 
+          <para>You can also get <command>svn list</command> output in
+            xml format with the <option>--xml</option> option:</para>
+
+          <screen>
+$ svn list --xml http://svn.red-bean.com/repos/test
+<?xml version="1.0"?>
+<lists>
+<list
+   path="http://svn.red-bean.com/repos/test">
+<entry
+   kind="dir">
+<name>examples</name>
+<size>0</size>
+<commit
+   revision="24">
+<author>harry</author>
+<date>2008-01-18T06:35:53.048870Z</date>
+</commit>
+</entry>
+...
+</list>
+</lists>
+</screen>
+
           <para>For further details, see the earlier section <xref
             linkend="svn.tour.history.browsing.list"/>.</para>
 
@@ -3011,7 +3120,17 @@
 
           <para>The <option>--incremental</option> option provides
             similar output control when using the
-            <option>--xml</option> option.</para>
+            <option>--xml</option> option:</para>
+
+          <screen>
+$ svn log --xml --incremental -r 1 sandwich.txt
+<logentry
+   revision="1">
+<author>harry</author>
+<date>2008-06-03T06:35:53.048870Z</date>
+<msg>Initial Import.</msg>
+</logentry>
+</screen>
 
           <tip>
             <para>If you run <command>svn log</command> on a specific
@@ -3728,6 +3847,23 @@
 $ svn propget svn:log --revprop -r 20 
 Began journal.
 </screen>
+
+          <para>Lastly, you can get <command>svn propget</command>
+            output in xml format with the <option>--xml</option>
+            option:</para>
+
+          <screen>
+$ svn propget --xml svn:ignore .
+<?xml version="1.0"?>
+<properties>
+<target
+   path="">
+<property
+   name="svn:ignore">*.o
+</property>
+</target>
+</properties>
+</screen>
           
         </refsect1>
       </refentry>
@@ -3819,6 +3955,22 @@
   svn:keywords : Author Date Rev
   owner : sally
 </screen>
+
+          <para>Lastly, you can get <command>svn proplist</command>
+            output in xml format with the <option>--xml</option>
+            option:</para>
+
+          <screen>
+$ svn proplist --xml 
+<?xml version="1.0"?>
+<properties>
+<target
+   path=".">
+<property
+   name="svn:ignore"/>
+</target>
+</properties>
+</screen>
           
         </refsect1>
       </refentry>
@@ -4508,6 +4660,8 @@
 --depth ARG
 --quiet (-q)
 --no-ignore
+--incremental
+--xml
 --username USER
 --password PASS
 --no-auth-cache
@@ -4571,6 +4725,41 @@
 Head revision:   981
 </screen>
 
+          <para>Lastly, you can get <command>svn status</command>
+            output in xml format with the <option>--xml</option>
+            option:</para>
+
+          <screen>
+$ svn status --xml wc
+<?xml version="1.0"?>
+<status>
+<target
+   path="wc">
+<entry
+   path="qax.c">
+<wc-status
+   props="none"
+   item="added"
+   revision="0">
+</wc-status>
+</entry>
+<entry
+   path="bar.c">
+<wc-status
+   props="normal"
+   item="modified"
+   revision="965">
+<commit
+   revision="965">
+<author>sally</author>
+<date>2008-05-28T06:35:53.048870Z</date>
+</commit>
+</wc-status>
+</entry>
+</target>
+</status>
+</screen>
+
           <para>For many more examples of <command>svn status</command>,
             see <xref linkend="svn.tour.cycle.examine.status"/>.</para>
 




More information about the svnbook-dev mailing list