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

Trouble replacing adm_access in libsvn_client/merge.c (merge_file_changed)

From: Daniel Näslund <daniel_at_longitudo.com>
Date: Sun, 23 Aug 2009 20:45:14 +0200

Hi!

Just checking if I'm on the right track!

I want to replace adm_access batons in the svn_wc_diff_callbacks4_t
(file_changed) function. The file_changed callback in
libsvn_client/merge.c is called from libsvn_client/repos_diff.c.

My problem is with the locking. An adm_access baton is holding a
write-lock to the target. I need to free that lock and regain it in
libsvn_client/merge.c.

The best thing would be if I could just get the existing adm_access
baton for the path. If I were in libsvn_wc I could use
svn_wc__adm_retrieve_internal2(). Any suggestions?

Here is an exceprt of the code. First the caller, then the callee:

* subversion/libsvn_client/repos_diff.c
  (close_file)

          // if (b->added)
          // call eb->diff_callbacks->file_changed
 1324 else
 1325 {
 1326 SVN_ERR(svn_wc_adm_close2(eb->adm_access, eb->pool));
 1327
 1328 SVN_ERR(eb->diff_callbacks->file_changed
 1329 (eb->wc_ctx, &content_state, &prop_state, &b->tree_conflicted,
 1330 b->wcpath,
 1331 b->path_end_revision ? b->path_start_revision : NULL,
 1332 b->path_end_revision,
 1333 b->edit_baton->revision,
 1334 b->edit_baton->target_revision,
 1335 mimetype1, mimetype2,
 1336 b->propchanges, b->pristine_props,
 1337 b->edit_baton->diff_cmd_baton));
 1338
 1339 /* TODO: Open the adm_access again? Get one already open? */
 1340 SVN_ERR(svn_wc_adm_probe_open3(&eb->adm_access, NULL, b->wcpath,
 1341 eb->dry_run, -1, NULL, NULL, eb->pool));

* subversion/libsvn_client/merge.c
  (merge_file_changed)

 1254 err = svn_wc__adm_open_in_context(&adm_access, wc_ctx,
 1255 svn_dirent_dirname(mine, subpool),
 1256 ! merge_b->dry_run, 0, NULL, NULL,
 1257 subpool);
 1258
 1259 /* TODO What to do for what errors? */
 1260 if (err && merge_b->dry_run)
 1261 {
 1262 svn_error_clear(err);
 1263 adm_access = NULL;
 1264 }
 1265 else if (err && err->apr_err == SVN_ERR_WC_NOT_LOCKED)
 1266 {
 1267 if (merge_b->ctx->notify_func)
 1268 {
 1269
 1270 /* TODO rev number not correct */
 1271 (*merge_b->ctx->notify_func)(merge_b->ctx->notify_baton, mine,
 1272 svn_wc_notify_skip, svn_node_file,
 1273 NULL, svn_wc_notify_state_missing,
 1274 svn_wc_notify_state_unknown,
 1275 older_rev);
 1276 }
 1277 svn_error_clear(err);
 1278
 1279 return SVN_NO_ERROR;
 1280 }
 1281 else if (err && err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY)
 1282 {
 1283 svn_error_clear(err);
 1284 adm_access = NULL;
 1285 }
 1286 else if (err)
 1287 {
 1288 return svn_error_return(err);
 1289 }

Mvh
Daniel

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2386552
Received on 2009-08-23 20:45:40 CEST

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