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

Re: svn cat doesn't work on moved files

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-03-29 02:38:57 CET

Tobias Ringstrom wrote:

>I can imagine needing both methods. How about changing -r to follow
>history through the moves to wc/bar in rev X, and implement -R to go
>straight to wc/foo in rev X as -r does now?
>
>That way we get the following meanings of -r and -R:
>
>-rX: First locate the object using the specified name in the wc, then
> trace history backwards to revision X. If an URL is used, the HEAD
> version of the repo is used to identify the object whose history is
> traced back to rev X.
>
>-RX: In version X of the repository, locate the object by the specified
> name.
>
>

Now, this *does* sound like a recipe for confusion. I don't understand
why people are so worried about URLs and WC paths acting differently.
After all, they already do, and for good reason. Take, for example, the
following:

    svn mv wc/foo wc/bar
    svn mv file:///repo/foo file:///repo/bar

These two commands don't do the same thing. The first creates an
uncommitted copy in the WC, using the current WC version as the copy
source; the second commits a copy of HEAD in the repository.

Let's look at "svn cat" in this light:

    (1) svn cat wc/foo
    (2) svn cat file:///repo/foo

To me, the most obvious interpretation of (1) is to get the contents of
the BASE version of wc/foo, regardless of local modifications; and of
(2), get the contents of "foo" at current HEAD of the repository. So, if
"wc/foo" hasn't been renamed in the working copy, these could be
rewritten to:

    (1) svn cat -rBASE url-of(wc/foo)
    (2) svn cat -rHEAD file:///repo/foo

where "url-of(wc/foo)" is whatever "svn info" tells you about the URL.
Extendinf this difference of interpretation, it seems obvious to me that

    (3) svn cat -r15 wc/foo
    (4) svn cat -r15 file:///repo/foo

have different meanings, too: (3) means get me the contents that the
file wc/foo had in revision 15, regardless of what its name was then;
and (4) means get the contents of whatever was called "foo" in revision
15 of the repository.

The idea that WC paths are just shortcuts for URLs is, IMNSHO, flawed.
If we do that, you really don't have any way of following rename history
without parsing the output of "svn log".

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Mar 29 02:39:50 2003

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.