You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Daniel Gehriger <da...@linkcad.com> on 2006/10/09 09:08:50 UTC

Difference between "--revision xyz" and "@xyz" ?

Hi,

What is the difference between

  [1] svn cat http://myserver/dev/trunk/test.h@1234

and

  [2] svn cat http://myserver/dev/trunk/test.h@1234 --revision 1234

and

  [3] http://myserver/dev/trunk/test.h@1234 --revision 1234

?

I found that if the file "test.h" has been renamed to "test2.h" in 
revision 1235, only [2] and [3] will work, while [1] returns an error.

Regards,

Daniel

[I'm using SVN 1.4.0 on the client and server]

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

Re: Difference between "--revision xyz" and "@xyz" ?

Posted by Daniel Gehriger <da...@linkcad.com>.
Daniel Gehriger wrote:
> Duncan Murdoch wrote:
>> On 10/9/2006 8:50 AM, Daniel Gehriger wrote:
>>>
>>> [1] svn cat .../file-1.h --revision 1
>>>
>>> returns file-2.h of rev 1 because the filename identifies "file-1.h 
>>> of the HEAD revision, and subversion returns rev 1 of that file, 
>>> which was named "file-2.h" in rev 1;
>>
>> Right.
> 
> We are both wrong:

Stupid me. We are of course both *right*!

> 
> # svn cat file:///tmp/testrepos/file-1.h --revision 1
> file-2.h
> 

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

Re: Difference between "--revision xyz" and "@xyz" ?

Posted by Daniel Gehriger <da...@linkcad.com>.
Duncan Murdoch wrote:
> On 10/9/2006 8:50 AM, Daniel Gehriger wrote:
>>
>> Duncan Murdoch wrote:
>>> The @ identifies the name of a file, the --revision identifies which 
>>> revision to look at.  There may be multiple unrelated files in your 
>>> repository named test.h (e.g. if you delete it, and later add a new 
>>> one with the same name).  The @ says you want the file that was 
>>> called test.h in revision 1234.  Then the --revision says you want a 
>>> particular revision of that file, not necessarily the same one.
>>
>> If I understand correctly, this means that, given the following repos:
> 

Done... I started with two files, "file-1.h" and "file-2.h", each file 
containing its own filename as a text string.

> I'd suggest making a little test repos, to play with these things.  But 
> my guesses are below:
>>
>> r1: import of file-1.h, file-2.h
>> r2: rename "file-1.h" into "file-1a.h" => file-1a.h, file-2.h
>> r3: rename "file-2.h" into "file-1.h"  => file-1a.h, file-1.h
>>
>> then
>>
>> [1] svn cat .../file-1.h --revision 1
>>
>> returns file-2.h of rev 1 because the filename identifies "file-1.h of 
>> the HEAD revision, and subversion returns rev 1 of that file, which 
>> was named "file-2.h" in rev 1;
> 
> Right.

We are both wrong:

# svn cat file:///tmp/testrepos/file-1.h --revision 1
file-2.h

> 
>>
>> and
>>
>> [2] svn cat .../file-1.h@1
>>
>> return "file-1.h" of rev 1;
> 
> I think not.  file-1.h@1 was deleted in r2.  Since you didn't specify a 
> revision, svn will look for the HEAD, and won't find it.

I win:

# svn cat file:///tmp/testrepos/file-1.h@1
file-1.h

> 
>>
>> and finally:
>>
>> [2] svn cat .../file-1.h@1 --revision 3
>>
>> returns "file-1a.h" of rev 3.
> 
> Same problem here.  That file was deleted, and doesn't exist in rev 3.

You are right:

# svn cat file:///tmp/testrepos/file-1.h@1 --revision 3
svn: Unable to find repository location for 
'file:///tmp/testrepos/file-1.h' in revision 3

I now understand that SVN can "walk backwards" through renames, but not 
forwards...

Thanks for your input!

- Daniel

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

Re: Difference between "--revision xyz" and "@xyz" ?

Posted by Duncan Murdoch <mu...@stats.uwo.ca>.
On 10/9/2006 8:50 AM, Daniel Gehriger wrote:
> 
> Duncan Murdoch wrote:
>> The @ identifies the name of a file, the --revision identifies which 
>> revision to look at.  There may be multiple unrelated files in your 
>> repository named test.h (e.g. if you delete it, and later add a new one 
>> with the same name).  The @ says you want the file that was called 
>> test.h in revision 1234.  Then the --revision says you want a particular 
>> revision of that file, not necessarily the same one.
> 
> If I understand correctly, this means that, given the following repos:

I'd suggest making a little test repos, to play with these things.  But 
my guesses are below:
> 
> r1: import of file-1.h, file-2.h
> r2: rename "file-1.h" into "file-1a.h" => file-1a.h, file-2.h
> r3: rename "file-2.h" into "file-1.h"  => file-1a.h, file-1.h
> 
> then
> 
> [1] svn cat .../file-1.h --revision 1
> 
> returns file-2.h of rev 1 because the filename identifies "file-1.h of 
> the HEAD revision, and subversion returns rev 1 of that file, which was 
> named "file-2.h" in rev 1;

Right.

> 
> and
> 
> [2] svn cat .../file-1.h@1
> 
> return "file-1.h" of rev 1;

I think not.  file-1.h@1 was deleted in r2.  Since you didn't specify a 
revision, svn will look for the HEAD, and won't find it.

> 
> and finally:
> 
> [2] svn cat .../file-1.h@1 --revision 3
> 
> returns "file-1a.h" of rev 3.

Same problem here.  That file was deleted, and doesn't exist in rev 3.

I think what people would like (with "true renames") would be for [2] 
and the other [2] ;-) to give the same thing, namely "file-1a.h" of rev 
3, but I don't think that's what you'll get in current svn.  svn knows 
that file-1a.h came from file-1.h@1, but it doesn't know that file-1.h@1 
became file-1a.h, because it thinks you just did a copy and delete.

