You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Paul Burba <pa...@softlanding.com> on 2006/10/25 20:49:27 UTC

Challenge: Quickly finding the rev an ood path was deleted

For those of you not following this thread...

  http://svn.haxx.se/dev/archive-2006-10/0018.shtml

...We've come up against a difficult problem when getting the status on 
out of date paths which no longer exist at HEAD.  Specifically we would 
like to populate the svn_wc_status2_t ood_last_cmt_rev member with the 
revision the path was deleted, currently this is just set to 
SVN_INVALID_REVNUM.  This isn't important for the svn command line, but 
for other users of svn_client_status2() like Subclipse it is. 

My current solution is a new function in libsvn_repos/rev_hunt: 
svn_repos_deleted_rev().  Unfortunately my crude linear search approach is 
painfully slow if the revision a path was deleted and HEAD are 
significantly far apart.  You can see svn_repos_deleted_rev() in all it's 
horrible glory and the rest of the (much prettier) work in progress at the 
branch https://svn.collab.net/repos/svn/branches/ood-status-info

So, to sum up the challenge: "If a path doesn't exist at HEAD, but may 
have existed previously, what is the most efficient way to find the 
revision it was most recently deleted?"

dlr suggested it might be possible to do this in the FS layer.  If anyone 
has an inkling how to do that, or sees some other inspired solution please 
let us know (it's probably best to reply to the aforementioned thread 
rather than this one).

Thanks,

Paul B.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Challenge: Quickly finding the rev an ood path was deleted

Posted by David Glasser <gl...@mit.edu>.
On 10/25/06, Paul Burba <pa...@softlanding.com> wrote:
> My current solution is a new function in libsvn_repos/rev_hunt:
> svn_repos_deleted_rev().  Unfortunately my crude linear search approach is
> painfully slow if the revision a path was deleted and HEAD are
> significantly far apart.  You can see svn_repos_deleted_rev() in all it's
> horrible glory and the rest of the (much prettier) work in progress at the
> branch https://svn.collab.net/repos/svn/branches/ood-status-info

I'm not sure how tough it would be to optimize a single such lookup at
the fs level; I don't know much about BDB, but my incomplete
understanding of FSFS leads me to think it would be somewhat
difficult.

On the other hand, the response to "when was this path last deleted,
no later than rN" should never change, so one could just cache it.
This would be a "schema change" for the FS, but it would be
backwards-compatible, in that I think an empty cache could be created
without a dump/load.  I'm not sure what the best format for such a
cache would be, though, at least on FSFS.

--dave


-- 
David Glasser | glasser@mit.edu | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Challenge: Quickly finding the rev an ood path was deleted

Posted by Mark Phippard <ma...@softlanding.com>.
Paul Burba <pa...@softlanding.com> wrote on 10/25/2006 04:49:27 PM:

> For those of you not following this thread...
> 
>   http://svn.haxx.se/dev/archive-2006-10/0018.shtml
> 
> ...We've come up against a difficult problem when getting the status on 
> out of date paths which no longer exist at HEAD.  Specifically we would 
> like to populate the svn_wc_status2_t ood_last_cmt_rev member with the 
> revision the path was deleted, currently this is just set to 
> SVN_INVALID_REVNUM.  This isn't important for the svn command line, but 
> for other users of svn_client_status2() like Subclipse it is. 

I will just add that while this particular scenario does not apply to the 
command line currently:

1)  If the svn status command is ever enhanced to show this information 
(as it should be IMO) then it would apply.
2)  Whatever routine is created could potentially be used in some other 
commands like svn log and info to make them more usable when the item has 
been deleted from the repository.

On #2 as an example, if you run svn st -u in your WC and discover a file 
has been deleted.  It is very hard to find out when/why it was deleted. 
All you can do is use svn log on the parent folder and look through the 
output.  You cannot run svn log on the file itself unless you already know 
when it was deleted.  Even then, I am not sure you can ever see the log 
info for the revision when it was deleted.  I'd like see this enhanced so 
that if you ask for a log from -r BASE:HEAD that you see the history of 
the item from the revision in your WC to when it was deleted.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org