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

RE: svn commit: r943986 - /subversion/trunk/subversion/libsvn_wc/status.c

From: Bert Huijben <bert_at_vmoo.com>
Date: Thu, 13 May 2010 22:35:36 +0200

> -----Original Message-----
> From: dannas_at_apache.org [mailto:dannas_at_apache.org]
> Sent: donderdag 13 mei 2010 21:32
> To: commits_at_subversion.apache.org
> Subject: svn commit: r943986 -
> /subversion/trunk/subversion/libsvn_wc/status.c
>
> Author: dannas
> Date: Thu May 13 19:32:11 2010
> New Revision: 943986
>
> URL: http://svn.apache.org/viewvc?rev=943986&view=rev
> Log:
> Don't use svn_wc_entry for fetching an url.
>
> * subversion/libsvn_wc/status.c
> (assemble_status): Fetch the url with a node func. Use
> svn_wc__check_wc_root() for determining if a path is switched.
>
> Modified:
> subversion/trunk/subversion/libsvn_wc/status.c
>
> Modified: subversion/trunk/subversion/libsvn_wc/status.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/stat
> us.c?rev=943986&r1=943985&r2=943986&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/libsvn_wc/status.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/status.c Thu May 13 19:32:11
> +++ 2010
> @@ -284,6 +284,7 @@ assemble_status(svn_wc_status3_t **statu
> svn_wc_status3_t *stat;
> svn_wc__db_status_t db_status;
> svn_wc__db_kind_t db_kind;
> + const char *url;
> svn_boolean_t locked_p = FALSE;
> svn_boolean_t switched_p = FALSE;
> const svn_wc_conflict_description2_t *tree_conflict; @@ -320,25 +321,22
> @@ assemble_status(svn_wc_status3_t **statu
> &lock, db, local_abspath, result_pool,
> scratch_pool));
>
> + SVN_ERR(svn_wc__internal_node_get_url(&url, db, local_abspath,
> + result_pool, scratch_pool));
> +
> /** File externals are switched files, but they are not shown as
> such. To be switched it must have both an URL and a parent with
> - an URL, at the very least. If this is the root folder on the
> - (virtual) disk, entry and parent_entry will be equal. */
> + an URL, at the very least. */
> if (entry->file_external_path)
> {
> file_external_p = TRUE;
> }
> - else if (entry->url && parent_entry && parent_entry->url &&
> - entry != parent_entry)
> + else
> {
> - /* An item is switched if:
> - parent-url + basename(path) != entry->url */
> - switched_p = (strcmp(
> - svn_uri_join(parent_entry->url,
> - svn_path_uri_encode(svn_dirent_basename(
> - local_abspath, NULL),
> - scratch_pool),
> - scratch_pool), entry->url) != 0);
> + svn_boolean_t is_wc_root; /* Not used. */
> +
> + SVN_ERR(svn_wc__check_wc_root(&is_wc_root, NULL, &switched_p,
> db,
> + local_abspath, scratch_pool));

You replace a few in memory operations with several database operations on the node and its parent(s) here. Was this intended? (I don't think this will make status faster).
While walking the tree for status you know the url of the parent and of the node itself.

This check_wc_root function starts looking in the database for the url of the node.. and its parent (probably inherited, so looking further up)... and then does this same check for you.

        Bert

> }
>
> /* Examine whether our directory metadata is present, and compensate
> @@ -603,7 +601,7 @@ assemble_status(svn_wc_status3_t **statu
> stat->file_external = file_external_p;
> stat->copied = entry->copied;
> stat->repos_lock = repos_lock;
> - stat->url = (entry->url ? entry->url : NULL);
> + stat->url = url;
> stat->revision = revision;
> stat->changed_rev = changed_rev;
> stat->changed_author = changed_author;
>
Received on 2010-05-13 22:36:09 CEST

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