Author: steveking
Date: Wed May 18 18:58:49 2011
New Revision: 1124382

URL: http://svn.apache.org/viewvc?rev=1124382&view=rev
Log:
As discussed :http://svn.haxx.se/dev/archive-2011-05/0543.shtml
make it possible for clients to determine the suggested action to resolve
the error from the error code.

* subversion/include/svn_error_codes.h
  new error code SVN_ERR_CLIENT_MERGE_UPDATEREQUIRED which indicates that an
  update would resolve the problem
* /subversion/libsvn_client\merge.c
  (calculate_remaining_ranges)
  (ensure_wc_is_suitable_merge_target): return the new error code
* subversion/libsvn_ra_neon/commit.c
  (checkout_resource): change error code to SVN_ERR_FS_OUT_OF_DATE indicating
  that an update would resolve the problem

Modified:
    subversion/trunk/subversion/include/svn_error_codes.h
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/libsvn_ra_neon/commit.c

Modified: subversion/trunk/subversion/include/svn_error_codes.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_error_codes.h?rev=1124382&r1=1124381&r2=1124382&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_error_codes.h (original)
+++ subversion/trunk/subversion/include/svn_error_codes.h Wed May 18 18:58:49 
2011
@@ -1196,6 +1196,11 @@ SVN_ERROR_START
              SVN_ERR_CLIENT_CATEGORY_START + 19,
              "Detected a cycle while processing the operation")
 
+  /** @since New in 1.7. */
+  SVN_ERRDEF(SVN_ERR_CLIENT_MERGE_UPDATEREQUIRED,
+             SVN_ERR_CLIENT_CATEGORY_START + 20,
+             "Working copy and merge source not ready for reintegration")
+
   /* misc errors */
 
   SVN_ERRDEF(SVN_ERR_BASE,

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1124382&r1=1124381&r2=1124382&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Wed May 18 18:58:49 2011
@@ -3943,7 +3943,7 @@ calculate_remaining_ranges(svn_client__m
           SVN_ERR(svn_wc__node_get_url(&url, ctx->wc_ctx, child->abspath,
                                        scratch_pool, scratch_pool));
           if (strcmp(start_url, url) == 0)
-            return svn_error_create(SVN_ERR_CLIENT_NOT_READY_TO_MERGE, NULL,
+            return svn_error_create(SVN_ERR_CLIENT_MERGE_UPDATEREQUIRED, NULL,
                                     _("Cannot reverse-merge a range from a "
                                       "path's own future history; try "
                                       "updating first"));
@@ -9015,7 +9015,7 @@ ensure_wc_is_suitable_merge_target(const
         }
 
       if (min_rev != max_rev)
-        return svn_error_createf(SVN_ERR_CLIENT_NOT_READY_TO_MERGE, NULL,
+        return svn_error_createf(SVN_ERR_CLIENT_MERGE_UPDATEREQUIRED, NULL,
                                  _("Cannot merge into mixed-revision working "
                                    "copy [%lu:%lu]; try updating first"),
                                    min_rev, max_rev);

Modified: subversion/trunk/subversion/libsvn_ra_neon/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/commit.c?rev=1124382&r1=1124381&r2=1124382&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/commit.c (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/commit.c Wed May 18 18:58:49 2011
@@ -508,7 +508,7 @@ static svn_error_t * checkout_resource(c
          ### overly generic.  See issue #2740. */
       if (err->apr_err == SVN_ERR_FS_CONFLICT)
         return svn_error_createf
-          (err->apr_err, err,
+          (SVN_ERR_FS_OUT_OF_DATE, err,
            _("File or directory '%s' is out of date; try updating"),
            svn_relpath_local_style(local_relpath, pool));
       return err;


Reply via email to