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

Re: svn cat on deleted file doesn't seem to work

From: Tim Hill <drtimhill_at_comcast.net>
Date: 2006-12-08 17:17:12 CET

This is a "peg revision" problem. It's best to understand how
Subversion works when you specify "-r". First, it looks in the most
recent revision for the specified path, and then it follows the
history of that file backwards (or, occasionally, forwards) until it
locates the required revision. It does this so that it can track
things like file renames. For example, if you rename "foo.c" to
"bar.c" at revision 100, you can still access "foo.c" at revision 90
using "foo.c -r90" even though at that point the file has a different
name.

However, in your case, the file has been _deleted_ in rev 15, so in
the current rev it does not exist! Hence the problem. The solution is
to use a "peg revision", which is a modified URL of the form
"URL@rev#". In your case this would be:

http://server/repo/path/arraylist.cs@11

When you use a peg revision, you are telling Subversion to modify the
above search operation and *start* the search at the specified
revision (11). This gets around the delete problem, since the file
does exist at the earlier rev. You can combine a peg-rev and a -r
switch. For example:

http://server/repo/path/file@90 -r 80

This tells Subversion to look for the file at revision 90 and then
search back to revision 90.

In fact, *all* URLs have a peg revision, its just that the default
value if the peg-rev is omitted is HEAD, which is most cases is what
you want.

HTH

--Tim

On Dec 7, 2006, at 11:14 PM, Andrew wrote:

> It seems that I cannot cat an older version of a file arraylist.cs.
> I don't think I did anything unusual. Here is some output. Is this
> what is supposed to happen? Any help would be appreciated. Please
> send responses directly to me - I'm not on the mailing list.
>
> % svn --version
> svn, version 1.3.0 (r17949)
> compiled Jan 15 2006, 23:18:48
> % ls
> assert.cs
> % svn diff # directory is up to date
> % svn update # be sure we're up to date
> At revision 15.
> % svn list -r 15 # as expected - does not include arraylist.cs
> assert.cs
> % svn list -r 11 # as expected - includes arraylist.cs
> arraylist.cs
> assert.cs
> % svn cat -r 11 arraylist.cs # why can't I cat arraylist.cs?
> svn: 'arraylist.cs' has no URL
> % svn cat -r 11 assert.cs # works fine
> (assert.cs's contents)
>
> ---------------------------------------------------------------------
> 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
Received on Fri Dec 8 17:18:04 2006

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