You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David Kimdon <dw...@debian.org> on 2002/05/01 05:57:32 UTC

[PATCH]: fix #661 (Bad user supplied rev # produces scary error)

Hi,

This patch fixes the spooky error message of issue #661.

before:
$ svn merge file:///var/svn -r 400:500

subversion/libsvn_fs/err.c:96
svn_error: #21055 : <Filesystem is corrupt>
  reference to non-existent revision `400' in filesystem `/var/svn/db'
$ 

after:
$ svn merge file:///var/svn -r 400:500

subversion/libsvn_fs/err.c:158
svn_error: #21057 : <Invalid filesystem revision number>
  reference to non-existent revision `400' in filesystem `/var/svn/db'
$ 


-David


    Fix issue #661:

    * subversion/libsvn_fs/err.c (svn_fs__err_dangling_rev):  When a
    non-existent revision is referenced pass back the 'Invalid filesystem
    revision number' error structure rather than the 'Filesystem is corrupt'
    error structure.


Index: subversion/libsvn_fs/err.c
===================================================================
--- subversion/libsvn_fs/err.c
+++ subversion/libsvn_fs/err.c	Thu Apr 25 22:28:40 2002
@@ -154,9 +154,11 @@
 svn_error_t *
 svn_fs__err_dangling_rev (svn_fs_t *fs, svn_revnum_t rev)
 {
-  return
-    corrupt_rev ("reference to non-existent revision `%lu' in filesystem `%s'",
-                 rev, fs);
+  return 
+    svn_error_createf
+    (SVN_ERR_FS_NO_SUCH_REVISION, 0, 0, fs->pool,
+     "reference to non-existent revision `%lu' in filesystem `%s'",
+     (unsigned long) rev, fs->path);
 }
 
 

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

Re: [PATCH]: fix #661 (Bad user supplied rev # produces scary error)

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
David Kimdon <dw...@debian.org> writes:
> This patch fixes the spooky error message of issue #661.

Applied in rev 1835 (with an extra tweak, see the rev for details).

Thanks!

-K

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

Re: SVN_REVNUM_T_FMT anyone?, WAS: RE: [PATCH]: fix #661 (Bad user supplied rev # produces scary error)

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
"Sander Striker" <st...@apache.org> writes:
> I've seen this a lot in the codebase.  What I would really like
> is an SVN_REVNUM_T_FMT define, which we can use similar like the
> APR_xxx_T_FMT defines (example: printf("%" APR_OFF_T_FMT,
> some_apr_off_t_var); ).
> We can loose the cast with this and changing the type (lets not do that!),
> will only be a one place modification.

Ahhh, good idea.  Done in revision 1836.

-K

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

SVN_REVNUM_T_FMT anyone?, WAS: RE: [PATCH]: fix #661 (Bad user supplied rev # produces scary error)

Posted by Sander Striker <st...@apache.org>.
> From: David Kimdon [mailto:dwhedon@dualmedia.fr]On Behalf Of David
> Kimdon
> Sent: 01 May 2002 07:58

> Hi,
> 
> This patch fixes the spooky error message of issue #661.

[...]
> +  return 
> +    svn_error_createf
> +    (SVN_ERR_FS_NO_SUCH_REVISION, 0, 0, fs->pool,
> +     "reference to non-existent revision `%lu' in filesystem `%s'",
                                              ^^
> +     (unsigned long) rev, fs->path);
         ^^^^^^^^^^^^^

I've seen this a lot in the codebase.  What I would really like
is an SVN_REVNUM_T_FMT define, which we can use similar like the
APR_xxx_T_FMT defines (example: printf("%" APR_OFF_T_FMT, some_apr_off_t_var); ).
We can loose the cast with this and changing the type (lets not do that!),
will only be a one place modification.

Sander

PS.  This has nothing to do with the presented patch.


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