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

Re: [PATCH] Correct svn_wc_get_pristine_copy_path() comment.

From: Madan U Sreenivasan <madan_at_collab.net>
Date: 2006-06-21 09:39:47 CEST

On Wed, 21 Jun 2006 03:24:30 +0530, Julian Foad
<julianfoad@btopenworld.com> wrote:

> Julian Foad wrote:
[snip]

> We need to resolve this one way or another. Possible designs are:
>
> 1) Given a path of a WC file (which need not exist),
> get the path at which its text base is or would be if it had one.

The function does not insist on a a WC file... we can pass any path/file
to the function, and it would return

path/../.svn/text-base/file.svn-base

It is as simple as that.

--------------------8<----------------------------------------------8<--------------------------
>>> import svn.wc
>>> svn.wc.get_pristine_copy_path("/tmp/nonexistantfile")
'/tmp/.svn/text-base/nonexistantfile.svn-base'
>>>
--------------------8<----------------------------------------------8<--------------------------

And I think this implementation is correct.

>
> /** Given a @a path to a WC file, set @a *pristine_path to the path of
> its
> * pristine (base) copy. The file at @a path need not exist. The file
> at
> * @a *pristine_path might not exist.
> */

For the comment I would suggest,

/* Given any @a path, return where svn would look for its BASE version. */

     No mention of whether the path exists/if the text-base dir exists/ if
the file has a text-base file/if it is a WC file/if it is a file or a dir
- nothing. I think it conveys what exactly the function does. The function
simply doesn't care about these factors.

Another point I would like to discuss is:
svn_wc_get_pristine_copy_path() doesn't even care if the path given is a
file or a dir.

--------------------8<----------------------------------------------8<--------------------------
>>> svn.wc.get_pristine_copy_path("/tmp")
'/.svn/text-base/tmp.svn-base'
--------------------8<----------------------------------------------8<--------------------------

Is this intentional? AFAIK, the wc dirs do not have a text-base file.
Shouldn't this case return an error?

Regards,
Madan.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jun 21 09:09:41 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.