[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: Stefan Sperling <stsp_at_elego.de>
Date: Fri, 25 Apr 2008 13:44:16 +0200

On Fri, Apr 25, 2008 at 11:24:12AM +0100, Julian Foad wrote:
> Stefan Sperling wrote:
>>> This would seem to me to be a good candidate for a --dry-run type of behaviour,
>>> or a verification step before actually attempting to execute the switch.
>>>
>>> An error message of "can't switch - [files/directories list here] would be lost
>>> or damaged" would be very useful.
>>
>> You can (and probably should) run switch with --dry-run first.
>
> Er, no you can't.
>
> Subcommand 'switch' doesn't accept option '--dry-run'

Oh, sorry! I assumed it did, but I didn't check :/

We should add probably --dry-run to both update and switch on
the tree-conflicts branch to support this use case. Issue? :)

So Aaron, I'm afraid that for now, checking for unversioned
files after a switch/update is the only workaround I know :(

>> With tree-conflict detection in place (i.e. not with 1.5, nor
>> trunk, but our experimental tree-conflicts branch), this will
>> notify you about conflicts, i.e. you'll see directories flagged
>> as 'C'. (*lightbulb* Hmmm.... we might actually want to print a
>> summary of all potential conflicts of any kind after any --dry-run
>> operation... Cc'ing Julian Foad. Julian, do think this would be
>> a good idea?)
>
> So, in the scenario where you "merge" or "switch" or "update" with
> "--dry-run" (let's say that were supported), and get thousands of "M"od,
> "D"el, and "A"dd notifications, and perhaps a few "C"onflicts as well, you
> want to see at least something like:
>
> [[[
> $ svn <merge|switch|update|whatever> --dry-run ...
> M a.c
> M b.c
> C c.c
> [...]
> D foo
> M bar
> M baz
> svn: There were conflicts.
> ]]]
>
> (and maybe more detail)?

Exactly. Maybe some stats?

  $ svn <merge|switch|update|whatever> --dry-run ...
  M a.c
  M b.c
  C c.c
  [...]
  D foo
  M bar
  M baz
  svn: There were conflicts:
     5 text conflicts
     1 property conflict
     2 tree conflicts

Or even print affected paths as well:

  svn: There were conflicts:
       5 text conflicts
         c.c
         xyz
         a/b/c
         parser/parse.c
         security/ssl/ssl.c
       1 property conflict
         bar
       2 tree conflicts (showing victims)
         foo
         baz/bay/bax.c

This should happen regardless of --dry-run.

I suppose doing this would magnify svn's user-friendliness at
a non-trivial degree, especially given that with 3 different
types of conflicts, conflict handling will be getting a lot
more complicated than it currently is. Note though that interactive
conflict resolution makes it possible to resolve text (and property?)
conflicts right during the update process, so depending on how people
use this feature (and how we make it work with tree conflicts) the
above example output may be redundant in the non-dry-run case.

Julian, should I open a tree-conflict issue for this, also,
or append to an existing one? We should consider this when
we get to the "cleaning up the UI" part.

-- 
Stefan Sperling <stsp_at_elego.de>                    Software Monkey
 
German law requires the following banner :(
elego Software Solutions GmbH                            HRB 77719
Gustav-Meyer-Allee 25, Gebaeude 12        Tel:  +49 30 23 45 86 96 
13355 Berlin                              Fax:  +49 30 23 45 86 95
http://www.elego.de                               CEO: Olaf Wagner
 
Store password unencrypted (yes/no)? No

  • application/pgp-signature attachment: stored
Received on 2008-04-25 13:42:56 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.