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

[PATCH] wc-ng: remove a use of svn_wc_entry_t from libsvn_client

From: Matthew Bentham <mjb67_at_artvps.com>
Date: Fri, 12 Feb 2010 15:39:07 +0000

I understand from thread "WC-NG: How can we help with 1.7-readiness?"
that this sort of thing is helpful. I am a massive newbie, please
forgive me if I do something obviously wrong.

[[[
wc-ng: work towards eliminating svn_wc_entry_t

* subversion/libsvn_client/commit_util.c
   (add_lock_token): Replace a use of svn_wc__maybe_get_entry with
    use of svn_wc__node_get_*
]]]

Index: subversion/libsvn_client/commit_util.c
===================================================================
--- subversion/libsvn_client/commit_util.c (revision 909397)
+++ subversion/libsvn_client/commit_util.c (working copy)
@@ -195,19 +195,21 @@
 {
   struct add_lock_token_baton *altb = walk_baton;
   apr_pool_t *token_pool = apr_hash_pool_get(altb->lock_tokens);
- const svn_wc_entry_t *entry;
+ const char* lock_token = NULL;
+ const char* url = NULL;
+
+ SVN_ERR(svn_wc__node_get_url(&url, altb->wc_ctx, local_abspath,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__node_get_lock_token(&lock_token, altb->wc_ctx,
+ local_abspath, scratch_pool, scratch_pool));
 
- SVN_ERR(svn_wc__maybe_get_entry(&entry, altb->wc_ctx, local_abspath,
- svn_node_unknown, FALSE, FALSE,
- scratch_pool, scratch_pool));
-
   /* I want every lock-token I can get my dirty hands on!
      If this entry is switched, so what. We will send an irrelevant lock
      token. */
- if (entry && entry->url && entry->lock_token)
- apr_hash_set(altb->lock_tokens, apr_pstrdup(token_pool, entry->url),
+ if (url && lock_token)
+ apr_hash_set(altb->lock_tokens, apr_pstrdup(token_pool, url),
                  APR_HASH_KEY_STRING,
- apr_pstrdup(token_pool, entry->lock_token));
+ apr_pstrdup(token_pool, lock_token));
 
   return SVN_NO_ERROR;
 }
Received on 2010-02-12 16:39:44 CET

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