Any reason why we shouldn't be able to run 'svn log' on an uncommitted copy?

For example (this is with tr...@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:

### tr...@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.
]]]

Reply via email to