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 Glasser <gl...@davidglasser.net> on 2008/04/20 19:41:04 UTC

Re: svn commit: r30684 - in trunk/subversion: include libsvn_client libsvn_ra svnsync tests/cmdline tests/libsvn_ra_local

On Fri, Apr 18, 2008 at 9:56 AM,  <kf...@tigris.org> wrote:
> Author: kfogel
>  Date: Fri Apr 18 09:56:09 2008
>  New Revision: 30684
>
>  Log:
>  Check repository UUID when creating an RA session.  This fixes an
>  issue where "svn update" would silently overwrite the UUID of a
>  working copy if the repository UUID had changed.  Several tests in
>  svnadmin_tests which silently took advantage of this are fixed too.
>
>  This patch was filed as issue #3177.
>
>  Patch by: Daniel Shahaf <d....@daniel.shahaf.co.il>
>  (Tweaked by me to use the new API everywhere, fix up comments, etc.)
>
>  * subversion/include/svn_ra.h, subversion/libsvn_ra/ra_loader.c
>   (svn_ra_open3): New API, deprecates svn_ra_open2.  Adjust comments.
>
>  * subversion/libsvn_client/ra.c
>   (svn_client__open_ra_session_internal): When having a working copy,
>     pass its uuid to svn_ra_open3().
>
>  * subversion/include/svn_error_codes.h
>   (SVN_ERR_RA_UUID_MISMATCH): New error.
>
>  * subversion/tests/libsvn_ra_local/ra-local-test.c
>   (make_and_open_local_repos): Call svn_ra_open3, but pass NULL for uuid.
>
>  * subversion/svnsync/main.c
>   (do_initialize, initialize_cmd, synchronize_cmd, copy_revprops_cmd):
>     Call svn_ra_open3.
>   (open_source_session): Call svn_ra_open3, pass the expected uuid to it,
>     and eliminate the code that compared uuids by hand.
>
>  * subversion/include/svn_client.h
>   (svn_client_open_ra_session): Adjust comment.
>
>  * subversion/libsvn_client/client.h
>   (svn_client__default_walker_error_handler): Adjust comment.
>
>  * subversion/libsvn_client/copy.c
>   (repos_to_repos_copy): Adjust comment.
>
>  * subversion/tests/cmdline/update_tests.py
>   (update_uuid_changed): New test.
>   (test_list): Run it.
>
>  * subversion/tests/cmdline/switch_tests.py
>   (switch_change_repos_root): Change expected error message.
>
>  * subversion/tests/cmdline/svnadmin_tests.py
>   (extra_headers, extra_blockcontent, empty_date):
>     Load dumpfile with '--ignore-uuid' in order to not change the repository
>     uuid, since a working copy already has been checked out from it.
>
>  Modified:
>    trunk/subversion/include/svn_client.h
>    trunk/subversion/include/svn_error_codes.h
>    trunk/subversion/include/svn_ra.h
>    trunk/subversion/libsvn_client/client.h
>    trunk/subversion/libsvn_client/copy.c
>    trunk/subversion/libsvn_client/ra.c
>    trunk/subversion/libsvn_ra/ra_loader.c
>    trunk/subversion/svnsync/main.c
>    trunk/subversion/tests/cmdline/svnadmin_tests.py
>    trunk/subversion/tests/cmdline/switch_tests.py
>    trunk/subversion/tests/cmdline/update_tests.py
>    trunk/subversion/tests/libsvn_ra_local/ra-local-test.c
>
>  Modified: trunk/subversion/include/svn_client.h
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_client.h?pathrev=30684&r1=30683&r2=30684
>  ==============================================================================
>  --- trunk/subversion/include/svn_client.h       Fri Apr 18 08:57:47 2008        (r30683)
>  +++ trunk/subversion/include/svn_client.h       Fri Apr 18 09:56:09 2008        (r30684)
>  @@ -4319,7 +4319,7 @@ svn_client_uuid_from_path(const char **u
>   *
>   * @since New in 1.3.
>   *
>  - * @note This function is similar to svn_ra_open2(), but the caller avoids
>  + * @note This function is similar to svn_ra_open3(), but the caller avoids
>   * having to providing its own callback functions.
>   */
>   svn_error_t *
>
>  Modified: trunk/subversion/include/svn_error_codes.h
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_error_codes.h?pathrev=30684&r1=30683&r2=30684
>  ==============================================================================
>  --- trunk/subversion/include/svn_error_codes.h  Fri Apr 18 08:57:47 2008        (r30683)
>  +++ trunk/subversion/include/svn_error_codes.h  Fri Apr 18 09:56:09 2008        (r30684)
>  @@ -739,6 +739,11 @@ SVN_ERROR_START
>               SVN_ERR_RA_CATEGORY_START + 8,
>               "Server can only replay from the root of a repository")
>
>  +  /** @since New in 1.5. */
>  +  SVN_ERRDEF(SVN_ERR_RA_UUID_MISMATCH,
>  +             SVN_ERR_RA_CATEGORY_START + 9,
>  +             "Repository UUID does not match expected UUID")
>  +
>    /* ra_dav errors */
>
>    SVN_ERRDEF(SVN_ERR_RA_DAV_SOCK_INIT,
>
>  Modified: trunk/subversion/include/svn_ra.h
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_ra.h?pathrev=30684&r1=30683&r2=30684
>  ==============================================================================
>  --- trunk/subversion/include/svn_ra.h   Fri Apr 18 08:57:47 2008        (r30683)
>  +++ trunk/subversion/include/svn_ra.h   Fri Apr 18 09:56:09 2008        (r30684)
>  @@ -57,7 +57,7 @@ const svn_version_t *svn_ra_version(void
>   * @a close_baton as appropriate.
>   *
>   * @a path is relative to the "root" of the session, defined by the
>  - * @a repos_url passed to svn_ra_open2() vtable call.
>  + * @a repos_URL passed to svn_ra_open3() vtable call.
>   *
>   * @a name is the name of the property to fetch. If the property is present,
>   * then it is returned in @a value. Otherwise, @a *value is set to @c NULL.
>  @@ -284,7 +284,7 @@ typedef struct svn_ra_reporter3_t
>     * implementor should assume the directory has no entries or props.
>     *
>     * This will *override* any previous set_path() calls made on parent
>  -   * paths.  @a path is relative to the URL specified in svn_ra_open2().
>  +   * paths.  @a path is relative to the URL specified in svn_ra_open3().
>     *
>     * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
>     *
>  @@ -435,7 +435,7 @@ typedef struct svn_ra_reporter_t
>   /** A collection of callbacks implemented by libsvn_client which allows
>   * an RA layer to "pull" information from the client application, or
>   * possibly store information.  libsvn_client passes this vtable to
>  - * svn_ra_open2().
>  + * svn_ra_open3().
>   *
>   * Each routine takes a @a callback_baton originally provided with the
>   * vtable.
>  @@ -571,6 +571,9 @@ typedef struct svn_ra_session_t svn_ra_s
>   * Open a repository session to @a repos_URL.  Return an opaque object
>   * representing this session in @a *session_p, allocated in @a pool.
>   *
>  + * Return @c SVN_ERR_RA_UUID_MISMATCH if @a uuid is non-NULL and not equal
>  + * to the UUID of the repository at @c repos_URL.
>  + *
>   * @a callbacks/@a callback_baton is a table of callbacks provided by the
>   * client; see @c svn_ra_callbacks2_t.
>   *
>  @@ -583,7 +586,22 @@ typedef struct svn_ra_session_t svn_ra_s
>   *
>   * @see svn_client_open_ra_session().
>   *
>  + * @since New in 1.6.
>  + */
>  +svn_error_t *
>  +svn_ra_open3(svn_ra_session_t **session_p,
>  +             const char *repos_URL,
>  +             const char *uuid,
>  +             const svn_ra_callbacks2_t *callbacks,
>  +             void *callback_baton,
>  +             apr_hash_t *config,
>  +             apr_pool_t *pool);
>  +
>  +/**
>  + * Similiar to svn_ra_open3(), but with @a uuid set to @c NULL.
>  + *
>   * @since New in 1.3.
>  + * @deprecated Provided for backward compatibility with the 1.4 API.
>   */
>   svn_error_t *
>   svn_ra_open2(svn_ra_session_t **session_p,
>
>  Modified: trunk/subversion/libsvn_client/client.h
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/client.h?pathrev=30684&r1=30683&r2=30684
>  ==============================================================================
>  --- trunk/subversion/libsvn_client/client.h     Fri Apr 18 08:57:47 2008        (r30683)
>  +++ trunk/subversion/libsvn_client/client.h     Fri Apr 18 09:56:09 2008        (r30684)
>  @@ -369,11 +369,11 @@ svn_client__default_walker_error_handler
>   #define SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx) \
>          ((ctx)->log_msg_func3 || (ctx)->log_msg_func2 || (ctx)->log_msg_func)
>
>  -/* This is the baton that we pass svn_ra_open2(), and is associated with
>  +/* This is the baton that we pass svn_ra_open3(), and is associated with
>     the callback table we provide to RA. */
>   typedef struct
>   {
>  -  /* Holds the directory that corresponds to the REPOS_URL at svn_ra_open2()
>  +  /* Holds the directory that corresponds to the REPOS_URL at svn_ra_open3()
>       time. When callbacks specify a relative path, they are joined with
>       this base directory. */
>    const char *base_dir;
>
>  Modified: trunk/subversion/libsvn_client/copy.c
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/copy.c?pathrev=30684&r1=30683&r2=30684
>  ==============================================================================
>  --- trunk/subversion/libsvn_client/copy.c       Fri Apr 18 08:57:47 2008        (r30683)
>  +++ trunk/subversion/libsvn_client/copy.c       Fri Apr 18 09:56:09 2008        (r30684)
>  @@ -749,7 +749,7 @@ repos_to_repos_copy(svn_commit_info_t **
>                                               ctx, pool);
>
>    /* If the two URLs appear not to be in the same repository, then
>  -     top_url will be empty and the call to svn_ra_open2()
>  +     top_url will be empty and the call to svn_ra_open3()
>       above will have failed.  Below we check for that, and propagate a
>       descriptive error back to the user.
>
>
>  Modified: trunk/subversion/libsvn_client/ra.c
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/ra.c?pathrev=30684&r1=30683&r2=30684
>  ==============================================================================
>  --- trunk/subversion/libsvn_client/ra.c Fri Apr 18 08:57:47 2008        (r30683)
>  +++ trunk/subversion/libsvn_client/ra.c Fri Apr 18 09:56:09 2008        (r30684)
>  @@ -291,6 +291,7 @@ svn_client__open_ra_session_internal(svn
>   {
>    svn_ra_callbacks2_t *cbtable = apr_pcalloc(pool, sizeof(*cbtable));
>    svn_client__callback_baton_t *cb = apr_pcalloc(pool, sizeof(*cb));
>  +  const char *uuid = NULL;
>
>    cbtable->open_tmp_file = use_admin ? open_admin_tmp_file : open_tmp_file;
>    cbtable->get_wc_prop = use_admin ? get_wc_prop : NULL;
>  @@ -310,7 +311,17 @@ svn_client__open_ra_session_internal(svn
>    cb->commit_items = commit_items;
>    cb->ctx = ctx;
>
>  -  SVN_ERR(svn_ra_open2(ra_session, base_url, cbtable, cb,
>  +  if (base_access)
>  +    {
>  +      svn_wc_entry_t *entry;
>  +
>  +      SVN_ERR(svn_wc_entry(&entry, base_dir, base_access, FALSE, pool));

I get a warning on this line; I think it wants entry to be const?

--dave

>  +
>  +      if (entry && entry->uuid)
>  +        uuid = entry->uuid;
>  +    }
>  +
>  +  SVN_ERR(svn_ra_open3(ra_session, base_url, uuid, cbtable, cb,
>                         ctx->config, pool));
>
>    return SVN_NO_ERROR;
>
>  Modified: trunk/subversion/libsvn_ra/ra_loader.c
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_ra/ra_loader.c?pathrev=30684&r1=30683&r2=30684
>  ==============================================================================
>  --- trunk/subversion/libsvn_ra/ra_loader.c      Fri Apr 18 08:57:47 2008        (r30683)
>  +++ trunk/subversion/libsvn_ra/ra_loader.c      Fri Apr 18 09:56:09 2008        (r30684)
>  @@ -50,7 +50,7 @@
>
>   /* ### This file maps URL schemes to particular RA libraries.
>     ### Currently, the only pair of RA libraries which support the same
>  -   ### protocols are neon and serf.  svn_ra_open2 makes the assumption
>  +   ### protocols are neon and serf.  svn_ra_open3 makes the assumption
>     ### that this is the case; that their 'schemes' fields are both
>     ### dav_schemes; and that "neon" is listed first.
>
>  @@ -378,8 +378,9 @@ svn_ra_create_callbacks(svn_ra_callbacks
>    return SVN_NO_ERROR;
>   }
>
>  -svn_error_t *svn_ra_open2(svn_ra_session_t **session_p,
>  +svn_error_t *svn_ra_open3(svn_ra_session_t **session_p,
>                            const char *repos_URL,
>  +                          const char *uuid,
>                            const svn_ra_callbacks2_t *callbacks,
>                            void *callback_baton,
>                            apr_hash_t *config,
>  @@ -468,10 +469,37 @@ svn_error_t *svn_ra_open2(svn_ra_session
>    SVN_ERR(vtable->open_session(session, repos_URL, callbacks, callback_baton,
>                                 config, pool));
>
>  +  /* Check the UUID. */
>  +  if (uuid)
>  +    {
>  +      const char *repository_uuid;
>  +
>  +      SVN_ERR(vtable->get_uuid(session, &repository_uuid, pool));
>  +
>  +      if (strcmp(uuid, repository_uuid) != 0)
>  +        {
>  +          return svn_error_createf(SVN_ERR_RA_UUID_MISMATCH, NULL,
>  +                                   _("Repository UUID '%s' doesn't match "
>  +                                     "expected UUID '%s'"),
>  +                                   repository_uuid, uuid);
>  +        }
>  +    }
>  +
>    *session_p = session;
>    return SVN_NO_ERROR;
>   }
>
>  +svn_error_t *svn_ra_open2(svn_ra_session_t **session_p,
>  +                          const char *repos_URL,
>  +                          const svn_ra_callbacks2_t *callbacks,
>  +                          void *callback_baton,
>  +                          apr_hash_t *config,
>  +                          apr_pool_t *pool)
>  +{
>  +  return svn_ra_open3(session_p, repos_URL, NULL,
>  +                      callbacks, callback_baton, config, pool);
>  +}
>  +
>   svn_error_t *svn_ra_open(svn_ra_session_t **session_p,
>                           const char *repos_URL,
>                           const svn_ra_callbacks_t *callbacks,
>
>  Modified: trunk/subversion/svnsync/main.c
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svnsync/main.c?pathrev=30684&r1=30683&r2=30684
>  ==============================================================================
>  --- trunk/subversion/svnsync/main.c     Fri Apr 18 08:57:47 2008        (r30683)
>  +++ trunk/subversion/svnsync/main.c     Fri Apr 18 09:56:09 2008        (r30684)
>  @@ -619,7 +619,7 @@ do_initialize(svn_ra_session_t *to_sessi
>
>    /* Now fill in our bookkeeping info in the dest repository. */
>
>  -  SVN_ERR(svn_ra_open2(&from_session, baton->from_url,
>  +  SVN_ERR(svn_ra_open3(&from_session, baton->from_url, NULL,
>                         &(baton->source_callbacks), baton,
>                         baton->config, pool));
>    SVN_ERR(svn_ra_get_repos_root2(from_session, &root_url, pool));
>  @@ -703,8 +703,8 @@ initialize_cmd(apr_getopt_t *os, void *b
>                               _("Path '%s' is not a URL"), from_url);
>
>    baton = make_subcommand_baton(opt_baton, to_url, from_url, 0, 0, pool);
>  -  SVN_ERR(svn_ra_open2(&to_session, baton->to_url, &(baton->sync_callbacks),
>  -                       baton, baton->config, pool));
>  +  SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
>  +                       &(baton->sync_callbacks), baton, baton->config, pool));
>    SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
>    SVN_ERR(with_locked(to_session, do_initialize, baton, pool));
>
>  @@ -1237,7 +1237,6 @@ open_source_session(svn_ra_session_t **f
>                      apr_pool_t *pool)
>   {
>    svn_string_t *from_url, *from_uuid;
>  -  const char *uuid;
>
>    SVN_ERR(svn_ra_rev_prop(to_session, 0, SVNSYNC_PROP_FROM_URL,
>                            &from_url, pool));
>  @@ -1252,19 +1251,8 @@ open_source_session(svn_ra_session_t **f
>         _("Destination repository has not been initialized"));
>
>    /* Open the session to copy the revision data. */
>  -  SVN_ERR(svn_ra_open2(from_session, from_url->data, callbacks, baton,
>  -                       config, pool));
>  -
>  -  /* Ok, now sanity check the UUID of the source repository, it
>  -     wouldn't be a good thing to sync from a different repository. */
>  -
>  -  SVN_ERR(svn_ra_get_uuid2(*from_session, &uuid, pool));
>  -
>  -  if (strcmp(uuid, from_uuid->data) != 0)
>  -    return svn_error_createf(APR_EINVAL, NULL,
>  -                             _("UUID of source repository (%s) does not "
>  -                               "match expected UUID (%s)"),
>  -                             uuid, from_uuid->data);
>  +  SVN_ERR(svn_ra_open3(from_session, from_url->data, from_uuid->data,
>  +                       callbacks, baton, config, pool));
>
>    return SVN_NO_ERROR;
>   }
>  @@ -1642,8 +1630,8 @@ synchronize_cmd(apr_getopt_t *os, void *
>                               _("Path '%s' is not a URL"), to_url);
>
>    baton = make_subcommand_baton(opt_baton, to_url, NULL, 0, 0, pool);
>  -  SVN_ERR(svn_ra_open2(&to_session, baton->to_url, &(baton->sync_callbacks),
>  -                       baton, baton->config, pool));
>  +  SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
>  +                       &(baton->sync_callbacks), baton, baton->config, pool));
>    SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
>    SVN_ERR(with_locked(to_session, do_synchronize, baton, pool));
>
>  @@ -1793,8 +1781,8 @@ copy_revprops_cmd(apr_getopt_t *os, void
>
>    baton = make_subcommand_baton(opt_baton, to_url, NULL,
>                                  start_rev, end_rev, pool);
>  -  SVN_ERR(svn_ra_open2(&to_session, baton->to_url, &(baton->sync_callbacks),
>  -                       baton, baton->config, pool));
>  +  SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
>  +                       &(baton->sync_callbacks), baton, baton->config, pool));
>    SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
>    SVN_ERR(with_locked(to_session, do_copy_revprops, baton, pool));
>
>
>  Modified: trunk/subversion/tests/cmdline/svnadmin_tests.py
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/svnadmin_tests.py?pathrev=30684&r1=30683&r2=30684
>  ==============================================================================
>  --- trunk/subversion/tests/cmdline/svnadmin_tests.py    Fri Apr 18 08:57:47 2008        (r30683)
>  +++ trunk/subversion/tests/cmdline/svnadmin_tests.py    Fri Apr 18 09:56:09 2008        (r30684)
>  @@ -204,7 +204,8 @@ def extra_headers(sbox):
>    dumpfile[3:3] = \
>         [ "X-Comment-Header: Ignored header normally not in dump stream\n" ]
>
>  -  load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile)
>  +  load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile,
>  +                             '--ignore-uuid')
>
>   #----------------------------------------------------------------------
>   # Ensure loading continues after skipping a bit of unknown extra content.
>  @@ -222,7 +223,8 @@ def extra_blockcontent(sbox):
>    # Insert the extra content after "PROPS-END\n"
>    dumpfile[11] = dumpfile[11][:-2] + "extra text\n\n\n"
>
>  -  load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile)
>  +  load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile,
>  +                             '--ignore-uuid')
>
>   #----------------------------------------------------------------------
>   def inconsistent_headers(sbox):
>  @@ -254,7 +256,8 @@ def empty_date(sbox):
>           "K 7\nsvn:log\nV 0\n\nK 10\nsvn:author\nV 4\nerik\nPROPS-END\n\n\n"
>           ]
>
>  -  load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile)
>  +  load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile,
>  +                             '--ignore-uuid')
>
>    # Verify that the revision still lacks the svn:date property.
>    svntest.actions.run_and_verify_svn(None, [], [], "propget",
>
>  Modified: trunk/subversion/tests/cmdline/switch_tests.py
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/switch_tests.py?pathrev=30684&r1=30683&r2=30684
>  ==============================================================================
>  --- trunk/subversion/tests/cmdline/switch_tests.py      Fri Apr 18 08:57:47 2008        (r30683)
>  +++ trunk/subversion/tests/cmdline/switch_tests.py      Fri Apr 18 09:56:09 2008        (r30684)
>  @@ -1067,7 +1067,7 @@ def switch_change_repos_root(sbox):
>
>    svntest.main.create_repos(other_repo_dir)
>    svntest.actions.run_and_verify_svn(None, None,
>  -                                     ".*not the same repository.*",
>  +                                     ".*UUID.*",
>                                       'switch',
>                                       other_A_url, A_wc_dir)
>
>
>  Modified: trunk/subversion/tests/cmdline/update_tests.py
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/update_tests.py?pathrev=30684&r1=30683&r2=30684
>  ==============================================================================
>  --- trunk/subversion/tests/cmdline/update_tests.py      Fri Apr 18 08:57:47 2008        (r30683)
>  +++ trunk/subversion/tests/cmdline/update_tests.py      Fri Apr 18 09:56:09 2008        (r30684)
>  @@ -3817,6 +3817,45 @@ interactive-conflicts = true
>                                          '-r1', wc_dir)
>
>
>  +#----------------------------------------------------------------------
>  +
>  +
>  +def update_uuid_changed(sbox):
>  +  "update fails when repos uuid changed"
>  +
>  +  def wc_uuid(wc_dir):
>  +    "Return the UUID of the working copy at WC_DIR."
>  +
>  +    exit_code, output, errput = svntest.main.run_svn(None, 'info', wc_dir)
>  +    if errput:
>  +      raise svntest.verify.SVNUnexpectedStderr(errput)
>  +
>  +    for line in output:
>  +      if line.startswith('Repository UUID:'):
>  +        return line[17:].rstrip()
>  +
>  +    # No 'Repository UUID' line in 'svn info'?
>  +    raise svntest.verify.SVNUnexpectedStdout(output)
>  +
>  +  sbox.build(read_only = True)
>  +  wc_dir = sbox.wc_dir
>  +  repo_dir = sbox.repo_dir
>  +
>  +  uuid_before = wc_uuid(wc_dir)
>  +
>  +  # Change repository's uuid.
>  +  svntest.actions.run_and_verify_svnadmin(None, None, [],
>  +                                          'setuuid', repo_dir)
>  +
>  +  # 'update' detected the new uuid...
>  +  svntest.actions.run_and_verify_svn(None, None, '.*UUID.*',
>  +                                     'update', wc_dir)
>  +
>  +  # ...and didn't overwrite the old uuid.
>  +  uuid_after = wc_uuid(wc_dir)
>  +  if uuid_before != uuid_after:
>  +    raise svntest.Failure
>  +
>
>   #######################################################################
>   # Run the tests
>  @@ -3870,6 +3909,7 @@ test_list = [ None,
>                update_copied_and_deleted_prop,
>                update_accept_conflicts,
>                eof_in_interactive_conflict_resolver,
>  +              update_uuid_changed,
>               ]
>
>   if __name__ == '__main__':
>
>  Modified: trunk/subversion/tests/libsvn_ra_local/ra-local-test.c
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/libsvn_ra_local/ra-local-test.c?pathrev=30684&r1=30683&r2=30684
>  ==============================================================================
>  --- trunk/subversion/tests/libsvn_ra_local/ra-local-test.c      Fri Apr 18 08:57:47 2008        (r30683)
>  +++ trunk/subversion/tests/libsvn_ra_local/ra-local-test.c      Fri Apr 18 09:56:09 2008        (r30684)
>  @@ -99,8 +99,9 @@ make_and_open_local_repos(svn_ra_session
>
>    SVN_ERR(current_directory_url(&url, repos_name, pool));
>
>  -  SVN_ERR(svn_ra_open2(session,
>  +  SVN_ERR(svn_ra_open3(session,
>                         url,
>  +                       NULL,
>                         cbtable,
>                         NULL,
>                         NULL,
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
>  For additional commands, e-mail: svn-help@subversion.tigris.org
>
>



-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

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

Re: svn commit: r30684 - in trunk/subversion: include libsvn_client libsvn_ra svnsync tests/cmdline tests/libsvn_ra_local

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Karl Fogel wrote on Mon, 21 Apr 2008 at 02:33 -0400:
> "David Glasser" <gl...@davidglasser.net> writes:
> >>  -  SVN_ERR(svn_ra_open2(ra_session, base_url, cbtable, cb,
> >>  +  if (base_access)
> >>  +    {
> >>  +      svn_wc_entry_t *entry;
> >>  +
> >>  +      SVN_ERR(svn_wc_entry(&entry, base_dir, base_access, FALSE, pool));
> >
> > I get a warning on this line; I think it wants entry to be const?
> 
> Thanks.  I think Senthil caught this later and will be committing the
> fix.
(r30726)
> Don't know why I missed the warning -- I assume there was one, I'm
> using GCC 4.2.3 (Debian 4.2.3-3) -- when I built it.
> 

You're probably correct, I'm using the same version and get a warning.  
(I'm surprised it got in the patch, however;  I do check for warnings.)

> -Karl
> 


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

Re: svn commit: r30684 - in trunk/subversion: include libsvn_client libsvn_ra svnsync tests/cmdline tests/libsvn_ra_local

Posted by Karl Fogel <kf...@red-bean.com>.
"David Glasser" <gl...@davidglasser.net> writes:
>>  -  SVN_ERR(svn_ra_open2(ra_session, base_url, cbtable, cb,
>>  +  if (base_access)
>>  +    {
>>  +      svn_wc_entry_t *entry;
>>  +
>>  +      SVN_ERR(svn_wc_entry(&entry, base_dir, base_access, FALSE, pool));
>
> I get a warning on this line; I think it wants entry to be const?

Thanks.  I think Senthil caught this later and will be committing the
fix.  Don't know why I missed the warning -- I assume there was one, I'm
using GCC 4.2.3 (Debian 4.2.3-3) -- when I built it.

-Karl

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

Re: svn commit: r30684 - in trunk/subversion: include libsvn_client libsvn_ra svnsync tests/cmdline tests/libsvn_ra_local

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
David Glasser wrote on Sun, 20 Apr 2008 at 12:41 -0700:
> On Fri, Apr 18, 2008 at 9:56 AM,  <kf...@tigris.org> wrote:
> > Author: kfogel
> >  Date: Fri Apr 18 09:56:09 2008
> >  New Revision: 30684
> >
> >  Log:
> >  Check repository UUID when creating an RA session.  This fixes an
> >  issue where "svn update" would silently overwrite the UUID of a
> >  working copy if the repository UUID had changed.  Several tests in
> >  svnadmin_tests which silently took advantage of this are fixed too.
> >
> >  --- trunk/subversion/libsvn_client/ra.c Fri Apr 18 08:57:47 2008        (r30683)
> >  +++ trunk/subversion/libsvn_client/ra.c Fri Apr 18 09:56:09 2008        (r30684)
> >  @@ -291,6 +291,7 @@ svn_client__open_ra_session_internal(svn
> >   {
> >    svn_ra_callbacks2_t *cbtable = apr_pcalloc(pool, sizeof(*cbtable));
> >    svn_client__callback_baton_t *cb = apr_pcalloc(pool, sizeof(*cb));
> >  +  const char *uuid = NULL;
> >
> >    cbtable->open_tmp_file = use_admin ? open_admin_tmp_file : open_tmp_file;
> >    cbtable->get_wc_prop = use_admin ? get_wc_prop : NULL;
> >  @@ -310,7 +311,17 @@ svn_client__open_ra_session_internal(svn
> >    cb->commit_items = commit_items;
> >    cb->ctx = ctx;
> >
> >  -  SVN_ERR(svn_ra_open2(ra_session, base_url, cbtable, cb,
> >  +  if (base_access)
> >  +    {
> >  +      svn_wc_entry_t *entry;
> >  +
> >  +      SVN_ERR(svn_wc_entry(&entry, base_dir, base_access, FALSE, pool));
> 
> I get a warning on this line; I think it wants entry to be const?
> 

Yes it does.  Sorry about that;  I fixed it here, but forgot to
convey the fix to the list.

Daniel


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

Re: svn commit: r30684 - in trunk/subversion: include libsvn_client libsvn_ra svnsync tests/cmdline tests/libsvn_ra_local

Posted by Senthil Kumaran S <se...@collab.net>.
David Glasser wrote:
>>    cbtable->open_tmp_file = use_admin ? open_admin_tmp_file : open_tmp_file;
>>    cbtable->get_wc_prop = use_admin ? get_wc_prop : NULL;
>>  @@ -310,7 +311,17 @@ svn_client__open_ra_session_internal(svn
>>    cb->commit_items = commit_items;
>>    cb->ctx = ctx;
>>
>>  -  SVN_ERR(svn_ra_open2(ra_session, base_url, cbtable, cb,
>>  +  if (base_access)
>>  +    {
>>  +      svn_wc_entry_t *entry;
>>  +
>>  +      SVN_ERR(svn_wc_entry(&entry, base_dir, base_access, FALSE, pool));
> 
> I get a warning on this line; I think it wants entry to be const?

Committed in r30726.

PS: I did not notice your email before I posted a patch for the same.

-- 
Senthil Kumaran S
http://www.stylesen.org/

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