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

RE: How to find out the rev number where a file was deleted?

From: Edward Ned Harvey <svn_at_nedharvey.com>
Date: Sat, 27 Nov 2010 08:26:33 -0500

> From: Ryan Schmidt [mailto:subversion-2010d_at_ryandesign.com]
>
> Certainly not if you use an operative revision. You would need to use a
peg
> revision for that. The book explains the difference between the two.
>
> http://svnbook.red-bean.com/nightly/en/svn.advanced.pegrevs.html

This does explain something I didn't already know ... but it seems to just
clarify and add credibility to Paul's original question. He wants to see
the history, including the rev where the file was deleted. Now that I'm
using the correct operative & peg revisions ... I can see the history of a
file, including all the modifications etc, but cannot get the rev where it
was deleted.

Complete details follow, but this is the relevant part. A file named foo
was deleted in rev 4. It seems, if I svn log foo_at_3, and I specify -r
0:head, then I should get the complete history of that file, even for revs
higher than 3.

[user_at_machine wc]# svn log -v -r 0:head file://${HOME}/trash/repo/foo_at_3
svn: File not found: revision 4, path '/foo'
[user_at_machine wc]# svn log -v -r 0:3 file://${HOME}/trash/repo/foo_at_3
------------------------------------------------------------------------
r1 | root | 2010-11-27 08:12:20 -0500 (Sat, 27 Nov 2010) | 1 line
Changed paths:
   A /foo

added
[ *snip*]

Here are the complete details:

[user_at_machine ~]# mkdir $HOME/trash
[user_at_machine ~]# cd $HOME/trash
[user_at_machine trash]# mkdir repo
[user_at_machine trash]# svnadmin create repo
[user_at_machine trash]# mkdir wc
[user_at_machine trash]# svn co file://${HOME}/trash/repo wc
Checked out revision 0.
[user_at_machine trash]# cd wc
[user_at_machine wc]# touch foo
[user_at_machine wc]# svn add foo
A foo
[user_at_machine wc]# svn commit -m 'added' foo
Adding foo
Transmitting file data .
Committed revision 1.
[user_at_machine wc]# echo "a" > foo
[user_at_machine wc]# svn commit -m 'changed a' foo
Sending foo
Transmitting file data .
Committed revision 2.
[user_at_machine wc]# echo "b" > foo
[user_at_machine wc]# svn commit -m 'changed b' foo
Sending foo
Transmitting file data .
Committed revision 3.
[user_at_machine wc]# svn rm foo
D foo
[user_at_machine wc]# svn commit -m 'deleted' foo
Deleting foo

Committed revision 4.
[user_at_machine wc]# svn log -v foo_at_2
svn: 'foo' is not under version control
[user_at_machine wc]# svn log -v file://${HOME}/trash/repo/foo_at_2
------------------------------------------------------------------------
r2 | root | 2010-11-27 08:12:32 -0500 (Sat, 27 Nov 2010) | 1 line
Changed paths:
   M /foo

changed a
------------------------------------------------------------------------
r1 | root | 2010-11-27 08:12:20 -0500 (Sat, 27 Nov 2010) | 1 line
Changed paths:
   A /foo

added
------------------------------------------------------------------------
[user_at_machine wc]# svn log -v file://${HOME}/trash/repo/foo_at_3
------------------------------------------------------------------------
r3 | root | 2010-11-27 08:12:45 -0500 (Sat, 27 Nov 2010) | 1 line
Changed paths:
   M /foo

changed b
------------------------------------------------------------------------
r2 | root | 2010-11-27 08:12:32 -0500 (Sat, 27 Nov 2010) | 1 line
Changed paths:
   M /foo

changed a
------------------------------------------------------------------------
r1 | root | 2010-11-27 08:12:20 -0500 (Sat, 27 Nov 2010) | 1 line
Changed paths:
   A /foo

added
------------------------------------------------------------------------
[user_at_machine wc]# svn log -v file://${HOME}/trash/repo/foo_at_4
svn: File not found: revision 4, path '/foo'
[user_at_machine wc]# svn log -v -r 0:head file://${HOME}/trash/repo/foo_at_3
svn: File not found: revision 4, path '/foo'
[user_at_machine wc]# svn log -v -r 0:3 file://${HOME}/trash/repo/foo_at_3
------------------------------------------------------------------------
r1 | root | 2010-11-27 08:12:20 -0500 (Sat, 27 Nov 2010) | 1 line
Changed paths:
   A /foo

added
------------------------------------------------------------------------
r2 | root | 2010-11-27 08:12:32 -0500 (Sat, 27 Nov 2010) | 1 line
Changed paths:
   M /foo

changed a
------------------------------------------------------------------------
r3 | root | 2010-11-27 08:12:45 -0500 (Sat, 27 Nov 2010) | 1 line
Changed paths:
   M /foo

changed b
------------------------------------------------------------------------
Received on 2010-11-27 14:27:18 CET

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.