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

[PATCH] Handle "svn log" in working copy with empty repos

From: Michael W Thelen <thelenm_at_cs.utah.edu>
Date: 2004-06-29 08:58:15 CEST

Hi all,

Here is a patch just to fix up the corner case where the user runs "svn
log" (no arguments) in the working copy with an empty repository (no
revisions). Currently svn errors out with "No such revision 1". This
is directly related to issue #692.

I wanted to add a test case for this, but it looks like all the tests in
log_tests.py run over a non-empty repository, and my Python skills
aren't good enough yet to change that.

-- Mike

Log:
Handle the log message when requested with an implicit BASE:1 in the working
copy, with an empty repository (no revisions). This addresses issue
#692... this is not the "saner fix" mentioned by Greg Hudson, just a
quick fix for right now since "svn log" in a working copy with an empty
repository errors out unnecessarily.

* subversion/libsvn_client/log.c
  (svn_client_log): The special case code now handles the case where a request
  of BASE:1 was made implicitly via a working copy, in addition to the case
  where HEAD:1 was requested implicitly via a URL.

Index: subversion/libsvn_client/log.c
===================================================================
--- subversion/libsvn_client/log.c (revision 10100)
+++ subversion/libsvn_client/log.c (working copy)
@@ -288,7 +288,8 @@
      * See also http://subversion.tigris.org/issues/show_bug.cgi?id=692.
      */
     if (err && (err->apr_err == SVN_ERR_FS_NO_SUCH_REVISION)
- && (start->kind == svn_opt_revision_head)
+ && ((start->kind == svn_opt_revision_head)
+ || (start->kind == svn_opt_revision_base))
         && ((end->kind == svn_opt_revision_number)
             && (end->value.number == 1)))
       {

-- 
Michael W. Thelen
If you wish your merit to be known, acknowledge that of other people.
                -- Oriental proverb

Received on Tue Jun 29 08:59:38 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.