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

Re: "switch" should check the node type [was: Re: 1.0.1 veto for r8959]

From: John Szakmeister <john_at_szakmeister.net>
Date: 2004-03-12 12:09:04 CET

On Thursday 11 March 2004 08:15, Julian Foad wrote:
> Time for a change of subject, I think :-)

So here's a small patch that checks the node type of the switch URL. I'm not
terribly happy with it, although I'm not sure there is another way to do
this. I attempted to use the svn_get_longest_ancestor() function to pull off
the common part of the entry's url and the switch url. The problem is that
the session still needs to be rooted in the specified WC directory, and
base_dir and base_url must be for the same node. The end result is that the
only way to possibly do this in one connection is to generate a path based on
the entry's url to the location to pointed by the switch url:

  entry->url = http://server/repo/trunk
  switch url = http://server/repo/branches/my-branch
  switch path = ../branches/my-branch

I'm not sure we'd even handle the path correctly. I'll play a little more
later, but I wanted to get this patch out there to see what you guys think.

-John

Log:
----------------------------
Ensure that the entities pointed to by the wc path and the URL are of the
same type before allowing 'svn switch' to continue.

* subversion/libsvn_client/switch.c
  (get_url_kind): New.
  (svn_client_switch): Check the URL's kind to make sure it exists, and also
  validate that it represents the same type as the wc path.
----------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Fri Mar 12 12:11:45 2004

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.