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

switching a single file

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2002-02-01 18:38:37 CET

OK, more theoretical discussion on 'svn switch'.

Here's how switch looks on a directory:

   $ svn switch A/D/H file:///.../A/B/E
   A A/D/H/alpha
   A A/D/H/beta
   D A/D/H/chi
   D A/D/H/omega
   D A/D/H/psi

When the command completes, 'H' still has the same name -- both the
working directory, and as an entry in its parent's .svn/entries file.
However, H's own 'this_dir' entry (and of it's children) have URLs
that point to A/B/E/... on the server, which is exactly what we want.
The way we got this behavior to work was to make sure that both the
update-editor and dir_delta are anchored directly on A/D/H.

So now I want to switch a file:

   $ svn switch A/mu file:///.../A/B/E/alpha

If I anchor the update-editor and dir_delta on 'A', then I see this
result:

   D A/mu
   A A/alpha

Which certainly *not* what we want!

So I see two possible routes from here:

 
 1. Let the 'D mu, A alpha' happen, then just rename the file manually
    after the edit (both the working file and in many places within
    .svn/) But this output is misleading to the user, unless they see:

            D A/mu
            A A/alpha
            Pssst: A/alpha has been renamed back to A/mu.

    This whole idea seems nasty to me.

 2. Assuming dir_delta is incapable, have some *other* routine drive
    the update-editor exactly how we want it driven:

           open_root() <-- which is A
           open_file(mu)
           send_txdelta(mu->alpha)
           send_propdelta(mu->alpha)
           close_file(mu)
           close_dir()
           close_edit()

    Am I right in assuming that there's no possible way to make
    dir_delta send these commands? I mean, how could it? Mu and
    Alpha are two different filenames... it's going to want to do a
    delete and add, right?

    So if that's true, perhaps in the case of a single file
    RA->do_switch() can drive the editor directly as we wish, rather
    than handing off the work to dir_delta.

Opinions?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:03 2006

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.