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

How to determine ancestry (or lack thereof) between two noderevs?

From: LUCAS DE RODRIGO IGNACIO <idelucas_at_typsa.es>
Date: 2005-07-28 09:01:11 CEST

Is there any easy way to know, given two noderevs (or rather, their
IDs), if they belong to the same branch in history? In other words,
if one is an ancestor of the other? Note that svn_fs_compare_ids
can't help as I would need this hypothetical function to return
FALSE in the following case:
1) A copied to B
2) A copied to C
3) Do B and C belong to the same branch? (svn_fs_compare_ids would
return "related", I need FALSE).

To spell it out, svn_fs_compare_ids seems to distinguish between
three "levels of relationship":
1) Node IDs are different ("unrelated")
2) Node IDs are the same, but copy IDs and/or revision IDs are
different ("related")
3) All three IDs are the same ("same")
I would need a way to distinguish case 2) between cases where one
is an ancestor of the other, and cases when they just share a
common ancestor.

The only way I can imagine to do this is to repeatedly use
svn_fs_node_history until I arrive at either a positive
svn_fs_copied_from result with the other node, or the original
create. This doesn't look terribly efficient, so I'd like to know
if there's an alternative. Thanks in advance.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jul 28 10:43:43 2005

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