[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] issue #2505: Add FAQ entry: Why doesn't svn switch work in some cases?

From: James Coleman <jamesc_at_dspsrv.com>
Date: 2007-07-16 12:08:40 CEST

David Glasser wrote:
> On 7/13/07, James Coleman <jamesc@dspsrv.com> wrote:
>> 2. Two other tiny errors in faq (internal links):
>> entry in FAQ TOC for #broken-subclipse was missing (nxt to new svn
>> switch entry).
>> and found a href to #moderated that should be #moderation
>> I'm VERY sorry for including them in this patch but they really
>> are tiny! :-7
>
> Can you send these separately (and with a log message)? As you said,
> they're tiny, so we'd rather just apply them immediately instead of
> having to wait on making sure that the explanation of the complicated
> problem is ready to commit.
>
> --dave
>
>

Way to go me. :(
No patch and then disappear :(
Thank you all for bearing with me and being very kind! :)

Thank you very much Karl! Sorry you had to extract it.
I see the patch is applied with corrections. Very happy it looks nice :)
Original patch attached here for reference.

James

Index: www/faq.html
===================================================================
--- www/faq.html (revision 25731)
+++ www/faq.html (working copy)
@@ -142,6 +142,7 @@
 
 <h4>Troubleshooting:</h4>
 <ul>
+
 <li><a href="#stuck-bdb-repos">My repository seems to get stuck all the
     time, giving me errors about needing recovery (DB_RUNRECOVERY).
     What could be the cause?</a></li>
@@ -239,6 +240,10 @@
     operations involving a lot of data over SSL, I get the error
     <tt>SSL negotiation failed: SSL error: decryption failed or bad
     record mac</tt>.</a></li>
+<li><a href="#broken-subclipse">I get an error that says "This client is too
+ old".</li>
+<li><a href="#svn-switch-problem">Why doesn't svn switch work in some cases?
+ </li>
 </ul>
 
 <h4>Developer questions:</h4>
@@ -602,7 +607,7 @@
        Subversion Users mailing list</a> (<a
        href="mailto:users@subversion.tigris.org"
>users@subversion.tigris.org</a>)
- &mdash; note that the list is moderated, so
+ &mdash; note that the list is moderated, so
        there may be a delay before your post shows up</li>
   <li><a href="http://svn.haxx.se/users/">The Subversion Users list
        archives</a></li>
@@ -3381,11 +3386,8 @@
 an older version (or possibly upgrading to a newer version) is known
 to fix this issue.</p>
 
-
 </div>
 
-</div>
-
 <div class="h3" id="broken-subclipse" title="broken-subclipse">
 <h3>I get an error that says "This client is too old".</h3>
 
@@ -3409,6 +3411,147 @@
 
 </div>
 
