<p>I've somehow managed to get an SVN repository into a bad state. I've moved a directory and now I can't commit it in its new location.</p>

<p>As far as <code>svn status</code> is concerned, the directory is unknown (the name of the directory is <code>type</code>).</p>

<pre>
$ svn status
?      type
</pre>

<p>When I try to add the directory, the server says it already exists.</p>

<pre>
$ svn add type
svn: warning: 'type' is already under version control
</pre>

<p>If I try to update the directory, it's gone again.</p>

<pre>
$ svn update type
svn: '.' is not under version control
</pre>

<p>If I try to commit it, the server complains that it's old parent directory no longer exists.</p>

<pre>
$ svn commit type -m "Moving type"
svn: Commit failed (details follow):
svn: '/prior/trunk/src/nyu/prior/cvc3/theorem_prover/expression' path not found
</pre>

<p>To add to the mystery, the contents of the directory are marked as modified.</p>

<pre>
$ svn status type
A  +   type
M  +   type/IntegerType.java
M  +   type/BooleanType.java
M  +   type/Type.java
M  +   type/RationalRangeType.java
M  +   type/RationalType.java
M  +   type/IntegerRangeType.java
</pre>

<p>If I try to update from within the directory, I get this.</p>

<pre>
$ cd type
$ svn update
svn: Two top-level reports with no target
</pre>

<p>Committing from within the directory gives the same <code>path not found</code> error as above.</p>

<p>What's going on and how do I fix it?</p>

<p>EDIT: @Rob Oxspring caught me out: I got too aggressive moving things around in Eclipse.</p>

<p>UPDATE: I'm accepting @Rob Oxspring's answer of "don't do that/just start over" and taking his advice. I'd still be interested if anybody could tell me: (a) what the above error messages <em>mean</em> precisely and (b) how to actually <em>fix</em> the problem.</p>

[{'answer_id': 47030, 'author': 'crashmstr', 'author_id': 1441, 'author_profile': 'https://Stackoverflow.com/users/1441', 'pm_score': 2, 'selected': False, 'text': '<p>Did you start by just copying/moving the directory with OS commands, or did you start with SVN stuff? If you just copied the files via the OS, you would still have hidden folders containing SVN information pointing to the old location.</p>\n'}, {'answer_id': 47042, 'author': 'BCS', 'author_id': 1343, 'author_profile': 'https://Stackoverflow.com/users/1343', 'pm_score': 3, 'selected': False, 'text': '<p>The easy way to fix many SVN errors is to move the whole directory away via the OS, update to get another clean copy of it and then merge in anything you changed with some other tool, WinMerge or the like.</p>\n\n<p>After that, you can do whatever you were trying to do, but do it correctly :).</p>\n'}, {'answer_id': 47051, 'author': 'Andreas Kraft', 'author_id': 4799, 'author_profile': 'https://Stackoverflow.com/users/4799', 'pm_score': 0, 'selected': False, 'text': '<p>My experience is that sometimes the local copy gets out of sync with the repository. I usually solve this by going up the local directory tree, starting from the directory with the problem and try to do do cleanup and update with each step.</p>\n'}, {'answer_id': 47098, 'author': 'Rob Oxspring', 'author_id': 1867, 'author_profile': 'https://Stackoverflow.com/users/1867', 'pm_score': 5, 'selected': True, 'text': "<p>It looks to me like <code>type</code> was created by some Subversion-aware copy command, then moved into the current directory using a Subversion-unaware copy.  In my experience, this sort of thing typically occurs when package refactoring operations have been chained together in Eclipse without commits in between.  Typically, Subversion doesn't handle it well when you copy/move a locally copied/moved file or folder, although I think version 1.5 may handle it better.</p>\n\n<p>To avoid this in the future, commit between such steps.  If you'd like to hide the intervening commits then I'd recommend doing the multi-step refactoring on a branch and then merging the changes back into the mainline in that single commit you were after.</p>\n\n<p>If it's not too much work, then I'd recommend getting back to a clean working copy and redoing your changes, committing after each step.  If you're happy to lose the history, i.e. allowing the new <code>IntegerType.java</code> to not be linked at all to the old <code>IntegerType.java</code>, then you could take the approach suggested by BCS:</p>\n\n<ul>\n<li>Move your changed files into some temporary location, stripping out any <code>.svn</code> directories</li>\n<li>Update your working copy into a clean working state</li>\n<li>Copy your changes back to where you want them to be</li>\n<li>Commit the resulting working copy</li>\n</ul>\n"}, {'answer_id': 47185, 'author': 'Matt Sheppard', 'author_id': 797, 'author_profile': 'https://Stackoverflow.com/users/797', 'pm_score': 1, 'selected': False, 'text': "<p>I'd suggest, to delete (outside subversionso with rm or similar), the directory above test, and then running svn update there.</p>\n\n<p>That is, if you don't want to get a whole new working copy as others have suggested, which might be the safest approach.</p>\n"}, {'answer_id': 1891622, 'author': 'déo', 'author_id': 102550, 'author_profile': 'https://Stackoverflow.com/users/102550', 'pm_score': 0, 'selected': False, 'text': "<p>What happened is that you made a checkout of a folder, then locally 'svn add'ed and/or modified something to/in this folder, but before you have committed your changes, the original folder was moved (or deleted) from the SVN repository.</p>\n\n<p>All you need to do is to switch your current checkout to the new location in the SVN repository. So, supposing you have a checkout of the foo folder from path/to/folder1/foo, and that foo was moved to path/to/foo, you just need to run:</p>\n\n<pre><code>$ svn switch path/to/foo\n</code></pre>\n\n<p>That's it... ;-)</p>\n"}, {'answer_id': 6645011, 'author': 'BlueRaja - Danny Pflughoeft', 'author_id': 238419, 'author_profile': 'https://Stackoverflow.com/users/238419', 'pm_score': 1, 'selected': False, 'text': '<p>I just had this same problem.  I fixed it by deleting the <code>.svn</code> folder from the affected folder.</p>\n'}]
['https://Stackoverflow.com/questions/47022', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1412/']