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

single file switching (was: svn commit: rev 1163 - trunk/subversion/include trunk/subversion/libsvn_ra_local trunk/subversion/mod_dav_svn trunk/subversion/libsvn_repos)

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-02-04 11:13:00 CET

On Sun, Feb 03, 2002 at 10:59:44PM -0600, sussman@tigris.org wrote:
>...
> Close to getting 'svn switch' to work properly on a single file,

A long time ago, we decided to avoid a lot of work that was associated with
a working copy that has disjoint files. We said that 1.0 would only deal
with mixed dirs. That would ease our burden by quite a bit.

I still don't think that switching a file makes any sense. It introduces a
TON of questions throughout our codebase now. Even something as simple as
"svn stat" will create the question of "but wait, what repository is that
from?" And that "svn stat -u" for a single directory could create a bunch of
sessions.

> darnit. At least in ra_local. The pipe editor is currently confused;
> even though it's normally anchored on the target-parent (and uses this
> path to fetch CR's during the editor drive), we now have a situation
> where it needs to *ignore* the src-basename it receives in open_file()
> and instead fetch the CR for the tgt-basename! I think I see how to
> do this. Very tricky. I wonder if this is going to be a nightmare in
> ra_dav.

It is a nightmare in ra_local. Why the heck is an editor involved at all? If
you want to switch a *file*, then call get_file and be done with it.

> * delta.c (svn_repos_switch_file): new func. uses dir_delta helper
> funcs to transform a single file into another, without a delete or
> add. A very simple editor drive, but confusing to the CR-fetching
> pipe-editor.

An editor is for transforming trees. This feels like it is mixing up the
concept. Even worse, that a bunch of modal logic is going in to force the
editor to act in a "funny" way to accomplish something which shouldn't have
used an editor in the first place.

Heck, IMO, it shouldn't even be tried in the first place.

> * reporter.c (svn_repos_report_baton_t): new 'is_switch' flag.
>
> (svn_repos_begin_report): take 'is_switch' argument.

Bleck. Why introduce this mode? When you describe a tree to the reporter
stuff, and then ask for a delta back, *why* does it care about "is_switch"?
The answer is that it only cares if you happen to try switching a single
file. But only because the nice, clean, logical operation of the previous
reporter doesn't work for a file.

> (svn_repos_finish_report): use 'is_switch' flag: we're switching a
> single file, call the new svn_repos_switch_file() instead of
> svn_repos_dir_delta().
>
> * svn_repos.h (svn_repos_switch_file): declare.
> (svn_repos_begin_report): take 'is_switch' argument.
>
> * libsvn_ra_local/ra_plugin.c (do_switch, do_update, do_status): pass
> 'is_switch' to svn_repos_begin_report.
>
> * mod_dav_svn/update.c (dav_svn__update_report): same.

The problem is that this "mode" in the reporter is infecting the system. The
reporter is to describe a state tree and drive a delta to describe how to
change it. Now the logic is all messed up.

I'd really prefer if we rethought how the switch is supposed to function for
a file. One of:

1) don't allow it in the first place
2) just use RA->get_file()

And yank all this reporter tweaking out.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
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:04 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.