+
+<div class="h3" id="svn-switch-problem" title="svn-switch-problem">
+<h3>Why doesn't svn switch work in some cases?</h3>
+
+<p>In some cases where there are unversioned (and maybe ignored) items in the
+working copy then you can get an error. The switch stops leaving the working
+copy half switched.</p>
+
+<p>If you take to wrong corrective action you can end up with
+an unusable working copy.
+Sometimes with these situations user is directed to do svn cleanup.
+But the svn cleanup may also encounter an error.
+See <a href=http://subversion.tigris.org/issues/show_bug.cgi?id=2505>issue 2505</a>.
+</p>
+
+<p>The user can manually remove the dirs or files causing problem and then
+cleanup and continue the switch to recover from this situation.</p>
+
+<p>A switch from a <i>pristine</i> clean checkout always works without error.
+There are three ways of working if you are using svn switch as part of your
+development process:
+
+<ol>
+
+<li>Fully clean your working copy of unversioned (including ignored) files before
+switch. <br><b>WARNING! This deletes all unversioned dirs/files.
+Be VERY sure that you do not need anything that will be removed.</b>
+
+<blockquote>
+<div><code><pre>
+# Check and delete svn unversioned files:
+svn status --no-ignore | grep "^[I?]" | sed 's/^[I?]//'
+svn status --no-ignore | grep "^[I?]" | sed 's/^[I?]//' |xargs rm -rf
+</pre></code></div>
+</blockquote>
+
+</li>
+
+<li>Keep a <i>pristine</i> clean checkout. Update that then copy it and switch in
+the copy when a switch to another branch is desired.</li>
+
+<li>Live dangerously :).
+ Switch between branches without cleaning up BUT if you encounter a switch error
+ know that you have to recover from this properly.
+ Delete the unversioned files and the directory that the error was reported on.
+ Then "svn cleanup" if needed and then resume the switch.
+ Unless you do delete all unversioned files you may have to repeat this
+ process multiple times.</li>
+
+</ol>
+
+</p>
+
+<p>Some examples are detailed here in
+<a href=http://subversion.tigris.org/issues/show_bug.cgi?id=2505>issue 2505</a>.
+The problem is that the svn client plays it
+safe and doesn't want to delete anything unversioned.
+</p>
+
+<p>Two specific examples are detailed here to illustrate a problem like this.
+There are also other svn switch errors nt covered here which the policy of
+switching only from a <i>pristine</i> clean checkout solves.
+
+<ol>
+
+<li>If any directory has been moved or renamed between the branches then
+anything unversioned will cause a problem.
+In this case this error will be seen:
+<br>
+<blockquote>
+<div><code><pre>
+wc/$ svn switch $SVNROOT/$project/branches/$ticket-xxx
+svn: Won't delete locally modified directory '&lt;dir&gt;'
+svn: Left locally modified or unversioned files
+</pre></code></div>
+</blockquote>
+<p>Removing all unversioned files and continuing the switch will recover from this.</p>
+</li>
+
+<li>If a temporary build file has ever been added and removed then a switch
+in a repository with that unversioned file (likely after a build) fails.
+Same error will be seen:
+<br>
+<blockquote>
+<div><code><pre>
+wc/$ svn switch $SVNROOT/$project/branches/$ticket-xxx
+svn: Won't delete locally modified directory '&lt;dir&gt;'
+svn: Left locally modified or unversioned files
+</pre></code></div>
+</blockquote>
+<p>In this case just removing the unversioned items will not recover.
+A cleanup fails but svnswitch directs user to do svn cleanup.
+<br>
+<blockquote>
+<div><code><pre>
+wc/$ svn switch $SVNROOT/$project/branches/$ticket-xxx
+svn: Directory '&lt;dir&gt;/.svn' containing working copy admin area is missing
+wc/$ svn cleanup
+svn: '&lt;dir&gt;' is not a working copy directory
+wc/$ svn switch $SVNROOT/$project/branches/$ticket-xxx
+svn: Working copy '.' locked
+svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
+</pre></code></div>
+</blockquote>
+</p>
+<p>Removing the directory (and all other unversioned files to prevent
+ switch breaking on a similar error repeatedly) and continuing the switch
+ will recover from this.</p>
+</li>
+
+</ol>
+
+<p>The TortoiseSVN cleanup error is a bit different, you might encounter this:
+<blockquote>
+<div><code><pre>
+Subversion reported an error while doing a cleanup!
+&lt;dir&gt;/&lt;anotherdir&gt; is not a working copy directory
+</pre></code></div>
+</blockquote>
+</p>
+
+<p>In each case here the svn switch breaks leaving user with a half-switched
+working copy. Items are marked in status with S for switched items (dirrerent
+ from top directory), ! for dirs with problem and ~ for the files that are
+ the problem (and with maybe L for locked). Like this:
+<blockquote>
+<div><code><pre>
+wc/$ svn status
+! .
+! &lt;dir&gt;
+ S &lt;switched_things&gt;
+~ &lt;dir&gt;/&lt;thing_that_is_now_unversioned&gt;
+</pre></code></div>
+</blockquote>
+</p>
+
+</div>
+
+</div>
+
+
 <div class="h2" id="developer-questions" title="developer-questions">
 <h2>Developer questions:</h2>
 <p/>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 16 12:06:57 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.