Revision number where a file is deleted is NOT visible in the file's history, but buried in the folder's history - Please document that in svnbook, and add a FAQ
From: <eurbah_at_free.fr>
Date: Mon, 21 Mar 2011 21:11:09 +0100 (CET)
A) Naive goal
B) Naive commands fail
$ svn log myFolder/myFile
$ svn log $REPO/myFolder/myFile
C) Discover an adequate peg revision
$ svn log -v myFolder
But a simple 'grep' can NOT provide the desired revision number, so the user has to manually parse this (potentially very long) output in order to find the string '/myFolder/myFile' where action is not 'D', and then search upward the corresponding revision number.
At the end of this work, the user hopefully has found a peg revision, say 123454321, and must memorize it.
D) Even with peg revision, commands using local names also fail
$ svn log myFolder/myFile_at_123454321
$ svn log myFolder/myFile_at_123454321 -r 123454321:0
E) With peg revision and URL, naive command fails
$ svn log $REPO/myFolder/myFile_at_123454321 -r HEAD:0
F) Peg revision, URL and restricted revision range partially succeed
$ svn log $REPO/myFolder/myFile_at_123454321 -r 123454321:0
G) Naive goal requires complex processing
Therefore, an 'svn log' of the file can NEVER display the number of the revision where the file has been deleted (I suppose that this is not a bug, but a feature).
The only known way to fulfill the naive goal of displaying the whole history of the deleted 'myFolder/myFile' file is to use following procedure :
1) Parse the output of 'svn log -v myFolder' to find the first occurrence of the string 'D /myFolder/myFile',
2) Search upward the corresponding revision number (this is the number of the revision where the file has been deleted, say 123455555)
3) Memorize this number,
4) In order to display the message corresponding to the file deletion, type the following command using this number :
$ svn log $REPO/myFolder -r 123455555
5) In order to display the history of the file before the deletion, type the following command using this number minus one :
$ svn log $REPO/myFolder/myFile_at_123455554 -r 123455554:0
H) User documentation and issue list
- Please create a corresponding FAQ using section G above,
- Please document that clearly inside the Subversion book, in particular in following sections :
- If the behavior described in section D above is a real bug, please enter it as defect in the subversion issue list.
Thank you in advance for your work.
Best regards. Etienne URBAH
|
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.