On Wed, Jan 20, 2010 at 1:06 PM, Paul Burba <ptburba_at_gmail.com> wrote:
> Any reason why we shouldn't be able to run 'svn log' on an uncommitted copy?
>
> For example (this is with trunk_at_901239):
>
> ### A WC with no local changes:
>
> Â >svn st
>
> ### Check the log of a file:
>
> Â >svn log A\D\H\psi
> Â ------------------------------------------------------------------------
> Â r4 | jrandom | 2010-01-20 09:23:21 -0500 (Wed, 20 Jan 2010) | 1 line
> Â log msg
> Â ------------------------------------------------------------------------
> Â r1 | jrandom | 2010-01-20 09:23:12 -0500 (Wed, 20 Jan 2010) | 1 line
> Â Log message for revision 1.
> Â ------------------------------------------------------------------------
>
> ### Move that same file:
>
> Â >svn move A\D\H\psi A\D\H\psi_moved
> Â A Â Â Â Â A\D\H\psi_moved
> Â D Â Â Â Â A\D\H\psi
>
> Â >svn st
> Â A Â + Â Â A\D\H\psi_moved
> Â D Â Â Â A\D\H\psi
>
> ### Run 'svn log' on the move destination. Â Shouldn't this
> ### give us the log of 'psi'?
>
> Â >svn log A\D\H\psi_moved
> Â ..\..\..\subversion\svn\log-cmd.c:600: (apr_err=160013)
> Â ..\..\..\subversion\libsvn_client\log.c:627: (apr_err=160013)
> Â ..\..\..\subversion\libsvn_repos\log.c:1449: (apr_err=160013)
> Â ..\..\..\subversion\libsvn_repos\log.c:1092: (apr_err=160013)
> Â ..\..\..\subversion\libsvn_fs_fs\tree.c:2818: (apr_err=160013)
> Â svn: File not found: revision 13, path '/A/D/H/psi_moved'
>
>
> The reason the above doesn't work appears due to a broken API promise
> in svn_client_log5; specifically the part which states:
>
> "@a peg_revision indicates in which revision @a targets are valid.
> If @a peg_revision is #svn_opt_revision_unspecified, it defaults to
> #svn_opt_revision_head for URLs or #svn_opt_revision_working for WC paths"
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ^^^^^^^^^^^^^^^^^^^^^^
>
> Thing is, we don't currently default to a peg rev of
> svn_opt_revision_working in this case. Â The attached patch makes this
> default take place. Â It passes all tests and in the above example DTRT
> IMO:
>
> ### TRUNK_at_901239 PATCHED:
>
> Â >svn log A\D\H\psi_moved
> Â ------------------------------------------------------------------------
> Â r4 | jrandom | 2010-01-20 09:23:21 -0500 (Wed, 20 Jan 2010) | 1 line
> Â log msg
> Â ------------------------------------------------------------------------
> Â r1 | jrandom | 2010-01-20 09:23:12 -0500 (Wed, 20 Jan 2010) | 1 line
> Â Log message for revision 1.
> Â ------------------------------------------------------------------------
>
> Unless anyone has an objection to this, I'll add a test to the
> attached patch and commit...it just seems so obvious that this should
> work that I'm suspicious there isn't a good reason it does not :-P
>
> Paul
>
> [[[
> Allow 'svn log' on an uncommitted copy/move destination.
>
> * subversion/libsvn_client/log.c
>
> Â (svn_client_log5): Keep API promise that a peg revision
> Â svn_opt_revision_unspecified defaults to svn_opt_revision_working for
> Â WC paths.
> ]]]
Added a test and committed r901752.
Paul
Received on 2010-01-21 17:00:11 CET