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

Issue #1532 - Switch a file to a dir: can't switch it back to the file

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Wed, 06 Jul 2011 12:42:27 +0100

<http://subversion.tigris.org/issues/show_bug.cgi?id=1532>

  svn switch ^/dir_url file_path # This worked, but then ...
  svn switch ^/file_url file_path # this errored out.

I filed this issue back in 2003 and it was unfixable then, but with
WC-NG it should be relatively easy, so I'm trying.

We don't strictly need to do this for 1.7.0, but if it is supposed to be
easy with WC-NG then actually doing it should be a good test that we've
got things right.

After trying naively to fix it just by anchoring the reporter/editor
drive at the parent directory (even when the target starts out as a
directory), I found there is a problem at an earlier stage. Starting
from a clean greek-tree checkout:

  $ svn switch ^/iota wc/A/C
  D wc/A/C
  A wc/A/C
  $ cat wc/A/C
  This is the file 'iota'.
  $ svn status wc/A/C
                                ### No output. Should be 'S'.
  $ svn info wc/A/C
  Node Kind: file
  URL: file:///.../repos/A/C ### Should be '.../iota'.
  ...

The node at 'A/C' on disk has been switched to be a file, and some of
the metadata updated accordingly, but the URL in the metadata has not
been changed.

Tracing it through, the "delete" part looks OK; the result in NODES is

   local_relpath = A/C
        op_depth = 0
  parent_relpath = A
        repos_id = 1
      repos_path = A/C
        revision = 1
        presence = not-present
            kind = dir

Then, in update_editor.c:make_file_baton(), fb->new_relpath gets set to
'A/C'. The logic that is used in make_dir_baton() correctly accounts
for a switch to a directory, so I'm using that logic in
make_file_baton() also.

Fixed in r1143357.

Now back to the original problem, switching the switched path back to
the original path.

- Julian
Received on 2011-07-06 13:43:15 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.