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

Re: svn log questions

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2004-12-10 08:16:06 CET

On Dec 10, 2004, at 12:45 AM, Brad Schick wrote:

> I think svn log -rPREV has a surprising behavior. -rPREV seems to look
> for literally COMMITTED-1,

It's not surprising: it's consistent across all commands. "COMMITTED"
of a file is defined to be the last revision in which the file changed,
effectively equivalent to the per-file revision. "PREV" is defined to
be "COMMITTED-1", just as you said. In file terms, COMMITTED-1 is
guaranteed to be "the version of the file just before the latest
version".

> which often doesn't exist for a specific item.

PREV *does* exist for each file, but the problem here is that it's not
likely that the file was part of a commit in rPREV.

For example, suppose a file changed in r10, r15, and r20. You check
out r20 into a working copy. COMMITTED of the file is r20, and PREV is
r19. If you were to run 'svn cat -rPREV', you'd get r19 of the file,
which happens to be identical to r15, r16, r17, and r18. They're all
the same "previous version" of the file.

Unfortunately, this doesn't mesh with 'svn log' semantics quite so
well. 'svn log -rX[:Y] PATH' is like asking for the intersection of
two searches: the intersection of all log messages within the -rX:Y
range, and the intersection of all commits which affected PATH. If
PATH was never changed within the -rX:Y range, then the result is no
intersection: the empty set. That's why you see nothing.

> Wouldn't this be more useful if it looked for the previous *change* on
> an
> item so that "svn log -rPREV file" showed the log for the prev change?

If you leave off the revision search range, then 'svn log PATH' shows
all commits that ever affected PATH.

I think what you want is 'svn log file --limit 1'. It will stop after
showing you one log message, and that's guaranteed to be the most
recent change on a file.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Dec 10 08:18:17 2004

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.