Duncan Murdoch

> 
> Correct ?
> 
> - Daniel
> 
> 
> 
> 
> 

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

Re: Difference between "--revision xyz" and "@xyz" ?

Posted by Daniel Gehriger <da...@linkcad.com>.

Duncan Murdoch wrote:
> The @ identifies the name of a file, the --revision identifies which 
> revision to look at.  There may be multiple unrelated files in your 
> repository named test.h (e.g. if you delete it, and later add a new one 
> with the same name).  The @ says you want the file that was called 
> test.h in revision 1234.  Then the --revision says you want a particular 
> revision of that file, not necessarily the same one.

If I understand correctly, this means that, given the following repos:

r1: import of file-1.h, file-2.h
r2: rename "file-1.h" into "file-1a.h" => file-1a.h, file-2.h
r3: rename "file-2.h" into "file-1.h"  => file-1a.h, file-1.h

then

[1] svn cat .../file-1.h --revision 1

returns file-2.h of rev 1 because the filename identifies "file-1.h of 
the HEAD revision, and subversion returns rev 1 of that file, which was 
named "file-2.h" in rev 1;

and

[2] svn cat .../file-1.h@1

return "file-1.h" of rev 1;

and finally:

[2] svn cat .../file-1.h@1 --revision 3

returns "file-1a.h" of rev 3.

Correct ?

- Daniel






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

Re: Difference between "--revision xyz" and "@xyz" ?

Posted by Duncan Murdoch <mu...@stats.uwo.ca>.
On 10/9/2006 5:08 AM, Daniel Gehriger wrote:
> Hi,
> 
> What is the difference between
> 
>   [1] svn cat http://myserver/dev/trunk/test.h@1234
> 
> and
> 
>   [2] svn cat http://myserver/dev/trunk/test.h@1234 --revision 1234
> 
> and
> 
>   [3] http://myserver/dev/trunk/test.h@1234 --revision 1234
> 
> ?

The @ identifies the name of a file, the --revision identifies which 
revision to look at.  There may be multiple unrelated files in your 
repository named test.h (e.g. if you delete it, and later add a new one 
with the same name).  The @ says you want the file that was called 
test.h in revision 1234.  Then the --revision says you want a particular 
revision of that file, not necessarily the same one.

> 
> I found that if the file "test.h" has been renamed to "test2.h" in 
> revision 1235, only [2] and [3] will work, while [1] returns an error.

That's because test.h@1234 was deleted, and no longer exists in the HEAD 
revision, the default revision to look at.  svn doesn't understand that 
your rename means test2.h is a descendant of test.h, all it sees is the 
deletion of test.h, because it currently implements renames as "copy + 
delete original".

Duncan Murdoch
> 
> Regards,
> 
> Daniel
> 
> [I'm using SVN 1.4.0 on the client and server]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org

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