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

the difference between created_rev() and origin_rev()

From: Ben Collins-Sussman <sussman_at_red-bean.com>
Date: Tue, 28 Apr 2009 13:49:01 -0500

Jon and I are trying to understand the difference between
svn_fs_node_created_rev() and svn_fs_node_origin_rev(). From reading
through code, I *think* I understand, but I'd like someone (cmpilato?
pburba?) to verify that I've got it right.

svn_fs_created_rev() is the "dumb" function. It just notices when a
specific node first came into existence, paying no attention to
"previous node" pointers or copyfrom metadata. In other words, it
only notices the third component in the X.Y.Z id string and says, "oh,
this node was created in transaction Z, which was committed as
revision R. So the created-rev is R."

svn_fs_node_origin() is the "smart" function which notices
copies/renames. First it walks backwards through all the
copyfrom-metadata that it can find, until it finds some ancestor which
was *didn't* come into existence via a copy event. Then it walks
backwards though the previous-node pointers until it finds the very
first version of the object (presumably created by either an add or
replace *without* copyfrom history.) It then returns that 'origin'
revision.

I suspect there's something slightly wrong with my explanation here,
since I don't grok how svn_fs_node_created_path() fits into this
universe: it seems to be paired with created_rev(), but that implies
that those two functions (as a pair) are paying attention to
copies/renames somehow...

Can someone de-confuse us?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1967056
Received on 2009-04-28 20:49:27 CEST

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