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

[PATCH] v2. replace adm_access batons in libsvn_client/patch.c

From: Daniel Näslund <daniel_at_longitudo.com>
Date: Fri, 11 Sep 2009 12:43:13 +0200

On Fri, Sep 11, 2009 at 12:04:04PM +0200, Bert Huijben wrote:
> > Hi!
> >
> > Bert told me that I needed to open an adm_access baton before calling
> > svn_wc_delete4() or svn_wc_add4() and so I've done. I added a comment
> > saying that those batons can be removed at a later stage. Perhaps I
> > should use the ## notation that I've found in other part of the wc
> > code?
> >
> > I wasn't sure if they should only be used to discuss design decisions
> > so I did't use them.
>
> The primary recursive open of an access baton in svn_client_patch
> should be enough to make things work correctly. You don't need the
> other open operations at every delete/add. The access batons are then
> stored in the working copy context.
>
> @@ -1109,17 +1130,7 @@
> svn_client_ctx_t *ctx,
> apr_pool_t *pool)
> {
> - svn_wc_adm_access_t *adm_access;
> - const char *abs_target;
> + SVN_ERR(apply_textdiffs(patch_path, target, dry_run, ctx, pool));
>
> - SVN_ERR(svn_dirent_get_absolute(&abs_target, target, pool));
> - SVN_ERR(svn_wc__adm_open_in_context(&adm_access, ctx->wc_ctx, abs_target,
> - TRUE, -1, ctx->cancel_func,
> - ctx->cancel_baton, pool));
> -
> - SVN_ERR(apply_textdiffs(patch_path, target, adm_access, dry_run, ctx, pool));
> -
> - SVN_ERR(svn_wc_adm_close2(adm_access, pool));
> -
> return SVN_NO_ERROR;
> }
>
> If you revert this change (without the apply_textdiffs change) you can
> forget all the other svn_wc__adm_open_in_context calls.
>
>
> Bert

Ok. I got the impression that the baton would get closed after each call
to svn_wc_add() or svn_wc_delete(). Obviously that was wrong cause it
works alright with your proposed changes.

I've run the patch_tests.py on this patch but not the entire test suite.
I suppose that is alright since svn patch is a new feature.

New log message:

[[[
As part of WC-NG work, replace adm_access batons.

* subversion/libsvn_client/patch.c
  (init_patch_target): Replace adm_access parameter with path parameter.
    Call resolve_target_path() with path instead of accessing the path
    through the baton.
  (apply_one_patch): Remove adm_access parameter. Call
    init_patch_target() without adm_access. Replace call to
    svn_wc_add3() with svn_wc_add4(). Replace call to svn_wc_delete3()
    with svn_wc_delete4().
  (apply_textdiffs): Remove adm_access parameter. Call apply_one_patch()
    without adm_access.
  (svn_client_patch): Call apply_textdiffs() without adm_access.
]]]

Daniel Nslund

Received on 2009-09-11 12:43:36 CEST

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