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

Re: svn_fs_history_prev() and svn_fs_copied_from() question

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Thu, 18 Nov 2010 09:09:57 -0500

On 11/18/2010 09:02 AM, C. Michael Pilato wrote:
> On 11/18/2010 08:43 AM, Daniel Shahaf wrote:
>> Yes, that's what I meant, but I see that Philip already committed a fix.
>>
>> Question to FS people:
>>
>> Is the svn_fs_history_location(svn_fs_history_prev()) approach
>> equivalent to the svn_fs_copied_from() approach?
>
> No.
>
> svn_fs_copied_from() will only return information about copies when you ask
> it of the actual copy target.
>
> svn_fs_history_prev() will traverse history thru copies for any subtree of
> the copy.
>
> For example, in our Greek tree, if r2 is a move of '/A' to '/Z', then:
>
> svn_fs_copied_from('/Z', r2) = '/A', r1
>
> svn_fs_copied_from('/Z/B/E/alpha', r2) = NULL, SVN_INVALID_REVNUM
>
> but:
>
> svn_fs_history_prev('/Z', r2) = '/A', r1
>
> svn_fs_history_prev('/Z/B/E/alpha', r2) = '/A/B/E/alpha', r1

Another subtlety. Say some other change is committed in our under '/Z' in
r3 (but not to '/Z/B/E/alpha'):

    svn_fs_copied_from('/Z', r3) = NULL, SVN_INVALID_REVNUM
    svn_fs_copied_from('/Z/B/E/alpha', r3) = NULL, SVN_INVALID_REVNUM

    svn_fs_history_prev('/Z', r3) = '/Z', r2
    svn_fs_history_prev('/Z/B/E/alpha', r3) = '/Z/B/E/alpha', r2

Notice that svn_fs_copied_from() doesn't see the copy because the
node-revision for /Z_at_3 was not the exact target of a copy.

Notice also that svn_fs_history_prev() doesn't return information about the
copy source either, because the previous "interesting history location" is
the copy itself.

Another nuance not demonstrated by my simple example is that
svn_fs_history_prev() might not really return "the copy source", even when
you query the exact copy target. Why? Because the source of the copy might
not be an "interesting history location". Maybe you did 'svn copy
^/trunk_at_20 ^/branches/branch' (creating r21), but prior to your commit, the
last time ^/trunk changed was r10. svn_fs_history_prev('^/branches/branch',
r21) will return '^/trunk', r10, *not* '^/trunk', r20.

Confused yet?

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on 2010-11-18 15:10:38 CET

This is an archived mail posted to the Subversion Dev mailing list.