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

Re: Reverting an ADD status file after an update tree conflict deletes the file

From: Johan Corveleyn <jcorvel_at_gmail.com>
Date: Mon, 14 Oct 2013 21:39:24 +0200

On Mon, Oct 14, 2013 at 9:26 PM, Bob Archer <Bob.Archer_at_amsi.com> wrote:
>> On Mon, Oct 14, 2013 at 9:08 PM, Bob Archer <Bob.Archer_at_amsi.com>
>> wrote:
>> > Bert,
>> >
>> >
>> >
>> > But, this isn't a merge it is an update. If I revert the add I lose
>> > all the changes I made in step 1 of my steps below. I might have made
>> > a few hundred changes. Granted, I probably shouldn't do the revert
>> > without copying the file off somewhere... but those local modifications
>> > I made are NOWHERE in this case and can't be recovered if my local copy of
>> the file is deleted.
>> >
>>
>> But, but ... isn't 'revert' always a lossy operation? If you revert a locally
>> modified file you also lose your local modifications.
>
> But, but, shouldn't then a revert, revert back to the pristine of my working copy, which is the local file without my modifications? I'm not even seeing that, which would somewhat make sense in my head.

That's indeed pretty strange. I didn't realize that. But even then you
would have lost your local changes, no?

>
>>
>> OK, if you revert a normal 'add', svn will keep the local file. But as Bert said, if
>> you revert an 'add with history' (A +), which seems to be the case here, svn
>> will just throw away whatever is there, exactly like when you revert a
>> Modified file.
>>
>> There is no "revert only the add, but keep the local mods" operation.
>
> Ok, but bottom line... subversion has TRASHED my local changes. This was really surprised me, and in a bad way. Granted, I only found this in a test and didn't actually lose important modifications.
>

You asked it to trash you local changes. That's precisely what revert is for.

Ok, I think the underlying problem is that svn currently does a lousy
job at helping users resolve tree conflicts. You're really on your
own, and have to improvise. Perhaps it's not even possible to resolve
this kind of tree conflict with standard commands (without moving the
modified file aside, and moving it back etc). So I can perfectly
imagine that you get misled into trying 'revert' to get out of the
nasty situation. All I can suggest at this time is: never revert
something if it still contains uncommitted changes. If you're unsure
what will happen, make a backup copy of your local mods first.

-- 
Johan
Received on 2013-10-14 21:40:18 CEST

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.