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

Re: Peg revisions, diff, and repository roots

From: Ben Collins-Sussman <sussman_at_red-bean.com>
Date: 2006-02-01 02:11:56 CET

On 1/31/06, Garrett Rooney <rooneg@electricjellyfish.net> wrote:

> > Consistency with other commands. That's the party line, at least. :-)
>
> /me still fails to see why defaulting to HEAD makes sense for the
> other commands anyway...

Ah! The history of pegrevs! It all started with this use-case:

$ svn cat -rN foo.c
svn: error: foo.c doesn't exist in rN

// user curses

$ svn ls -rN URL
svn:error: URL doesn't exist in rN

// user curses even more.

$ svn log -v
[user visually parses lots of junk, figures out old name]

$ svn ls -rN slighty-older-URL
[command works]

[user sends angry mail to list saying "why don't you trace history?!?"]

So we decided: OK, fine. If the user *ever* leaves off the @REV
syntax on a path or URL argument, then it's our job to trace that path
back in time. We assume that 'path' really means 'path@BASE' and
'URL' really means 'URL@HEAD'.

We began by adding this peg-behavior to 'cat' and 'ls', and from there
it slowly spread to the other commands. It may be slightly
inconvenient (i.e. not optimized for the most common use-case in each
command), but the theory is that at least the behavior is
consistent... and thus predictable, easy to learn, easy to understand.

> Sure, but it seems like this history trace code should be able to say
> "duh, this is the root node, it's never going to move!" and bail early
> or something... And even the client side could check for the repos
> root URL and bail early if we wanted to, although I'm not sure a round
> trip is worth it.

Yeah, actually, the WC is now storing the repository root url in the
entries file. So I guess it would work!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Feb 1 02:12:30 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.