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

Re: PATCH: issue 1361: Enable "svn cat -rBASE" to work without contacting the repository

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-09-23 01:32:13 CEST

John Szakmeister wrote:
>
> IIRC, this will grab the properties for the working copy, not the pristine
> text-base. If the working copy's properties were modified, then you'll be
> retreiving something different than expected. I think you need to do this
> instead:
> svn_wc_get_prop_diffs (NULL, &props, path_or_url, adm_access, pool)
...

Philip Martin wrote:
>
> $ rm versioned_file.c
> $ mkdir versioned_file.c
> $ svn cat -rBASE versioned_file.c
>
> There is no reason for that to fail, the text-base is available.
>
> svn_wc_get_actual_target is an expensive call. It might be better to
> use the fact that 'svn cat PATH' requires PATH to be a file, so just
> svn_path_split PATH, open the parent of PATH, get the svn_wc_entry_t
> of PATH and check the entry is that of a file.

Thank you, folks, for your comments. Especially appreciated are the suggestions of what to do instead.

I will have a go at correcting this.

In the meantime, I have been reading about the related issue 1191 which is about "svn cat" supporting the Working copy as well as BASE, and about what should be the default. My thoughts on that boil down to:

1) We should first implement a "WORKING" (or "WC") revision keyword, otherwise the arguments about what the default should be are very heavily biased towards "WC" being the default because if it wasn't you couldn't specify it. There is already a revision-type enumerator for it.

2) I'm rapidly coming to think that it is a bad idea to add all this code now. In particular, adding "-rBASE" to "svn cat" without adding it to other commands, and without adding "-rWC" as well, is too much of a hack. Writing this patch has given me a good start at learning the Subversion code, and though it is very good compared to most other software I have worked on, I have of course been finding inconsistencies and bugs. The more I find, the more I want to fix them - by simplifying, unifying, refactoring - almost always by deleting spurious special cases, not by adding more code.

I probably will finish this "cat -rBASE" patch, but part of me wants to resist checking it in. We'll see.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Sep 23 01:32:01 2003

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.