You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Michael W Thelen <th...@cs.utah.edu> on 2004/06/29 06:58:15 UTC

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

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

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

Posted by kf...@collab.net.
Michael W Thelen <th...@cs.utah.edu> writes:
> Well, I don't see a reason not to apply it if it works... but I think my
> pedantic nature and current lack of SVN development experience make me a
> good volunteer to implement the saner fix.  (I want to see the bug
> completely fixed, and since it's a harmless bug I probably won't break
> anything in trying.)  I'll see what I can do.

Sounds great to me...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by Michael W Thelen <th...@cs.utah.edu>.
* kfogel@collab.net <kf...@collab.net> [2004-06-30 12:44]:
> Michael W Thelen <th...@cs.utah.edu> writes:
> > 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.
> 
> Thanks for the patch, but I wonder -- is it worth it?
> 
> That is, if there is a saner fix available, and the bug is so rare and
> so inconsequential anyway (which I believe this one is), then there's
> little point putting in a "quick fix".  It would be better to do
> nothing, or do the sane fix.

Well, I don't see a reason not to apply it if it works... but I think my
pedantic nature and current lack of SVN development experience make me a
good volunteer to implement the saner fix.  (I want to see the bug
completely fixed, and since it's a harmless bug I probably won't break
anything in trying.)  I'll see what I can do.

-- Mike

-- 
Michael W. Thelen
When everybody actually is out to get you, paranoia is just good thinking.
                -- Woody Allen

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

Posted by kf...@collab.net.
Michael W Thelen <th...@cs.utah.edu> writes:
> 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.

Thanks for the patch, but I wonder -- is it worth it?

That is, if there is a saner fix available, and the bug is so rare and
so inconsequential anyway (which I believe this one is), then there's
little point putting in a "quick fix".  It would be better to do
nothing, or do the sane fix.

Thoughts?

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org