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

Re: svn switch to an incorrect branch deletes modified local files

From: Aaron Eppolito <aarone_at_apple.com>
Date: Wed, 23 Apr 2008 18:01:19 -0700

On Apr 23, 2008, at 5:27 PM, David Glasser wrote:

> On Wed, Apr 23, 2008 at 5:06 PM, Karl Fogel <kfogel_at_red-bean.com>
> wrote:
>> "David Glasser" <glasser_at_davidglasser.net> writes:
>>>> No, switching to a new working copy rooted in the current
>>>> directory is
>>>> fine -- people do it all the time, and Subversion has no way to
>>>> know
>>>> whether it's right or wrong for your given situation.
>>> Eh, I deny that it's "fine"... the current working copy code has a
>>> high probability of breaking your wc if you do a weird switch (issue
>>> #2505). This broader issue probably is easier to fix in a wc
>>> rewrite
>>> which constructs a full metadata tree before actually trying to muck
>>> with user files.
>> It may be buggy, but it is an intended feature. I do such switches
>> all
>> the time. In fact they are the majority of switches I perform
>> (because
>> I'm switching from one branch to another, or trunk to/from a branch).
> Er, I guess my real position is: "svn switch should be able to do
> arbitrary switches, but in practice it just doesn't work unless you're
> switching between multiple branches at the same level (including trunk
> of course); and when it doesn't work, it's usually unrecoverable".
> Though the bad cases I'm referring to are exactly the opposite of what
> you just said... "switching from one branch to another, or trunk
> to/from a branch" are the svn switch cases that I expect to not break.
> --dave

I'm nearly certain that they were gone from disk, but it's entirely
possible that in my freakout I overlooked them. Ah, yep, you're right
-- I just tried it and yes, they're still there on disk. All the
unmodifieds are gone, but the modified ones are still there, albeit no
longer versioned.

Furthermore, the switches that you mention (branch -> trunk or vice
versa) are exactly what I was intending to do. What I failed to do
was match directory levels.

Instead of switching from:
https://svn/project/branches/branchname/subdir to

I switched the subdirectory to the root:
https://svn/project/branches/branchname/subdir to

resulting in this directory structure:

While I'm sure someone out there has a reason to reroot a new working
copy of a project WITHIN a subdirectory of a working copy of the SAME
project, I'm pretty sure that it's not the 95% case. I guess what I'd
expect is this:

[project/subdir/] % svn switch https://project/trunk
svn: 'https://project/trunk'
is not the same source location as
use --force to switch anyway

But then again, since project/branch/ looks the same as project/
subdirectory/ to svn, I guess it's just a limitation of the tags/
branches-in-svn-aren't-really thing. Of course, I'd really like to be
able to get info for all the branches of a file like in cvs, but, I


PS. looks like this is already covered in other bugs so I suppose I
shouldn't file a separate ER. thanks.

To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-04-24 03:43:47 CEST

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.