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

Re: Commit fails with path not found

From: David Weintraub <qazwart_at_gmail.com>
Date: Mon, 10 Jan 2011 10:01:27 -0500

It looks like you deleted the target directories, but you didn't do an "svn
update". I can see that because "svn status" is putting "!" in front of the
target directories.

Your next step is to do an "svn update" which will recreate the "target"
directories, but as directories Subversion is tracking (they'll have the
.svn directory in them.

Once that is done, you should simply see files with "?" in front of them and
no more "!" or "~". Then, you should be able to commit -- at least from the
command line via "svn commit".

Once you've done the commit, we have your working directory and the
Subversion server more or less in agreement. We can finally clean up the
rest of the mess:

*STEP #1*: Using the "svn delete" command from the command line, delete the
target directories. That will remove them from the Subversion repository.
You can never, ever have Maven "target" directories in your Subversion
repository. This confuses the heck out of Subversion.

*STEP #2*: Once you've removed these target directories, do another "svn
commit". Those "target" directories are no longer in your Subversion
repository.

*STEP #3*: Once we've cleaned up the "target" directory mess, you can take
care of all those directories in your "svn status" that show a "?". These
directories look like source directories, but aren't in your Subversion
repository. If you need them in Subversion, use an "svn add" to add them in.

*STEP #4*: Do another "svn status". You shouldn't be getting any lines that
start with "~" or "!" or "?". The only lines you should be getting start
with "A" which means you've added the missing directories to your Subversion
repository.

*STEP #5*: Do another "svn commit". You've at last cleaned everything up.
All "target" directories that caused problems are now gone. All missing
source directories and files are now in Subversion. In theory, someone
should now be able to checkout the project and do a build.

*OPTIONAL, BUT HIGHLY RECOMMENDED STEP #6*: Now that everything is cleaned
up, it'll be nice if we could keep it this way. There are two things you can
do:

   1. Add the property "svn:ignore=target" to the directories where "target"
   directories are built. This will help prevent someone from accidentally
   adding these "target" directories back into your Subversion repository. They
   won't show up as new, but missing Subversion elements in status reports, and
   if you do a massive add, they won't get added. It is still possible for
   someone to purposefully add them back into your Subversion repository.
   2. If you have such a pre-commit trigger, set it so you can't add
   directories called "target" to your Subversion repository.

Once you've completed all of these steps, I recommend that you delete the
project in Eclipse and recheck it out, and make sure you can build it and
everything works.

-- 
David Weintraub
qazwart_at_gmail.com
Received on 2011-01-10 16:05:08 CET

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

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