I've posed this warning on Apple's internal svn mailing list and a few
folks have suggested I file it as a bug. It seems policy is to bring
it up in this forum first. I've searched through the bugs and the
~950 matches on "switch" on this list and haven't heard mention of the
In very short summary, if you inadvertently switch a subdirectory to a
branch/tag/head of the root level, it will DELETE all files in the
subdirectory, INCLUDING locally modified files.
A concrete example:
[myproject/Subdirectory/Files]% svn stat
[myproject/Subdirectory/Files]% svn switch https://svnserver/myproject/trunk
A //// the entire trunk's directory structure...
I understand that what I should have done was this:
[myproject/Subdirectory/Files]% svn switch https://svnserver/myproject/trunk/Subdirectory/Files
That said, svn has enough information to know that switching to a new
working copy rooted in the current directory is not the right thing.
It should have warned, saying something like "This directory does not
correspond to https://svnserver/myproject/trunk".
At the very least, it shouldn't be deleting files with modifications!
Thankfully, I still had these open in an editor so I was able to save
them to a new location, but otherwise, I would have lost all my local
On Apr 22, 2008, at 11:54 AM, Matt Ackeret wrote:
> write up a bug?
On Apr 22, 2008, at 3:24 PM, Stephen Davis wrote:
> If you switch to something with the same hierarchical layout, then
> svn switch won't touch your modified files. Unfortunately, as you
> discovered, the same does not hold true if the local files do not
> exist in the new hierarchy being laid down.
> I hope you filed a ticket with the Subversion team -- I'm sure they
> would treat data loss as an issue worth fixing.
Received on 2008-04-24 01:39:38 CEST