Hello,
I have a project that happens to have two separate objects
with the same path.
SVN seems to make it difficult to view the history of objects
other than those present at the HEAD, unless you already know
certain key historical revision numbers.
[I have tried this with SVN 1.6.6 and SlikSVN 1.6.9]
As a simplified example, suppose the history is like this:
trunk/ branch/
r1
--cp-->
r2
r3
r4
r5 (rm)
r6
<--mv--
r7
r8
The full history on the entire repository might look like this:
> svn log -vr 1:HEAD "file://localhost/c:/Temp/spb_repo/"
------------------------------------------------------------------
r1 | robh | 2010-02-22 11:25:21 +0000 (Mon, 22 Feb 2010) | 1 line
Changed paths:
A /trunk
A /trunk/file.txt
initial version
------------------------------------------------------------------
r2 | robh | 2010-02-22 11:25:21 +0000 (Mon, 22 Feb 2010) | 1 line
Changed paths:
A /branch (from /trunk:1)
create branch
------------------------------------------------------------------
r3 | robh | 2010-02-22 11:25:22 +0000 (Mon, 22 Feb 2010) | 1 line
Changed paths:
M /trunk/file.txt
trunk edit
------------------------------------------------------------------
r4 | robh | 2010-02-22 11:25:22 +0000 (Mon, 22 Feb 2010) | 1 line
Changed paths:
M /branch/file.txt
branch edit
------------------------------------------------------------------
r5 | robh | 2010-02-22 11:25:23 +0000 (Mon, 22 Feb 2010) | 1 line
Changed paths:
D /trunk
trunk delete
------------------------------------------------------------------
r6 | robh | 2010-02-22 11:25:23 +0000 (Mon, 22 Feb 2010) | 1 line
Changed paths:
M /branch/file.txt
further branch edit
------------------------------------------------------------------
r7 | robh | 2010-02-22 11:25:24 +0000 (Mon, 22 Feb 2010) | 1 line
Changed paths:
D /branch
A /trunk (from /branch:6)
move branch back to trunk
------------------------------------------------------------------
r8 | robh | 2010-02-22 11:25:24 +0000 (Mon, 22 Feb 2010) | 1 line
Changed paths:
M /trunk/file.txt
new-trunk edit
------------------------------------------------------------------
By trying to use peg and operative revisions,
I get the following responses
> REM *** (1) log trunk ***
> svn log -qr 1:HEAD "file://localhost/c:/Temp/spb_repo/"trunk
------------------------------------------------------------------
r1 | robh | 2010-02-22 11:25:21 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r2 | robh | 2010-02-22 11:25:21 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r4 | robh | 2010-02-22 11:25:22 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r6 | robh | 2010-02-22 11:25:23 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r7 | robh | 2010-02-22 11:25:24 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r8 | robh | 2010-02-22 11:25:24 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
> REM *** (2) log branch ***
> svn log -qr 1:6 "file://localhost/c:/Temp/spb_repo/"branch_at_2
------------------------------------------------------------------
r1 | robh | 2010-02-22 11:25:21 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r2 | robh | 2010-02-22 11:25:21 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r4 | robh | 2010-02-22 11:25:22 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r6 | robh | 2010-02-22 11:25:23 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
> REM *** (3) log branch ? ***
> svn log -qr 1:HEAD "file://localhost/c:/Temp/spb_repo/"branch_at_2
svn: File not found: revision 8, path '/branch'
> REM *** (4) log old trunk ***
> svn log -qr 1:4 "file://localhost/c:/Temp/spb_repo/"trunk_at_1
------------------------------------------------------------------
r1 | robh | 2010-02-22 11:25:21 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r3 | robh | 2010-02-22 11:25:22 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
> REM *** (5) log old trunk ? ***
> svn log -qr 1:HEAD "file://localhost/c:/Temp/spb_repo/"trunk_at_1
------------------------------------------------------------------
r1 | robh | 2010-02-22 11:25:21 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r2 | robh | 2010-02-22 11:25:21 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r4 | robh | 2010-02-22 11:25:22 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r6 | robh | 2010-02-22 11:25:23 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r7 | robh | 2010-02-22 11:25:24 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
r8 | robh | 2010-02-22 11:25:24 +0000 (Mon, 22 Feb 2010)
------------------------------------------------------------------
The cases (1), (2) are as I would expect,
case (4) is almost as I would expect,
but cases (3) and (5) were a surprise to me.
In case (1), the log follows the object through renames,
which can be helpful.
I can obviously limit that with --stop-on-copy.
In case (3), I know that the path doesn't exist in the HEAD,
but I'd like to see as many revisions as possible
(perhaps qualified by --limit or --stop-on-copy).
In case (4), I'd quite like to see revision 5
where the object was deleted, if I specify -r1:5,
rather than getting an error as in case (3).
In case (5), I seem to get the wrong branch,
although I can see some ambiguity in what I've asked for.
I want to see as many revisions on the 'old' trunk as possible;
that's why I specified the peg.
SVN has shown me correct information I suppose,
because the 'new' trunk is indeed related to the 'old' trunk
through two renames.
But, if I don't already know the revisions where the 'old' trunk
was deleted, how can I easily find the history I'm looking for?
Even pegging at revision 3 does not work as I expected.
[I have read
http://svnbook.red-bean.com/en/1.5/svn.advanced.pegrevs.html
about "Peg and Operative Revisions".]
Am I missing something?
Is there a simple method for revealing the revisions at which a
path or object is deleted on the command line
(i.e. without requiring a script)?
[The graphing tool in Tortoise SVN can be quite helpful.
However, I'd like to be able to more easily select the object I'm
interested in on the command line.
(And of course, Tortoise is only available on Windoze.)]
If the behaviour I'm looking for is not implemented,
perhaps there is scope for additional switches:
--show-object-deletion
--stop-on-delete
Thanks,
Rob.
PS. I have some scripts and an image (revision graph). I have attached
them, but I don't know if they will be stripped from this email:
svn_peg_bug_create_repo.bat.7z
svn_peg_bug_demp.bat.7z
svn_peg_bug.png
all files are less than 6KB.
________________________________________________________________
This message has been independently scanned for the Softel Group and cleared of containing viruses and other malicious data.
Powering Television Beyond the Video (TM)
Received on 2010-02-22 14:46:35 CET