[svnbook] r3906 committed - Finish issue #28 ("svn checkout --force' option and E code not...
svnbook at googlecode.com
svnbook at googlecode.com
Tue Jul 12 11:11:43 CDT 2011
Revision: 3906
Author: cmpilato at gmail.com
Date: Tue Jul 12 09:10:29 2011
Log: Finish issue #28 ("svn checkout --force' option and E code not
explained").
(There might still be places elsewhere in the book which need
adjusting to reflect this functionality, but hopefully those will be
caught in the forthcoming book read-thru.)
* src/en/book/ch09-reference.xml
(svn.ref.svn.c.checkout): Document 'svn checkout --force'.
http://code.google.com/p/svnbook/source/detail?r=3906
Modified:
/trunk/src/en/book/ch09-reference.xml
=======================================
--- /trunk/src/en/book/ch09-reference.xml Mon Jul 11 09:05:11 2011
+++ /trunk/src/en/book/ch09-reference.xml Tue Jul 12 09:10:29 2011
@@ -1342,6 +1342,94 @@
</screen>
</informalexample>
+ <para>Subversion will complain by default if you try to
+ check out a directory atop an existing directory which
+ contains files or subdirectories that the checkout itself
+ would have created. Use the <option>--force</option>
+ option to override this safeguard. When you check out
+ with the <option>--force</option> option, any unversioned
+ file in the checkout target tree which ordinarily would
+ obstruct the checkout will still become versioned, but
+ Subversion will preserve its contents as-is. If those
+ contents differ from the repository file at that path
+ (which was downloaded as part of the checkout), the file
+ will appear to have local modifications—the changes
+ required to transform the versioned file you checked out
+ into the unversioned file you had before checking
+ out—when the checkout completes.</para>
+
+ <informalexample>
+ <screen>
+$ mkdir project
+$ mkdir project/lib
+$ touch project/lib/file.c
+$ svn checkout file:///var/svn/repos/project/trunk project
+svn: Failed to add directory 'project/lib': an unversioned directory of
the same name already exists
+$ svn checkout file:///var/svn/repos/project/trunk project --force
+E project/lib
+A project/lib/subdir
+E project/lib/file.c
+A project/lib/anotherfile.c
+A project/include/header.h
+Checked out revision 21.
+$ svn st wc
+M project/lib/file.c
+$ svn diff wc
+Index: project/lib/file.c
+===================================================================
+--- project/lib/file.c (revision 1)
++++ project/lib/file.c (working copy)
+@@ -3 +0,0 @@
+-/* file.c: Code for acting file-ishly. */
+-#include <stdio.h>
+-/* Not feeling particularly creative today. */
+
+$
+</screen>
+ </informalexample>
+
+ <para>As in another other working copy, you have the choices
+ typically available: reverting some or all of those
+ local <quote>modifications</quote>, committing them, or
+ continuing to modify your working copy.</para>
+
+ <para>This feature is especially useful for performing
+ in-place imports of unversioned directory trees. By first
+ importing the tree into the repository, and then checking
+ out new repository location atop the unversioned tree with
+ the <option>--force</option> option, you effectively
+ transform the unversioned tree into a working
+ copy.</para>
+
+ <informalexample>
+ <screen>
+$ svn mkdir -m "Create newproject project root." \
+ file://var/svn/repos/newproject
+$ svn import -m "Import initial newproject codebase." newproject \
+ file://var/svn/repos/newproject/trunk
+Adding newproject/include
+Adding newproject/include/newproject.h
+Adding newproject/lib
+Adding newproject/lib/helpers.c
+Adding newproject/lib/base.c
+Adding newproject/notes
+Adding newproject/notes/README
+
+Committed revision 22.
+$ svn co file://`pwd`/repos-1.6/newproject/trunk newproject --force
+E newproject/include
+E newproject/include/newproject.h
+E newproject/lib
+E newproject/lib/helpers.c
+E newproject/lib/base.c
+E newproject/notes
+E newproject/notes/README
+Checked out revision 2.
+$ svn st newproject
+$
+</screen>
+ </informalexample>
+
</refsect1>
</refentry>
More information about the svnbook-dev
mailing list